diff --git a/Data/Scripts/Miscellaneous/GameManager/GUIManager.lua b/Data/Scripts/Miscellaneous/GameManager/GUIManager.lua index fd63db8..b05f2ac 100644 --- a/Data/Scripts/Miscellaneous/GameManager/GUIManager.lua +++ b/Data/Scripts/Miscellaneous/GameManager/GUIManager.lua @@ -91,7 +91,7 @@ function GUIManager:DisplayTeamCredits(team, credits, income) positiveText = "" 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 color = team.Faction.Color diff --git a/Data/Scripts/Miscellaneous/GameManager/SkirmishGameClass.lua b/Data/Scripts/Miscellaneous/GameManager/SkirmishGameClass.lua index d2798df..b025432 100644 --- a/Data/Scripts/Miscellaneous/GameManager/SkirmishGameClass.lua +++ b/Data/Scripts/Miscellaneous/GameManager/SkirmishGameClass.lua @@ -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 [%s]: BUILT %s ($%d)", timeText, team.Number, owner.Name, unit.DisplayName, + local text = string.format("%s [%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] + -- 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 - return - end + -- local owner = self.Players[unit.OwnerId] - local killer = self.Players[unit.KillerId] - local timeText = FormatTime(unit.DeathTime) + -- if not owner then + -- return + -- end - if not killer then - local team = self.Teams[owner.TeamId] + -- local killer = self.Players[unit.KillerId] + -- local timeText = FormatTime(unit.DeathTime) - if not team then - return - end + -- if not killer then + -- local team = self.Teams[owner.TeamId] - local text = string.format("%s\t [%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 team then + -- return + -- end - self.CombatFeed:Append(text, -1, color) - else - local team = self.Teams[killer.TeamId] + -- local text = string.format("%s\t [%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 team then - return - end + -- self.CombatFeed:Append(text, -1, color) + -- else + -- local team = self.Teams[killer.TeamId] - local text = string.format("%s\t [%s]: KILLED %s (%s)", timeText, team.Number, killer.Name, unit - .DisplayName, - owner.Name) - local faction = Factions[killer.Faction] - ---@type ColorStruct - local color = nil + -- if not team then + -- return + -- end - if faction then - color = faction.Color - else - color = ColorStruct:New(1, 1, 1, 1) - end + -- local text = string.format("%s\t [%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) - end + -- if faction then + -- color = faction.Color + -- else + -- color = ColorStruct:New(1, 1, 1, 1) + -- end + + -- self.CombatFeed:Append(text, -1, color) + -- end end -- ================================================== diff --git a/Data/Scripts/Miscellaneous/GameManager/TacticalGameClass.lua b/Data/Scripts/Miscellaneous/GameManager/TacticalGameClass.lua index d4d151e..83c5cb4 100644 --- a/Data/Scripts/Miscellaneous/GameManager/TacticalGameClass.lua +++ b/Data/Scripts/Miscellaneous/GameManager/TacticalGameClass.lua @@ -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)