diff --git a/changelog.txt b/changelog.txt index a8b4da4aa3..0eb85a7ecc 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,19 @@ +0.6.1 +Slight Annoyance Alleviated + Added "Do not show again" checkboxes to version/zone warning MessageBoxes +Suggestions + Changed settings panel to disable child checkboxes (suggestion by Enjoy.) + Changed sv_noclipspeed to scale to maxvel (suggestion by lody) +Fixes + Fixed checkpoints being corrupted upon map load + Fixed (most) crashes with changing resolution and exiting the game + Fixed ReplayUI to better scale for 1080p + Prevent playback of replays with different tickrate than current (will revist) + Fixed maps that crashed when using a fade-in trigger + Fixed spawn searching to prioritize info_player_start over info_player_(counter)terrorist + Fixed bug with cursor disappearing when net_graph was turned on + Fixed maps that use detail objects (for real this time) + 0.6.0 New Replay UI Like DemoUI, a window to control playback of Replay files @@ -44,35 +60,4 @@ Fixes, Baby Fixed player_speedmod not setting player speed Fixed offset bug with spectating a replay in chase mode Fixed the mapfinished panel to not prematurely close if player goes out of end trigger - Fixed mom_restart not resetting player progress (stored in target name) - -0.5.0 -New Main Menu UI - Thanks to NicolasDe from Project-9 for GameUI2 - New background (from tutorial levels) to accomodate the shininess -Play Replays from Leaderboards - Right-clicking when the leaderboards are open will allow you to right click a run and "Watch Replay" - More functionality in future updates! -Contact/Feedback Panel - Introduced a panel for in-game feedback, available in the menu. -Overhauled Settings Panel - Changed to tabular settings, includes four new Tabs: - "Controls" for momentum-specific controls settings - "HUD Settings" for HUD-related momentum settings - "Run Comparisons" for settings regarding the comparisons panel - "Replays" for replay-related settings (just translucence for Alpha) -Accurate Timer Fix - Fixed offset calculations by using a new method to calculate them -Bug/Other fixes - Fixed potential bug with saving times to file - Fixed empty node graphs building - Changed practice mode to enable when no inputs are pressed - Fixed RichText highlighting to properly display highlighted text - Fixed replays recording paused frames - Fixed animations for player jumping and zone enter speed on the HUD speedometer - Fixed the zone buffer for the comparisons panel - Fixed the Changelog panel to properly scroll to top upon load - Removed ability to save/load (use the checkpoint menu instead!) - Fixed Biohazard90's Source Shader Editor (faulty config) - Fixed Version Update panel showing when you have a higher version than master - Fixed a bug in the blockfix system with incorporating the mom_bhop_playblocksound cvar \ No newline at end of file + Fixed mom_restart not resetting player progress (stored in target name) \ No newline at end of file diff --git a/mp/game/momentum/resource/momentum_english.txt b/mp/game/momentum/resource/momentum_english.txt index 55942d6f9b..a14729c42b 100644 Binary files a/mp/game/momentum/resource/momentum_english.txt and b/mp/game/momentum/resource/momentum_english.txt differ diff --git a/mp/game/momentum/resource/ui/ReplayUI.res b/mp/game/momentum/resource/ui/ReplayUI.res index 9da7056da9..7e16e26aa1 100644 --- a/mp/game/momentum/resource/ui/ReplayUI.res +++ b/mp/game/momentum/resource/ui/ReplayUI.res @@ -30,7 +30,8 @@ "enabled" "1" "tabPosition" "0" "labelText" "#MOM_ReplayStatusPlaying" - "textAlignment" "west" + "font" "DefaultSmall" + "textAlignment" "center" "dulltext" "0" "brighttext" "0" "wrap" "0" @@ -52,7 +53,7 @@ "enabled" "1" "tabPosition" "0" "labelText" "|<" - "textAlignment" "west" + "textAlignment" "center" "dulltext" "0" "brighttext" "0" "wrap" "0" @@ -74,7 +75,7 @@ "enabled" "1" "tabPosition" "0" "labelText" ">|" - "textAlignment" "west" + "textAlignment" "center" "dulltext" "0" "brighttext" "0" "wrap" "0" @@ -96,7 +97,7 @@ "enabled" "1" "tabPosition" "0" "labelText" "<" - "textAlignment" "west" + "textAlignment" "center" "dulltext" "0" "brighttext" "0" "wrap" "0" @@ -118,7 +119,7 @@ "enabled" "1" "tabPosition" "0" "labelText" ">" - "textAlignment" "west" + "textAlignment" "center" "dulltext" "0" "brighttext" "0" "wrap" "0" @@ -151,7 +152,7 @@ "fieldName" "ReplayProgressLabelFrame" "xpos" "12" "ypos" "113" - "wide" "116" + "wide" "130" "tall" "24" "autoResize" "0" "pinCorner" "0" @@ -159,6 +160,7 @@ "enabled" "1" "tabPosition" "0" "textAlignment" "west" + "font" "DefaultSmall" "dulltext" "0" "brighttext" "1" "wrap" "0" @@ -169,7 +171,7 @@ "fieldName" "ReplayProgressLabelTime" "xpos" "13" "ypos" "29" - "wide" "160" + "wide" "250" "tall" "24" "autoResize" "0" "pinCorner" "0" @@ -177,6 +179,7 @@ "enabled" "1" "tabPosition" "0" "textAlignment" "west" + "font" "DefaultSmall" "dulltext" "0" "brighttext" "1" "wrap" "0" @@ -195,6 +198,7 @@ "enabled" "1" "tabPosition" "0" "labelText" "#MOM_ReplayTimescale" + "font" "DefaultSmall" "textAlignment" "west" "dulltext" "0" "brighttext" "0" @@ -205,7 +209,7 @@ { "ControlName" "CCvarSlider" "fieldName" "TimescaleSlider" - "xpos" "80" + "xpos" "95" "ypos" "148" "wide" "110" "tall" "40" @@ -219,6 +223,7 @@ "tabPosition" "0" "leftText" "#GameUI_Low" "rightText" "#GameUI_High" + "font" "DefaultSmall" "minvalue" "0.1" "maxvalue" "10.0" "cvar_name" "mom_replay_timescale" @@ -231,7 +236,7 @@ { "ControlName" "TextEntry" "fieldName" "TimescaleEntry" - "xpos" "196" + "xpos" "220" "ypos" "148" "wide" "60" "tall" "24" @@ -252,7 +257,7 @@ { "ControlName" "Button" "fieldName" "ReplayGo" - "xpos" "133" + "xpos" "150" "ypos" "113" "wide" "48" "tall" "24" @@ -262,8 +267,9 @@ "enabled" "1" "tabPosition" "0" "labelText" "#MOM_ReplayGoto" - "textAlignment" "west" + "textAlignment" "center" "dulltext" "0" + "font" "DefaultSmall" "brighttext" "0" "wrap" "0" "Command" "gototick" @@ -274,7 +280,7 @@ { "ControlName" "TextEntry" "fieldName" "ReplayGoToTick" - "xpos" "196" + "xpos" "205" "ypos" "113" "wide" "60" "tall" "24" @@ -306,7 +312,7 @@ "enabled" "1" "tabPosition" "0" "labelText" ">>" - "textAlignment" "west" + "textAlignment" "center" "dulltext" "0" "brighttext" "0" "wrap" "0" @@ -327,7 +333,7 @@ "enabled" "1" "tabPosition" "0" "labelText" "<<" - "textAlignment" "west" + "textAlignment" "center" "dulltext" "0" "brighttext" "0" "wrap" "0" diff --git a/mp/game/momentum/resource/ui/SettingsPanel_ComparisonsSettings.res b/mp/game/momentum/resource/ui/SettingsPanel_ComparisonsSettings.res index e53f3bad2e..88ca56fa9c 100644 --- a/mp/game/momentum/resource/ui/SettingsPanel_ComparisonsSettings.res +++ b/mp/game/momentum/resource/ui/SettingsPanel_ComparisonsSettings.res @@ -42,6 +42,7 @@ "Default" "0" "cvar_name" "mom_comparisons" "cvar_value" "1" + "actionsignallevel" "1" } "CompareFormat" @@ -73,6 +74,7 @@ "Default" "0" "cvar_name" "mom_comparisons_format_output" "cvar_value" "1" + "actionsignallevel" "1" } "ZonesLabel" @@ -126,6 +128,7 @@ "maxchars" "-1" "NumericInputOnly" "1" "unicode" "0" + "actionsignallevel" "1" } "TimeTypeLabel" @@ -180,6 +183,7 @@ "NumericInputOnly" "0" "unicode" "0" "font" "DefaultVerySmall" + "actionsignallevel" "1" } "TimeShowOverall" @@ -212,6 +216,7 @@ "Default" "0" "cvar_name" "mom_comparisons_time_show_overall" "cvar_value" "1" + "actionsignallevel" "1" } "TimeShowZone" @@ -244,6 +249,7 @@ "Default" "0" "cvar_name" "mom_comparisons_time_show_perzone" "cvar_value" "1" + "actionsignallevel" "1" } "VelShow" @@ -275,6 +281,7 @@ "Default" "0" "cvar_name" "mom_comparisons_vel_show" "cvar_value" "1" + "actionsignallevel" "1" } "VelShowAvg" @@ -306,6 +313,7 @@ "Default" "0" "cvar_name" "mom_comparisons_vel_show_avg" "cvar_value" "1" + "actionsignallevel" "1" } "VelShowMax" @@ -337,6 +345,7 @@ "Default" "0" "cvar_name" "mom_comparisons_vel_show_max" "cvar_value" "1" + "actionsignallevel" "1" } "VelShowEnter" @@ -369,6 +378,7 @@ "Default" "0" "cvar_name" "mom_comparisons_vel_show_enter" "cvar_value" "1" + "actionsignallevel" "1" } "VelShowExit" @@ -401,6 +411,7 @@ "Default" "0" "cvar_name" "mom_comparisons_vel_show_exit" "cvar_value" "1" + "actionsignallevel" "1" } "SyncShow" @@ -432,6 +443,7 @@ "Default" "0" "cvar_name" "mom_comparisons_sync_show" "cvar_value" "0" + "actionsignallevel" "1" } "SyncShowS1" @@ -464,6 +476,7 @@ "Default" "0" "cvar_name" "mom_comparisons_sync_show_sync1" "cvar_value" "0" + "actionsignallevel" "1" } "SyncShowS2" @@ -496,6 +509,7 @@ "Default" "0" "cvar_name" "mom_comparisons_sync_show_sync2" "cvar_value" "0" + "actionsignallevel" "1" } "ShowJumps" @@ -527,6 +541,7 @@ "Default" "0" "cvar_name" "mom_comparisons_jumps_show" "cvar_value" "1" + "actionsignallevel" "1" } "ShowStrafes" @@ -558,5 +573,6 @@ "Default" "0" "cvar_name" "mom_comparisons_strafe_show" "cvar_value" "1" + "actionsignallevel" "1" } } \ No newline at end of file diff --git a/mp/game/momentum/scripts/titles.txt b/mp/game/momentum/scripts/titles.txt index 389ba134b1..b043ce2b5f 100644 --- a/mp/game/momentum/scripts/titles.txt +++ b/mp/game/momentum/scripts/titles.txt @@ -211,91 +211,4 @@ CHEATER #MOM_Cheater_Message } -$position -1 0.65 - -GAMESAVING -{ -#HL2_Saved -} - -// In-Game messages -$position 0.1 0.1 -$effect 2 -// This is the final color -$color 100 100 100 -// This is the highlight color -$color2 240 110 0 -// This is the time it takes to fade each character -$fadein 0.00 -// This is the amount of time the highlight lags behind the leading edge of the text -$fxtime 0.15 -// How long to hold the message on the screen (after it scans out) -$holdtime 1.0 -// How long it takes to fade out the message after holding -$fadeout 0.25 - -$boxsize 0.4 -$boxcolor 31 31 31 127 - -// The following message will clear any existing message of the given name -$clearmessage GAMESAVING - -GAMESAVED_360 -{ -#HL2_Saved -} - -$position -1 0.65 - -GAMESAVED -{ -#HL2_Saved -} - -$clearmessage 0 - -// Game title -// This is a placeholder to hold the effects controls for the "Half-Life" title -$position -1 -1 -// Only effect 0 is supported for game title -$effect 0 -// This is the final color -$color 180 180 180 -// Not used color2 -$color2 0 0 0 -// This is the time it takes to fade in the title -$fadein 1.0 -// How long to hold the message on the screen (after it scans out) -$holdtime 3.0 -// How long it takes to fade out the message after holding -$fadeout 1.5 - -$boxsize 0.0 - -GAMETITLE -{ -Half-Life -} - -//HAZARD COURSE TEXT - -// Test values -- JAY -$position -1 0.65 -// Scan-out text effect -$effect 2 -// This is the final color -$color 100 100 100 -// This is the highlight color -$color2 0 200 50 -// This is the time it takes to fade each character -$fadein 0.005 -// This is the amount of time the highlight lags behind the leading edge of the text -$fxtime 0.5 -// How long to hold the message on the screen (after it scans out) -$holdtime 3.5 -// How long it takes to fade out the message after holding - -$fadeout 1.5 -$position -1 0.65 -$position -1 0.3 - +$position -1 0.65 \ No newline at end of file diff --git a/mp/src/game/client/ShaderEditor/ShaderEditorSystem.cpp b/mp/src/game/client/ShaderEditor/ShaderEditorSystem.cpp index 07ad4bce03..f4f2b7529a 100644 --- a/mp/src/game/client/ShaderEditor/ShaderEditorSystem.cpp +++ b/mp/src/game/client/ShaderEditor/ShaderEditorSystem.cpp @@ -787,7 +787,7 @@ class CSimpleVCallbackView : public CBaseVCallbackView m_fogInfo = fogInfo; }; - void Draw() override + void Draw() OVERRIDE { DrawSetup(0, m_DrawFlags, 0); @@ -839,7 +839,7 @@ class CSimpleVCallbackView : public CBaseVCallbackView m_pMainView->DisableFog(); }; - void CallbackInitRenderList(int viewId) override + void CallbackInitRenderList(int viewId) OVERRIDE { BaseClass::CallbackInitRenderList(viewId); @@ -915,15 +915,15 @@ class CSimpleVCallbackView : public CBaseVCallbackView } }; - bool ShouldDrawParticles() override { return settings.bDrawParticles; }; + bool ShouldDrawParticles() OVERRIDE { return settings.bDrawParticles; }; - bool ShouldDrawRopes() override { return settings.bDrawRopes; }; + bool ShouldDrawRopes() OVERRIDE { return settings.bDrawRopes; }; - bool ShouldDrawWorld() override { return settings.bDrawWorld; }; + bool ShouldDrawWorld() OVERRIDE { return settings.bDrawWorld; }; - bool ShouldDrawTranslucents() override { return settings.bDrawTranslucents; }; + bool ShouldDrawTranslucents() OVERRIDE { return settings.bDrawTranslucents; }; - bool ShouldDrawTranslucentWorld() override { return settings.bDrawWorld && settings.bDrawTranslucents; }; + bool ShouldDrawTranslucentWorld() OVERRIDE { return settings.bDrawWorld && settings.bDrawTranslucents; }; private: VisibleFogVolumeInfo_t m_fogInfo; diff --git a/mp/src/game/client/ShaderEditor/ShaderEditorSystem.h b/mp/src/game/client/ShaderEditor/ShaderEditorSystem.h index 5d09739f8d..19eb80d2db 100644 --- a/mp/src/game/client/ShaderEditor/ShaderEditorSystem.h +++ b/mp/src/game/client/ShaderEditor/ShaderEditorSystem.h @@ -16,12 +16,12 @@ class ShaderEditorHandler : public CAutoGameSystemPerFrame ShaderEditorHandler( char const *name ); ~ShaderEditorHandler(); - bool Init() override; - void Shutdown() override; + bool Init() OVERRIDE; + void Shutdown() OVERRIDE; - void Update( float frametime ) override; - void PreRender() override; - void PostRender() override; + void Update( float frametime ) OVERRIDE; + void PreRender() OVERRIDE; + void PostRender() OVERRIDE; void CustomViewRender( int *viewId, const VisibleFogVolumeInfo_t &fogVolumeInfo, const WaterRenderInfo_t &waterRenderInfo ); void CustomPostRender() const; void UpdateSkymask( bool bCombineMode = false ) const; diff --git a/mp/src/game/client/cbase.h b/mp/src/game/client/cbase.h index b5c6544193..57e3260bd3 100644 --- a/mp/src/game/client/cbase.h +++ b/mp/src/game/client/cbase.h @@ -9,8 +9,6 @@ #define CBASE_H #ifdef _WIN32 #pragma once -#else -#define override #endif struct studiohdr_t; diff --git a/mp/src/game/client/cdll_client_int.cpp b/mp/src/game/client/cdll_client_int.cpp index 1e05475c7d..a91fd0c73e 100644 --- a/mp/src/game/client/cdll_client_int.cpp +++ b/mp/src/game/client/cdll_client_int.cpp @@ -225,6 +225,7 @@ IReplaySystem *g_pReplay = NULL; IHaptics* haptics = NULL;// NVNT haptics system interface singleton #ifdef GAMEUI2 +CSysModule *g_pGameUI2Module = nullptr; IGameUI2* g_pGameUI2 = NULL; #endif @@ -1173,14 +1174,14 @@ void CHLClient::PostInit() char modulePath[modulePathLength]; Q_snprintf(modulePath, modulePathLength, "%s\\bin\\gameui2.dll", engine->GetGameDirectory()); - CSysModule* dllModule = Sys_LoadModule(modulePath); - if (dllModule) + g_pGameUI2Module = Sys_LoadModule(modulePath); + if (g_pGameUI2Module) { ConColorMsg(Color(0, 148, 255, 255), "Loaded gameui2.dll\n"); - CreateInterfaceFn appSystemFactory = Sys_GetFactory(dllModule); + CreateInterfaceFn appSystemFactory = Sys_GetFactory(g_pGameUI2Module); - g_pGameUI2 = appSystemFactory ? ((IGameUI2*) appSystemFactory(GAMEUI2_DLL_INTERFACE_VERSION, NULL)) : NULL; + g_pGameUI2 = appSystemFactory ? static_cast(appSystemFactory(GAMEUI2_DLL_INTERFACE_VERSION, nullptr)) : NULL; if (g_pGameUI2) { ConColorMsg(Color(0, 148, 255, 255), "Initializing IGameUI2 interface...\n"); @@ -1208,7 +1209,7 @@ void CHLClient::PostInit() CreateInterfaceFn appSystemFactory = Sys_GetFactory(SharedModule); - shared = appSystemFactory ? ((CShared*)appSystemFactory(INTERFACEVERSION_SHAREDGAMEDLL, NULL)) : NULL; + shared = appSystemFactory ? static_cast(appSystemFactory(INTERFACEVERSION_SHAREDGAMEDLL, nullptr)) : NULL; if (shared) { ConColorMsg(Color(0, 148, 255, 255), "Loaded shared interface (CLIENT)\n"); @@ -1270,20 +1271,21 @@ void CHLClient::Shutdown( void ) UncacheAllMaterials(); IGameSystem::ShutdownAllSystems(); - + + gHUD.Shutdown(); + VGui_Shutdown(); + #ifdef GAMEUI2 if (g_pGameUI2) { g_pGameUI2->OnShutdown(); -#ifndef DEBUG - g_pGameUI2->Shutdown(); //For some reason this causes hangs when you debug -#endif + g_pGameUI2->Shutdown(); } + + if (g_pGameUI2Module) + Sys_UnloadModule(g_pGameUI2Module); #endif - gHUD.Shutdown(); - VGui_Shutdown(); - ParticleMgr()->Term(); ClearKeyValuesCache(); diff --git a/mp/src/game/client/client_momentum.vpc b/mp/src/game/client/client_momentum.vpc index 9929304522..a8c60aec9a 100644 --- a/mp/src/game/client/client_momentum.vpc +++ b/mp/src/game/client/client_momentum.vpc @@ -14,7 +14,7 @@ $Configuration $Compiler { $AdditionalIncludeDirectories "$BASE;$SRCDIR\game\gameui2,.\momentum\ui\HUD,.\momentum\ui\MainMenu,.\momentum\ui\SettingsPanel,.\momentum\ui\MapSelection,.\momentum\ui,.\momentum;$SRCDIR\game\shared\momentum;$SRCDIR\thirdparty\gason\src,$SRCDIR\vgui2,$SRCDIR\public,$SRCDIR\game\shared" - $PreprocessorDefinitions "$BASE;GAMEUI2;SOURCE_2013" + $PreprocessorDefinitions "$BASE;GAMEUI2;SOURCE_2013;SDK_DLL" } } diff --git a/mp/src/game/client/game_controls/baseviewport.cpp b/mp/src/game/client/game_controls/baseviewport.cpp index 31d8dca255..90d25b7e78 100644 --- a/mp/src/game/client/game_controls/baseviewport.cpp +++ b/mp/src/game/client/game_controls/baseviewport.cpp @@ -222,7 +222,6 @@ void CBaseViewport::OnScreenSizeChanged(int iOldWide, int iOldTall) #ifndef _XBOX vgui::ipanel()->MoveToBack( m_pBackGround->GetVPanel() ); // really send it to the back #endif - // hide all panels when reconnecting ShowPanel( PANEL_ALL, false ); @@ -707,7 +706,8 @@ void CBaseViewport::ReloadScheme(const char *fromFile) gHUD.RefreshHudTextures(); - InvalidateLayout( true, true ); + if (fromFile) + InvalidateLayout(true, true); // reset the hud gHUD.ResetHUD(); diff --git a/mp/src/game/client/hl2/hud_credits.cpp b/mp/src/game/client/hl2/hud_credits.cpp index e704131afe..fa40f01cc5 100644 --- a/mp/src/game/client/hl2/hud_credits.cpp +++ b/mp/src/game/client/hl2/hud_credits.cpp @@ -63,15 +63,15 @@ class CHudCredits : public CHudElement, public vgui::Panel public: CHudCredits(const char *pElementName); - void Init(void) override; - void LevelShutdown(void) override; + void Init(void) OVERRIDE; + void LevelShutdown(void) OVERRIDE; int GetStringPixelWidth(wchar_t *pString, vgui::HFont hFont); void MsgFunc_CreditsMsg(bf_read &msg); void MsgFunc_LogoTimeMsg(bf_read &msg); - bool ShouldDraw(void) override + bool ShouldDraw(void) OVERRIDE { g_bRollingCredits = IsActive(); @@ -82,8 +82,8 @@ class CHudCredits : public CHudElement, public vgui::Panel } protected: - void Paint() override; - void ApplySchemeSettings(vgui::IScheme *pScheme) override; + void Paint() OVERRIDE; + void ApplySchemeSettings(vgui::IScheme *pScheme) OVERRIDE; private: void Clear(); diff --git a/mp/src/game/client/momentum/c_mom_player.h b/mp/src/game/client/momentum/c_mom_player.h index 650d789f43..9df758f927 100644 --- a/mp/src/game/client/momentum/c_mom_player.h +++ b/mp/src/game/client/momentum/c_mom_player.h @@ -21,9 +21,9 @@ class C_MomentumPlayer : public C_BasePlayer C_MomentumPlayer(); ~C_MomentumPlayer(); - void PostDataUpdate(DataUpdateType_t updateType) override; - void OnDataChanged(DataUpdateType_t type) override; - bool CreateMove(float flInputSampleTime, CUserCmd *pCmd) override; + void PostDataUpdate(DataUpdateType_t updateType) OVERRIDE; + void OnDataChanged(DataUpdateType_t type) OVERRIDE; + bool CreateMove(float flInputSampleTime, CUserCmd *pCmd) OVERRIDE; virtual void ClientThink(void); Vector m_lastStandingPos; // used by the gamemovement code for finding ladders diff --git a/mp/src/game/client/momentum/c_mom_replay_entity.h b/mp/src/game/client/momentum/c_mom_replay_entity.h index 5f773b295e..e2af84059a 100644 --- a/mp/src/game/client/momentum/c_mom_replay_entity.h +++ b/mp/src/game/client/momentum/c_mom_replay_entity.h @@ -29,6 +29,6 @@ class C_MomentumReplayGhostEntity : public C_BaseAnimating int m_iCurrentTick; // The current tick of playback char m_pszPlayerName[MAX_PLAYER_NAME_LENGTH]; - bool ShouldInterpolate() override { return true; } + bool ShouldInterpolate() OVERRIDE { return true; } CInterpolatedVar m_iv_vecViewOffset; }; \ No newline at end of file diff --git a/mp/src/game/client/momentum/client_events.cpp b/mp/src/game/client/momentum/client_events.cpp index 193eae99f8..37ba51ede3 100644 --- a/mp/src/game/client/momentum/client_events.cpp +++ b/mp/src/game/client/momentum/client_events.cpp @@ -58,7 +58,8 @@ void CMOMClientEvents::PostInit() // Version warning // MOM_TODO: Change this once we hit Alpha/Beta // MOM_CURRENT_VERSION - messageboxpanel->CreateMessagebox("#MOM_StartupMsg_Prealpha_Title", "#MOM_StartupMsg_Prealpha", "#MOM_IUnderstand"); + messageboxpanel->CreateMessageboxVarRef("#MOM_StartupMsg_Prealpha_Title", "#MOM_StartupMsg_Prealpha", "mom_toggle_versionwarn", "#MOM_IUnderstand"); + if (!steamapicontext || !steamapicontext->SteamHTTP() || !steamapicontext->SteamUtils()) { messageboxpanel->CreateMessagebox("#MOM_StartupMsg_NoSteamApiContext_Title", "#MOM_StartupMsg_NoSteamApiContext", "#MOM_IUnderstand"); diff --git a/mp/src/game/client/momentum/client_events.h b/mp/src/game/client/momentum/client_events.h index 71b1c52bcb..fc50304f02 100644 --- a/mp/src/game/client/momentum/client_events.h +++ b/mp/src/game/client/momentum/client_events.h @@ -14,7 +14,7 @@ class CMOMClientEvents : public CAutoGameSystem } //After DLL inits successfully - void PostInit() override; + void PostInit() OVERRIDE; //From the Valve SDK wiki static void MountAdditionalContent(); diff --git a/mp/src/game/client/momentum/clientmode_mom_normal.cpp b/mp/src/game/client/momentum/clientmode_mom_normal.cpp index dc8f8de378..5b3db6d843 100644 --- a/mp/src/game/client/momentum/clientmode_mom_normal.cpp +++ b/mp/src/game/client/momentum/clientmode_mom_normal.cpp @@ -39,7 +39,7 @@ class CHudViewport : public CBaseViewport DECLARE_CLASS_SIMPLE(CHudViewport, CBaseViewport); protected: - void ApplySchemeSettings(vgui::IScheme *pScheme) override + void ApplySchemeSettings(vgui::IScheme *pScheme) OVERRIDE { BaseClass::ApplySchemeSettings(pScheme); @@ -48,7 +48,7 @@ class CHudViewport : public CBaseViewport SetPaintBackgroundEnabled(false); } - IViewPortPanel *CreatePanelByName(const char *pzName) override + IViewPortPanel *CreatePanelByName(const char *pzName) OVERRIDE { if (!Q_strcmp(PANEL_TIMES, pzName)) @@ -67,7 +67,7 @@ class CHudViewport : public CBaseViewport return BaseClass::CreatePanelByName(pzName); } - void CreateDefaultPanels(void) override + void CreateDefaultPanels(void) OVERRIDE { AddNewPanel(CreatePanelByName(PANEL_REPLAY), "PANEL_REPLAY"); AddNewPanel(CreatePanelByName(PANEL_TIMES), "PANEL_TIMES"); @@ -103,11 +103,7 @@ ClientModeMOMNormal::~ClientModeMOMNormal() void ClientModeMOMNormal::Init() { BaseClass::Init(); - - m_pHudMenuStatic = GET_HUDELEMENT(CHudMenuStatic); - m_pHudMapFinished = GET_HUDELEMENT(CHudMapFinishedDialog); - m_pLeaderboards = dynamic_cast(m_pViewport->FindPanelByName(PANEL_TIMES)); - m_pSpectatorGUI = dynamic_cast(m_pViewport->FindPanelByName(PANEL_SPECGUI)); + SetupPointers(); // Load up the combine control panel scheme g_hVGuiCombineScheme = scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel(PANEL_CLIENTDLL), @@ -191,4 +187,12 @@ int ClientModeMOMNormal::HandleSpectatorKeyInput(int down, ButtonCode_t keynum, } return 1; -} \ No newline at end of file +} + +void ClientModeMOMNormal::SetupPointers() +{ + m_pHudMenuStatic = GET_HUDELEMENT(CHudMenuStatic); + m_pHudMapFinished = GET_HUDELEMENT(CHudMapFinishedDialog); + m_pLeaderboards = dynamic_cast(m_pViewport->FindPanelByName(PANEL_TIMES)); + m_pSpectatorGUI = dynamic_cast(m_pViewport->FindPanelByName(PANEL_SPECGUI)); +} diff --git a/mp/src/game/client/momentum/clientmode_mom_normal.h b/mp/src/game/client/momentum/clientmode_mom_normal.h index 44658b2dae..e5f8067533 100644 --- a/mp/src/game/client/momentum/clientmode_mom_normal.h +++ b/mp/src/game/client/momentum/clientmode_mom_normal.h @@ -38,11 +38,13 @@ class ClientModeMOMNormal : public ClientModeShared ClientModeMOMNormal(); ~ClientModeMOMNormal(); - void Init() override; - bool ShouldDrawCrosshair(void) override; + void Init() OVERRIDE; + bool ShouldDrawCrosshair(void) OVERRIDE; //NOTE: This includes mouse inputs!!! - int HudElementKeyInput(int down, ButtonCode_t keynum, const char *pszCurrentBinding) override; - int HandleSpectatorKeyInput(int down, ButtonCode_t keynum, const char *pszCurrentBinding) override; + int HudElementKeyInput(int down, ButtonCode_t keynum, const char *pszCurrentBinding) OVERRIDE; + int HandleSpectatorKeyInput(int down, ButtonCode_t keynum, const char *pszCurrentBinding) OVERRIDE; + + void SetupPointers(); public: CHudMenuStatic *m_pHudMenuStatic; diff --git a/mp/src/game/client/momentum/mom_event_listener.h b/mp/src/game/client/momentum/mom_event_listener.h index 51075a3720..c6088662a7 100644 --- a/mp/src/game/client/momentum/mom_event_listener.h +++ b/mp/src/game/client/momentum/mom_event_listener.h @@ -13,7 +13,7 @@ class C_Momentum_EventListener : public CGameEventListener void Init(); - void FireGameEvent(IGameEvent* pEvent) override; + void FireGameEvent(IGameEvent* pEvent) OVERRIDE; bool m_bTimeDidSave, m_bTimeDidUpload; bool m_bMapIsLinear; diff --git a/mp/src/game/client/momentum/mom_in_main.cpp b/mp/src/game/client/momentum/mom_in_main.cpp index dccf758b10..01d57ac8b4 100644 --- a/mp/src/game/client/momentum/mom_in_main.cpp +++ b/mp/src/game/client/momentum/mom_in_main.cpp @@ -19,7 +19,7 @@ class CMOMInput : public CInput typedef CInput BaseClass; public: - int GetButtonBits(int bResetState) override + int GetButtonBits(int bResetState) OVERRIDE { int bits = BaseClass::GetButtonBits(bResetState); CalcButtonBits(bits, IN_TIMES, s_ClearInputState, &in_times, bResetState); @@ -34,7 +34,7 @@ class CMOMInput : public CInput return bits; } - void ClearInputButton(int bits) override + void ClearInputButton(int bits) OVERRIDE { s_ClearInputState |= bits; BaseClass::ClearInputButton(bits); diff --git a/mp/src/game/client/momentum/mom_prediction.cpp b/mp/src/game/client/momentum/mom_prediction.cpp index b1736d6678..bf14f0efc4 100644 --- a/mp/src/game/client/momentum/mom_prediction.cpp +++ b/mp/src/game/client/momentum/mom_prediction.cpp @@ -15,7 +15,7 @@ class CMOMPrediction : public CPrediction DECLARE_CLASS(CMOMPrediction, CPrediction); public: - void SetupMove(C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move) override + void SetupMove(C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move) OVERRIDE { player->AvoidPhysicsProps(ucmd); diff --git a/mp/src/game/client/momentum/mom_run_poster.h b/mp/src/game/client/momentum/mom_run_poster.h index 4edc42ef36..94dcd9effd 100644 --- a/mp/src/game/client/momentum/mom_run_poster.h +++ b/mp/src/game/client/momentum/mom_run_poster.h @@ -19,7 +19,7 @@ class CRunPoster : CGameEventListener ~CRunPoster(); void Init(); - void FireGameEvent(IGameEvent *pEvent) override; + void FireGameEvent(IGameEvent *pEvent) OVERRIDE; void PostTimeCallback(HTTPRequestCompleted_t *, bool); CCallResult cbPostTimeCallback; diff --git a/mp/src/game/client/momentum/ui/CVarSlider.h b/mp/src/game/client/momentum/ui/CVarSlider.h index 1418d063af..9527db3679 100644 --- a/mp/src/game/client/momentum/ui/CVarSlider.h +++ b/mp/src/game/client/momentum/ui/CVarSlider.h @@ -18,10 +18,10 @@ class CCvarSlider : public vgui::Slider void SetMinMaxValues(float minValue, float maxValue, bool bSetTickdisplay = true); void SetTickColor(Color color); - void Paint() override; + void Paint() OVERRIDE; - void ApplySettings(KeyValues *inResourceData) override; - void GetSettings(KeyValues *outResourceData) override; + void ApplySettings(KeyValues *inResourceData) OVERRIDE; + void GetSettings(KeyValues *outResourceData) OVERRIDE; void ApplyChanges(); float GetSliderValue(); diff --git a/mp/src/game/client/momentum/ui/ChangelogPanel.cpp b/mp/src/game/client/momentum/ui/ChangelogPanel.cpp index c7a169dee5..b79312e5c5 100644 --- a/mp/src/game/client/momentum/ui/ChangelogPanel.cpp +++ b/mp/src/game/client/momentum/ui/ChangelogPanel.cpp @@ -38,6 +38,9 @@ CChangelogPanel::CChangelogPanel(VPANEL parent) : BaseClass(nullptr, "ChangelogP // Called when the versions don't match (there's an update) void CChangelogPanel::Activate() { + // Reset the version warning to keep reminding them + ConVarRef("mom_toggle_versionwarn").SetValue(0); + char m_cReleaseText[225]; m_pReleaseText->GetText(m_cReleaseText, sizeof(m_cReleaseText)); char m_cReleaseF[225]; diff --git a/mp/src/game/client/momentum/ui/ChangelogPanel.h b/mp/src/game/client/momentum/ui/ChangelogPanel.h index 6a170801d3..7abf829dac 100644 --- a/mp/src/game/client/momentum/ui/ChangelogPanel.h +++ b/mp/src/game/client/momentum/ui/ChangelogPanel.h @@ -3,9 +3,9 @@ #include "cbase.h" #include "IChangelogPanel.h" -#include -#include #include +#include +#include #include #include #include @@ -32,20 +32,20 @@ class CChangelogPanel : public Frame if (m_pChangeLog) { m_pChangeLog->SetText(m_pwOnlineChangelog); - //Delay the scrolling to a tick or so away, thanks Valve. + // Delay the scrolling to a tick or so away, thanks Valve. m_flScrollTime = system()->GetFrameTime() + 0.010f; } } - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { BaseClass::ApplySchemeSettings(pScheme); m_pChangeLog->SetFont(pScheme->GetFont("DefaultSmall")); } - void Activate() override; + void Activate() OVERRIDE; - void OnThink() override + void OnThink() OVERRIDE { BaseClass::OnThink(); if (m_flScrollTime > 0.0f && system()->GetFrameTime() > m_flScrollTime) @@ -55,7 +55,7 @@ class CChangelogPanel : public Frame } } - void OnKillFocus() override + void OnKillFocus() OVERRIDE { BaseClass::OnKillFocus(); Close(); @@ -72,13 +72,13 @@ class CChangelogPanel : public Frame class CChangelogInterface : public IChangelogPanel { private: - CChangelogPanel *pPanel; + CChangelogPanel *pPanel; public: - CChangelogInterface() { pPanel = nullptr; } - ~CChangelogInterface() { } - void Create(vgui::VPANEL parent) override { pPanel = new CChangelogPanel(parent); } - void Destroy() override + CChangelogInterface() { pPanel = nullptr; } + virtual ~CChangelogInterface() {} + void Create(vgui::VPANEL parent) OVERRIDE { pPanel = new CChangelogPanel(parent); } + void Destroy() OVERRIDE { if (pPanel) { @@ -87,14 +87,14 @@ class CChangelogInterface : public IChangelogPanel } pPanel = nullptr; } - void Activate(void) override + void Activate(void) OVERRIDE { if (pPanel) { pPanel->Activate(); } } - void Close() override + void Close() OVERRIDE { if (pPanel) { @@ -102,7 +102,7 @@ class CChangelogInterface : public IChangelogPanel } } - void SetVersion(const char *pVersion) const override + void SetVersion(const char *pVersion) const OVERRIDE { if (pPanel) { @@ -110,7 +110,7 @@ class CChangelogInterface : public IChangelogPanel } } - void SetChangelog(const char *pChangelog) const override + void SetChangelog(const char *pChangelog) const OVERRIDE { if (pPanel) { diff --git a/mp/src/game/client/momentum/ui/ClientTimesDisplay.cpp b/mp/src/game/client/momentum/ui/ClientTimesDisplay.cpp index 89317ab4b6..c2280a1b07 100644 --- a/mp/src/game/client/momentum/ui/ClientTimesDisplay.cpp +++ b/mp/src/game/client/momentum/ui/ClientTimesDisplay.cpp @@ -63,6 +63,8 @@ CClientTimesDisplay::CClientTimesDisplay(IViewPort *pViewPort) : m_bFriendsTimesLoaded(false), m_bUnauthorizedFriendlist(false) { + SetSize(10, 10); // Quiet the "parent not sized yet" spew, actual size in leaderboards.res + m_iPlayerIndexSymbol = KeyValuesSystem()->GetSymbolForString("playerIndex"); m_nCloseKey = BUTTON_CODE_INVALID; @@ -188,12 +190,6 @@ CClientTimesDisplay::~CClientTimesDisplay() { m_pCurrentLeaderboards = nullptr; - if (m_pImageList) - { - delete m_pImageList; - m_pImageList = nullptr; - } - if (m_pLeaderboardReplayCMenu) { m_pLeaderboardReplayCMenu->DeletePanel(); @@ -466,7 +462,7 @@ void CClientTimesDisplay::ShowPanel(bool bShow) { // Catch the case where we call ShowPanel before ApplySchemeSettings, eg when // going from windowed <-> fullscreen - if (m_pImageList == nullptr) + if (!m_pImageList && bShow) { InvalidateLayout(true, true); } diff --git a/mp/src/game/client/momentum/ui/ClientTimesDisplay.h b/mp/src/game/client/momentum/ui/ClientTimesDisplay.h index f8365e8989..0c1934cc31 100644 --- a/mp/src/game/client/momentum/ui/ClientTimesDisplay.h +++ b/mp/src/game/client/momentum/ui/ClientTimesDisplay.h @@ -94,31 +94,31 @@ class CClientTimesDisplay : public vgui::EditablePanel, public IViewPortPanel, p CClientTimesDisplay(IViewPort *pViewPort); ~CClientTimesDisplay(); - const char *GetName(void) override { return PANEL_TIMES; } + const char *GetName(void) OVERRIDE { return PANEL_TIMES; } - void SetData(KeyValues *data) override{}; + void SetData(KeyValues *data) OVERRIDE{}; - void Reset() override; - void Update() override; + void Reset() OVERRIDE; + void Update() OVERRIDE; void Update(bool pFullUpdate); void Reset(bool pFullReset); - bool NeedsUpdate(void) override; + bool NeedsUpdate(void) OVERRIDE; - bool HasInputElements(void) override { return true; } + bool HasInputElements(void) OVERRIDE { return true; } - void ShowPanel(bool bShow) override; + void ShowPanel(bool bShow) OVERRIDE; bool ShowAvatars() { return IsPC(); } // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui - vgui::VPANEL GetVPanel(void) override { return BaseClass::GetVPanel(); } + vgui::VPANEL GetVPanel(void) OVERRIDE { return BaseClass::GetVPanel(); } - bool IsVisible() override { return BaseClass::IsVisible(); } + bool IsVisible() OVERRIDE { return BaseClass::IsVisible(); } - void SetParent(vgui::VPANEL parent) override { BaseClass::SetParent(parent); } + void SetParent(vgui::VPANEL parent) OVERRIDE { BaseClass::SetParent(parent); } // IGameEventListener interface: - void FireGameEvent(IGameEvent *event) override; + void FireGameEvent(IGameEvent *event) OVERRIDE; //void UpdatePlayerAvatar(int playerIndex, KeyValues *kv); // Updates the local player's avatar image @@ -146,17 +146,17 @@ class CClientTimesDisplay : public vgui::EditablePanel, public IViewPortPanel, p bool GetPlayerTimes(KeyValues *outPlayerInfo, bool fullUpdate); void InitScoreboardSections(); void UpdatePlayerInfo(KeyValues *outPlayerInfo, bool fullUpdate); - void OnThink() override; + void OnThink() OVERRIDE; void AddHeader(); // add the start header of the scoreboard static int GetAdditionalHeight() { return 0; } - void OnCommand(const char *pCommand) override; + void OnCommand(const char *pCommand) OVERRIDE; // sorts players within a section static bool StaticLocalTimeSortFunc(vgui::SectionedListPanel *list, int itemID1, int itemID2); static bool StaticOnlineTimeSortFunc(vgui::SectionedListPanel *list, int itemID1, int itemID2); - void ApplySchemeSettings(vgui::IScheme *pScheme) override; + void ApplySchemeSettings(vgui::IScheme *pScheme) OVERRIDE; void PostApplySchemeSettings(vgui::IScheme *pScheme); diff --git a/mp/src/game/client/momentum/ui/ContactPanel.cpp b/mp/src/game/client/momentum/ui/ContactPanel.cpp index 8861cfff8c..2711289168 100644 --- a/mp/src/game/client/momentum/ui/ContactPanel.cpp +++ b/mp/src/game/client/momentum/ui/ContactPanel.cpp @@ -20,8 +20,8 @@ class CContactPanel : public Frame CContactPanel(VPANEL parent); // Constructor ~CContactPanel() {}; // Destructor - void OnThink() override; - void Activate() override; + void OnThink() OVERRIDE; + void Activate() OVERRIDE; void InitPanel(); protected: MESSAGE_FUNC_CHARPTR(OnURLChange, "OnFinishRequest", URL) @@ -87,11 +87,11 @@ class CContactPanelInterface : public IContactPanel { contact_panel = nullptr; } - void Create(VPANEL parent) override + void Create(VPANEL parent) OVERRIDE { contact_panel = new CContactPanel(parent); } - void Destroy() override + void Destroy() OVERRIDE { if (contact_panel) { @@ -99,7 +99,7 @@ class CContactPanelInterface : public IContactPanel delete contact_panel; } } - void Activate(void) override + void Activate(void) OVERRIDE { if (contact_panel) { @@ -107,7 +107,7 @@ class CContactPanelInterface : public IContactPanel contact_panel->SetKeyBoardInputEnabled(true); } } - void Close() override + void Close() OVERRIDE { if (contact_panel) { diff --git a/mp/src/game/client/momentum/ui/HUD/hud_comparisons.h b/mp/src/game/client/momentum/ui/HUD/hud_comparisons.h index 00cbbdbc8d..9ee5c79c76 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_comparisons.h +++ b/mp/src/game/client/momentum/ui/HUD/hud_comparisons.h @@ -36,14 +36,14 @@ class C_RunComparisons : public CHudElement, public Panel C_RunComparisons(const char* pElementName); ~C_RunComparisons(); - void OnThink() override; - void Init() override; - void Reset() override; - void Paint() override; - bool ShouldDraw() override; - void OnTick() override; + void OnThink() OVERRIDE; + void Init() OVERRIDE; + void Reset() OVERRIDE; + void Paint() OVERRIDE; + bool ShouldDraw() OVERRIDE; + void OnTick() OVERRIDE; - void FireGameEvent(IGameEvent *event) override; + void FireGameEvent(IGameEvent *event) OVERRIDE; void LoadComparisons(); void LoadBogusComparisons(); @@ -59,7 +59,7 @@ class C_RunComparisons : public CHudElement, public Panel int GetMaximumTall(); void SetMaxWide(int); - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { Panel::ApplySchemeSettings(pScheme); m_hTextFont = pScheme->GetFont("HudHintTextSmall", true); diff --git a/mp/src/game/client/momentum/ui/HUD/hud_keypress.cpp b/mp/src/game/client/momentum/ui/HUD/hud_keypress.cpp index b2f8f24947..782eac25f1 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_keypress.cpp +++ b/mp/src/game/client/momentum/ui/HUD/hud_keypress.cpp @@ -31,20 +31,20 @@ class CHudKeyPressDisplay : public CHudElement, public Panel CHudKeyPressDisplay(const char *pElementName); - bool ShouldDraw() override + bool ShouldDraw() OVERRIDE { C_MomentumPlayer *pMom = ToCMOMPlayer(C_BasePlayer::GetLocalPlayer()); // don't show during map finished dialog return showkeys.GetBool() && pMom && !pMom->m_RunData.m_bMapFinished && CHudElement::ShouldDraw(); } - void OnThink() override; - void Paint() override; - void Init() override; - void Reset() override; + void OnThink() OVERRIDE; + void Paint() OVERRIDE; + void Init() OVERRIDE; + void Reset() OVERRIDE; void DrawKeyTemplates(); - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { Panel::ApplySchemeSettings(pScheme); SetBgColor(Color(0, 0, 0, 1)); // empty background, 1 alpha (out of 255) so game text doesnt obscure our text diff --git a/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.cpp b/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.cpp index 902175587e..02678b3aa7 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.cpp +++ b/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.cpp @@ -12,6 +12,7 @@ DECLARE_HUDELEMENT_DEPTH(CHudMapFinishedDialog, 70); CHudMapFinishedDialog::CHudMapFinishedDialog(const char *pElementName) : CHudElement(pElementName), BaseClass(g_pClientMode->GetViewport(), "CHudMapFinishedDialog") { + SetSize(10, 10); // Fix "not sized yet" spew m_pRunStats = nullptr; m_bIsGhost = false; m_iCurrentPage = 0; diff --git a/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.h b/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.h index df114d2a74..5dde484260 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.h +++ b/mp/src/game/client/momentum/ui/HUD/hud_mapfinished.h @@ -33,17 +33,19 @@ class CHudMapFinishedDialog : public CHudElement, public EditablePanel CHudMapFinishedDialog(const char *pElementName); ~CHudMapFinishedDialog(); - bool ShouldDraw() override; - void Paint() override; - void OnThink() override; - void Init() override; - void Reset() override; - void SetVisible(bool) override; - void FireGameEvent(IGameEvent*) override; + bool ShouldDraw() OVERRIDE; + void Paint() OVERRIDE; + void OnThink() OVERRIDE; + void Init() OVERRIDE; + void Reset() OVERRIDE; + void SetVisible(bool) OVERRIDE; + void FireGameEvent(IGameEvent*) OVERRIDE; - void OnMousePressed(MouseCode code) override; + bool IsBuildGroupEnabled() OVERRIDE { return false; } - void ApplySchemeSettings(IScheme *pScheme) override; + void OnMousePressed(MouseCode code) OVERRIDE; + + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE; protected: CPanelAnimationVar(HFont, m_hTextFont, "TextFont", "Default"); diff --git a/mp/src/game/client/momentum/ui/HUD/hud_mapinfo.cpp b/mp/src/game/client/momentum/ui/HUD/hud_mapinfo.cpp index 8c329355d9..f11e524f7e 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_mapinfo.cpp +++ b/mp/src/game/client/momentum/ui/HUD/hud_mapinfo.cpp @@ -41,17 +41,17 @@ class C_HudMapInfo : public CHudElement, public Panel DECLARE_CLASS_SIMPLE(C_HudMapInfo, Panel); C_HudMapInfo(const char *pElementName); - void OnThink() override; - void Init() override; - void Reset() override; - void Paint() override; - bool ShouldDraw() override + void OnThink() OVERRIDE; + void Init() OVERRIDE; + void Reset() OVERRIDE; + void Paint() OVERRIDE; + bool ShouldDraw() OVERRIDE { IViewPortPanel *pLeaderboards = gViewPortInterface->FindPanelByName(PANEL_TIMES); return CHudElement::ShouldDraw() && pLeaderboards && !pLeaderboards->IsVisible(); } - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { Panel::ApplySchemeSettings(pScheme); diff --git a/mp/src/game/client/momentum/ui/HUD/hud_menu_static.h b/mp/src/game/client/momentum/ui/HUD/hud_menu_static.h index 21947c2f30..6a66b9974f 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_menu_static.h +++ b/mp/src/game/client/momentum/ui/HUD/hud_menu_static.h @@ -29,14 +29,14 @@ class CHudMenuStatic : public CHudElement, public vgui::Panel wchar_t g_szMenuString[512]; char g_szPrelocalisedMenuString[512]; - void Init(void) override; - void VidInit(void) override; - void Reset(void) override; - bool ShouldDraw(void) override; + void Init(void) OVERRIDE; + void VidInit(void) OVERRIDE; + void Reset(void) OVERRIDE; + bool ShouldDraw(void) OVERRIDE; virtual bool IsMenuDisplayed(); void HideMenu(void); - void Paint() override; - void OnThink() override; + void Paint() OVERRIDE; + void OnThink() OVERRIDE; //Overrides //Called from a CON_COMMAND most likely. @@ -50,7 +50,7 @@ class CHudMenuStatic : public CHudElement, public vgui::Panel void ProcessText(void); void ShowMenu_KeyValueItems(KeyValues *pKV); - void ApplySchemeSettings(vgui::IScheme *pScheme) override; + void ApplySchemeSettings(vgui::IScheme *pScheme) OVERRIDE; void PaintString(const wchar_t *text, int textlen, vgui::HFont& font, int x, int y); private: diff --git a/mp/src/game/client/momentum/ui/HUD/hud_speedometer.cpp b/mp/src/game/client/momentum/ui/HUD/hud_speedometer.cpp index ed1f9941b9..3e8932f962 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_speedometer.cpp +++ b/mp/src/game/client/momentum/ui/HUD/hud_speedometer.cpp @@ -59,14 +59,14 @@ class CHudSpeedMeter : public CHudElement, public CHudNumericDisplay public: CHudSpeedMeter(const char *pElementName); - void Init() override { Reset(); } + void Init() OVERRIDE { Reset(); } - void VidInit() override { Reset(); } + void VidInit() OVERRIDE { Reset(); } - void Paint() override; - void PaintNumbers(HFont font, int xpos, int ypos, int value, bool atLeast2Digits) override; + void Paint() OVERRIDE; + void PaintNumbers(HFont font, int xpos, int ypos, int value, bool atLeast2Digits) OVERRIDE; - void Reset() override + void Reset() OVERRIDE { // We set the proper LabelText based on mom_speedmeter_units value switch (mom_speedometer_units.GetInt()) @@ -88,15 +88,15 @@ class CHudSpeedMeter : public CHudElement, public CHudNumericDisplay stageStartAlpha = 0.0f; } - void OnThink() override; + void OnThink() OVERRIDE; - bool ShouldDraw() override + bool ShouldDraw() OVERRIDE { IViewPortPanel *pLeaderboards = gViewPortInterface->FindPanelByName(PANEL_TIMES); return mom_speedometer.GetBool() && CHudElement::ShouldDraw() && pLeaderboards && !pLeaderboards->IsVisible(); } - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { Panel::ApplySchemeSettings(pScheme); secondaryColor = GetSchemeColor("SecondaryValueColor", pScheme); @@ -108,7 +108,7 @@ class CHudSpeedMeter : public CHudElement, public CHudNumericDisplay } bool ShouldColorize() const { return mom_speedometer_colorize.GetBool(); } - void FireGameEvent(IGameEvent *pEvent) override + void FireGameEvent(IGameEvent *pEvent) OVERRIDE { if (!Q_strcmp(pEvent->GetName(), "zone_exit")) { diff --git a/mp/src/game/client/momentum/ui/HUD/hud_strafesync.cpp b/mp/src/game/client/momentum/ui/HUD/hud_strafesync.cpp index 1ff0d5b7ad..f95c6db628 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_strafesync.cpp +++ b/mp/src/game/client/momentum/ui/HUD/hud_strafesync.cpp @@ -41,8 +41,8 @@ class CHudStrafeSyncDisplay : public CHudElement, public CHudNumericDisplay DECLARE_CLASS_SIMPLE(CHudStrafeSyncDisplay, CHudNumericDisplay); CHudStrafeSyncDisplay(const char *pElementName); - void OnThink() override; - bool ShouldDraw() override + void OnThink() OVERRIDE; + bool ShouldDraw() OVERRIDE { IViewPortPanel *pLeaderboards = gViewPortInterface->FindPanelByName(PANEL_TIMES); if (pLeaderboards && pLeaderboards->IsVisible()) @@ -66,7 +66,7 @@ class CHudStrafeSyncDisplay : public CHudElement, public CHudNumericDisplay return strafesync_draw.GetBool() && CHudElement::ShouldDraw() && shouldDrawLocal; } - void Reset() override + void Reset() OVERRIDE { m_flNextColorizeCheck = 0; m_flLastStrafeSync = 0; @@ -74,7 +74,7 @@ class CHudStrafeSyncDisplay : public CHudElement, public CHudNumericDisplay m_lastColor = normalColor; m_currentColor = normalColor; } - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { Panel::ApplySchemeSettings(pScheme); SetFgColor(GetSchemeColor("White", pScheme)); @@ -85,7 +85,7 @@ class CHudStrafeSyncDisplay : public CHudElement, public CHudNumericDisplay digit_xpos_initial = digit_xpos; } bool ShouldColorize() { return strafesync_colorize.GetInt() > 0; } - void Paint() override; + void Paint() OVERRIDE; private: float m_flNextColorizeCheck; @@ -214,8 +214,8 @@ class CHudStrafeSyncBar : public CHudFillableBar public: CHudStrafeSyncBar(const char *pElementName); - void OnThink() override; - bool ShouldDraw() override + void OnThink() OVERRIDE; + bool ShouldDraw() OVERRIDE { C_MomentumPlayer *pPlayer = ToCMOMPlayer(C_BasePlayer::GetLocalPlayer()); bool shouldDrawLocal = false; @@ -235,7 +235,7 @@ class CHudStrafeSyncBar : public CHudFillableBar return strafesync_drawbar.GetBool() && CHudElement::ShouldDraw() && shouldDrawLocal; } - void Reset() override + void Reset() OVERRIDE { m_flNextColorizeCheck = 0; m_flLastStrafeSync = 0; @@ -243,7 +243,7 @@ class CHudStrafeSyncBar : public CHudFillableBar m_lastColor = normalColor; m_currentColor = normalColor; } - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { Panel::ApplySchemeSettings(pScheme); SetFgColor(GetSchemeColor("White", pScheme)); @@ -251,7 +251,7 @@ class CHudStrafeSyncBar : public CHudFillableBar increaseColor = GetSchemeColor("MOM.Speedometer.Increase", pScheme); decreaseColor = GetSchemeColor("MOM.Speedometer.Decrease", pScheme); } - void Paint() override; + void Paint() OVERRIDE; bool ShouldColorize() { return strafesync_colorize.GetInt() > 0; } private: diff --git a/mp/src/game/client/momentum/ui/HUD/hud_timer.cpp b/mp/src/game/client/momentum/ui/HUD/hud_timer.cpp index a73583ea80..0d0979be7d 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_timer.cpp +++ b/mp/src/game/client/momentum/ui/HUD/hud_timer.cpp @@ -36,17 +36,17 @@ class C_HudTimer : public CHudElement, public Panel { DECLARE_CLASS_SIMPLE(C_HudTimer, Panel); C_HudTimer(const char *pElementName); - void OnThink() override; - void Init() override; - void Reset() override; - void Paint() override; - bool ShouldDraw() override + void OnThink() OVERRIDE; + void Init() OVERRIDE; + void Reset() OVERRIDE; + void Paint() OVERRIDE; + bool ShouldDraw() OVERRIDE { IViewPortPanel *pLeaderboards = gViewPortInterface->FindPanelByName(PANEL_TIMES); return mom_timer.GetBool() && CHudElement::ShouldDraw() && pLeaderboards && !pLeaderboards->IsVisible(); } - void ApplySchemeSettings(IScheme *pScheme) override + void ApplySchemeSettings(IScheme *pScheme) OVERRIDE { Panel::ApplySchemeSettings(pScheme); SetFgColor(GetSchemeColor("MOM.Panel.Fg", pScheme)); diff --git a/mp/src/game/client/momentum/ui/HUD/hud_versioninfo.cpp b/mp/src/game/client/momentum/ui/HUD/hud_versioninfo.cpp index 4d387faac5..b12f4a9591 100644 --- a/mp/src/game/client/momentum/ui/HUD/hud_versioninfo.cpp +++ b/mp/src/game/client/momentum/ui/HUD/hud_versioninfo.cpp @@ -20,11 +20,11 @@ class CHudVersionInfo : public CHudElement, public Panel public: CHudVersionInfo(const char *pElementName); - bool ShouldDraw() override { return CHudElement::ShouldDraw(); } + bool ShouldDraw() OVERRIDE { return CHudElement::ShouldDraw(); } - void Paint() override; + void Paint() OVERRIDE; - void Init() override; + void Init() OVERRIDE; protected: CPanelAnimationVar(HFont, m_hTextFont, "TextFont", "Default"); diff --git a/mp/src/game/client/momentum/ui/IMessageboxPanel.h b/mp/src/game/client/momentum/ui/IMessageboxPanel.h index cff5b50c8c..8d284ddcf1 100644 --- a/mp/src/game/client/momentum/ui/IMessageboxPanel.h +++ b/mp/src/game/client/momentum/ui/IMessageboxPanel.h @@ -13,6 +13,7 @@ class IMessageboxPanel virtual vgui::Panel *CreateMessagebox(const char *pTitle, const char *pMessage, const char *pAccept = nullptr) = 0; virtual vgui::Panel *CreateConfirmationBox(vgui::Panel *pTarget, const char *pTitle, const char *pMessage, KeyValues *okCommand, KeyValues *cancelCommand, const char *pAcceptText = nullptr, const char *pCancelText = nullptr) = 0; + virtual vgui::Panel *CreateMessageboxVarRef(const char *pTitle, const char *pMessage, const char *cvar, const char *pAccept = nullptr) = 0; virtual void FlushMessageboxes() = 0; virtual void FlushMessageboxes(vgui::HPanel pHp) = 0; }; diff --git a/mp/src/game/client/momentum/ui/MapSelection/MapInfoDialog.h b/mp/src/game/client/momentum/ui/MapSelection/MapInfoDialog.h index 7f9740f605..d27ae69c1e 100644 --- a/mp/src/game/client/momentum/ui/MapSelection/MapInfoDialog.h +++ b/mp/src/game/client/momentum/ui/MapSelection/MapInfoDialog.h @@ -33,8 +33,8 @@ class CDialogMapInfo : public Frame // message handlers MESSAGE_FUNC(OnConnect, "Connect"); // vgui overrides - void OnTick() override; - void PerformLayout() override; + void OnTick() OVERRIDE; + void PerformLayout() OVERRIDE; // API void GetMapInfo(const char* mapname); diff --git a/mp/src/game/client/momentum/ui/MapSelection/MapSelector.cpp b/mp/src/game/client/momentum/ui/MapSelection/MapSelector.cpp index c0ba013556..234cd4c2cf 100644 --- a/mp/src/game/client/momentum/ui/MapSelection/MapSelector.cpp +++ b/mp/src/game/client/momentum/ui/MapSelection/MapSelector.cpp @@ -121,6 +121,7 @@ void CMapSelector::Destroy() { m_hMapsDlg->Close(); m_hMapsDlg->MarkForDeletion(); + m_hMapsDlg = nullptr; } } diff --git a/mp/src/game/client/momentum/ui/MapSelection/MapSelector.h b/mp/src/game/client/momentum/ui/MapSelection/MapSelector.h index e8689249a2..4e9661d684 100644 --- a/mp/src/game/client/momentum/ui/MapSelection/MapSelector.h +++ b/mp/src/game/client/momentum/ui/MapSelection/MapSelector.h @@ -13,10 +13,10 @@ class CMapSelector : public IMapSelector CMapSelector(); ~CMapSelector(); - void Create(VPANEL parent) override; - void Destroy() override; - void Activate() override; - void Deactivate() override; + void Create(VPANEL parent) OVERRIDE; + void Destroy() OVERRIDE; + void Activate() OVERRIDE; + void Deactivate() OVERRIDE; void Open(); void CloseAllMapInfoDialogs(); diff --git a/mp/src/game/client/momentum/ui/MapSelection/MapSelectorDialog.cpp b/mp/src/game/client/momentum/ui/MapSelection/MapSelectorDialog.cpp index 7e3ccf7736..e0907c4aa2 100644 --- a/mp/src/game/client/momentum/ui/MapSelection/MapSelectorDialog.cpp +++ b/mp/src/game/client/momentum/ui/MapSelection/MapSelectorDialog.cpp @@ -46,6 +46,7 @@ CMapSelectorDialog::CMapSelectorDialog(vgui::VPANEL parent) : Frame(nullptr, "CM // property sheet m_pTabPanel = new PropertySheet(this, "MapTabs"); + m_pTabPanel->SetSize(10, 10); // Fix "parent not sized yet" spew m_pTabPanel->SetTabWidth(72); m_pTabPanel->AddPage(m_pLocal, "#MOM_MapSelector_LocalMaps"); //MOM_TODO: uncomment: m_pTabPanel->AddPage(m_pOnline, "#MOM_MapSelector_OnlineMaps"); @@ -77,8 +78,10 @@ CMapSelectorDialog::CMapSelectorDialog(vgui::VPANEL parent) : Frame(nullptr, "CM //----------------------------------------------------------------------------- CMapSelectorDialog::~CMapSelectorDialog() { - delete m_pContextMenu; + if (m_pContextMenu) + m_pContextMenu->DeletePanel(); + // Attempt to save user data, if not that's okay SaveUserData(); if (m_pSavedData) @@ -169,6 +172,8 @@ void CMapSelectorDialog::LoadUserData() //----------------------------------------------------------------------------- void CMapSelectorDialog::SaveUserData() { + if (!g_pFullFileSystem) return; + m_pSavedData->Clear(); m_pSavedData->LoadFromFile(g_pFullFileSystem, "cfg/MapSelector.vdf", "MOD"); diff --git a/mp/src/game/client/momentum/ui/MessageboxPanel.cpp b/mp/src/game/client/momentum/ui/MessageboxPanel.cpp index 87f2050e93..8f8539d028 100644 --- a/mp/src/game/client/momentum/ui/MessageboxPanel.cpp +++ b/mp/src/game/client/momentum/ui/MessageboxPanel.cpp @@ -2,6 +2,11 @@ #include "cbase.h" #include "MessageboxPanel.h" +#include "mom_shareddefs.h" +#include + +static MAKE_TOGGLE_CONVAR(mom_toggle_nostartorend, "0", FCVAR_HIDDEN | FCVAR_ARCHIVE, "Controls if No Start or End should be shown.\n"); +static MAKE_TOGGLE_CONVAR(mom_toggle_versionwarn, "0", FCVAR_HIDDEN | FCVAR_ARCHIVE, "Controls if the initial version warning should be shown.\n"); void __MsgFunc_MB_PlayerTriedSaveOrLoad(bf_read &msg) { @@ -9,7 +14,7 @@ void __MsgFunc_MB_PlayerTriedSaveOrLoad(bf_read &msg) } void __MsgFunc_MB_NoStartOrEnd(bf_read &msg) { - messageboxpanel->CreateMessagebox("#MOM_MB_NoStartOrEnd_Title", "#MOM_MB_NoStartOrEnd"); + messageboxpanel->CreateMessageboxVarRef("#MOM_MB_NoStartOrEnd_Title", "#MOM_MB_NoStartOrEnd", "mom_toggle_nostartorend"); } void __MsgFunc_MB_EditingZone(bf_read &msg) @@ -17,6 +22,62 @@ void __MsgFunc_MB_EditingZone(bf_read &msg) messageboxpanel->CreateMessagebox("#MOM_MB_EditingZone_Title", "#MOM_MB_EditingZone"); } +MessageBoxVarRef::MessageBoxVarRef(const char* title, const char* msg, const char* cvar) : MessageBox(title, msg) +{ + // When toggled, will not allow the panel to be created (We don't check it here because we've done it on our 2 interfaces (Messaging and IMEssageBox) + // this also allows us to show this even if the toggle says no! (Like, for important stuff) + m_pToggleCheckButton = new CvarToggleCheckButton(this, "MessageboxVarRef", "#MOM_MB_DontShowAgain", cvar); + AddActionSignalTarget(m_pToggleCheckButton); // Catch that OK button press +} + +MessageBoxVarRef::~MessageBoxVarRef() +{ + if (m_pToggleCheckButton) + { + m_pToggleCheckButton->DeletePanel(); + m_pToggleCheckButton = nullptr; + } +} + +// Overridden +void MessageBoxVarRef::PerformLayout() +{ + int x, y, wide, tall; + GetClientArea(x, y, wide, tall); + wide += x; + tall += y; + + int boxWidth, boxTall; + GetSize(boxWidth, boxTall); + + int oldWide, oldTall; + m_pOkButton->GetSize(oldWide, oldTall); + + int btnWide, btnTall; + m_pOkButton->GetContentSize(btnWide, btnTall); + btnWide = max(oldWide, btnWide + 10); + btnTall = max(oldTall, btnTall + 10); + m_pOkButton->SetSize(btnWide, btnTall); + + boxWidth = max(boxWidth, m_pMessageLabel->GetWide() + 100); + boxWidth = max(boxWidth, btnWide * 2 + 30); + SetSize(boxWidth, boxTall); + + m_pMessageLabel->SetPos((wide / 2) - (m_pMessageLabel->GetWide() / 2) + x, y + 5); + m_pOkButton->SetPos((wide / 2) - (m_pOkButton->GetWide() / 2) + x, tall - m_pOkButton->GetTall() - 25); + + if (m_pToggleCheckButton) + { + int dummy, okY; + m_pOkButton->GetPos(dummy, okY); + m_pToggleCheckButton->SetAutoWide(true); + m_pToggleCheckButton->SetPos(x, tall - m_pToggleCheckButton->GetTall()); + } + + // Bypass BaseClass and call its BaseClass + Frame::PerformLayout(); +} + // Constuctor: Initializes the Panel CMessageboxPanel::CMessageboxPanel(VPANEL parent) : BaseClass(nullptr, "MessageboxPanel") { @@ -95,6 +156,29 @@ Panel *CMessageboxPanel::CreateConfirmationBox(Panel *pTarget, const char *pTitl return pMessageBox; } +Panel* CMessageboxPanel::CreateMessageboxVarRef(const char* pTitle, const char* pMessage, const char* cvar, const char* pAccept) +{ + ConVarRef varref(cvar); + if (!varref.IsValid()) + return nullptr; + // Preliminary check, if the var is already 1 then bail + if (varref.GetBool()) + return nullptr; + MessageBoxVarRef *pMessageBox = new MessageBoxVarRef(pTitle, pMessage, cvar); + // If it is not a nullptr and it's not an empty string... + if (pAccept && Q_strlen(pAccept) > 0) + { + pMessageBox->SetOKButtonText(pAccept); + } + // Needed for saving the ConVarRef + pMessageBox->SetCommand(new KeyValues("ApplyChanges")); + pMessageBox->MoveToCenterOfScreen(); + + m_mbItems.AddToTail(pMessageBox); + pMessageBox->DoModal(); + return pMessageBox; +} + void CMessageboxPanel::FlushMessageboxes() { FOR_EACH_VEC(m_mbItems, iIterator) diff --git a/mp/src/game/client/momentum/ui/MessageboxPanel.h b/mp/src/game/client/momentum/ui/MessageboxPanel.h index 33f2b716af..8f4551c566 100644 --- a/mp/src/game/client/momentum/ui/MessageboxPanel.h +++ b/mp/src/game/client/momentum/ui/MessageboxPanel.h @@ -15,8 +15,20 @@ using namespace vgui; + +class MessageBoxVarRef : public MessageBox +{ +public: + MessageBoxVarRef(const char *title, const char *msg, const char *cvar); + ~MessageBoxVarRef(); + + void PerformLayout() OVERRIDE; +private: + CvarToggleCheckButton* m_pToggleCheckButton; +}; + // CChangelogPanel class -class CMessageboxPanel : public Frame +class CMessageboxPanel : public Frame // We're not a child of MessageBox for a good reason. I guess... { DECLARE_CLASS_SIMPLE(CMessageboxPanel, Frame); // CChangelogPanel : This Class / vgui::Frame : BaseClass @@ -24,7 +36,7 @@ class CMessageboxPanel : public Frame CMessageboxPanel(VPANEL parent); // Constructor ~CMessageboxPanel(); // Destructor - void Close() override; + void Close() OVERRIDE; // Creates a messagebox, with pTitle as title and pMessage as message. // It does not disappear until Close is pressed or FlushMessageboxes() is called @@ -33,6 +45,10 @@ class CMessageboxPanel : public Frame Panel *CreateConfirmationBox(Panel *pTarget, const char *pTitle, const char *pMessage, KeyValues *okCommand, KeyValues *cancelCommand, const char *pAcceptText = nullptr, const char *pCancelText = nullptr); + + // Creates a messagebox with a "Don't show me this again" toggle controlled by a convar (Defined in its params) + // TIP: ConVar should be defined as FCVAR_HIDDEN | FCVAR_ARCHIVE with default to 0. + Panel *CreateMessageboxVarRef(const char *pTitle, const char *pMessage, const char* cvar, const char *pAccept = nullptr); // This function deletes all the messageboxes void FlushMessageboxes(); // Removes the HPanel messagebox @@ -49,10 +65,10 @@ class CMessageboxInterface : public IMessageboxPanel public: CMessageboxInterface() { pPanel = nullptr; } - ~CMessageboxInterface() {} - void Create(VPANEL parent) override { pPanel = new CMessageboxPanel(parent); } + virtual ~CMessageboxInterface() {} + void Create(VPANEL parent) OVERRIDE { pPanel = new CMessageboxPanel(parent); } - void Destroy() override + void Destroy() OVERRIDE { if (pPanel) { @@ -61,7 +77,7 @@ class CMessageboxInterface : public IMessageboxPanel pPanel = nullptr; } - void Activate(void) override + void Activate(void) OVERRIDE { if (pPanel) { @@ -69,7 +85,7 @@ class CMessageboxInterface : public IMessageboxPanel } } - void Close() override + void Close() OVERRIDE { if (pPanel) { @@ -78,7 +94,7 @@ class CMessageboxInterface : public IMessageboxPanel } // is the default parameter specifier needed here? - Panel *CreateMessagebox(const char *pTitle, const char *pMessage, const char *pAccept = nullptr) override + Panel *CreateMessagebox(const char *pTitle, const char *pMessage, const char *pAccept = nullptr) OVERRIDE { if (pPanel) { @@ -88,7 +104,7 @@ class CMessageboxInterface : public IMessageboxPanel } Panel *CreateConfirmationBox(Panel *pTarget, const char *pTitle, const char *pMessage, KeyValues *okCommand, - KeyValues *cancelCommand, const char *pAcceptText = nullptr, const char *pCancelText = nullptr) override + KeyValues *cancelCommand, const char *pAcceptText = nullptr, const char *pCancelText = nullptr) OVERRIDE { if (pPanel) { @@ -97,7 +113,16 @@ class CMessageboxInterface : public IMessageboxPanel return nullptr; } - void FlushMessageboxes() override + Panel *CreateMessageboxVarRef(const char *pTitle, const char *pMessage, const char *cvar, const char *pAccept = nullptr) OVERRIDE + { + if (pPanel) + { + return pPanel->CreateMessageboxVarRef(pTitle, pMessage, cvar, pAccept); + } + return nullptr; + } + + void FlushMessageboxes() OVERRIDE { if (pPanel) { @@ -105,7 +130,7 @@ class CMessageboxInterface : public IMessageboxPanel } } - void FlushMessageboxes(HPanel pHp) override + void FlushMessageboxes(HPanel pHp) OVERRIDE { if (pPanel) { diff --git a/mp/src/game/client/momentum/ui/ReplayContextMenu.h b/mp/src/game/client/momentum/ui/ReplayContextMenu.h index bdf572a9e5..5d851433f7 100644 --- a/mp/src/game/client/momentum/ui/ReplayContextMenu.h +++ b/mp/src/game/client/momentum/ui/ReplayContextMenu.h @@ -19,7 +19,7 @@ class CReplayContextMenu : public vgui::Menu // call this to Activate the menu void ShowMenu(); - void OnCursorExitedMenuItem(int vpanel) override; + void OnCursorExitedMenuItem(int vpanel) OVERRIDE; }; diff --git a/mp/src/game/client/momentum/ui/SettingsPanel/ComparisonsSettingsPage.cpp b/mp/src/game/client/momentum/ui/SettingsPanel/ComparisonsSettingsPage.cpp index cacb2abf5f..f29aafa515 100644 --- a/mp/src/game/client/momentum/ui/SettingsPanel/ComparisonsSettingsPage.cpp +++ b/mp/src/game/client/momentum/ui/SettingsPanel/ComparisonsSettingsPage.cpp @@ -6,66 +6,39 @@ ComparisonsSettingsPage::ComparisonsSettingsPage(Panel *pParent) : BaseClass(pParent, "ComparisonsSettings") { m_pCompareShow = FindControl>("CompareShow"); - m_pCompareShow->AddActionSignalTarget(this); m_pMaxZones = FindControl("Zones"); - m_pMaxZones->AddActionSignalTarget(this); - m_pMaxZonesLabel = FindControl