Skip to content

Commit

Permalink
disable branding by default
Browse files Browse the repository at this point in the history
add branding dvar and disable it by default
  • Loading branch information
bradstv committed Oct 3, 2023
1 parent b91954d commit 4f59aad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 5 additions & 6 deletions data/ui_scripts/main_menu/__init__.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ package.loaded["LUI.mp_menus.MPXboxLiveMenu"].XboxLiveOptionsFeeder = function(
local f29_local3 = {}
local f29_local4 = nil
if f29_local0 then
f29_local4 = Engine.Localize( "@LUA_MENU_STORE_CAPS" ) -- Orginally @LUA_MENU_PUBLIC_MATCH_CAPS but we need to use @LUA_MENU_STORE_CAPS
f29_local4 = Engine.Localize( "@LUA_MENU_STORE_CAPS" )
elseif f29_local1 then
f29_local4 = Engine.Localize( "@PLATFORM_FIND_GAME_CAPS" )
else
f29_local4 = Engine.Localize( "@LUA_MENU_STORE_CAPS" ) -- Orginally @PLATFORM_FIND_GAME_CAPS but we need to use @LUA_MENU_STORE_CAPS
f29_local4 = Engine.Localize( "@LUA_MENU_STORE_CAPS" )
end
f29_local3[#f29_local3 + 1] = {
type = "UIGenericButton",
Expand All @@ -205,7 +205,7 @@ package.loaded["LUI.mp_menus.MPXboxLiveMenu"].XboxLiveOptionsFeeder = function(
properties = {
button_text = f29_local4,
button_action_func = FindMatchAction,
desc_text = SvS.IsSvS() and Engine.Localize( "@LUA_MENU_SQUADS_FIND_MATCH_DESC" ) or Engine.Localize( "@LUA_MENU_STORE_DESC" ), -- Orginally @PLATFORM_DESC_FIND_GAME but we need to use @LUA_MENU_STORE_DESC
desc_text = SvS.IsSvS() and Engine.Localize( "@LUA_MENU_SQUADS_FIND_MATCH_DESC" ) or Engine.Localize( "@LUA_MENU_STORE_DESC" ),
disabledFunc = LUI.mp_menus.MPXboxLiveMenu.disableCreateGameButtons,
additional_handlers = {
check_buttons = LUI.mp_menus.MPLivePrivateLobby.RefreshButtonDisable
Expand Down Expand Up @@ -479,17 +479,16 @@ function FindMatchAfterThrottleEvent( f4_arg0, f4_arg1 )
end
LUI.FlowManager.RequestAddMenu( f4_arg0, "menu_xboxlive_lobby", false, f4_arg1.controller, false )
else
LUI.FlowManager.RequestPopupMenu( f4_arg0, "menu_systemlink_join" ) -- open server list instead of playlist_main
LUI.FlowManager.RequestPopupMenu( f4_arg0, "menu_systemlink_join" )
end
end
end
end

function BarracksAction( f9_arg0, f9_arg1 )
LUI.FlowManager.RequestAddMenu( f9_arg0, "menu_stats", true, f9_arg1.controller ) -- custom stats menu
LUI.FlowManager.RequestAddMenu( f9_arg0, "menu_stats", true, f9_arg1.controller )
end

-- Remove social button
LUI.MenuBuilder.m_definitions["online_friends_widget"] = function()
return {
type = "UIElement"
Expand Down
6 changes: 6 additions & 0 deletions src/client/component/branding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace branding
namespace
{
utils::hook::detour ui_get_formatted_build_number_hook;
game::dvar_t* ui_showBranding;

void dvar_set_string_stub(game::dvar_t* dvar, const char* string)
{
Expand Down Expand Up @@ -72,8 +73,13 @@ namespace branding
ui_get_formatted_build_number_hook.create(
SELECT_VALUE(0x140415FD0, 0x1404D7C00), ui_get_formatted_build_number_stub);

ui_showBranding = game::Dvar_RegisterBool("ui_showBranding", false,
game::DVAR_FLAG_NONE, "Show IW6x branding at the top left");

scheduler::loop([]()
{
if (!ui_showBranding->current.enabled) return;

const auto x = 3;
const auto y = 0;
const auto scale = 0.5f;
Expand Down

0 comments on commit 4f59aad

Please sign in to comment.