Skip to content

Commit

Permalink
Added main menu branding with toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex109 committed Mar 30, 2024
1 parent 8ef54f1 commit d7f2943
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions cod4qol/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void commands::InitializeCommands()
game::Cmd_AddCommand("updatecod4qol", updater::Update);

qol_version = game::Cvar_RegisterString("qol_version", COD4QOL_VERSION, game::dvar_flags::read_only, "CoD4QOL version.");
qol_show_mainmenuinfo = game::Cvar_RegisterBool("qol_show_mainmenuinfo", 1, game::dvar_flags::saved, "Show the CoD4QOL version and social media links in the main menu.");

cg_fovscale = game::Find("cg_fovscale");
cg_fovscale->flags = game::none;
Expand Down
1 change: 1 addition & 0 deletions cod4qol/commands.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace commands
inline game::dvar_s* qol_disable_steam_auth;
inline game::dvar_s* qol_ambient;
inline game::dvar_s* qol_stockmenu;
inline game::dvar_s* qol_show_mainmenuinfo;

void InitializeCommands();

Expand Down
Binary file modified mod/cod4qol/mod.ff
Binary file not shown.
1 change: 1 addition & 0 deletions mod/cod4qol/ui/options_sound_pc.menu
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ itemDef { \
CHOICE_DVARFLOATLIST_VIS( 25, "Play ambient music", qol_ambient, { "@MENU_OFF" 0 "@MENU_ON" 1 }, ;, when( localVarInt ( ui_qol ) == 2 );)
CHOICE_DVARFLOATLIST_VIS( 26, "Raw input", raw_input, { "@MENU_OFF" 0 "@MENU_ON" 1 }, ;, when( localVarInt ( ui_qol ) == 2 );)
CHOICE_DVARFLOATLIST_VIS( 27, "Always load stock menu", qol_stockmenu, { "@MENU_OFF" 0 "@MENU_ON" 1 }, ;, when( localVarInt ( ui_qol ) == 2 );)
CHOICE_DVARFLOATLIST_VIS( 28, "Display main menu branding", qol_show_mainmenuinfo, { "@MENU_OFF" 0 "@MENU_ON" 1 }, ;, when( localVarInt ( ui_qol ) == 2 );)

itemDef
{
Expand Down
10 changes: 5 additions & 5 deletions mod/cod4qol/ui_mp/main.menu
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ itemDef { \

#define CLEARUIHINT exec "set ui_hint_text @MP_NULL"

PREPROC_TEXT_DRAW_ALIGNED_EXTR( 0 0 0 0 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, 0 0, "CoD4QOL " + dvarString( qol_version ), TEXTSIZE_SMALL, -5, 20, ITEM_ALIGN_RIGHT, 0.69 0.69 0.69 0.4, when( !localvarBool( ui_hideBack ) ))
PREPROC_SHADER_DRAW_ALIGNED_EXTR( 0 17 15 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "discord_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 0", when( !localvarBool( ui_hideBack ) ) )
PREPROC_SHADER_DRAW_ALIGNED_EXTR( -20 17 15 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "youtube_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 1", when( !localvarBool( ui_hideBack ) ) )
PREPROC_SHADER_DRAW_ALIGNED_EXTR( -40 17 15 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "github_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 2", when( !localvarBool( ui_hideBack ) ) )
PREPROC_SHADER_DRAW_ALIGNED_EXTR( -81 0 96 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "kofi_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 3", when( !localvarBool( ui_hideBack ) ) )
PREPROC_TEXT_DRAW_ALIGNED_EXTR( 0 0 0 0 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, 0 0, "CoD4QOL " + dvarString( qol_version ), TEXTSIZE_SMALL, -5, 20, ITEM_ALIGN_RIGHT, 0.69 0.69 0.69 0.4, when( !localvarBool( ui_hideBack ) && dvarbool( qol_show_mainmenuinfo ) ))
PREPROC_SHADER_DRAW_ALIGNED_EXTR( 0 17 15 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "discord_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 0", when( !localvarBool( ui_hideBack ) && dvarbool( qol_show_mainmenuinfo ) ) )
PREPROC_SHADER_DRAW_ALIGNED_EXTR( -20 17 15 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "youtube_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 1", when( !localvarBool( ui_hideBack ) && dvarbool( qol_show_mainmenuinfo ) ) )
PREPROC_SHADER_DRAW_ALIGNED_EXTR( -40 17 15 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "github_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 2", when( !localvarBool( ui_hideBack ) && dvarbool( qol_show_mainmenuinfo ) ) )
PREPROC_SHADER_DRAW_ALIGNED_EXTR( -81 0 96 15 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP, -20 20, "kofi_icon", 1 1 1 0.2, 0, 0, 0 0 0 0, exec "openlink 3", when( !localvarBool( ui_hideBack ) && dvarbool( qol_show_mainmenuinfo ) ) )

CHOICE_BUTTON_VIS( 1, "@MENU_AUTO_UPDATE", open auconfirm;, when( dvarbool( cl_updateAvailable ) && !localvarBool( ui_hideBack ) ) )
//CHOICE_BUTTON_VIS( 2, "@MENU_JOIN_GAME", open join_game_popup;, when( !localvarBool( ui_hideBack ) ) )
Expand Down

0 comments on commit d7f2943

Please sign in to comment.