瀏覽代碼

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

philormand 4 年之前
父節點
當前提交
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'