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

View File

@@ -104,6 +104,11 @@ function TacticalGameClass:CombatTextUnitBuilt(unit)
return
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 text = string.format("%s\t[%s]: BUILT %s ($%d)", timeText, owner.Name, unit.Name, unit.BuildCost)
local faction = Factions[owner.Faction]
@@ -155,6 +160,11 @@ function TacticalGameClass:CombatTextUnitKilled(unit)
return
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 timeText = FormatTime(unit.DeathTime)