diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 3da5e6100..868b4b5f9 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -3307,6 +3307,8 @@ void CMenus::RenderSettingsStA(CUIRect MainView) UI()->DoScrollbarOption(&g_Config.m_ClOutlineAlpha, &g_Config.m_ClOutlineAlpha, &Button, Localize("Outline Opacity"), 0, 100, &CUI::ms_LinearScrollbarScale, 0u, "%"); static CButtonContainer s_aResetIDs[24]; + static CUI::SDropDownState s_BackendDropDownState; + static CScrollRegion s_BackendDropDownScrollRegion; int i = 0; DoLine_ColorPicker(&s_aResetIDs[i++], @@ -3401,8 +3403,6 @@ void CMenus::RenderSettingsStA(CUIRect MainView) for(auto &Bind : vBindsList) vBindsName.push_back(Bind.m_aName); - static CUI::SDropDownState s_BackendDropDownState; - static CScrollRegion s_BackendDropDownScrollRegion; s_BackendDropDownState.m_SelectionPopupContext.m_pScrollRegion = &s_BackendDropDownScrollRegion; s_SelectedBind = UI()->DoDropDown(&BindWheelList, s_SelectedBind, vBindsName.data(), vBindsName.size(), s_BackendDropDownState); diff --git a/src/game/client/components/menus_start.cpp b/src/game/client/components/menus_start.cpp index 1e1a3efaf..246abb3f3 100644 --- a/src/game/client/components/menus_start.cpp +++ b/src/game/client/components/menus_start.cpp @@ -75,6 +75,8 @@ std::vector quotes = { "W's in the shhhhhaaat :screamin':", "SpinbrosTV... you'r onto something, you'r onto something man", "Also try M-Client v3 :D", + "Choo-Choo", + "Super rare text you might see once in your life", @@ -82,11 +84,19 @@ std::vector quotes = { // Function to get a random quote std::string GetRandomQuote() { - // Get a random index - int index = rand() % quotes.size(); - // Return the random quote - return quotes[index]; + std::srand(std::time(nullptr)); + + + int randomNum = std::rand() % 10000 + 1; + + if (randomNum == 1) { + return quotes.back(); // Return the super rare quote + } else { + + int index = std::rand() % quotes.size(); + return quotes[index]; + } } void CMenus::RenderStartMenu(CUIRect MainView) @@ -293,10 +303,10 @@ void CMenus::RenderStartMenu(CUIRect MainView) VersionUpdate.VMargin(VMargin, &VersionUpdate); CUIRect RandomText; - RandomText.x = 595.0f; - RandomText.y = 110.0f; - RandomText.w = 230.0f; - RandomText.h = 150.0f; + RandomText.x = 605.0f; + RandomText.y = 130.0f; + RandomText.w = 330.0f; + RandomText.h = 60.0f; static bool Quote = false; if (!Quote) @@ -305,9 +315,21 @@ void CMenus::RenderStartMenu(CUIRect MainView) dbg_msg("Quotes", "%s", randomQuote.c_str()); } - TextRender()->TextColor(1.0f, 1.0f, 0.0f, 1.0f); - UI()->DoLabel(&RandomText, randomQuote.c_str(), 20.0f, TEXTALIGN_ML); - TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); + + if(!str_comp(randomQuote.c_str(), "Super rare text you might see once in your life")) + { + ColorRGBA color = color_cast(ColorHSVA(round_to_int(LocalTime() * 25) % 255 / 255.f, 1.f, 1.f)); + color.a = 0.9f; + TextRender()->TextColor(color); + UI()->DoLabel(&RandomText, "Super rare text you might see once in your life", 20.0f, TEXTALIGN_ML); + TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); + } + else + { + TextRender()->TextColor(1.0f, 1.0f, 0.0f, 1.0f); + UI()->DoLabel(&RandomText, randomQuote.c_str(), 20.0f, TEXTALIGN_ML); + TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); + } #if defined(CONF_AUTOUPDATE) diff --git a/src/game/client/components/parser.cpp b/src/game/client/components/parser.cpp index d04f4e292..aacc43780 100644 --- a/src/game/client/components/parser.cpp +++ b/src/game/client/components/parser.cpp @@ -11,7 +11,7 @@ void CStats::FetchPlayer(CStatsPlayer *pStatsDest, const char *pPlayer) { char aUrl_DDStats[256]; char aUrl_DDNet[256]; - char aEscapedName[MAX_NAME_LENGTH]; + char aEscapedName[MAX_NAME_LENGTH * 4]; EscapeUrl(aEscapedName, sizeof(aEscapedName), pPlayer); str_format(aUrl_DDStats, sizeof(aUrl_DDStats), "%s%s", STATS_URL_DDSTATS, aEscapedName); pStatsDest->m_pGetStatsDDStats = HttpGet(aUrl_DDStats);