Quote from: Bernkastel on February 25, 2011, 06:25:29 am
Quote from: SBR* on February 25, 2011, 04:31:11 am
Alright, what she has to do, is alias the Scene_Map methods called 'main' and 'update'.
The alias of main would be this:
class Scene_Map
alias whatever_you_want_it_to_be main
def main
@spwindow = Window_Skillpoints.new
whatever_you_want_it_to_be
@spwindow.dispose
end
end
The update one should call the window's update method.
The window's update method should check if the previous amount of skillpoints is the same as the current one and if that's the case, it should call the refresh method. The refresh method draws the text.
So the text, drawn in the event, is drawn in the refresh method. This way, the event isn't necessary at all
.
Thank you for the reply. <3
Well, will that even work? It's not a scene. It's a window.
Sorry, I sound like a total moron.
As you might now, Scene_Map is the scene you're in when you're on a map.
As this window is displayed when on the map, you have to edit Scene_Map to display it automatically: when Scene_Map is called, you load the window and when another scene is called, you dispose the window.
When Scene_Map is updating (when you're on the map), it calls the update method of the window. This update method checks if the content has changed and if it has, it refreshes the content.
In the current script, refresh is completely misused: it is currently used to remove the contents if the method is called. You could better name the method dispose and use 'super', but I think this is already included in Window_Base/Window if it's even necessary.
If your friend doesn't know what alias is: when using 'alias', you sort of overwrite the old method, while the current content of the method is kept, because you change the name of the method. So you change old_method_name to new_method_name and then overwrite old_method_name. Somewhere in the overwriting of old_method_name, you call new_method_name, which holds the content of the original method. So when old_method_name is called, both the new and the original content are executed

.
def old_method_name
print '1'
end
alias new_method_name old_method_name
def old_method_name
new_method_name
print '2'
end
OUTPUT:
1
2