1
0
Pārlūkot izejas kodu

[Changed] Add the option to delete Object window debug variables

philormand 4 gadi atpakaļ
vecāks
revīzija
ba685d7f66
2 mainītis faili ar 34 papildinājumiem un 2 dzēšanām
  1. 18 0
      locations/obj_din.qsrc
  2. 16 2
      locations/onobjsel.qsrc

+ 18 - 0
locations/obj_din.qsrc

@@ -2441,6 +2441,7 @@ if $ARGS[0] = 'old':
 	if cheatConsole = 0: addobj '<center>Console</center>'
 	addobj '<center>Toggle Debug Variables</center>'
 	addobj '<center>Add Debug Variable</center>'
+	addobj '<center>Delete Debug Variable</center>'
 	if cheatTime = 1:
 		addobj '<center>-1 Hour</center>'
 		addobj '<center>+1 Hour</center>'
@@ -2491,6 +2492,23 @@ if $ARGS[0] = "AddDebugVar":
 	end 
 end
 
+if $ARGS[0] = "DeleteDebugVar":
+	if $ARGS[1] <> '':
+		if ARRSIZE('$ObjDebugVars') > 0:
+			i = 0
+			:DeleteDebugVarLoop
+			if i < ARRSIZE('$ObjDebugVars'):
+				if $ObjDebugVars[i] = $ARGS[1]:
+					killvar '$ObjDebugVars', i
+					i = ARRSIZE('$ObjDebugVars')
+				else
+					i += 1
+				end
+				jump 'DeleteDebugVarLoop'
+			end 
+		end 
+	end 
+end
 
 if $ARGS[0] = 'wait':
 	cla

+ 16 - 2
locations/onobjsel.qsrc

@@ -14,11 +14,25 @@ end
 
 if $selobj = '<center>Add Debug Variable</center>':
 	$tmpVar = INPUT('Enter the variable name')
-	gs 'obj_din', 'AddDebugVar', $tmpVar
-	gs 'stat'
+	if $tmpVar <> '':
+		gs 'obj_din', 'AddDebugVar', $tmpVar
+		gs 'stat'
+	end
 	killvar '$tmpVar'
 end
 
+if $selobj = '<center>Delete Debug Variable</center>':
+	$tmpVar = INPUT('Enter the variable name to delete')
+	if $tmpVar <> '':
+		gs 'obj_din', 'DeleteDebugVar', $tmpVar
+		gs 'stat'
+	end
+	killvar '$tmpVar'
+end
+
+
+
+
 if INSTR($selobj,':') > 0:
 	tmpPos = INSTR($selobj,':') - 1
 	$tmpVar = MID($selobj, 1, tmpPos)