diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index 16d2aa09f2..23ed35d38e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -47,9 +47,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic [FluentReference] const string Spectators = "label-spectators"; - [FluentReference] - const string Gone = "label-client-state-disconnected"; - [FluentReference] const string KickTooltip = "button-kick-player"; @@ -245,7 +242,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var item = playerTemplate.Clone(); LobbyUtils.SetupProfileWidget(item, client, orderManager, worldRenderer); - var nameLabel = item.Get("NAME"); + var nameLabel = item.Get("NAME"); WidgetUtils.BindPlayerNameAndStatus(nameLabel, pp); nameLabel.GetColor = () => pp.Color; @@ -301,18 +298,22 @@ namespace OpenRA.Mods.Common.Widgets.Logic var item = spectatorTemplate.Clone(); LobbyUtils.SetupProfileWidget(item, client, orderManager, worldRenderer); - var nameLabel = item.Get("NAME"); + var nameLabel = item.Get("NAME"); var nameFont = Game.Renderer.Fonts[nameLabel.Font]; - var suffixLength = new CachedTransform(s => nameFont.Measure(s).X); - var name = new CachedTransform<(string Name, string Suffix), string>(c => - WidgetUtils.TruncateText(c.Name, nameLabel.Bounds.Width - suffixLength.Update(c.Suffix), nameFont) + c.Suffix); - - nameLabel.GetText = () => + var name = new CachedTransform(c => { - var suffix = client.State == Session.ClientState.Disconnected ? $" ({FluentProvider.GetMessage(Gone)})" : ""; - return name.Update((client.Name, suffix)); - }; + var name = WidgetUtils.WithSuffix(client.Name, WinState.Undefined, c); + var truncated = WidgetUtils.TruncateText(name, nameLabel.Bounds.Width, nameFont); + if (name != truncated) + nameLabel.GetTooltipText = () => name; + else + nameLabel.GetTooltipText = null; + + return truncated; + }); + + nameLabel.GetText = () => name.Update(client.State); var kickButton = item.Get("KICK"); bool IsVoteKick() => !Game.IsHost; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs index 25a1c51002..7b3f1c2bba 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly World world; CameraOption selected; - readonly LabelWidget shroudLabel; + readonly LabelWithTooltipWidget shroudLabel; sealed class CameraOption { @@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var item = ScrollItemWidget.Setup(template, option.IsSelected, option.OnClick); var showFlag = option.Faction != null; - var label = item.Get("LABEL"); + var label = item.Get("LABEL"); label.IsVisible = () => showFlag; label.GetColor = () => option.Color; @@ -162,7 +162,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic shroudSelector.ShowDropDown("SPECTATOR_DROPDOWN_TEMPLATE", 400, groups, SetupItem); }; - shroudLabel = shroudSelector.Get("LABEL"); + shroudLabel = shroudSelector.Get("LABEL"); shroudLabel.IsVisible = () => selected.Faction != null; shroudLabel.GetText = () => selected.Label; shroudLabel.GetColor = () => selected.Color; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs index a0f8c304ac..074cfc92cb 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs @@ -319,7 +319,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic AddPlayerFlagAndName(template, player); - var playerName = template.Get("PLAYER"); + var playerName = template.Get("PLAYER"); playerName.GetColor = () => Color.White; var playerColor = template.Get("PLAYER_COLOR"); @@ -365,7 +365,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic AddPlayerFlagAndName(template, player); - var playerName = template.Get("PLAYER"); + var playerName = template.Get("PLAYER"); playerName.GetColor = () => Color.White; var playerColor = template.Get("PLAYER_COLOR"); @@ -386,7 +386,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic AddPlayerFlagAndName(template, player); - var playerName = template.Get("PLAYER"); + var playerName = template.Get("PLAYER"); playerName.GetColor = () => Color.White; var playerColor = template.Get("PLAYER_COLOR"); @@ -407,7 +407,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic AddPlayerFlagAndName(template, player); - var playerName = template.Get("PLAYER"); + var playerName = template.Get("PLAYER"); playerName.GetColor = () => Color.White; var playerColor = template.Get("PLAYER_COLOR"); @@ -428,7 +428,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic AddPlayerFlagAndName(template, player); - var playerName = template.Get("PLAYER"); + var playerName = template.Get("PLAYER"); playerName.GetColor = () => Color.White; var playerColor = template.Get("PLAYER_COLOR"); @@ -480,7 +480,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic AddPlayerFlagAndName(template, player); - var playerName = template.Get("PLAYER"); + var playerName = template.Get("PLAYER"); playerName.GetColor = () => Color.White; var playerColor = template.Get("PLAYER_COLOR"); @@ -580,7 +580,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic flag.GetImageCollection = () => "flags"; flag.GetImageName = () => player.Faction.InternalName; - var playerName = template.Get("PLAYER"); + var playerName = template.Get("PLAYER"); WidgetUtils.BindPlayerNameAndStatus(playerName, player); playerName.GetColor = () => player.Color; diff --git a/OpenRA.Mods.Common/Widgets/WidgetUtils.cs b/OpenRA.Mods.Common/Widgets/WidgetUtils.cs index 7fc9fde296..07c5a6da77 100644 --- a/OpenRA.Mods.Common/Widgets/WidgetUtils.cs +++ b/OpenRA.Mods.Common/Widgets/WidgetUtils.cs @@ -329,34 +329,44 @@ namespace OpenRA.Mods.Common.Widgets icon.GetSprite = () => cache.Update((button.IsDisabled(), button.Depressed, Ui.MouseOverWidget == button, false, button.IsHighlighted())); } - public static void BindPlayerNameAndStatus(LabelWidget label, Player p) + public static string WithSuffix(string name, WinState winState, Session.ClientState clientState) + { + if (clientState == Session.ClientState.Disconnected) + return name + " (" + FluentProvider.GetMessage(Gone) + ")"; + + if (winState == WinState.Won) + return name + " (" + FluentProvider.GetMessage(Won) + ")"; + + if (winState == WinState.Lost) + return name + " (" + FluentProvider.GetMessage(Lost) + ")"; + + return name; + } + + public static void BindPlayerNameAndStatus(LabelWithTooltipWidget label, Player p) { - var client = p.World.LobbyInfo.ClientWithIndex(p.ClientIndex); - var nameFont = Game.Renderer.Fonts[label.Font]; var name = new CachedTransform<(WinState WinState, Session.ClientState ClientState), string>(c => { - var text = p.ResolvedPlayerName; + var text = WithSuffix(p.ResolvedPlayerName, c.WinState, c.ClientState); + var truncatedText = TruncateText(text, label.Bounds.Width, Game.Renderer.Fonts[label.Font]); - var suffix = ""; - if (c.WinState == WinState.Won) - suffix = $" ({FluentProvider.GetMessage(Won)})"; - else if (c.WinState == WinState.Lost) - suffix = $" ({FluentProvider.GetMessage(Lost)})"; + if (text != truncatedText) + label.GetTooltipText = () => text; + else + label.GetTooltipText = null; - if (client.State == Session.ClientState.Disconnected) - suffix = $" ({FluentProvider.GetMessage(Gone)})"; - - text += suffix; - - var size = nameFont.Measure(text) - nameFont.Measure(p.ResolvedPlayerName); - return TruncateText(text, label.Bounds.Width - size.X, nameFont); + return truncatedText; }); + var client = p.World.LobbyInfo.ClientWithIndex(p.ClientIndex); label.GetText = () => { var clientState = client != null ? client.State : Session.ClientState.Ready; return name.Update((p.WinState, clientState)); }; + + // Trigger a tooltip update. + label.GetText(); } public static void SetupTextNotification(Widget notificationWidget, TextNotification notification, int boxWidth, bool withTimestamp) diff --git a/mods/cnc/chrome/dialogs.yaml b/mods/cnc/chrome/dialogs.yaml index 83ce4f596f..57f37dada3 100644 --- a/mods/cnc/chrome/dialogs.yaml +++ b/mods/cnc/chrome/dialogs.yaml @@ -167,20 +167,23 @@ ScrollPanel@SPECTATOR_DROPDOWN_TEMPLATE: X: 2 Y: 0 Visible: false + EnableChildMouseOver: true Children: Image@FLAG: X: 4 Y: 4 Width: 32 Height: 16 - Label@LABEL: + LabelWithTooltip@LABEL: X: 40 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 42 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 Height: 25 Shadow: True diff --git a/mods/cnc/chrome/ingame-infostats.yaml b/mods/cnc/chrome/ingame-infostats.yaml index 87d152af87..d560f22a55 100644 --- a/mods/cnc/chrome/ingame-infostats.yaml +++ b/mods/cnc/chrome/ingame-infostats.yaml @@ -104,11 +104,13 @@ Container@SKIRMISH_STATS: Visible: false TooltipContainer: TOOLTIP_CONTAINER Template: ANONYMOUS_PLAYER_TOOLTIP - Label@NAME: + LabelWithTooltip@NAME: X: 29 Width: 191 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Image@FACTIONFLAG: X: 230 Y: 4 @@ -163,11 +165,13 @@ Container@SKIRMISH_STATS: Visible: false TooltipContainer: TOOLTIP_CONTAINER Template: ANONYMOUS_PLAYER_TOOLTIP - Label@NAME: + LabelWithTooltip@NAME: X: 29 Width: 191 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Checkbox@MUTE: X: 457 Width: 25 diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index 5fb15b0efc..3120de6500 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -274,14 +274,16 @@ Container@OBSERVER_WIDGETS: Y: 4 Width: 32 Height: 16 - Label@LABEL: + LabelWithTooltip@LABEL: X: 40 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 42 - 16 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 - 16 Height: 25 Shadow: True Container@INGAME_OBSERVERSTATS_BG: @@ -747,6 +749,7 @@ Container@OBSERVER_WIDGETS: Width: 705 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -765,13 +768,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 160 Y: 0 @@ -834,6 +839,7 @@ Container@OBSERVER_WIDGETS: Width: 730 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -852,13 +858,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 160 Y: 0 @@ -914,6 +922,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -932,13 +941,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverProductionIcons@PRODUCTION_ICONS: X: 160 Y: 0 @@ -951,6 +962,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -969,13 +981,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverSupportPowerIcons@SUPPORT_POWER_ICONS: X: 160 Y: 0 @@ -988,6 +1002,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -1006,13 +1021,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverArmyIcons@ARMY_ICONS: X: 160 Y: 0 @@ -1025,6 +1042,7 @@ Container@OBSERVER_WIDGETS: Width: 760 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -1043,13 +1061,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@ASSETS_DESTROYED: X: 160 Y: 0 diff --git a/mods/common/chrome/dropdowns.yaml b/mods/common/chrome/dropdowns.yaml index c5a0ea5b1f..977e5cfc9d 100644 --- a/mods/common/chrome/dropdowns.yaml +++ b/mods/common/chrome/dropdowns.yaml @@ -130,20 +130,23 @@ ScrollPanel@SPECTATOR_DROPDOWN_TEMPLATE: X: 2 Y: 0 Visible: false + EnableChildMouseOver: true Children: Image@FLAG: X: 4 Y: 6 Width: 32 Height: 16 - Label@LABEL: + LabelWithTooltip@LABEL: X: 40 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 42 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 Height: 25 Shadow: True diff --git a/mods/common/chrome/ingame-infostats.yaml b/mods/common/chrome/ingame-infostats.yaml index 8427ced7cc..f1f0d9e3a8 100644 --- a/mods/common/chrome/ingame-infostats.yaml +++ b/mods/common/chrome/ingame-infostats.yaml @@ -101,11 +101,13 @@ Container@SKIRMISH_STATS: Visible: false TooltipContainer: TOOLTIP_CONTAINER Template: ANONYMOUS_PLAYER_TOOLTIP - Label@NAME: + LabelWithTooltip@NAME: X: 29 Width: 191 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Image@FACTIONFLAG: X: 230 Y: 5 @@ -160,11 +162,13 @@ Container@SKIRMISH_STATS: Visible: false TooltipContainer: TOOLTIP_CONTAINER Template: ANONYMOUS_PLAYER_TOOLTIP - Label@NAME: + LabelWithTooltip@NAME: X: 29 Width: 191 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Checkbox@MUTE: X: 457 Width: 25 diff --git a/mods/common/fluent/common.ftl b/mods/common/fluent/common.ftl index e584a5e962..510f1d7058 100644 --- a/mods/common/fluent/common.ftl +++ b/mods/common/fluent/common.ftl @@ -165,7 +165,6 @@ label-mission-accomplished = Accomplished label-mission-failed = Failed ## GameInfoStatsLogic -label-client-state-disconnected = Gone label-mute-player = Mute this player label-unmute-player = Unmute this player button-kick-player = Kick this player @@ -862,6 +861,7 @@ notification-desync-compare-logs = Out of sync in frame { $frame }. ## WidgetUtils label-win-state-won = Won label-win-state-lost = Lost +label-client-state-disconnected = Gone ## Player enumerated-bot-name = diff --git a/mods/d2k/chrome/dropdowns.yaml b/mods/d2k/chrome/dropdowns.yaml index 014f92d0a3..b1acefc690 100644 --- a/mods/d2k/chrome/dropdowns.yaml +++ b/mods/d2k/chrome/dropdowns.yaml @@ -126,20 +126,23 @@ ScrollPanel@SPECTATOR_DROPDOWN_TEMPLATE: X: 2 Y: 0 Visible: false + EnableChildMouseOver: true Children: Image@FLAG: Width: 23 Height: 23 X: 4 Y: 2 - Label@LABEL: + LabelWithTooltip@LABEL: X: 34 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 36 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 Height: 25 Shadow: True diff --git a/mods/d2k/chrome/ingame-infostats.yaml b/mods/d2k/chrome/ingame-infostats.yaml index 1174df5c1f..ea727ccc88 100644 --- a/mods/d2k/chrome/ingame-infostats.yaml +++ b/mods/d2k/chrome/ingame-infostats.yaml @@ -103,11 +103,13 @@ Container@SKIRMISH_STATS: Visible: false TooltipContainer: TOOLTIP_CONTAINER Template: ANONYMOUS_PLAYER_TOOLTIP - Label@NAME: + LabelWithTooltip@NAME: X: 29 Width: 191 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Image@FACTIONFLAG: X: 230 Y: 4 diff --git a/mods/d2k/chrome/ingame-observer.yaml b/mods/d2k/chrome/ingame-observer.yaml index bbff318d4f..6f960ef030 100644 --- a/mods/d2k/chrome/ingame-observer.yaml +++ b/mods/d2k/chrome/ingame-observer.yaml @@ -93,14 +93,16 @@ Container@OBSERVER_WIDGETS: Height: 23 X: 4 Y: 2 - Label@LABEL: + LabelWithTooltip@LABEL: X: 34 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 36 - 16 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 - 16 Height: 25 Shadow: True Container@REPLAY_PLAYER: @@ -643,6 +645,7 @@ Container@OBSERVER_WIDGETS: Width: 700 Height: 25 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -659,13 +662,15 @@ Container@OBSERVER_WIDGETS: Y: 2 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 35 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 155 Y: 0 @@ -728,6 +733,7 @@ Container@OBSERVER_WIDGETS: Width: 720 Height: 25 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -744,13 +750,15 @@ Container@OBSERVER_WIDGETS: Y: 2 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 35 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 155 Y: 0 @@ -806,6 +814,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 25 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -822,13 +831,15 @@ Container@OBSERVER_WIDGETS: Y: 2 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 35 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverProductionIcons@PRODUCTION_ICONS: X: 155 Y: 1 @@ -842,6 +853,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 25 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -858,13 +870,15 @@ Container@OBSERVER_WIDGETS: Y: 2 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 35 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverSupportPowerIcons@SUPPORT_POWER_ICONS: X: 155 Y: 1 @@ -878,6 +892,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 25 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -896,13 +911,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 35 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverArmyIcons@ARMY_ICONS: X: 155 Y: 1 @@ -916,6 +933,7 @@ Container@OBSERVER_WIDGETS: Width: 755 Height: 25 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -932,13 +950,15 @@ Container@OBSERVER_WIDGETS: Y: 2 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 35 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@ASSETS_DESTROYED: X: 155 Y: 0 diff --git a/mods/ra/chrome/ingame-observer.yaml b/mods/ra/chrome/ingame-observer.yaml index 7bf11318b1..220d3022b4 100644 --- a/mods/ra/chrome/ingame-observer.yaml +++ b/mods/ra/chrome/ingame-observer.yaml @@ -108,14 +108,16 @@ Container@OBSERVER_WIDGETS: Y: 6 Width: 32 Height: 16 - Label@LABEL: + LabelWithTooltip@LABEL: X: 40 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 42 - 16 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 - 16 Height: 25 Shadow: True Image@SIDEBAR_BACKGROUND_BOTTOM: @@ -685,6 +687,7 @@ Container@OBSERVER_WIDGETS: Width: 705 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -703,13 +706,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 160 Y: 0 @@ -772,6 +777,7 @@ Container@OBSERVER_WIDGETS: Width: 735 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -790,13 +796,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 160 Y: 0 @@ -852,6 +860,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -870,13 +879,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverProductionIcons@PRODUCTION_ICONS: X: 160 Y: 0 @@ -889,6 +900,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -907,13 +919,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverSupportPowerIcons@SUPPORT_POWER_ICONS: X: 160 Y: 0 @@ -926,6 +940,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -944,13 +959,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverArmyIcons@ARMY_ICONS: X: 160 Y: 0 @@ -963,6 +980,7 @@ Container@OBSERVER_WIDGETS: Width: 760 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -981,13 +999,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@ASSETS_DESTROYED: X: 160 Y: 0 diff --git a/mods/ts/chrome/dropdowns.yaml b/mods/ts/chrome/dropdowns.yaml index 9038890827..840c907cee 100644 --- a/mods/ts/chrome/dropdowns.yaml +++ b/mods/ts/chrome/dropdowns.yaml @@ -96,20 +96,23 @@ ScrollPanel@SPECTATOR_DROPDOWN_TEMPLATE: X: 2 Y: 0 Visible: false + EnableChildMouseOver: true Children: Image@FLAG: X: 4 Y: 6 Width: 32 Height: 16 - Label@LABEL: + LabelWithTooltip@LABEL: X: 40 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 42 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 Height: 25 Shadow: True diff --git a/mods/ts/chrome/ingame-observer.yaml b/mods/ts/chrome/ingame-observer.yaml index 33fa9307c6..0fb611ee2b 100644 --- a/mods/ts/chrome/ingame-observer.yaml +++ b/mods/ts/chrome/ingame-observer.yaml @@ -93,14 +93,16 @@ Container@OBSERVER_WIDGETS: Height: 23 X: 2 Y: 5 - Label@LABEL: + LabelWithTooltip@LABEL: X: 34 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 36 Height: 25 Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@NOFLAG_LABEL: X: 5 - Width: PARENT_WIDTH + Width: PARENT_WIDTH - 7 Height: 25 Shadow: True Container@REPLAY_PLAYER: @@ -635,6 +637,7 @@ Container@OBSERVER_WIDGETS: Width: 705 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -653,13 +656,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 160 Y: 0 @@ -722,6 +727,7 @@ Container@OBSERVER_WIDGETS: Width: 645 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -740,13 +746,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@CASH: X: 160 Y: 0 @@ -795,6 +803,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -813,13 +822,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverProductionIcons@PRODUCTION_ICONS: X: 160 Y: 0 @@ -833,6 +844,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -851,13 +863,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverSupportPowerIcons@SUPPORT_POWER_ICONS: X: 160 Y: 0 @@ -871,6 +885,7 @@ Container@OBSERVER_WIDGETS: Width: 400 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -889,13 +904,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP ObserverArmyIcons@ARMY_ICONS: X: 160 Y: 0 @@ -908,6 +925,7 @@ Container@OBSERVER_WIDGETS: Width: 760 Height: 24 Background: scrollitem-nohover + EnableChildMouseOver: true Children: ColorBlock@PLAYER_COLOR: X: 0 @@ -926,13 +944,15 @@ Container@OBSERVER_WIDGETS: Height: PARENT_HEIGHT - 4 ImageName: random ImageCollection: flags - Label@PLAYER: + LabelWithTooltip@PLAYER: X: 40 Y: 0 Width: 120 Height: PARENT_HEIGHT Font: Bold Shadow: True + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@ASSETS_DESTROYED: X: 160 Y: 0