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

@@ -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.
if not owner then
return return
end -- if not self.IsLocalSpectator then
-- -- No Text feed for combatants
-- return
-- end
local killer = self.Players[unit.KillerId] -- local owner = self.Players[unit.OwnerId]
local timeText = FormatTime(unit.DeathTime)
if not killer then -- if not owner then
local team = self.Teams[owner.TeamId] -- return
-- end
if not team then -- local killer = self.Players[unit.KillerId]
return -- local timeText = FormatTime(unit.DeathTime)
end
local text = string.format("%s\t<T%d> [%s]: MISTAKES WERE MADE %s", timeText, team.Number, owner.Name, -- if not killer then
unit.DisplayName) -- local team = self.Teams[owner.TeamId]
local color = ColorStruct:New(0.8, 0.8, 0.8, 1)
self.CombatFeed:Append(text, -1, color) -- if not team then
else -- return
local team = self.Teams[killer.TeamId] -- end
if not team then -- local text = string.format("%s\t<T%d> [%s]: MISTAKES WERE MADE %s", timeText, team.Number, owner.Name,
return -- unit.DisplayName)
end -- local color = ColorStruct:New(0.8, 0.8, 0.8, 1)
local text = string.format("%s\t<T%d> [%s]: KILLED %s (%s)", timeText, team.Number, killer.Name, unit -- self.CombatFeed:Append(text, -1, color)
.DisplayName, -- else
owner.Name) -- local team = self.Teams[killer.TeamId]
local faction = Factions[killer.Faction]
---@type ColorStruct
local color = nil
if faction then -- if not team then
color = faction.Color -- return
else -- end
color = ColorStruct:New(1, 1, 1, 1)
end
self.CombatFeed:Append(text, -1, color) -- local text = string.format("%s\t<T%d> [%s]: KILLED %s (%s)", timeText, team.Number, killer.Name, unit
end -- .DisplayName,
-- owner.Name)
-- local faction = Factions[killer.Faction]
-- ---@type ColorStruct
-- local color = nil
-- if faction then
-- 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)