From fab5fc0641aa50a0cb09a1b8ae6ed738830b3157 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Fri, 30 Aug 2024 21:54:12 +0100 Subject: [PATCH] New UI no longer activates as part of initializing --- .../003_Game processing/002_Scene_Map.rb | 2 +- .../004_Scene/003_Scene_ChooseCommands.rb | 2 +- .../005_Battle_CatchAndStoreMixin.rb | 2 +- Data/Scripts/013_Items/001_Item_Utilities.rb | 2 +- Data/Scripts/016_UI/005_UI_Party.rb | 2 +- Data/Scripts/016_UI/017_UI_PokemonStorage.rb | 6 +++--- Data/Scripts/016_UI/023_UI_PurifyChamber.rb | 4 ++-- Data/Scripts/016b_UI redesign/000_UI_base.rb | 2 -- .../016b_UI redesign/001_UI_PauseMenu.rb | 2 +- .../016b_UI redesign/006_UI_Summary.rb | 20 ++++++++++--------- .../Scripts/016c_UI_old/006_UI_old_Summary.rb | 2 +- .../001_Battle Frontier/005_UI_BattleSwap.rb | 2 +- .../003_Debug_MenuExtraCode.rb | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Data/Scripts/003_Game processing/002_Scene_Map.rb b/Data/Scripts/003_Game processing/002_Scene_Map.rb index 8ffed4333..4e00b8f57 100644 --- a/Data/Scripts/003_Game processing/002_Scene_Map.rb +++ b/Data/Scripts/003_Game processing/002_Scene_Map.rb @@ -103,7 +103,7 @@ class Scene_Map $game_temp.in_menu = true $game_player.straighten $game_map.update - UI::PauseMenu.new + UI::PauseMenu.new.main $game_temp.in_menu = false end diff --git a/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb b/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb index 8b658cf41..2acd680f6 100644 --- a/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb +++ b/Data/Scripts/011_Battle/004_Scene/003_Scene_ChooseCommands.rb @@ -466,7 +466,7 @@ class Battle::Scene ret = -1 pbFadeOutIn do screen = UI::PokemonSummary.new([pkmn], 0, mode: :choose_move, new_move: moveToLearn) - ret = screen.result + ret = screen.choose_move end return ret end diff --git a/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb b/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb index 24aadff33..32c6fd20d 100644 --- a/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb +++ b/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb @@ -63,7 +63,7 @@ module Battle::CatchAndStoreMixin break when 2 # See X's summary pbFadeOutIn do - screen = UI::PokemonSummary.new(pkmn, mode: :in_battle) + UI::PokemonSummary.new(pkmn, mode: :in_battle).main end when 3 # Check party @scene.pbPartyScreen(0, true, 2) diff --git a/Data/Scripts/013_Items/001_Item_Utilities.rb b/Data/Scripts/013_Items/001_Item_Utilities.rb index dfdec27b8..20d0651e7 100644 --- a/Data/Scripts/013_Items/001_Item_Utilities.rb +++ b/Data/Scripts/013_Items/001_Item_Utilities.rb @@ -633,7 +633,7 @@ def pbForgetMove(pkmn, moveToLearn) ret = -1 pbFadeOutIn do screen = UI::PokemonSummary.new([pkmn], 0, mode: :choose_move, new_move: moveToLearn) - ret = screen.result + ret = screen.choose_move end return ret end diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index 42d3b56f8..506c5ca60 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -702,7 +702,7 @@ class PokemonParty_Scene def pbSummary(pkmnid, inbattle = false) oldsprites = pbFadeOutAndHide(@sprites) - UI::PokemonSummary.new(@party, pkmnid, mode: (inbattle ? :in_battle : :normal)) + UI::PokemonSummary.new(@party, pkmnid, mode: (inbattle ? :in_battle : :normal)).main yield if block_given? pbRefresh pbFadeInAndShow(@sprites, oldsprites) diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index ababd6ff8..938e2e163 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -1247,14 +1247,14 @@ class PokemonStorageScene def pbSummary(selected, heldpoke) oldsprites = pbFadeOutAndHide(@sprites) if heldpoke - UI::PokemonSummary.new(heldpoke) + UI::PokemonSummary.new(heldpoke).main elsif selected[0] == -1 - screen = UI::PokemonSummary.new(@storage.party, selected[1]) + screen = UI::PokemonSummary.new(@storage.party, selected[1]).main @selection = screen.result pbPartySetArrow(@sprites["arrow"], @selection) pbUpdateOverlay(@selection, @storage.party) else - screen = UI::PokemonSummary.new(@storage.boxes[selected[0]].pokemon, selected[1]) + screen = UI::PokemonSummary.new(@storage.boxes[selected[0]].pokemon, selected[1]).main @selection = screen.result pbSetArrow(@sprites["arrow"], @selection) pbUpdateOverlay(@selection) diff --git a/Data/Scripts/016_UI/023_UI_PurifyChamber.rb b/Data/Scripts/016_UI/023_UI_PurifyChamber.rb index ed7f6ebde..f6c2acd5a 100644 --- a/Data/Scripts/016_UI/023_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/023_UI_PurifyChamber.rb @@ -1232,7 +1232,7 @@ class PurifyChamberScene def pbSummary(pos, heldpkmn) if heldpkmn oldsprites = pbFadeOutAndHide(@sprites) - UI::PokemonSummary.new(heldpkmn) + UI::PokemonSummary.new(heldpkmn).main pbFadeInAndShow(@sprites, oldsprites) return end @@ -1249,7 +1249,7 @@ class PurifyChamberScene end return if party.length == 0 oldsprites = pbFadeOutAndHide(@sprites) - screen = UI::PokemonSummary.new(party, startindex) + screen = UI::PokemonSummary.new(party, startindex).main selection = screen.result @sprites["setview"].cursor = indexes[selection] pbFadeInAndShow(@sprites, oldsprites) diff --git a/Data/Scripts/016b_UI redesign/000_UI_base.rb b/Data/Scripts/016b_UI redesign/000_UI_base.rb index 1bad88d7c..fc683895f 100644 --- a/Data/Scripts/016b_UI redesign/000_UI_base.rb +++ b/Data/Scripts/016b_UI redesign/000_UI_base.rb @@ -353,8 +353,6 @@ module UI def initialize @disposed = false initialize_visuals - # TODO: Call main separately, not here? - main end def initialize_visuals diff --git a/Data/Scripts/016b_UI redesign/001_UI_PauseMenu.rb b/Data/Scripts/016b_UI redesign/001_UI_PauseMenu.rb index ede4ee5d9..7bc64e13e 100644 --- a/Data/Scripts/016b_UI redesign/001_UI_PauseMenu.rb +++ b/Data/Scripts/016b_UI redesign/001_UI_PauseMenu.rb @@ -273,7 +273,7 @@ MenuHandlers.add(:pause_menu, :trainer_card, { "effect" => proc { |menu| pbPlayDecisionSE pbFadeOutIn do - UI::TrainerCard.new + UI::TrainerCard.new.main menu.refresh end next false diff --git a/Data/Scripts/016b_UI redesign/006_UI_Summary.rb b/Data/Scripts/016b_UI redesign/006_UI_Summary.rb index e92c0969c..a10a61356 100644 --- a/Data/Scripts/016b_UI redesign/006_UI_Summary.rb +++ b/Data/Scripts/016b_UI redesign/006_UI_Summary.rb @@ -1386,7 +1386,6 @@ class UI::PokemonSummary < UI::BaseScreen @mode = mode @new_move = (new_move) ? Pokemon::Move.new(new_move) : nil super() - @result = @party_index if @result.nil? end def initialize_visuals @@ -1401,14 +1400,17 @@ class UI::PokemonSummary < UI::BaseScreen #----------------------------------------------------------------------------- def main - if @mode == :choose_move - pbSEPlay("GUI menu open") - start_screen - @result = perform_action(:navigate_moves) - end_screen - return - end + return choose_move if @mode == :choose_move super + @result = @party_index + end + + def choose_move + pbSEPlay("GUI menu open") + start_screen + @result = perform_action(:navigate_moves) + end_screen + return @result end end @@ -1551,7 +1553,7 @@ def pbChooseMove(pokemon, variableNumber, nameVarNumber) ret = -1 pbFadeOutIn do screen = UI::PokemonSummary.new(pokemon, mode: :choose_move) - ret = screen.result + ret = screen.choose_move end $game_variables[variableNumber] = ret if ret >= 0 diff --git a/Data/Scripts/016c_UI_old/006_UI_old_Summary.rb b/Data/Scripts/016c_UI_old/006_UI_old_Summary.rb index 1b2660a26..31ac3612e 100644 --- a/Data/Scripts/016c_UI_old/006_UI_old_Summary.rb +++ b/Data/Scripts/016c_UI_old/006_UI_old_Summary.rb @@ -1400,7 +1400,7 @@ def pbChooseMove(pokemon, variableNumber, nameVarNumber) ret = -1 pbFadeOutIn do screen = UI::PokemonSummary.new(pokemon, mode: :choose_move) - ret = screen.result + ret = screen.choose_move end $game_variables[variableNumber] = ret if ret >= 0 diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb index b737a7952..ef253a316 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/005_UI_BattleSwap.rb @@ -146,7 +146,7 @@ class BattleSwapScene def pbSummary(list, index) visibleSprites = pbFadeOutAndHide(@sprites) { pbUpdate } - screen = UI::PokemonSummary.new(list, index) + screen = UI::PokemonSummary.new(list, index).main @sprites["list"].index = screen.result pbFadeInAndShow(@sprites, visibleSprites) { pbUpdate } end diff --git a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb index c9ad0a3a5..d33f9249b 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb @@ -335,7 +335,7 @@ def pbDebugDayCare [_INTL("Summary"), _INTL("Withdraw"), _INTL("Cancel")], 3) when 0 # Summary pbFadeOutIn do - UI::PokemonSummary.new(pkmn) + UI::PokemonSummary.new(pkmn).main need_refresh = true end when 1 # Withdraw