diff --git a/data/cdata/ui_scripts/patches/scoreboard.lua b/data/cdata/ui_scripts/patches/scoreboard.lua index 1913ca4a..c3cfbcb2 100644 --- a/data/cdata/ui_scripts/patches/scoreboard.lua +++ b/data/cdata/ui_scripts/patches/scoreboard.lua @@ -22,3 +22,14 @@ LUI.mp_hud.Scoreboard.DetermineIfSingleTeamGameType = function() return Game.GetPlayerTeam() == Teams.free end + +local updateicon = LUI.FactionIcon.Update +LUI.FactionIcon.Update = function(element, icon, a3) + local scale = LUI.FactionIcon.BackgroundScale + if (game:isdefaultmaterial(icon .. "_soft")) then + LUI.FactionIcon.BackgroundScale = 0 + end + + updateicon(element, icon, a3) + LUI.FactionIcon.BackgroundScale = scale +end diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index bdbdbe5a..2089a5ac 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -330,6 +330,12 @@ namespace ui_scripting return steam::SteamApps()->GetCurrentGameLanguage(); }; + game_type["isdefaultmaterial"] = [](const game&, const std::string& material) + { + return static_cast(::game::DB_IsXAssetDefault(::game::ASSET_TYPE_MATERIAL, + material.data())); + }; + auto server_list_table = table(); lua["serverlist"] = server_list_table;