New UI no longer activates as part of initializing

This commit is contained in:
Maruno17
2024-08-30 21:54:12 +01:00
parent 89e6df6e06
commit fab5fc0641
13 changed files with 25 additions and 25 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -353,8 +353,6 @@ module UI
def initialize
@disposed = false
initialize_visuals
# TODO: Call main separately, not here?
main
end
def initialize_visuals

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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