So in my game, there would need to be two different Key Item selection interface called for different purpose (choices and a quest journal). I had the unpleasant surprise to discover that once Window_KeyItem is drawn, it is set in stone and cannot seemingly be changed.
Here's what I tried to do. Please excuse the horrible ruby syntax:
As you can see variable 19 would control the appearance of Window_KeyItem. As it currently stand, it just satay at whatever branch it was first initialized in and cannot be changed.
Is there a way to change this to allow a dynamic change? As my knowledge in Ruby is quite limited, I assume there must be an obvious solution that I am missing. I tried to use various clear and update functions but it failed to do anything (possible error on my part here).
Here's what I tried to do. Please excuse the horrible ruby syntax:
Code:
def initialize(message_window)
p $game_variables[19]
if $game_variables[19] == 1
@message_window = message_window
super(0, 0, 272, 416)
self.openness = 0
deactivate
set_handler(:ok, method(:on_ok))
set_handler(:cancel, method(:on_cancel))
else
if $game_variables[19] == 2
#placeholder for now
@message_window = message_window
super(0, 0, 272, 416)
self.openness = 0
deactivate
set_handler(:ok, method(:on_ok))
set_handler(:cancel, method(:on_cancel))
else
#Default fallback
@message_window = message_window
super(0, 0, Graphics.width, fitting_height(4))
self.openness = 0
deactivate
set_handler(:ok, method(:on_ok))
set_handler(:cancel, method(:on_cancel))
end
end
As you can see variable 19 would control the appearance of Window_KeyItem. As it currently stand, it just satay at whatever branch it was first initialized in and cannot be changed.
Is there a way to change this to allow a dynamic change? As my knowledge in Ruby is quite limited, I assume there must be an obvious solution that I am missing. I tried to use various clear and update functions but it failed to do anything (possible error on my part here).