I am probably doing a lot wrong here, how ever as it stands this creates a window that writes: Gold: 0. if i walk over an event with gold and collect the gold the window doesn't update. (this window is displayed on the map while the character walks around). if I open the menu, then the window updates....What am I doing wrong?
Also, the draw_window_content method, see how I switch between system and normal color? there has to be a way better way of doing that.....
make better sense?
CODE
class Window_Show_InfoMap < Window_Base
def initialize
super(0, 0, 300, fitting_height(2))
refresh
end
def refresh
contents.clear
draw_window_content
end
def draw_window_content
cx = text_size(16).width
change_color(system_color)
draw_text(x+10, y+10, 50, line_height, "Gold: ")
change_color(normal_color)
draw_text(x+50, y+10, 10, line_height, $game_party.gold, 2)
end
end
class Scene_Map
alias adrien_window_show_infomap_start_a start
def start
adrien_window_show_infomap_start_a
create_show_infomap
end
def create_show_infomap
@show_infomap_window = Window_Show_InfoMap.new
@show_infomap_window.x = 200
@show_infomap_window.y = 0
end
end