Remove Killed unit display for tournament

This commit is contained in:
2026-03-15 12:35:35 -05:00
parent 5d3867c3fd
commit 770a42b841
3 changed files with 58 additions and 35 deletions

View File

@@ -91,7 +91,7 @@ function GUIManager:DisplayTeamCredits(team, credits, income)
positiveText = "" positiveText = ""
end end
local text = string.format("Team %d: $%d (%s%d)", team.Number, credits, positiveText, income) local text = string.format("Team %d: $ %d (%s%d)", team.Number, credits, positiveText, income)
local icon = team.Faction.Icon local icon = team.Faction.Icon
local color = team.Faction.Color local color = team.Faction.Color

View File

@@ -47,6 +47,11 @@ end
---Displays unit built combat text. ---Displays unit built combat text.
---@param unit UnitClass The built unit. ---@param unit UnitClass The built unit.
function SkirmishGameClass:CombatTextUnitBuilt(unit) function SkirmishGameClass:CombatTextUnitBuilt(unit)
if not self.IsLocalSpectator then
-- No Text feed for combatants
return
end
local owner = self.Players[unit.OwnerId] local owner = self.Players[unit.OwnerId]
if not owner then if not owner then
@@ -60,7 +65,7 @@ function SkirmishGameClass:CombatTextUnitBuilt(unit)
end end
local timeText = FormatTime(unit.BuildTime) local timeText = FormatTime(unit.BuildTime)
local text = string.format("%s\t<T%d> [%s]: BUILT %s ($%d)", timeText, team.Number, owner.Name, unit.DisplayName, local text = string.format("%s <T%d> [%s]: BUILT %s ($ %d)", timeText, team.Number, owner.Faction, unit.DisplayName,
unit.BuildCost) unit.BuildCost)
local faction = Factions[owner.Faction] local faction = Factions[owner.Faction]
---@type ColorStruct ---@type ColorStruct
@@ -79,49 +84,57 @@ end
---Displays killed unit combat text. ---Displays killed unit combat text.
---@param unit UnitClass The killed unit. ---@param unit UnitClass The killed unit.
function SkirmishGameClass:CombatTextUnitKilled(unit) function SkirmishGameClass:CombatTextUnitKilled(unit)
local owner = self.Players[unit.OwnerId] -- Right now, we don't really care about seeing killed units in the combat feed
-- If we want it in the future, uncomment the lines below.
return
-- if not self.IsLocalSpectator then
-- -- No Text feed for combatants
-- return
-- end
if not owner then -- local owner = self.Players[unit.OwnerId]
return
end
local killer = self.Players[unit.KillerId] -- if not owner then
local timeText = FormatTime(unit.DeathTime) -- return
-- end
if not killer then -- local killer = self.Players[unit.KillerId]
local team = self.Teams[owner.TeamId] -- local timeText = FormatTime(unit.DeathTime)
if not team then -- if not killer then
return -- local team = self.Teams[owner.TeamId]
end
local text = string.format("%s\t<T%d> [%s]: MISTAKES WERE MADE %s", timeText, team.Number, owner.Name, -- if not team then
unit.DisplayName) -- return
local color = ColorStruct:New(0.8, 0.8, 0.8, 1) -- end
self.CombatFeed:Append(text, -1, color) -- local text = string.format("%s\t<T%d> [%s]: MISTAKES WERE MADE %s", timeText, team.Number, owner.Name,
else -- unit.DisplayName)
local team = self.Teams[killer.TeamId] -- local color = ColorStruct:New(0.8, 0.8, 0.8, 1)
if not team then -- self.CombatFeed:Append(text, -1, color)
return -- else
end -- local team = self.Teams[killer.TeamId]
local text = string.format("%s\t<T%d> [%s]: KILLED %s (%s)", timeText, team.Number, killer.Name, unit -- if not team then
.DisplayName, -- return
owner.Name) -- end
local faction = Factions[killer.Faction]
---@type ColorStruct
local color = nil
if faction then -- local text = string.format("%s\t<T%d> [%s]: KILLED %s (%s)", timeText, team.Number, killer.Name, unit
color = faction.Color -- .DisplayName,
else -- owner.Name)
color = ColorStruct:New(1, 1, 1, 1) -- local faction = Factions[killer.Faction]
end -- ---@type ColorStruct
-- local color = nil
self.CombatFeed:Append(text, -1, color) -- if faction then
end -- color = faction.Color
-- else
-- color = ColorStruct:New(1, 1, 1, 1)
-- end
-- self.CombatFeed:Append(text, -1, color)
-- end
end end
-- ================================================== -- ==================================================

View File

@@ -104,6 +104,11 @@ function TacticalGameClass:CombatTextUnitBuilt(unit)
return return
end end
if not StringCompare(LocalPlayer.Get_Faction_Name(), owner.Faction) then
-- Do not display combat feed for players on opposite factions
return
end
local timeText = FormatTime(unit.BuildTime) local timeText = FormatTime(unit.BuildTime)
local text = string.format("%s\t[%s]: BUILT %s ($%d)", timeText, owner.Name, unit.Name, unit.BuildCost) local text = string.format("%s\t[%s]: BUILT %s ($%d)", timeText, owner.Name, unit.Name, unit.BuildCost)
local faction = Factions[owner.Faction] local faction = Factions[owner.Faction]
@@ -155,6 +160,11 @@ function TacticalGameClass:CombatTextUnitKilled(unit)
return return
end end
if not StringCompare(LocalPlayer.Get_Faction_Name(), owner.Faction) then
-- Do not display combat feed for players on opposite factions
return
end
local killer = self.Players[unit.KillerId] local killer = self.Players[unit.KillerId]
local timeText = FormatTime(unit.DeathTime) local timeText = FormatTime(unit.DeathTime)