From a9573584cd2dd68f4580f8164b0e81f52be8c24b Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Sun, 26 Jan 2025 03:54:10 +0000 Subject: [PATCH] installer_wizard: move credits to header, improve formatting --- UnleashedRecomp/res/.gitignore | 3 ++- UnleashedRecomp/res/credits.h | 19 +++++++++++++++++++ UnleashedRecomp/ui/installer_wizard.cpp | 21 +++++++++++++-------- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 UnleashedRecomp/res/credits.h diff --git a/UnleashedRecomp/res/.gitignore b/UnleashedRecomp/res/.gitignore index 435cdea..a472bb6 100644 --- a/UnleashedRecomp/res/.gitignore +++ b/UnleashedRecomp/res/.gitignore @@ -1,3 +1,4 @@ ![Ww][Ii][Nn]32/ *.c -*.h \ No newline at end of file +*.h +!credits.h \ No newline at end of file diff --git a/UnleashedRecomp/res/credits.h b/UnleashedRecomp/res/credits.h new file mode 100644 index 0000000..239f6e7 --- /dev/null +++ b/UnleashedRecomp/res/credits.h @@ -0,0 +1,19 @@ +#pragma once + +inline const char* g_credits[] = +{ + "Skyth", + "Hyper", + "Darío", + "Sajid", + "RadiantDerg", + "PTKay", + "DeaThProj", + "NextinHKRY", + "M&M", + "saguinee", + "LadyLunanova", + "LJSTAR" +}; + +inline size_t g_creditsSize = 12; diff --git a/UnleashedRecomp/ui/installer_wizard.cpp b/UnleashedRecomp/ui/installer_wizard.cpp index ff94832..347e832 100644 --- a/UnleashedRecomp/ui/installer_wizard.cpp +++ b/UnleashedRecomp/ui/installer_wizard.cpp @@ -29,6 +29,7 @@ #include #include #include +#include // One Shot Animations Constants static constexpr double SCANLINES_ANIMATION_TIME = 0.0; @@ -151,6 +152,7 @@ static int g_currentCursorIndex = -1; static int g_currentCursorDefault = 0; static bool g_currentCursorAccepted = false; static std::vector> g_currentCursorRects; +static std::string g_creditsStr; class SDLEventListenerForInstaller : public SDLEventListener { @@ -305,11 +307,8 @@ public: g_currentCursorIndex = newCursorIndex; } } -}; - -static SDLEventListenerForInstaller g_eventListener; - -const char CREDITS_TEXT[] = "Skyth, Hyper, Darío, Sajid, RadiantDerg, PTKay, DeaThProj, NextinHKRY, M&M, LadyLunanova"; +} +g_sdlEventListenerForInstaller; static std::string& GetWizardText(WizardPage page) { @@ -341,7 +340,7 @@ static const int WIZARD_INSTALL_TEXTURE_INDEX[] = }; // These are ordered from bottom to top in a 3x2 grid. -const char *LANGUAGE_TEXT[] = +const char* LANGUAGE_TEXT[] = { "FRANÇAIS", // French "DEUTSCH", // German @@ -710,7 +709,7 @@ static void DrawDescriptionContainer() hedgeDevStr ); - auto marqueeTextSize = g_seuratFont->CalcTextSizeA(fontSize, FLT_MAX, 0, CREDITS_TEXT); + auto marqueeTextSize = g_seuratFont->CalcTextSizeA(fontSize, FLT_MAX, 0, g_creditsStr.c_str()); auto marqueeTextMarginX = Scale(5); auto marqueeTextMarginY = Scale(15); @@ -719,7 +718,7 @@ static void DrawDescriptionContainer() ImVec2 textMax = { g_aspectRatioOffsetX + Scale(CONTAINER_X) + Scale(CONTAINER_WIDTH), g_aspectRatioOffsetY + Scale(CONTAINER_Y) + Scale(CONTAINER_HEIGHT) }; SetMarqueeFade(textMin, textMax, Scale(32)); - DrawTextWithMarquee(g_seuratFont, fontSize, textPos, textMin, textMax, colWhite, CREDITS_TEXT, g_installerEndTime, 0.9, Scale(200)); + DrawTextWithMarquee(g_seuratFont, fontSize, textPos, textMin, textMax, colWhite, g_creditsStr.c_str(), g_installerEndTime, 0.9, Scale(200)); ResetMarqueeFade(); } @@ -1470,6 +1469,12 @@ void InstallerWizard::Init() g_arrowCircle = LOAD_ZSTD_TEXTURE(g_arrow_circle); g_pulseInstall = LOAD_ZSTD_TEXTURE(g_pulse_install); g_upHedgeDev = LOAD_ZSTD_TEXTURE(g_hedgedev); + + for (int i = 0; i < g_creditsSize; i++) + { + g_creditsStr += g_credits[i]; + g_creditsStr += " "; + } } void InstallerWizard::Draw()