module GemWin
Commands = {
0 => { # Index number here - 1st command
:rect => [10,10,30,40], # [x,y,width,height]
:u => 0, # Command selected when the UP button is pressed
:d => 0, # Command selected when the DOWN button is pressed
:l => 11, # Command selected when the LEFT button is pressed
:r => 1, # Command selected when the RIGHT button is pressed
},
1 => { # Index number here - 2nd command
:rect => [40,30,30,40], # [x,y,width,height]
:u => 0, # Command selected when the UP button is pressed
:d => 2, # Command selected when the DOWN button is pressed
:l => 0, # Command selected when the LEFT button is pressed
:r => 2, # Command selected when the RIGHT button is pressed
},
2 => { # Index number here - 3rd command
:rect => [70,50,30,40], # [x,y,width,height]
:u => 1, # Command selected when the UP button is pressed
:d => 3, # Command selected when the DOWN button is pressed
:l => 1, # Command selected when the LEFT button is pressed
:r => 3, # Command selected when the RIGHT button is pressed
},
# And so on... Add more settings below if needed.
}
end
class Window_Gems < Window_Command
# This loads the values from the module setting based on the
# command's index.
def item_rect(index)
return Rect.new(*GemWin::Commands[index][:rect])
end
def cursor_up(wrap = false)
select(GemWin::Commands[index][:u])
end
def cursor_down(wrap = false)
select(GemWin::Commands[index][:d])
end
def cursor_left(wrap = false)
select(GemWin::Commands[index][:l])
end
def cursor_right(wrap = false)
select(GemWin::Commands[index][:r])
end
end