First, read this: http://www.rmxp.org/forums/showpost.php?p=211233&postcount=177
I could solve 'calling saved scene problem with SDK2', but there's new problem.
Example code:
I'm using a menu script that have 'Load' command, and what I want is: select 'Load', and when cancelling load, cursor is placed on 'Load' command. However, it doesn't work on above code.
If I changed above code like this, it worked like:
How can I solve this? I mean, is there any way to make [email='@scene.is]'@scene.is[/email]_a?(Scene class)' work on above code?
I could solve 'calling saved scene problem with SDK2', but there's new problem.
Example code:
Code:
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias load_initialize initialize
alias load_on_cancel on_cancel
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@scene = $scene.class
load_initialize
end
#--------------------------------------------------------------------------
# * Cancel Processing
#--------------------------------------------------------------------------
def on_cancel
load_on_cancel
if @scene.is_a?(Scene_Menu)
$scene = Scene_Menu.new(7)
else
$scene = @scene.new
end
end
end
Code:
def on_cancel
load_on_cancel
if @scene.is_a?(Scene_Menu) #checking current scene is ignored
$scene = Scene_Menu.new(7) #therefore, it doesn't work
else
$scene = @scene.new #it works
end
end
If I changed above code like this, it worked like:
Code:
def on_cancel
load_on_cancel
if @scene.is_a?(Scene_Menu.class) #it seems work
$scene = Scene_Menu.new(7) #it works
else #I think it's ignored
$scene = @scene.new #it doesn't work, so when cancelling load, it calls Scene_Menu
end
end
How can I solve this? I mean, is there any way to make [email='@scene.is]'@scene.is[/email]_a?(Scene class)' work on above code?