This is a very strange problem: I've created a new Window_Command, but for some reason it won't update the cursor position. The selection box appears, but if you press up or down it doesn't go up or down. I've used Scene_Menu as a template, but I can't see any differences between mine and Scene_Menu that would allow it to work, but not mine. I even checked Window_Command to make sure that it handles input, and sure enough it does. So why doesn't mine work?
PHP:
class Repository_Menu
#Display welcome text, present with choices #no choice
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
commands = []
i = 10
for i in 10 ... 20
if $game_switches[i] == true
commands.push($idLookup[i-10])
end
end
@command_window = Window_Command.new(230, commands)
@command_window.index = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update #how long do you think you have?
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
end
def refresh
end
def update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE #on this planet
if @detailWindow == nil || @detailWindow.disposed?
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
else
$game_system.se_play($data_system.cancel_se)
@detailWindow.dispose
end
return
end
if Input.trigger?(Input::C) && (@detailWindow == nil || @detailWindow.disposed?)
# Choose a topic, create a new window to show data on that topic.
$game_system.se_play($data_system.decision_se)
# Creates a new window that will draw the text of the topic selected
@detailWindow = Repository_Topics.new(@command_window.index)
end
end
end