diff --git a/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs b/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs index b4251dd5e0..64a97148ff 100644 --- a/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs @@ -17,13 +17,14 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets { + public enum WorldTooltipType { None, Unexplored, Actor } + public class CncWorldInteractionControllerWidget : WorldInteractionControllerWidget { public readonly string TooltipTemplate = "WORLD_TOOLTIP"; public readonly string TooltipContainer; Lazy tooltipContainer; - public enum WorldTooltipType { None, Unexplored, Actor } public WorldTooltipType TooltipType { get; private set; } public IToolTip ActorTooltip { get; private set; } diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ButtonTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ButtonTooltipLogic.cs index f9aa825b24..53fb660ddc 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/ButtonTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/ButtonTooltipLogic.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Support; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs index 9d104792da..1b319152e1 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Drawing; using System.Linq; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncDirectConnectLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncDirectConnectLogic.cs index 3f34dfbf60..f46afed61d 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncDirectConnectLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncDirectConnectLogic.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Linq; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs index a7d1c50b5f..eccc0c6e76 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs @@ -10,11 +10,9 @@ using System; using System.Drawing; -using System.Linq; +using OpenRA.Mods.RA.Orders; using OpenRA.Traits; using OpenRA.Widgets; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Orders; namespace OpenRA.Mods.Cnc.Widgets.Logic { diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs index 16e0b37f40..600033f512 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs @@ -13,11 +13,11 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.FileFormats; +using OpenRA.Mods.RA; +using OpenRA.Mods.RA.Widgets.Logic; using OpenRA.Network; using OpenRA.Traits; using OpenRA.Widgets; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Widgets.Logic; namespace OpenRA.Mods.Cnc.Widgets.Logic { diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncMenuLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncMenuLogic.cs index 22851ec338..cb2cf4ed53 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncMenuLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncMenuLogic.cs @@ -8,9 +8,7 @@ */ #endregion -using System.Linq; using System.Net; -using OpenRA.FileFormats; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncModBrowserLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncModBrowserLogic.cs index f013b1ea88..5e3273ca2d 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncModBrowserLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncModBrowserLogic.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncServerCreationLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncServerCreationLogic.cs index dd6befebbf..3fa7738105 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncServerCreationLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncServerCreationLogic.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Linq; using System.Net; using OpenRA.GameRules; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs index 52b44efe43..cc7884efed 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs @@ -11,11 +11,10 @@ using System; using System.Drawing; using System.Linq; -using OpenRA.Support; -using OpenRA.Traits; -using OpenRA.Widgets; using OpenRA.Mods.RA; using OpenRA.Mods.RA.Buildings; +using OpenRA.Traits; +using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic { diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/SimpleTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/SimpleTooltipLogic.cs index e67c73726c..d3b4b18f18 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/SimpleTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/SimpleTooltipLogic.cs @@ -9,7 +9,6 @@ #endregion using System; -using OpenRA.Support; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/SupportPowerTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/SupportPowerTooltipLogic.cs index 7ed763bb5d..b7bb75d3ee 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/SupportPowerTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/SupportPowerTooltipLogic.cs @@ -10,7 +10,6 @@ using System; using OpenRA.Mods.RA; -using OpenRA.Support; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/WorldTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/WorldTooltipLogic.cs index 4c8d790e85..f4a55feded 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/WorldTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/WorldTooltipLogic.cs @@ -10,9 +10,7 @@ using System; using System.Drawing; -using OpenRA.Support; using OpenRA.Widgets; -using TooltipType = OpenRA.Mods.Cnc.Widgets.CncWorldInteractionControllerWidget.WorldTooltipType; namespace OpenRA.Mods.Cnc.Widgets.Logic { @@ -21,7 +19,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic [ObjectCreator.UseCtor] public WorldTooltipLogic(Widget widget, TooltipContainerWidget tooltipContainer, CncWorldInteractionControllerWidget wic) { - widget.IsVisible = () => wic.TooltipType != TooltipType.None; + widget.IsVisible = () => wic.TooltipType != WorldTooltipType.None; var label = widget.GetWidget("LABEL"); var flag = widget.GetWidget("FLAG"); var owner = widget.GetWidget("OWNER"); @@ -39,10 +37,10 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic tooltipContainer.BeforeRender = () => { - if (wic == null || wic.TooltipType == TooltipType.None) + if (wic == null || wic.TooltipType == WorldTooltipType.None) return; - labelText = wic.TooltipType == TooltipType.Unexplored ? "Unexplored Terrain" : + labelText = wic.TooltipType == WorldTooltipType.Unexplored ? "Unexplored Terrain" : wic.ActorTooltip.Name(); var textWidth = font.Measure(labelText).X; if (textWidth != cachedWidth) @@ -51,7 +49,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic widget.Bounds.Width = 2*label.Bounds.X + textWidth; } var o = wic.ActorTooltip != null ? wic.ActorTooltip.Owner() : null; - showOwner = wic.TooltipType == TooltipType.Actor && o != null && !o.NonCombatant; + showOwner = wic.TooltipType == WorldTooltipType.Actor && o != null && !o.NonCombatant; if (showOwner) { diff --git a/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs b/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs index f1640b8767..0ea52edba7 100755 --- a/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs @@ -8,6 +8,7 @@ */ #endregion +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -15,7 +16,6 @@ using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Mods.RA; using OpenRA.Widgets; -using System; namespace OpenRA.Mods.Cnc.Widgets { @@ -184,6 +184,7 @@ namespace OpenRA.Mods.Cnc.Widgets var allQueues = a.World.ActorsWithTrait() .Where(p => p.Actor.Owner == p.Actor.World.LocalPlayer && p.Actor.IsInWorld) .Select(p => p.Trait).ToArray(); + foreach (var g in Groups.Values) g.Update(allQueues);