mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Fixed error message spam in the console when editing Game Swtches via the Debug mode feature
This commit is contained in:
@@ -85,7 +85,23 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
|
|||||||
if @mode == 0
|
if @mode == 0
|
||||||
name = $data_system.switches[index + 1]
|
name = $data_system.switches[index + 1]
|
||||||
codeswitch = (name[/^s\:/])
|
codeswitch = (name[/^s\:/])
|
||||||
val = (codeswitch) ? (eval($~.post_match) rescue nil) : $game_switches[index + 1]
|
if codeswitch
|
||||||
|
code = $~.post_match
|
||||||
|
code_parts = code.split(/[(\[=<>. ]/)
|
||||||
|
code_parts[0].strip!
|
||||||
|
code_parts[0].gsub!(/^\s*!/, "")
|
||||||
|
val = nil
|
||||||
|
if code_parts[0][0].upcase == code_parts[0][0] &&
|
||||||
|
(Kernel.const_defined?(code_parts[0]) rescue false)
|
||||||
|
val = (eval(code) rescue nil) # Code starts with a class/method name
|
||||||
|
elsif code_parts[0][0].downcase == code_parts[0][0] &&
|
||||||
|
!(Interpreter.method_defined?(code_parts[0].to_sym) rescue false) &&
|
||||||
|
!(Game_Event.method_defined?(code_parts[0].to_sym) rescue false)
|
||||||
|
val = (eval(code) rescue nil) # Code starts with a method name (that isn't in Interpreter/Game_Event)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
val = $game_switches[index + 1]
|
||||||
|
end
|
||||||
if val.nil?
|
if val.nil?
|
||||||
status = "[-]"
|
status = "[-]"
|
||||||
colors = 0
|
colors = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user