Small fix

This commit is contained in:
fed 2022-11-10 20:45:19 +01:00
parent 664264259a
commit 4542b97a96
3 changed files with 34 additions and 39 deletions

View File

@ -1,22 +1,22 @@
require("language")
if (game:issingleplayer()) then if (game:issingleplayer()) then
return return
end end
if (Engine.InFrontend()) then if (Engine.InFrontend()) then
require("shader_dialog") require("shader_dialog")
require("gamemodes") require("gamemodes")
require("no_mode_switch") require("no_mode_switch")
require("disable_useless_things") require("disable_useless_things")
else
require("scoreboard")
end end
-- defined in mp_hud/hudutils.lua -- defined in mp_hud/hudutils.lua
function GetGameModeName() function GetGameModeName()
return Engine.Localize(Engine.TableLookup(GameTypesTable.File, GameTypesTable.Cols.Ref, GameX.GetGameMode(), return Engine.Localize(Engine.TableLookup(GameTypesTable.File,
GameTypesTable.Cols.Name)) GameTypesTable.Cols.Ref, GameX.GetGameMode(), GameTypesTable.Cols.Name))
end end
function NeverAllowChangeTeams() function NeverAllowChangeTeams()
return false return false
end end

View File

@ -9,32 +9,3 @@ Cac.GameModes.Data = {
} }
} }
} }
if (Engine.InFrontend()) then
return
end
local gametypes = {
["dm"] = true,
["dom"] = true,
["sd"] = true,
["war"] = true,
["conf"] = true,
["vlobby"] = true,
["koth"] = true,
["sab"] = true,
["ctf"] = true,
["dd"] = true,
["hp"] = true,
["gun"] = true,
}
local func = LUI.mp_hud.Scoreboard.DetermineIfSingleTeamGameType
LUI.mp_hud.Scoreboard.DetermineIfSingleTeamGameType = function()
local gametype = Engine.GetDvarString("ui_gametype")
if (gametypes[gametype]) then
return func()
end
return Game.GetPlayerTeam() == Teams.free
end

View File

@ -0,0 +1,24 @@
local gametypes = {
["dm"] = true,
["dom"] = true,
["sd"] = true,
["war"] = true,
["conf"] = true,
["vlobby"] = true,
["koth"] = true,
["sab"] = true,
["ctf"] = true,
["dd"] = true,
["hp"] = true,
["gun"] = true,
}
local func = LUI.mp_hud.Scoreboard.DetermineIfSingleTeamGameType
LUI.mp_hud.Scoreboard.DetermineIfSingleTeamGameType = function()
local gametype = Engine.GetDvarString("ui_gametype")
if (gametypes[gametype]) then
return func()
end
return Game.GetPlayerTeam() == Teams.free
end