From 02129f55078ab053b8da71a4cda922eddaebfaff Mon Sep 17 00:00:00 2001 From: FL Date: Sat, 11 Mar 2023 19:52:07 -0300 Subject: [PATCH] =?UTF-8?q?Fixed=20party=20navigation=20on=20pok=C3=A9mon?= =?UTF-8?q?=20selection=20(#198)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed party navigation on pokémon selection On a selections like Battle Tower's, if player places the cursor into cancel and press up, the cursor doesn't move/loop. This was fixed. Co-authored-by: Maruno17 --- Data/Scripts/016_UI/005_UI_Party.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index 2ec9da17a..2fe9710d9 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -796,7 +796,7 @@ class PokemonParty_Scene when Input::LEFT loop do currentsel -= 1 - break unless currentsel > 0 && currentsel < @party.length && !@party[currentsel] + break unless currentsel > 0 && currentsel < Settings::MAX_PARTY_SIZE && !@party[currentsel] end if currentsel >= @party.length && currentsel < Settings::MAX_PARTY_SIZE currentsel = @party.length - 1 @@ -805,13 +805,10 @@ class PokemonParty_Scene when Input::RIGHT loop do currentsel += 1 - break unless currentsel < @party.length && !@party[currentsel] + break unless currentsel < Settings::MAX_PARTY_SIZE && !@party[currentsel] end - if currentsel == @party.length - currentsel = Settings::MAX_PARTY_SIZE - elsif currentsel == numsprites - currentsel = 0 - currentsel = numsprites - 1 if currentsel >= @party.length + if currentsel == numsprites + currentsel = (@party.length == 0) ? Settings::MAX_PARTY_SIZE : 0 end when Input::UP if currentsel >= Settings::MAX_PARTY_SIZE @@ -819,7 +816,7 @@ class PokemonParty_Scene while currentsel > 0 && currentsel < Settings::MAX_PARTY_SIZE && !@party[currentsel] currentsel -= 1 end - currentsel = numsprites - 1 if currentsel >= @party.length + currentsel = numsprites - 1 if currentsel < Settings::MAX_PARTY_SIZE && currentsel >= @party.length else loop do currentsel -= 2 @@ -840,8 +837,7 @@ class PokemonParty_Scene if currentsel >= @party.length && currentsel < Settings::MAX_PARTY_SIZE currentsel = Settings::MAX_PARTY_SIZE elsif currentsel >= numsprites - currentsel = 0 - currentsel = numsprites - 1 if currentsel >= @party.length + currentsel = (@party.length == 0) ? Settings::MAX_PARTY_SIZE : 0 end end return currentsel