Przeglądaj źródła

[Change] Add ability to change values for Object Debug Variables by clicking on them

philormand 4 lat temu
rodzic
commit
e4ef020b16
1 zmienionych plików z 21 dodań i 2 usunięć
  1. 21 2
      locations/onobjsel.qsrc

+ 21 - 2
locations/onobjsel.qsrc

@@ -11,10 +11,29 @@ if $selobj = '<center>Toggle Debug Variables</center>':
 	end
 	gs 'stat'
 end
+
 if $selobj = '<center>Add Debug Variable</center>':
-	$varname = INPUT('Enter the variable name')
-	gs 'obj_din', 'AddDebugVar', $varname
+	$tmpVar = INPUT('Enter the variable name')
+	gs 'obj_din', 'AddDebugVar', $tmpVar
+	gs 'stat'
+	killvar '$tmpVar'
+end
+
+if INSTR($selobj,':') > 0:
+	tmpPos = INSTR($selobj,':') - 1
+	$tmpVar = MID($selobj, 1, tmpPos)
+	$tmpVal = INPUT('Enter a value for <<$tmpVar>>')
+	if $tmpVal <> '':
+		if instr($tmpVar,'$') = 1:
+			dyneval('<<$tmpVar>> = ''<<$tmpVal>>''')
+		else
+			dyneval('<<$tmpVar>> = <<VAL($tmpVal)>>')
+		end 
+	end
 	gs 'stat'
+	killvar '$tmpVar'
+	killvar 'tmpPos'
+	killvar '$tmpVal'
 end
 
 if $selobj = '<center>-1 Hour</center>':gs 'obj_din', '-1 Hour'