- 2
- Posts
- 3
- Years
- USA
- Seen today
Hello,
I've been making a custom battle UI and decided to change the move button layout; my only issue is that when moving the cursor, it stops at the fourth slot even when I have less than 4 moves. For some reason I can't wrap my mind around how to properly program it so that it stops at the last available move.
Here is my layout:
Here is my current code:
I've been making a custom battle UI and decided to change the move button layout; my only issue is that when moving the cursor, it stops at the fourth slot even when I have less than 4 moves. For some reason I can't wrap my mind around how to properly program it so that it stops at the last available move.
Here is my layout:
Here is my current code:
Ruby:
oldIndex = cw.index
pbUpdate(cw)
if Input.trigger?(Input::LEFT)
cw.index -= 1 if cw.index != 0
elsif Input.trigger?(Input::RIGHT)
cw.index += 1 if cw.index != 3
end