From 6968d9f0d3ed162489c3afe39140a36b49e5580e Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 2 Feb 2017 21:33:46 -1000 Subject: [PATCH] Various UI fixes, unsupported emulator message --- Runtime/MP1/CFrontEndUI.cpp | 39 ++++++++++++++++++++++++------------- Runtime/MP1/CFrontEndUI.hpp | 4 +++- hecl | 2 +- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 311c6d607..01c83a4ae 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -936,14 +936,11 @@ void CFrontEndUI::SFusionBonusFrame::SetTableColors(CGuiTableGroup* tbgp) const void CFrontEndUI::SFusionBonusFrame::Update(float dt, CSaveUI* saveUI) { - bool doUpdate = false; - if (saveUI) - if (saveUI->GetUIType() == CSaveUI::EUIType::SaveReady) - doUpdate = true; + bool doDraw = !saveUI || saveUI->GetUIType() == CSaveUI::EUIType::SaveReady; - if (doUpdate != x38_lastDoUpdate) + if (doDraw != x38_lastDoDraw) { - x38_lastDoUpdate = doUpdate; + x38_lastDoDraw = doDraw; ResetCompletionFlags(); } @@ -975,6 +972,13 @@ void CFrontEndUI::SFusionBonusFrame::Update(float dt, CSaveUI* saveUI) instructionStr = g_MainStringTable->GetString(79); // You have not completed fusion else if (!g_GameState->SystemOptions().GetPlayerBeatFusion()) instructionStr = g_MainStringTable->GetString(77); // To play NES Metroid + else if (m_nesUnsupported) + { + instructionStr = u"NES Emulator currently unsupported"; + x30_textpane_instructions.x0_panes[0]->TextSupport()->SetText(instructionStr); + x30_textpane_instructions.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skYellow); + x30_textpane_instructions.x0_panes[1]->TextSupport()->SetText(instructionStr); + } } x30_textpane_instructions.SetPairText(instructionStr); @@ -988,7 +992,7 @@ CFrontEndUI::SFusionBonusFrame::ProcessUserInput(const CFinalInput& input, CSave if (sui) sui->ProcessUserInput(input); - if (x38_lastDoUpdate) + if (x38_lastDoDraw) { if (x0_gbaLinkFrame) { @@ -1003,6 +1007,7 @@ CFrontEndUI::SFusionBonusFrame::ProcessUserInput(const CFinalInput& input, CSave x39_fusionNotComplete = true; else if (sui) sui->SaveNESState(); + m_nesUnsupported = true; } } } @@ -1017,7 +1022,7 @@ CFrontEndUI::SFusionBonusFrame::ProcessUserInput(const CFinalInput& input, CSave void CFrontEndUI::SFusionBonusFrame::Draw() const { - if (!x38_lastDoUpdate) + if (!x38_lastDoDraw) return; if (x0_gbaLinkFrame) x0_gbaLinkFrame->Draw(); @@ -1027,7 +1032,7 @@ void CFrontEndUI::SFusionBonusFrame::Draw() const void CFrontEndUI::SFusionBonusFrame::DoCancel(CGuiTableGroup* caller) { - if (x39_fusionNotComplete || x3a_mpNotComplete) + if (x39_fusionNotComplete || x3a_mpNotComplete || m_nesUnsupported) { CSfxManager::SfxStart(1094, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); } @@ -1046,8 +1051,7 @@ void CFrontEndUI::SFusionBonusFrame::DoSelectionChange(CGuiTableGroup* caller, i if (caller == x28_tablegroup_options) { CSfxManager::SfxStart(1093, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); - x3a_mpNotComplete = false; - x39_fusionNotComplete = false; + ResetCompletionFlags(); } else { @@ -1090,10 +1094,17 @@ void CFrontEndUI::SFusionBonusFrame::DoAdvance(CGuiTableGroup* caller) x39_fusionNotComplete = false; PlayAdvanceSfx(); } + /* else if (g_GameState->SystemOptions().GetPlayerBeatFusion()) { x8_action = EAction::PlayNESMetroid; } + */ + else if (m_nesUnsupported) + { + m_nesUnsupported = false; + PlayAdvanceSfx(); + } else { x0_gbaLinkFrame = std::make_unique(x18_gbaLink.GetObj(), x4_gbaSupport.get(), false); @@ -1150,6 +1161,8 @@ void CFrontEndUI::SFrontEndFrame::FinishedLoading() std::bind(&SFrontEndFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2)); x18_tablegroup_mainmenu->SetMenuCancelCallback( std::bind(&SFrontEndFrame::DoCancel, this, std::placeholders::_1)); + + HandleActiveChange(x18_tablegroup_mainmenu); } bool CFrontEndUI::SFrontEndFrame::PumpLoad() @@ -1592,7 +1605,7 @@ void CFrontEndUI::SOptionsFrontEndFrame::FinishedLoading() x28_tablegroup_rightmenu = static_cast(x1c_loadedFrame->FindWidget("tablegroup_rightmenu")); x2c_tablegroup_double = static_cast(x1c_loadedFrame->FindWidget("tablegroup_double")); x30_tablegroup_triple = static_cast(x1c_loadedFrame->FindWidget("tablegroup_triple")); - x34_slidergroup_slider = static_cast(x1c_loadedFrame->FindWidget("tablegroup_slider")); + x34_slidergroup_slider = static_cast(x1c_loadedFrame->FindWidget("slidergroup_slider")); x24_tablegroup_leftmenu->SetMenuAdvanceCallback( std::bind(&SOptionsFrontEndFrame::DoLeftMenuAdvance, this, std::placeholders::_1)); @@ -1700,7 +1713,7 @@ bool CFrontEndUI::SOptionsFrontEndFrame::ProcessUserInput(const CFinalInput& inp void CFrontEndUI::SOptionsFrontEndFrame::Update(float dt, CSaveUI* sui) { x40_rumbleGen.Update(dt); - x134_24_visible = sui && sui->GetUIType() == CSaveUI::EUIType::SaveReady; + x134_24_visible = !sui || sui->GetUIType() == CSaveUI::EUIType::SaveReady; if (!PumpLoad()) return; diff --git a/Runtime/MP1/CFrontEndUI.hpp b/Runtime/MP1/CFrontEndUI.hpp index aa456bbf1..052d8bbb5 100644 --- a/Runtime/MP1/CFrontEndUI.hpp +++ b/Runtime/MP1/CFrontEndUI.hpp @@ -238,9 +238,10 @@ public: CGuiTableGroup* x28_tablegroup_options = nullptr; CGuiTableGroup* x2c_tablegroup_fusionsuit = nullptr; SGuiTextPair x30_textpane_instructions; - bool x38_lastDoUpdate = false; + bool x38_lastDoDraw = false; bool x39_fusionNotComplete = false; bool x3a_mpNotComplete = false; + bool m_nesUnsupported = false; SFusionBonusFrame(); void FinishedLoading(); @@ -254,6 +255,7 @@ public: { x39_fusionNotComplete = false; x3a_mpNotComplete = false; + m_nesUnsupported = false; } void DoCancel(CGuiTableGroup* caller); diff --git a/hecl b/hecl index 3d28db642..8915d4941 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 3d28db642414aeffb0e6ad39555487b5674642cd +Subproject commit 8915d494174c221673badcdb25e37fd43d98af88