2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-08 22:05:53 +00:00

Merge pull request #230 from lioncash/pause2

CPauseScreenBase: Minor cleanup
This commit is contained in:
Luke Street 2020-03-16 16:13:42 -04:00 committed by GitHub
commit 6ea64becb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
#include "Runtime/MP1/CPauseScreenBase.hpp" #include "Runtime/MP1/CPauseScreenBase.hpp"
#include <array>
#include "Runtime/CGameState.hpp" #include "Runtime/CGameState.hpp"
#include "Runtime/GameGlobalObjects.hpp" #include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Audio/CSfxManager.hpp" #include "Runtime/Audio/CSfxManager.hpp"
@ -252,11 +254,12 @@ void CPauseScreenBase::ChangeMode(EMode mode, bool playSfx) {
} }
void CPauseScreenBase::UpdateSideTable(CGuiTableGroup* table) { void CPauseScreenBase::UpdateSideTable(CGuiTableGroup* table) {
if (!table) if (!table) {
return; return;
}
zeus::CColor selColor = zeus::skWhite; constexpr zeus::CColor selColor = zeus::skWhite;
zeus::CColor deselColor = {1.f, 1.f, 1.f, 0.5f}; constexpr zeus::CColor deselColor = {1.f, 1.f, 1.f, 0.5f};
bool tableActive = true; bool tableActive = true;
if (table == x84_tablegroup_rightlog && x10_mode != EMode::RightTable) if (table == x84_tablegroup_rightlog && x10_mode != EMode::RightTable)
@ -520,9 +523,13 @@ void CPauseScreenBase::OnWidgetScroll(CGuiWidget* widget, const boo::SScrollDelt
} }
} }
static const char* PaneSuffixes[] = {"0", "1", "2", "3", "01", "12", "23", "012", "123", "0123", std::string CPauseScreenBase::GetImagePaneName(u32 i) {
"4", "5", "6", "7", "45", "56", "67", "456", "567", "4567"}; static constexpr std::array PaneSuffixes{
"0", "1", "2", "3", "01", "12", "23", "012", "123", "0123",
"4", "5", "6", "7", "45", "56", "67", "456", "567", "4567",
};
std::string CPauseScreenBase::GetImagePaneName(u32 i) { return fmt::format(fmt("imagepane_pane{}"), PaneSuffixes[i]); } return fmt::format(fmt("imagepane_pane{}"), PaneSuffixes[i]);
}
} // namespace urde::MP1 } // namespace urde::MP1