1
0
Эх сурвалжийг харах

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

philormand 4 жил өмнө
parent
commit
e4ef020b16
1 өөрчлөгдсөн 21 нэмэгдсэн , 2 устгасан
  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'