I'm making a turn-based RPG battle and the system itself works fine, however, the keyboard focus is a bit of a mess.
The battle commands are inside a vbox, which are: "Skills", "Guard", "Items", and "Escape". When arrow_down keyboard is pressed, from "Skills" textbutton it directly jumps to "Items" button.
So, the code is below:
Code: Select all
fixed:
at battlescreendissolve(0.5)
### MAIN COMMAND ###
frame:
xpos 101 ypos 200
background "battle/battlecommand_bg.png"
xysize (301, 328)
text "COMMANDS"
vbox:
xpos - 10
yalign 0.2
spacing - 10
textbutton "Skills" style "battlecommandbutton_bg" text_style "battlecommandbutton_text" action SetVariable("selected_battle_command", "skills")
textbutton "Guard" style "battlecommandbutton_bg" text_style "battlecommandbutton_text" action [SetVariable("selected_playeraction", playerskill_guard), Return()]
textbutton "Items" style "battlecommandbutton_bg" text_style "battlecommandbutton_text" action SetVariable("selected_battle_command", "items")
textbutton "Escape" style "battlecommandbutton_bg" text_style "battlecommandbutton_text" action [SetVariable("selected_playeraction", playerskill_escape), Return()]
if selected_battle_command == "skills":
use battle_command_skills
if selected_battle_command == "items":
use battle_command_items
Thank you for the help in advance!