diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000000..920800cbd5 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,55 @@ +0.4.7 +Bugfixes + Fixed replays sometimes not unloading + Fixed width of settings panel labels + Mapfinished panel resets to page 0 properly + Added StartupVids.txt to override Valve's startup vid + +0.4.5 +Changelog Introduced + The version update panel now includes a changelog for the newer version. +Spectator UI Updated + Now includes toggled mouse control upon pressing your +duck bind + Added a red X that stops the replay and respawns the player (similar to MapFinished) +Bugfixes + Fixed scroll detection + Scrolls of all force are detected now, player should jump properly (sorry about that, scrollers!) + Replays + Fixed crash with replays not unloading properly + Fixed potential crash with replays ending + Fixed velocity setting to a value that was too high (due to teleports) + Fixed potential "roaming" spec mode if replay was finished + Ending player movement actually approaches 0 now + The player will actually stop inside the end trigger + +0.4.0 +Replay System + Automatically records replays for every run + Small, lightweight file (28 bytes / tick) + Truncates the recording to the first two seconds before the run started to show prestrafe only + Supports all stats that were displayed during the real run + Allows playback of ghosts with options for 15 different display models and customizable colors (see mom_replay_* commands for more details) +Comparisons Panel + Compare your current run against your PB + Compare against any run stats; all, some or none +Precise Timer + Times accurate to 6 decimal places (however, we currently only display 3 decimal places) + The only timer for surf or bhop that is more accurate than the interval per tick + Read about how it works on our devblog +Map Finished Screen + Mouse controls for watching the replay of the run you just finished + Pages for stats in every zone, not just overall + Shows both XY and XYZ velocity (controlled by mom_speedometer_hvel currently) +Other changes + Added Source Shader Editor + Added both XY and XYZ velocities to run stats + Player's velocity is now slowed down when they finish a map to allow them to see the map finished screen + Crosshair is off by default + left and right are now bindable from Options->Keyboard + JUMP indicator in key press display no longer flashes when the player uses the scroll wheel to jump + Credits can now go faster if attack is pressed + Disabled demo interpolation, which fixes demo stuttering bug, but makes demos lag. Demos will work properly if you turn off client interpolation (cl_interp 0) but this breaks other things + point_servercommand entities are disabled by default + sv_gravity is development-only (sorry) + Player FOV setting now works properly through fov_desired + Changed mom_generate_zon_file to mom_zone_generate \ No newline at end of file diff --git a/mp/game/momentum/media/StartupVids.txt b/mp/game/momentum/media/StartupVids.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mp/game/momentum/resource/SourceScheme.res b/mp/game/momentum/resource/SourceScheme.res index 8a7796febd..7877e6de37 100644 --- a/mp/game/momentum/resource/SourceScheme.res +++ b/mp/game/momentum/resource/SourceScheme.res @@ -89,7 +89,7 @@ Scheme FrameSystemButton.BgColor "Blank" FrameSystemButton.Icon "" FrameSystemButton.DisabledIcon "" - FrameTitleBar.Font "Verdana" + FrameTitleBar.Font "DefaultSmall" FrameTitleBar.TextColor "255 255 255 204" FrameTitleBar.BgColor "Blank" FrameTitleBar.DisabledTextColor "255 255 255 91" @@ -255,6 +255,7 @@ Scheme "name" "Verdana" [$LINUX] "tall" "16" "weight" "500" + "antialias" "1" } } "DefaultBold" @@ -287,6 +288,7 @@ Scheme "tall" "12" [!$LINUX] "tall" "16" [$LINUX] "weight" "0" + "antialias" "1" } } "DefaultSmallDropShadow" @@ -298,6 +300,7 @@ Scheme "tall" "13" "weight" "0" "dropshadow" "1" + "antialias" "1" } } "DefaultVerySmall" @@ -306,8 +309,10 @@ Scheme { "name" "Tahoma" [!$LINUX] "name" "Verdana" [$LINUX] - "tall" "12" + "tall" "12" [$LINUX] + "tall" "10" [!$LINUX] "weight" "0" + "antialias" "1" } } diff --git a/mp/game/momentum/resource/gameui_english.txt b/mp/game/momentum/resource/gameui_english.txt index ff333582f8..f07a8ecd8b 100644 Binary files a/mp/game/momentum/resource/gameui_english.txt and b/mp/game/momentum/resource/gameui_english.txt differ diff --git a/mp/game/momentum/resource/ui/MomentumSettingsPanel.res b/mp/game/momentum/resource/ui/MomentumSettingsPanel.res index e34057f1d9..a4af93d2b4 100644 --- a/mp/game/momentum/resource/ui/MomentumSettingsPanel.res +++ b/mp/game/momentum/resource/ui/MomentumSettingsPanel.res @@ -4,10 +4,10 @@ { "ControlName" "CMomentumSettingsPanel" "fieldName" "CMomentumSettingsPanel" - "xpos" "337" - "ypos" "74" - "wide" "360" - "tall" "360" + "xpos" "304" + "ypos" "144" + "wide" "266" + "tall" "266" "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" @@ -25,7 +25,7 @@ "fieldName" "frame_topGrip" "xpos" "4" "ypos" "0" - "wide" "351" + "wide" "258" "tall" "2" "autoResize" "0" "pinCorner" "0" @@ -41,8 +41,8 @@ "ControlName" "Panel" "fieldName" "frame_bottomGrip" "xpos" "4" - "ypos" "357" - "wide" "346" + "ypos" "264" + "wide" "252" "tall" "2" "autoResize" "0" "pinCorner" "0" @@ -60,7 +60,7 @@ "xpos" "0" "ypos" "4" "wide" "2" - "tall" "351" + "tall" "258" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -74,10 +74,10 @@ { "ControlName" "Panel" "fieldName" "frame_rightGrip" - "xpos" "357" + "xpos" "264" "ypos" "4" "wide" "2" - "tall" "346" + "tall" "252" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -108,7 +108,7 @@ { "ControlName" "Panel" "fieldName" "frame_trGrip" - "xpos" "355" + "xpos" "262" "ypos" "0" "wide" "4" "tall" "4" @@ -126,7 +126,7 @@ "ControlName" "Panel" "fieldName" "frame_blGrip" "xpos" "0" - "ypos" "355" + "ypos" "262" "wide" "4" "tall" "4" "autoResize" "0" @@ -142,8 +142,8 @@ { "ControlName" "Panel" "fieldName" "frame_brGrip" - "xpos" "350" - "ypos" "350" + "xpos" "257" + "ypos" "257" "wide" "9" "tall" "9" "autoResize" "0" @@ -161,7 +161,7 @@ "fieldName" "frame_caption" "xpos" "0" "ypos" "0" - "wide" "354" + "wide" "261" "tall" "12" "autoResize" "0" "pinCorner" "0" @@ -178,8 +178,8 @@ "fieldName" "frame_minimize" "xpos" "0" "ypos" "0" - "wide" "8" - "tall" "8" + "wide" "0" + "tall" "0" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -196,7 +196,7 @@ "centerwrap" "0" "textinsetx" "2" "textinsety" "1" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" } @@ -206,8 +206,8 @@ "fieldName" "frame_maximize" "xpos" "0" "ypos" "0" - "wide" "8" - "tall" "8" + "wide" "0" + "tall" "0" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -224,7 +224,7 @@ "centerwrap" "0" "textinsetx" "2" "textinsety" "1" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" } @@ -234,8 +234,8 @@ "fieldName" "frame_mintosystray" "xpos" "0" "ypos" "0" - "wide" "8" - "tall" "8" + "wide" "0" + "tall" "0" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -252,7 +252,7 @@ "centerwrap" "0" "textinsetx" "2" "textinsety" "1" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "command" "MinimizeToSysTray" "Default" "0" @@ -261,7 +261,7 @@ { "ControlName" "Button" "fieldName" "frame_close" - "xpos" "335" + "xpos" "242" "ypos" "8" "wide" "17" "tall" "17" @@ -281,9 +281,9 @@ "centerwrap" "0" "textinsetx" "4" "textinsety" "2" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" - "Default" "1" + "Default" "0" } "frame_menu" { @@ -308,7 +308,7 @@ "centerwrap" "0" "textinsetx" "0" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" } @@ -316,11 +316,11 @@ { "ControlName" "ComboBox" "fieldName" "SpeedoUnits" - "xpos" "88" - "ypos" "108" - "wide" "120" + "xpos" "11" + "ypos" "100" + "wide" "96" "tall" "17" - "autoResize" "1" + "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -338,11 +338,11 @@ { "ControlName" "ComboBox" "fieldName" "SyncType" - "xpos" "52" - "ypos" "256" - "wide" "170" + "xpos" "16" + "ypos" "208" + "wide" "185" "tall" "16" - "autoResize" "0" + "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -360,9 +360,9 @@ { "ControlName" "ComboBox" "fieldName" "SyncColorize" - "xpos" "72" - "ypos" "273" - "wide" "70" + "xpos" "16" + "ypos" "241" + "wide" "56" "tall" "16" "autoResize" "0" "pinCorner" "0" @@ -383,9 +383,9 @@ "ControlName" "CvarToggleCheckButton" "fieldName" "SpeedoShow" "xpos" "8" - "ypos" "40" - "wide" "218" - "tall" "11" + "ypos" "26" + "wide" "96" + "tall" "16" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -398,21 +398,24 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "6" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" + "cvar_name" "mom_speedometer" + "cvar_value" "1" } "SpeedoShowJump" { "ControlName" "CvarToggleCheckButton" "fieldName" "SpeedoShowJump" "xpos" "8" - "ypos" "69" - "wide" "312" + "ypos" "56" + "wide" "189" "tall" "16" "autoResize" "0" "pinCorner" "0" @@ -426,23 +429,26 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "6" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" + "cvar_name" "mom_speedometer_showlastjumpvel" + "cvar_value" "1" } "ShowSpeedoHvel" { "ControlName" "CvarToggleCheckButton" "fieldName" "ShowSpeedoHvel" "xpos" "8" - "ypos" "56" - "wide" "217" - "tall" "11" - "autoResize" "0" + "ypos" "72" + "wide" "194" + "tall" "16" + "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -454,23 +460,26 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "6" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" + "cvar_name" "mom_speedometer_hvel" + "cvar_value" "0" } "SpeedoShowColor" { "ControlName" "CvarToggleCheckButton" "fieldName" "SpeedoShowColor" "xpos" "8" - "ypos" "85" - "wide" "320" + "ypos" "40" + "wide" "185" "tall" "16" - "autoResize" "0" + "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -482,23 +491,26 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "6" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" + "cvar_name" "mom_speedometer_colorize" + "cvar_value" "1" } "SyncShow" { "ControlName" "CvarToggleCheckButton" "fieldName" "SyncShow" - "xpos" "8" - "ypos" "224" - "wide" "161" + "xpos" "9" + "ypos" "161" + "wide" "107" "tall" "16" - "autoResize" "0" + "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -510,23 +522,26 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "6" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" + "cvar_name" "mom_strafesync_draw" + "cvar_value" "1" } "SyncShowBar" { "ControlName" "CvarToggleCheckButton" "fieldName" "SyncShowBar" - "xpos" "8" - "ypos" "240" - "wide" "144" + "xpos" "9" + "ypos" "176" + "wide" "96" "tall" "16" - "autoResize" "0" + "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -538,23 +553,26 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "6" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" + "cvar_name" "mom_strafesync_drawbar" + "cvar_value" "1" } "ButtonsShow" { "ControlName" "CvarToggleCheckButton" "fieldName" "ButtonsShow" - "xpos" "8" - "ypos" "168" - "wide" "336" + "xpos" "9" + "ypos" "133" + "wide" "200" "tall" "16" - "autoResize" "0" + "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -566,51 +584,25 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "6" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" "Default" "0" - } - "ApplyButton" - { - "ControlName" "Button" - "fieldName" "ApplyButton" - "xpos" "234" - "ypos" "273" - "wide" "40" - "tall" "16" - "autoResize" "0" - "pinCorner" "0" - "RoundedCorners" "15" - "pin_corner_to_sibling" "0" - "pin_to_sibling_corner" "0" - "visible" "1" - "enabled" "0" - "tabPosition" "0" - "labelText" "#GameUI_Apply" - "textAlignment" "west" - "dulltext" "0" - "brighttext" "0" - "wrap" "0" - "centerwrap" "0" - "textinsetx" "6" - "textinsety" "0" - "auto_wide_tocontents" "0" - "use_proportional_insets" "0" - "command" "ApplyChanges" - "Default" "0" + "cvar_name" "mom_showkeypresses" + "cvar_value" "1" } "SyncLabel" { "ControlName" "Label" "fieldName" "SyncLabel" - "xpos" "4" - "ypos" "212" - "wide" "144" - "tall" "8" + "xpos" "2" + "ypos" "152" + "wide" "51" + "tall" "10" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -623,21 +615,22 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultSmall" "wrap" "0" "centerwrap" "0" "textinsetx" "0" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" } "SpeedoLabel" { "ControlName" "Label" "fieldName" "SpeedoLabel" - "xpos" "6" - "ypos" "25" - "wide" "80" - "tall" "16" + "xpos" "2" + "ypos" "17" + "wide" "57" + "tall" "12" "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" @@ -650,21 +643,22 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultSmall" "wrap" "0" "centerwrap" "0" "textinsetx" "0" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" } "KeysLabel" { "ControlName" "Label" "fieldName" "KeysLabel" - "xpos" "4" - "ypos" "155" - "wide" "40" - "tall" "8" + "xpos" "2" + "ypos" "120" + "wide" "53" + "tall" "13" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -677,21 +671,22 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultSmall" "wrap" "0" "centerwrap" "0" "textinsetx" "0" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" } "SpeedoUnitsLabel" { "ControlName" "Label" "fieldName" "SpeedoUnitsLabel" - "xpos" "12" - "ypos" "107" - "wide" "75" - "tall" "16" + "xpos" "4" + "ypos" "88" + "wide" "72" + "tall" "11" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -704,21 +699,22 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "0" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" } "SyncTypeLabel" { "ControlName" "Label" "fieldName" "SyncTypeLabel" - "xpos" "11" - "ypos" "256" - "wide" "65" - "tall" "11" + "xpos" "4" + "ypos" "194" + "wide" "48" + "tall" "12" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -731,22 +727,23 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "0" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" } "SyncColorTypeLabel" { "ControlName" "Label" "fieldName" "SyncColorTypeLabel" - "xpos" "10" - "ypos" "273" - "wide" "59" - "tall" "12" - "autoResize" "0" + "xpos" "4" + "ypos" "226" + "wide" "65" + "tall" "9" + "autoResize" "1" "pinCorner" "0" "RoundedCorners" "15" "pin_corner_to_sibling" "0" @@ -758,21 +755,52 @@ "textAlignment" "west" "dulltext" "0" "brighttext" "0" + "Font" "DefaultVerySmall" "wrap" "0" "centerwrap" "0" "textinsetx" "0" "textinsety" "0" - "auto_wide_tocontents" "0" + "auto_wide_tocontents" "1" "use_proportional_insets" "0" } + "ApplyButton" + { + "ControlName" "Button" + "fieldName" "ApplyButton" + "xpos" "224" + "ypos" "232" + "wide" "25" + "tall" "16" + "autoResize" "0" + "pinCorner" "0" + "RoundedCorners" "15" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "labelText" "#GameUI_Apply" + "textAlignment" "center" + "dulltext" "0" + "brighttext" "0" + "Font" "DefaultVerySmall" + "wrap" "0" + "centerwrap" "0" + "textinsetx" "6" + "textinsety" "0" + "auto_wide_tocontents" "1" + "use_proportional_insets" "0" + "command" "ApplyChanges" + "Default" "0" + } "BuildModeDialog" { "ControlName" "BuildModeDialog" "fieldName" "BuildModeDialog" - "xpos" "61" - "ypos" "100" - "wide" "210" - "tall" "289" + "xpos" "33" + "ypos" "19" + "wide" "160" + "tall" "224" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" diff --git a/mp/game/momentum/resource/ui/Spectator.res b/mp/game/momentum/resource/ui/Spectator.res index d431037ecc..db649c8c9f 100644 --- a/mp/game/momentum/resource/ui/Spectator.res +++ b/mp/game/momentum/resource/ui/Spectator.res @@ -43,7 +43,7 @@ { "ControlName" "Label" "fieldName" "playerlabel" - "xpos" "r86" + "xpos" "10" "ypos" "20" "wide" "81" "tall" "15" @@ -60,7 +60,7 @@ { "ControlName" "Label" "fieldName" "timelabel" - "xpos" "r86" + "xpos" "10" "ypos" "28" "wide" "81" "tall" "15" @@ -92,7 +92,7 @@ { "ControlName" "Label" "fieldName" "extrainfo" - "xpos" "r86" + "xpos" "10" "ypos" "12" "wide" "81" "tall" "15" @@ -105,6 +105,7 @@ "dulltext" "0" "brighttext" "0" } + //Not used? "titlelabel" { "ControlName" "Label" @@ -123,4 +124,20 @@ "dulltext" "0" "brighttext" "0" } + + "Close_Panel" + { + "ControlName" "ImagePanel" + "fieldName" "Close_Panel" + "xpos" "r36"//Give a 4 pixel padding + "ypos" "4" + "wide" "32" + "tall" "32" + "autoResize" "0" + "pinCorner" "0" + "visible" "1" + "enabled" "1" + "scaleImage" "1" + "image" "close_button" + } } diff --git a/mp/game/momentum/resource/ui/versionwarnpanel.res b/mp/game/momentum/resource/ui/versionwarnpanel.res index af09405341..bb16c534f8 100644 --- a/mp/game/momentum/resource/ui/versionwarnpanel.res +++ b/mp/game/momentum/resource/ui/versionwarnpanel.res @@ -4,11 +4,10 @@ { "ControlName" "CVersionWarnPanel" "fieldName" "VersionWarnPanel" - "xpos" "c-225" - "ypos" "c-50" - "wide" "450" - "tall" "100" - "alpha" "255" + "xpos" "c-250" + "ypos" "c-125" + "wide" "650" + "tall" "320" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -16,18 +15,18 @@ "pin_to_sibling_corner" "0" "visible" "1" "enabled" "1" - "tabPosition" "32" + "tabPosition" "0" "settitlebarvisible" "1" - "title" "New version available" + "title" "#MOM_NewVersionTitle" } "frame_topGrip" { "ControlName" "Panel" "fieldName" "frame_topGrip" - "xpos" "8" + "xpos" "4" "ypos" "0" - "wide" "496" - "tall" "5" + "wide" "255" + "tall" "2" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -41,10 +40,10 @@ { "ControlName" "Panel" "fieldName" "frame_bottomGrip" - "xpos" "8" - "ypos" "507" - "wide" "486" - "tall" "5" + "xpos" "4" + "ypos" "157" + "wide" "250" + "tall" "2" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -59,9 +58,9 @@ "ControlName" "Panel" "fieldName" "frame_leftGrip" "xpos" "0" - "ypos" "8" - "wide" "5" - "tall" "496" + "ypos" "4" + "wide" "2" + "tall" "151" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -75,10 +74,10 @@ { "ControlName" "Panel" "fieldName" "frame_rightGrip" - "xpos" "507" - "ypos" "8" - "wide" "5" - "tall" "486" + "xpos" "261" + "ypos" "4" + "wide" "2" + "tall" "146" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -94,8 +93,8 @@ "fieldName" "frame_tlGrip" "xpos" "0" "ypos" "0" - "wide" "8" - "tall" "8" + "wide" "4" + "tall" "4" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -109,10 +108,10 @@ { "ControlName" "Panel" "fieldName" "frame_trGrip" - "xpos" "504" + "xpos" "259" "ypos" "0" - "wide" "8" - "tall" "8" + "wide" "4" + "tall" "4" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -127,9 +126,9 @@ "ControlName" "Panel" "fieldName" "frame_blGrip" "xpos" "0" - "ypos" "504" - "wide" "8" - "tall" "8" + "ypos" "155" + "wide" "4" + "tall" "4" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -143,10 +142,10 @@ { "ControlName" "Panel" "fieldName" "frame_brGrip" - "xpos" "494" - "ypos" "494" - "wide" "18" - "tall" "18" + "xpos" "254" + "ypos" "150" + "wide" "9" + "tall" "9" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -160,10 +159,10 @@ { "ControlName" "Panel" "fieldName" "frame_caption" - "xpos" "3" - "ypos" "-16" - "wide" "502" - "tall" "23" + "xpos" "0" + "ypos" "0" + "wide" "258" + "tall" "12" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -179,8 +178,8 @@ "fieldName" "frame_minimize" "xpos" "0" "ypos" "0" - "wide" "18" - "tall" "18" + "wide" "0" + "tall" "0" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -207,8 +206,8 @@ "fieldName" "frame_maximize" "xpos" "0" "ypos" "0" - "wide" "18" - "tall" "18" + "wide" "0" + "tall" "0" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -235,8 +234,8 @@ "fieldName" "frame_mintosystray" "xpos" "0" "ypos" "0" - "wide" "18" - "tall" "18" + "wide" "0" + "tall" "0" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -262,10 +261,10 @@ { "ControlName" "Button" "fieldName" "frame_close" - "xpos" "487" + "xpos" "239" "ypos" "8" - "wide" "13" - "tall" "13" + "wide" "17" + "tall" "17" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -280,21 +279,21 @@ "brighttext" "0" "wrap" "0" "centerwrap" "0" - "textinsetx" "2" - "textinsety" "1" + "textinsetx" "4" + "textinsety" "2" "auto_wide_tocontents" "0" "use_proportional_insets" "0" + "command" "turnoff" "Default" "0" - "command" "turnoff" } "frame_menu" { "ControlName" "FrameSystemButton" "fieldName" "frame_menu" - "xpos" "7" - "ypos" "8" - "wide" "18" - "tall" "18" + "xpos" "3" + "ypos" "4" + "wide" "9" + "tall" "9" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -320,8 +319,8 @@ "fieldName" "CloseButton" "xpos" "0" "ypos" "0" - "wide" "18" - "tall" "18" + "wide" "0" + "tall" "0" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -333,8 +332,8 @@ "labelText" "#GameUI_Close" "textAlignment" "north-west" "dulltext" "0" - "Font" "Default" "brighttext" "0" + "Font" "Default" "wrap" "0" "centerwrap" "0" "textinsetx" "2" @@ -345,34 +344,88 @@ } "ReleaseText" { - "ControlName" "URLLabel" + "ControlName" "URLLabel" "fieldName" "ReleaseText" - "xpos" "25" - "ypos" "50" - "wide" "640" - "tall" "20" - "autoResize" "0" + "xpos" "380" + "ypos" "94" + "wide" "260" + "tall" "120" + "autoResize" "0" "pinCorner" "0" + "RoundedCorners" "15" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" "visible" "1" "enabled" "1" - "textAlignment" "west" + "tabPosition" "0" "labelText" "#MOM_NewVersion" + "textAlignment" "west" + "dulltext" "0" + "brighttext" "1" + "Font" "DefaultSmall" + "wrap" "1" + "centerwrap" "0" + "textinsetx" "0" + "textinsety" "0" + "auto_wide_tocontents" "0" + "use_proportional_insets" "0" + "URLText" "https://github.com/momentum-mod/game/releases" + } + "ChangeLog" + { + "ControlName" "RichText" + "fieldName" "ChangeLog" + "xpos" "12" + "ypos" "55" + "wide" "350" + "tall" "250" + "autoResize" "0" + "pinCorner" "0" + "RoundedCorners" "15" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "maxchars" "-1" + "scrollbar" "1" + } + "Changelog_Label" + { + "ControlName" "Label" + "fieldName" "Changelog_Label" + "xpos" "9" + "ypos" "36" + "wide" "150" + "tall" "20" + "autoResize" "0" + "pinCorner" "0" + "RoundedCorners" "15" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "labelText" "#MOM_ChangeLog" + "textAlignment" "west" "dulltext" "0" - "brighttext" "1" - "Font" "Default" - "wrap" "0" - "centerwrap" "0" - "textinsetx" "0" - "textinsety" "0" + "brighttext" "0" + "font" "DefaultVerySmall" + "wrap" "0" + "centerwrap" "0" + "textinsetx" "0" + "textinsety" "0" + "auto_wide_tocontents" "0" + "use_proportional_insets" "0" } "BuildModeDialog" { "ControlName" "BuildModeDialog" "fieldName" "BuildModeDialog" - "xpos" "327" - "ypos" "301" - "wide" "300" - "tall" "420" + "xpos" "0" + "ypos" "0" + "wide" "160" + "tall" "224" "autoResize" "0" "pinCorner" "0" "RoundedCorners" "15" @@ -384,4 +437,4 @@ "settitlebarvisible" "1" "title" "#Frame_Untitled" } -} \ No newline at end of file +} diff --git a/mp/game/momentum/scripts/HudLayout.res b/mp/game/momentum/scripts/HudLayout.res index 51b16fa086..f6b22935b4 100644 --- a/mp/game/momentum/scripts/HudLayout.res +++ b/mp/game/momentum/scripts/HudLayout.res @@ -79,9 +79,9 @@ //You can override "MenuItemColor" etc here (I think) } // Version warning - CHudVersionWarn + CHudVersionInfo { - "fieldName" "CHudVersionWarn" + "fieldName" "CHudVersionInfo" "xpos" "640" "ypos" "460" "visible" "1" diff --git a/mp/src/game/client/cdll_client_int.cpp b/mp/src/game/client/cdll_client_int.cpp index 77a7e9e762..5b8f10d962 100644 --- a/mp/src/game/client/cdll_client_int.cpp +++ b/mp/src/game/client/cdll_client_int.cpp @@ -170,10 +170,6 @@ extern vgui::IInputInternal *g_InputInternal; #include "sixense/in_sixense.h" #endif - -//Momentum -#include "mom_event_listener.h" - // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -1093,8 +1089,6 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi HookHapticMessages(); // Always hook the messages #endif - g_MOMEventListener->Init();//Hook into game events - return true; } diff --git a/mp/src/game/client/client_momentum.vpc b/mp/src/game/client/client_momentum.vpc index f79d1bd03c..1ee5eaf982 100644 --- a/mp/src/game/client/client_momentum.vpc +++ b/mp/src/game/client/client_momentum.vpc @@ -60,7 +60,7 @@ $Project "Client (Momentum)" } } } - } + } $File "momentum\ui\MomentumSettingsDialog.cpp" $File "momentum\ui\IMomentumSettingsPanel.h" @@ -75,13 +75,14 @@ $Project "Client (Momentum)" $File "momentum\ui\ClientTimesDisplay.cpp" $File "momentum\ui\IVersionWarnPanel.h" $File "momentum\ui\VersionWarnPanel.cpp" - $File "momentum\ui\hud_versionwarn.cpp" - $File "momentum\ui\hud_mapfinished.cpp" + $File "momentum\ui\VersionWarnPanel.h" + $File "momentum\ui\hud_versioninfo.cpp" + $File "momentum\ui\hud_mapfinished.cpp" $File "momentum\ui\hud_mapfinished.h" - $File "momentum\ui\hud_keypress.cpp" - $File "hl2\hud_credits.cpp" - $File "hl2\hud_weaponselection.cpp" - $File "hud_chat.cpp" + $File "momentum\ui\hud_keypress.cpp" + $File "hl2\hud_credits.cpp" + $File "hl2\hud_weaponselection.cpp" + $File "hud_chat.cpp" $File "momentum\ui\hud_comparisons.cpp" $File "momentum\ui\hud_comparisons.h" $File "momentum\ui\hud_mapinfo.cpp" diff --git a/mp/src/game/client/momentum/client_events.cpp b/mp/src/game/client/momentum/client_events.cpp index 924b7af8ea..a9fffb59e0 100644 --- a/mp/src/game/client/momentum/client_events.cpp +++ b/mp/src/game/client/momentum/client_events.cpp @@ -3,57 +3,66 @@ #endif #include "client_events.h" + #include "filesystem.h" #include "movevars_shared.h" +#include "util/mom_util.h" +#include "mom_event_listener.h" #include "tier0/memdbgon.h" extern IFileSystem *filesystem; -namespace Momentum { +void CMOMClientEvents::PostInit() +{ + g_MOMEventListener->Init();//Hook into game events + + // enable console by default + ConVarRef con_enable("con_enable"); + con_enable.SetValue(true); - void OnClientDLLInit() - { - // enable console by default - ConVarRef con_enable("con_enable"); - con_enable.SetValue(true); - // mount CSS content even if it's on a different drive than SDK + if (SteamAPI_IsSteamRunning()) + { + mom_UTIL->GetRemoteRepoModVersion(); + } + + // mount CSS content even if it's on a different drive than SDK #ifdef _WIN32 - HKEY hKey; - if (VCRHook_RegOpenKeyEx(HKEY_LOCAL_MACHINE, - "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 240", - 0, - KEY_READ, - &hKey) == ERROR_SUCCESS) - { - char installPath[MAX_PATH]; - DWORD len = sizeof(installPath); - if (VCRHook_RegQueryValueEx(hKey, - "InstallLocation", - NULL, - NULL, - (LPBYTE)installPath, - &len) == ERROR_SUCCESS) - { - char path[MAX_PATH]; - Q_strncpy(path, installPath, sizeof(path)); - - Q_strncat(path, "\\cstrike", sizeof(path)); - filesystem->AddSearchPath(path, "GAME"); - - Q_strncat(path, "\\download", sizeof(path)); - filesystem->AddSearchPath(path, "GAME"); - - Q_strncpy(path, installPath, sizeof(path)); - Q_strncat(path, "\\cstrike\\cstrike_pak.vpk", sizeof(path)); - filesystem->AddSearchPath(path, "GAME"); - - filesystem->PrintSearchPaths(); - } - - VCRHook_RegCloseKey(hKey); - } + HKEY hKey; + if (VCRHook_RegOpenKeyEx(HKEY_LOCAL_MACHINE, + "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 240", + 0, + KEY_READ, + &hKey) == ERROR_SUCCESS) + { + char installPath[MAX_PATH]; + DWORD len = sizeof(installPath); + if (VCRHook_RegQueryValueEx(hKey, + "InstallLocation", + NULL, + NULL, + (LPBYTE) installPath, + &len) == ERROR_SUCCESS) + { + char path[MAX_PATH]; + Q_strncpy(path, installPath, sizeof(path)); + + Q_strncat(path, "\\cstrike", sizeof(path)); + filesystem->AddSearchPath(path, "GAME"); + + Q_strncat(path, "\\download", sizeof(path)); + filesystem->AddSearchPath(path, "GAME"); + + Q_strncpy(path, installPath, sizeof(path)); + Q_strncat(path, "\\cstrike\\cstrike_pak.vpk", sizeof(path)); + filesystem->AddSearchPath(path, "GAME"); + + filesystem->PrintSearchPaths(); + } + + VCRHook_RegCloseKey(hKey); + } #endif - } +} -} // namespace Momentum +CMOMClientEvents g_MOMClientEvents("CMOMClientEvents"); \ No newline at end of file diff --git a/mp/src/game/client/momentum/client_events.h b/mp/src/game/client/momentum/client_events.h index 302cbc8bda..791d46c3ce 100644 --- a/mp/src/game/client/momentum/client_events.h +++ b/mp/src/game/client/momentum/client_events.h @@ -4,10 +4,18 @@ #pragma once #endif -namespace Momentum { +#include "cbase.h" - void OnClientDLLInit(); +class CMOMClientEvents : public CAutoGameSystem +{ +public: + CMOMClientEvents(const char *pName) : CAutoGameSystem(pName) + { + } -} // namespace Momentum + //After DLL inits successfully + void PostInit() override; -#endif // CLIENT_EVENTS_H +}; + +#endif // CLIENT_EVENTS_H \ No newline at end of file diff --git a/mp/src/game/client/momentum/clientmode_mom_normal.cpp b/mp/src/game/client/momentum/clientmode_mom_normal.cpp index a6fb99d37c..7584d994b2 100644 --- a/mp/src/game/client/momentum/clientmode_mom_normal.cpp +++ b/mp/src/game/client/momentum/clientmode_mom_normal.cpp @@ -12,6 +12,7 @@ #include "iinput.h" #include "momSpectatorGUI.h" #include "momentum/mom_shareddefs.h" +#include "momSpectatorGUI.h" #include "vgui_int.h" #include #include @@ -111,6 +112,7 @@ void ClientModeMOMNormal::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)); // Load up the combine control panel scheme g_hVGuiCombineScheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel(PANEL_CLIENTDLL), @@ -161,29 +163,33 @@ int ClientModeMOMNormal::HudElementKeyInput(int down, ButtonCode_t keynum, const int ClientModeMOMNormal::HandleSpectatorKeyInput(int down, ButtonCode_t keynum, const char *pszCurrentBinding) { - // MOM_TODO: re-enable this in beta when we add movie-style controls to the spectator menu! - /* - // we are in spectator mode, open spectator menu - if (down && pszCurrentBinding && Q_strcmp(pszCurrentBinding, "+duck") == 0) - { - m_pViewport->ShowPanel(PANEL_SPECMENU, true); - return 0; // we handled it, don't handle twice or send to server - } - */ - if (down && pszCurrentBinding && Q_strcmp(pszCurrentBinding, "+attack") == 0) - { - engine->ClientCmd("spec_next"); - return 0; - } - else if (down && pszCurrentBinding && Q_strcmp(pszCurrentBinding, "+attack2") == 0) + if (m_pSpectatorGUI) { - engine->ClientCmd("spec_prev"); - return 0; - } - else if (down && pszCurrentBinding && Q_strcmp(pszCurrentBinding, "+jump") == 0) - { - engine->ClientCmd("spec_mode"); - return 0; + // we are in spectator mode, open spectator menu + if (down && pszCurrentBinding && !Q_strcmp(pszCurrentBinding, "+duck")) + { + m_pSpectatorGUI->SetMouseInputEnabled(!m_pSpectatorGUI->IsMouseInputEnabled()); + // MOM_TODO: re-enable this in beta when we add movie-style controls to the spectator menu! + //m_pViewport->ShowPanel(PANEL_SPECMENU, true); + + return 0; // we handled it, don't handle twice or send to server + } + + if (down && pszCurrentBinding && !Q_strcmp(pszCurrentBinding, "+attack") && !m_pSpectatorGUI->IsMouseInputEnabled()) + { + engine->ClientCmd("spec_next"); + return 0; + } + else if (down && pszCurrentBinding && !Q_strcmp(pszCurrentBinding, "+attack2") && !m_pSpectatorGUI->IsMouseInputEnabled()) + { + engine->ClientCmd("spec_prev"); + return 0; + } + else if (down && pszCurrentBinding && !Q_strcmp(pszCurrentBinding, "+jump")) + { + engine->ClientCmd("spec_mode"); + return 0; + } } return 1; diff --git a/mp/src/game/client/momentum/clientmode_mom_normal.h b/mp/src/game/client/momentum/clientmode_mom_normal.h index c40995b66b..ca48a6e01f 100644 --- a/mp/src/game/client/momentum/clientmode_mom_normal.h +++ b/mp/src/game/client/momentum/clientmode_mom_normal.h @@ -16,6 +16,7 @@ #include "hud_menu_static.h" #include "hud_mapfinished.h" #include "ClientTimesDisplay.h" +#include "momSpectatorGUI.h" #include #include @@ -47,6 +48,7 @@ class ClientModeMOMNormal : public ClientModeShared CHudMenuStatic *m_pHudMenuStatic; CHudMapFinishedDialog *m_pHudMapFinished; CClientTimesDisplay *m_pLeaderboards; + CMOMSpectatorGUI *m_pSpectatorGUI; }; extern IClientMode *GetClientModeNormal(); diff --git a/mp/src/game/client/momentum/ui/IVersionWarnPanel.h b/mp/src/game/client/momentum/ui/IVersionWarnPanel.h index 1d8a0157af..3de4a470c9 100644 --- a/mp/src/game/client/momentum/ui/IVersionWarnPanel.h +++ b/mp/src/game/client/momentum/ui/IVersionWarnPanel.h @@ -5,10 +5,13 @@ class VersionWarnPanel { public: + virtual ~VersionWarnPanel() {} virtual void Create(vgui::VPANEL parent) = 0; virtual void Destroy(void) = 0; virtual void Activate(void) = 0; virtual void Close() = 0; + virtual void SetVersion(const char *pVersion) const = 0; + virtual void SetChangelog(char *pChangelog) const = 0; }; extern VersionWarnPanel *versionwarnpanel; \ No newline at end of file diff --git a/mp/src/game/client/momentum/ui/MomentumSettingsDialog.cpp b/mp/src/game/client/momentum/ui/MomentumSettingsDialog.cpp index 67ee6d898d..cf14a36a05 100644 --- a/mp/src/game/client/momentum/ui/MomentumSettingsDialog.cpp +++ b/mp/src/game/client/momentum/ui/MomentumSettingsDialog.cpp @@ -1,60 +1,60 @@ -//The following include files are necessary to allow your the panel .cpp to compile. #include "cbase.h" + #include "IMomentumSettingsPanel.h" -using namespace vgui; #include -#include #include +#include +#include #include #include -#include #include "momentum/mom_shareddefs.h" #include "tier0/memdbgon.h" +using namespace vgui; + class CMomentumSettingsPanel : public vgui::Frame { DECLARE_CLASS_SIMPLE(CMomentumSettingsPanel, vgui::Frame); - //CMomentumSettingsPanel : This Class / vgui::Frame : BaseClass + // CMomentumSettingsPanel : This Class / vgui::Frame : BaseClass - CMomentumSettingsPanel(vgui::VPANEL parent); // Constructor - ~CMomentumSettingsPanel() {}; // Destructor + CMomentumSettingsPanel(VPANEL parent); // Constructor + ~CMomentumSettingsPanel(){}; // Destructor void Activate() override; -protected: - //VGUI overrides: + protected: + // VGUI overrides: void OnTick() override; MESSAGE_FUNC_PTR(OnTextChanged, "TextChanged", panel); MESSAGE_FUNC_PTR(OnCheckboxChecked, "CheckButtonChecked", panel); - MESSAGE_FUNC(OnApplyChanges, "ApplyChanges") - { - m_pApplyButton->SetEnabled(false); - } + MESSAGE_FUNC(OnApplyChanges, "ApplyChanges") { m_pApplyButton->SetEnabled(false); } -private: + private: void LoadSettings(); - //Other used VGUI control Elements: + // Other used VGUI control Elements: ComboBox *m_pSpeedometerUnits, *m_pSyncType, *m_pSyncColorize; - CvarToggleCheckButton *m_pSpeedometerShow, *m_pSpeedometerShowLastJump, *m_pSpeedometerShowVerticalVel, *m_pSpeedometerColorize, - *m_pSyncShow, *m_pSyncShowBar, *m_pButtonsShow, - *m_pShowVersion; + CvarToggleCheckButton *m_pSpeedometerShow, *m_pSpeedometerShowLastJump, *m_pSpeedometerShowVerticalVel, + *m_pSpeedometerColorize, *m_pSyncShow, *m_pSyncShowBar, *m_pButtonsShow, *m_pShowVersion; Button *m_pApplyButton; - }; // Constuctor: Initializes the Panel -CMomentumSettingsPanel::CMomentumSettingsPanel(vgui::VPANEL parent) - : BaseClass(nullptr, "CMomentumSettingsPanel") +CMomentumSettingsPanel::CMomentumSettingsPanel(vgui::VPANEL parent) : BaseClass(nullptr, "CMomentumSettingsPanel") { SetParent(parent); + + SetProportional(true); + LoadControlSettings("resource/ui/MomentumSettingsPanel.res"); + SetPaintBackgroundType(1); SetRoundedCorners(PANEL_ROUND_CORNER_ALL); SetKeyBoardInputEnabled(true); SetMouseInputEnabled(true); - SetProportional(true); + SetMinimumSize(500, 500); + SetTitleBarVisible(true); SetMinimizeButtonVisible(false); SetMaximizeButtonVisible(false); @@ -62,47 +62,51 @@ CMomentumSettingsPanel::CMomentumSettingsPanel(vgui::VPANEL parent) SetSizeable(false); SetMoveable(true); SetVisible(false); - - m_pSpeedometerUnits = new ComboBox(this, "SpeedoUnits", 3, false); + + m_pSpeedometerUnits = FindControl("SpeedoUnits"); + m_pSpeedometerUnits->SetNumberOfEditLines(3); m_pSpeedometerUnits->AddItem("#MOM_Settings_Speedometer_Units_UPS", nullptr); m_pSpeedometerUnits->AddItem("#MOM_Settings_Speedometer_Units_KPH", nullptr); m_pSpeedometerUnits->AddItem("#MOM_Settings_Speedometer_Units_MPH", nullptr); m_pSpeedometerUnits->AddActionSignalTarget(this); - m_pSyncType = new ComboBox(this, "SyncType", 2, false); + m_pSyncType = FindControl("SyncType"); + m_pSyncType->SetNumberOfEditLines(2); m_pSyncType->AddItem("#MOM_Settings_Sync_Type_Sync1", nullptr); m_pSyncType->AddItem("#MOM_Settings_Sync_Type_Sync2", nullptr); m_pSyncType->AddActionSignalTarget(this); - m_pSyncColorize = new ComboBox(this, "SyncColorize", 3, false); + m_pSyncColorize = FindControl("SyncColorize"); + m_pSyncColorize->SetNumberOfEditLines(3); m_pSyncColorize->AddItem("#MOM_Settings_Sync_Color_Type_None", nullptr); m_pSyncColorize->AddItem("#MOM_Settings_Sync_Color_Type_1", nullptr); m_pSyncColorize->AddItem("#MOM_Settings_Sync_Color_Type_2", nullptr); m_pSyncColorize->AddActionSignalTarget(this); - m_pSpeedometerShow = new CvarToggleCheckButton(this, "SpeedoShow", "#MOM_Settings_Speedometer_Show", "mom_speedometer", false); + m_pSpeedometerShow = FindControl>("SpeedoShow"); m_pSpeedometerShow->AddActionSignalTarget(this); - m_pSpeedometerShowLastJump = new CvarToggleCheckButton(this, "SpeedoShowJump", "#MOM_Settings_Speedometer_Show_Jump", - "mom_speedometer_showlastjumpvel", false); + + m_pSpeedometerShowLastJump = FindControl>("SpeedoShowJump"); m_pSpeedometerShowLastJump->AddActionSignalTarget(this); - m_pSpeedometerShowVerticalVel = new CvarToggleCheckButton(this, "ShowSpeedoHvel", "#MOM_Settings_Speedometer_Show_Hvel", - "mom_speedometer_hvel", false); + + m_pSpeedometerShowVerticalVel = FindControl>("ShowSpeedoHvel"); m_pSpeedometerShowVerticalVel->AddActionSignalTarget(this); - m_pSpeedometerColorize = new CvarToggleCheckButton(this, "SpeedoShowColor", "#MOM_Settings_Speedometer_Show_Color", - "mom_speedometer_colorize", false); + + m_pSpeedometerColorize = FindControl>("SpeedoShowColor"); m_pSpeedometerColorize->AddActionSignalTarget(this); - m_pSyncShow = new CvarToggleCheckButton(this, "SyncShow", "#MOM_Settings_Sync_Show", "mom_strafesync_draw", false); + m_pSyncShow = FindControl>("SyncShow"); m_pSyncShow->AddActionSignalTarget(this); - m_pSyncShowBar = new CvarToggleCheckButton(this, "SyncShowBar", "#MOM_Settings_Sync_Show_Bar", "mom_strafesync_drawbar", false); + + m_pSyncShowBar = FindControl>("SyncShowBar"); m_pSyncShowBar->AddActionSignalTarget(this); - m_pButtonsShow = new CvarToggleCheckButton(this, "ButtonsShow", "#MOM_Settings_Buttons_Show", "mom_showkeypresses", false); + m_pButtonsShow = FindControl>("ButtonsShow"); m_pButtonsShow->AddActionSignalTarget(this); - //MOM_TODO: have one for hud_versionwarn? + // MOM_TODO: have one for hud_versionwarn? - m_pApplyButton = new Button(this, "ApplyButton", "#GameUI_Apply", this); - m_pApplyButton->SetCommand("ApplyChanges"); + m_pApplyButton = FindControl