From 0e3cc1ad28b3fd992566a070c81158ed2363bf42 Mon Sep 17 00:00:00 2001 From: rob-v Date: Sat, 6 May 2017 15:01:51 +0200 Subject: [PATCH] (Lobby)MapPreviewLogic refactoring --- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 2 +- .../Widgets/Logic/Lobby/LobbyLogic.cs | 17 +- .../Logic/Lobby/LobbyMapPreviewLogic.cs | 212 ------------------ .../Widgets/Logic/Lobby/LobbyUtils.cs | 10 +- .../Widgets/Logic/Lobby/MapPreviewLogic.cs | 203 +++++++++++++++++ mods/cnc/chrome/lobby-mappreview.yaml | 19 +- mods/common/chrome/lobby-mappreview.yaml | 19 +- 7 files changed, 245 insertions(+), 237 deletions(-) delete mode 100644 OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs create mode 100644 OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 783258ad0a..cdc9bc4c18 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -622,7 +622,7 @@ - + diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index 99e6415d2a..68f2ae9c11 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -16,7 +16,6 @@ using System.Linq; using System.Threading.Tasks; using OpenRA.Chat; using OpenRA.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Network; using OpenRA.Traits; using OpenRA.Widgets; @@ -27,8 +26,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic { static readonly Action DoNothing = () => { }; - public MapPreview Map { get; private set; } - readonly ModData modData; readonly Action onStart; readonly Action onExit; @@ -64,10 +61,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly TabCompletionLogic tabCompletion = new TabCompletionLogic(); readonly LabelWidget chatLabel; - bool teamChat; + MapPreview Map { get; set; } bool addBotOnMapLoad; - + bool teamChat; int lobbyChatUnreadMessages; int globalChatLastReadMessages; int globalChatUnreadMessages; @@ -130,10 +127,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (name != null) name.GetText = () => orderManager.LobbyInfo.GlobalSettings.ServerName; - Ui.LoadWidget("LOBBY_MAP_PREVIEW", lobby.Get("MAP_PREVIEW_ROOT"), new WidgetArgs + Ui.LoadWidget("MAP_PREVIEW", lobby.Get("MAP_PREVIEW_ROOT"), new WidgetArgs { { "orderManager", orderManager }, - { "lobby", this } + { "getMap", (Func)(() => Map) }, + { "onMouseDown", (Action)((preview, map, mi) => LobbyUtils.SelectSpawnPoint(orderManager, preview, map, mi)) }, + { "getSpawnOccupants", (Func>)(map => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, map)) }, }); UpdateCurrentMap(); @@ -661,7 +660,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic template = emptySlotTemplate.Clone(); if (isHost) - LobbyUtils.SetupEditableSlotWidget(this, template, slot, client, orderManager); + LobbyUtils.SetupEditableSlotWidget(template, slot, client, orderManager, Map); else LobbyUtils.SetupSlotWidget(template, slot, client); @@ -680,7 +679,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic LobbyUtils.SetupClientWidget(template, client, orderManager, client.Bot == null); if (client.Bot != null) - LobbyUtils.SetupEditableSlotWidget(this, template, slot, client, orderManager); + LobbyUtils.SetupEditableSlotWidget(template, slot, client, orderManager, Map); else LobbyUtils.SetupEditableNameWidget(template, slot, client, orderManager); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs deleted file mode 100644 index 4896a5576e..0000000000 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs +++ /dev/null @@ -1,212 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System.Linq; -using OpenRA.Network; -using OpenRA.Widgets; - -namespace OpenRA.Mods.Common.Widgets.Logic -{ - public class LobbyMapPreviewLogic : ChromeLogic - { - readonly int blinkTickLength = 10; - bool installHighlighted; - int blinkTick; - - [ObjectCreator.UseCtor] - internal LobbyMapPreviewLogic(Widget widget, ModData modData, OrderManager orderManager, LobbyLogic lobby) - { - var mapRepository = modData.Manifest.Get().MapRepository; - - var available = widget.GetOrNull("MAP_AVAILABLE"); - if (available != null) - { - available.IsVisible = () => lobby.Map.Status == MapStatus.Available && (!lobby.Map.RulesLoaded || !lobby.Map.InvalidCustomRules); - - var preview = available.Get("MAP_PREVIEW"); - preview.Preview = () => lobby.Map; - preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); - preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map); - - var titleLabel = available.GetOrNull("MAP_TITLE"); - if (titleLabel != null) - { - var font = Game.Renderer.Fonts[titleLabel.Font]; - var title = new CachedTransform(m => WidgetUtils.TruncateText(m.Title, titleLabel.Bounds.Width, font)); - titleLabel.GetText = () => title.Update(lobby.Map); - titleLabel.GetTooltipText = () => lobby.Map.Title; - } - - var typeLabel = available.GetOrNull("MAP_TYPE"); - if (typeLabel != null) - { - var type = new CachedTransform(m => lobby.Map.Categories.FirstOrDefault() ?? ""); - typeLabel.GetText = () => type.Update(lobby.Map); - } - - var authorLabel = available.GetOrNull("MAP_AUTHOR"); - if (authorLabel != null) - { - var font = Game.Renderer.Fonts[authorLabel.Font]; - var author = new CachedTransform( - m => WidgetUtils.TruncateText("Created by {0}".F(lobby.Map.Author), authorLabel.Bounds.Width, font)); - authorLabel.GetText = () => author.Update(lobby.Map); - } - } - - var invalid = widget.GetOrNull("MAP_INVALID"); - if (invalid != null) - { - invalid.IsVisible = () => lobby.Map.Status == MapStatus.Available && lobby.Map.InvalidCustomRules; - - var preview = invalid.Get("MAP_PREVIEW"); - preview.Preview = () => lobby.Map; - preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); - preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map); - - var titleLabel = invalid.GetOrNull("MAP_TITLE"); - if (titleLabel != null) - titleLabel.GetText = () => lobby.Map.Title; - - var typeLabel = invalid.GetOrNull("MAP_TYPE"); - if (typeLabel != null) - { - var type = new CachedTransform(m => lobby.Map.Categories.FirstOrDefault() ?? ""); - typeLabel.GetText = () => type.Update(lobby.Map); - } - } - - var download = widget.GetOrNull("MAP_DOWNLOADABLE"); - if (download != null) - { - download.IsVisible = () => lobby.Map.Status == MapStatus.DownloadAvailable; - - var preview = download.Get("MAP_PREVIEW"); - preview.Preview = () => lobby.Map; - preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); - preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map); - - var titleLabel = download.GetOrNull("MAP_TITLE"); - if (titleLabel != null) - titleLabel.GetText = () => lobby.Map.Title; - - var typeLabel = download.GetOrNull("MAP_TYPE"); - if (typeLabel != null) - { - var type = new CachedTransform(m => lobby.Map.Categories.FirstOrDefault() ?? ""); - typeLabel.GetText = () => type.Update(lobby.Map); - } - - var authorLabel = download.GetOrNull("MAP_AUTHOR"); - if (authorLabel != null) - authorLabel.GetText = () => "Created by {0}".F(lobby.Map.Author); - - var install = download.GetOrNull("MAP_INSTALL"); - if (install != null) - { - install.OnClick = () => lobby.Map.Install(mapRepository, () => - { - lobby.Map.PreloadRules(); - Game.RunAfterTick(() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady)))); - }); - - install.IsHighlighted = () => installHighlighted; - } - } - - var progress = widget.GetOrNull("MAP_PROGRESS"); - if (progress != null) - { - progress.IsVisible = () => lobby.Map.Status != MapStatus.Available && - lobby.Map.Status != MapStatus.DownloadAvailable; - - var preview = progress.Get("MAP_PREVIEW"); - preview.Preview = () => lobby.Map; - preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); - preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map); - - var titleLabel = progress.GetOrNull("MAP_TITLE"); - if (titleLabel != null) - titleLabel.GetText = () => lobby.Map.Title; - - var typeLabel = progress.GetOrNull("MAP_TYPE"); - if (typeLabel != null) - if (typeLabel != null) - { - var type = new CachedTransform(m => lobby.Map.Categories.FirstOrDefault() ?? ""); - typeLabel.GetText = () => type.Update(lobby.Map); - } - - var statusSearching = progress.GetOrNull("MAP_STATUS_SEARCHING"); - if (statusSearching != null) - statusSearching.IsVisible = () => lobby.Map.Status == MapStatus.Searching; - - var statusUnavailable = progress.GetOrNull("MAP_STATUS_UNAVAILABLE"); - if (statusUnavailable != null) - statusUnavailable.IsVisible = () => lobby.Map.Status == MapStatus.Unavailable; - - var statusError = progress.GetOrNull("MAP_STATUS_ERROR"); - if (statusError != null) - statusError.IsVisible = () => lobby.Map.Status == MapStatus.DownloadError; - - var statusDownloading = progress.GetOrNull("MAP_STATUS_DOWNLOADING"); - if (statusDownloading != null) - { - statusDownloading.IsVisible = () => lobby.Map.Status == MapStatus.Downloading; - statusDownloading.GetText = () => - { - if (lobby.Map.DownloadBytes == 0) - return "Connecting..."; - - // Server does not provide the total file length - if (lobby.Map.DownloadPercentage == 0) - return "Downloading {0} kB".F(lobby.Map.DownloadBytes / 1024); - - return "Downloading {0} kB ({1}%)".F(lobby.Map.DownloadBytes / 1024, lobby.Map.DownloadPercentage); - }; - } - - var retry = progress.GetOrNull("MAP_RETRY"); - if (retry != null) - { - retry.IsVisible = () => (lobby.Map.Status == MapStatus.DownloadError || lobby.Map.Status == MapStatus.Unavailable) && - lobby.Map != MapCache.UnknownMap; - retry.OnClick = () => - { - if (lobby.Map.Status == MapStatus.DownloadError) - lobby.Map.Install(mapRepository, () => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady)))); - else if (lobby.Map.Status == MapStatus.Unavailable) - modData.MapCache.QueryRemoteMapDetails(mapRepository, new[] { lobby.Map.Uid }); - }; - - retry.GetText = () => lobby.Map.Status == MapStatus.DownloadError ? "Retry Install" : "Retry Search"; - } - - var progressbar = progress.GetOrNull("MAP_PROGRESSBAR"); - if (progressbar != null) - { - progressbar.IsIndeterminate = () => lobby.Map.DownloadPercentage == 0; - progressbar.GetPercentage = () => lobby.Map.DownloadPercentage; - progressbar.IsVisible = () => !retry.IsVisible(); - } - } - } - - public override void Tick() - { - if (++blinkTick >= blinkTickLength) - { - installHighlighted ^= true; - blinkTick = 0; - } - } - } -} diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index 3132abd418..1d13b1c765 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -38,8 +38,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic } } - public static void ShowSlotDropDown(LobbyLogic logic, DropDownButtonWidget dropdown, Session.Slot slot, - Session.Client client, OrderManager orderManager) + public static void ShowSlotDropDown(DropDownButtonWidget dropdown, Session.Slot slot, + Session.Client client, OrderManager orderManager, MapPreview map) { var options = new Dictionary>() { { "Slot", new List() { @@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var bots = new List(); if (slot.AllowBots) { - foreach (var b in logic.Map.Rules.Actors["player"].TraitInfos().Select(t => t.Name)) + foreach (var b in map.Rules.Actors["player"].TraitInfos().Select(t => t.Name)) { var bot = b; var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin); @@ -306,13 +306,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic name.GetText = () => label; } - public static void SetupEditableSlotWidget(LobbyLogic logic, Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager) + public static void SetupEditableSlotWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, MapPreview map) { var slot = parent.Get("SLOT_OPTIONS"); slot.IsVisible = () => true; slot.IsDisabled = () => orderManager.LocalClient.IsReady; slot.GetText = () => c != null ? c.Name : s.Closed ? "Closed" : "Open"; - slot.OnMouseDown = _ => ShowSlotDropDown(logic, slot, s, c, orderManager); + slot.OnMouseDown = _ => ShowSlotDropDown(slot, s, c, orderManager, map); // Ensure Name selector (if present) is hidden HideChildWidget(parent, "NAME"); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs new file mode 100644 index 0000000000..379a74f6b3 --- /dev/null +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs @@ -0,0 +1,203 @@ +#region Copyright & License Information +/* + * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using OpenRA.Network; +using OpenRA.Widgets; + +namespace OpenRA.Mods.Common.Widgets.Logic +{ + public class MapPreviewLogic : ChromeLogic + { + readonly int blinkTickLength = 10; + bool installHighlighted; + int blinkTick; + + [ObjectCreator.UseCtor] + internal MapPreviewLogic(Widget widget, ModData modData, OrderManager orderManager, Func getMap, + Action onMouseDown, Func> getSpawnOccupants) + { + var mapRepository = modData.Manifest.Get().MapRepository; + + var available = widget.GetOrNull("MAP_AVAILABLE"); + if (available != null) + { + available.IsVisible = () => + { + var map = getMap(); + return map.Status == MapStatus.Available && (!map.RulesLoaded || !map.InvalidCustomRules); + }; + SetupWidgets(available, getMap, onMouseDown, getSpawnOccupants); + } + + var invalid = widget.GetOrNull("MAP_INVALID"); + if (invalid != null) + { + invalid.IsVisible = () => + { + var map = getMap(); + return map.Status == MapStatus.Available && map.InvalidCustomRules; + }; + SetupWidgets(invalid, getMap, onMouseDown, getSpawnOccupants); + } + + var download = widget.GetOrNull("MAP_DOWNLOADABLE"); + if (download != null) + { + download.IsVisible = () => getMap().Status == MapStatus.DownloadAvailable; + SetupWidgets(download, getMap, onMouseDown, getSpawnOccupants); + + var install = download.GetOrNull("MAP_INSTALL"); + if (install != null) + { + install.OnClick = () => + { + var map = getMap(); + map.Install(mapRepository, () => + { + map.PreloadRules(); + if (orderManager != null) + Game.RunAfterTick(() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady)))); + }); + }; + + install.IsHighlighted = () => installHighlighted; + } + } + + var progress = widget.GetOrNull("MAP_PROGRESS"); + if (progress != null) + { + progress.IsVisible = () => + { + var map = getMap(); + return map.Status != MapStatus.Available && map.Status != MapStatus.DownloadAvailable; + }; + SetupWidgets(progress, getMap, onMouseDown, getSpawnOccupants); + + var statusSearching = progress.GetOrNull("MAP_STATUS_SEARCHING"); + if (statusSearching != null) + statusSearching.IsVisible = () => getMap().Status == MapStatus.Searching; + + var statusUnavailable = progress.GetOrNull("MAP_STATUS_UNAVAILABLE"); + if (statusUnavailable != null) + statusUnavailable.IsVisible = () => + { + var map = getMap(); + return map.Status == MapStatus.Unavailable && map != MapCache.UnknownMap; + }; + + var statusError = progress.GetOrNull("MAP_STATUS_ERROR"); + if (statusError != null) + statusError.IsVisible = () => getMap().Status == MapStatus.DownloadError; + + var statusDownloading = progress.GetOrNull("MAP_STATUS_DOWNLOADING"); + if (statusDownloading != null) + { + statusDownloading.IsVisible = () => getMap().Status == MapStatus.Downloading; + statusDownloading.GetText = () => + { + var map = getMap(); + if (map.DownloadBytes == 0) + return "Connecting..."; + + // Server does not provide the total file length + if (map.DownloadPercentage == 0) + return "Downloading {0} kB".F(map.DownloadBytes / 1024); + + return "Downloading {0} kB ({1}%)".F(map.DownloadBytes / 1024, map.DownloadPercentage); + }; + } + + var retry = progress.GetOrNull("MAP_RETRY"); + if (retry != null) + { + retry.IsVisible = () => + { + var map = getMap(); + return (map.Status == MapStatus.DownloadError || map.Status == MapStatus.Unavailable) && map != MapCache.UnknownMap; + }; + retry.OnClick = () => + { + var map = getMap(); + if (map.Status == MapStatus.DownloadError) + { + map.Install(mapRepository, () => + { + map.PreloadRules(); + if (orderManager != null) + Game.RunAfterTick(() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady)))); + }); + } + else if (map.Status == MapStatus.Unavailable) + modData.MapCache.QueryRemoteMapDetails(mapRepository, new[] { map.Uid }); + }; + + retry.GetText = () => getMap().Status == MapStatus.DownloadError ? "Retry Install" : "Retry Search"; + } + + var progressbar = progress.GetOrNull("MAP_PROGRESSBAR"); + if (progressbar != null) + { + progressbar.IsIndeterminate = () => getMap().DownloadPercentage == 0; + progressbar.GetPercentage = () => getMap().DownloadPercentage; + progressbar.IsVisible = () => getMap().Status == MapStatus.Downloading; + } + } + } + + public override void Tick() + { + if (++blinkTick >= blinkTickLength) + { + installHighlighted ^= true; + blinkTick = 0; + } + } + + void SetupWidgets(Widget parent, Func getMap, + Action onMouseDown, Func> getSpawnOccupants) + { + var preview = parent.Get("MAP_PREVIEW"); + preview.Preview = () => getMap(); + preview.OnMouseDown = mi => onMouseDown(preview, getMap(), mi); + preview.SpawnOccupants = () => getSpawnOccupants(getMap()); + + var titleLabel = parent.GetOrNull("MAP_TITLE"); + if (titleLabel != null) + { + titleLabel.IsVisible = () => getMap() != MapCache.UnknownMap; + var font = Game.Renderer.Fonts[titleLabel.Font]; + var title = new CachedTransform(m => WidgetUtils.TruncateText(m.Title, titleLabel.Bounds.Width, font)); + titleLabel.GetText = () => title.Update(getMap()); + titleLabel.GetTooltipText = () => getMap().Title; + } + + var typeLabel = parent.GetOrNull("MAP_TYPE"); + if (typeLabel != null) + { + var type = new CachedTransform(m => m.Categories.FirstOrDefault() ?? ""); + typeLabel.GetText = () => type.Update(getMap()); + } + + var authorLabel = parent.GetOrNull("MAP_AUTHOR"); + if (authorLabel != null) + { + var font = Game.Renderer.Fonts[authorLabel.Font]; + var author = new CachedTransform( + m => WidgetUtils.TruncateText("Created by {0}".F(m.Author), authorLabel.Bounds.Width, font)); + authorLabel.GetText = () => author.Update(getMap()); + } + } + } +} diff --git a/mods/cnc/chrome/lobby-mappreview.yaml b/mods/cnc/chrome/lobby-mappreview.yaml index 1739a0907f..a58c625c5a 100644 --- a/mods/cnc/chrome/lobby-mappreview.yaml +++ b/mods/cnc/chrome/lobby-mappreview.yaml @@ -1,5 +1,5 @@ -Container@LOBBY_MAP_PREVIEW: - Logic: LobbyMapPreviewLogic +Container@MAP_PREVIEW: + Logic: MapPreviewLogic Width: PARENT_RIGHT Height: PARENT_BOTTOM Children: @@ -54,12 +54,14 @@ Container@LOBBY_MAP_PREVIEW: Width: PARENT_RIGHT - 2 Height: PARENT_BOTTOM - 2 TooltipContainer: TOOLTIP_CONTAINER - Label@MAP_TITLE: + LabelWithTooltip@MAP_TITLE: Y: 172 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@MAP_STATUS_A: Y: 187 Width: PARENT_RIGHT @@ -67,6 +69,7 @@ Container@LOBBY_MAP_PREVIEW: Font: Tiny Align: Center Text: This map is not compatible + IgnoreMouseOver: true Label@MAP_STATUS_B: Y: 200 Width: PARENT_RIGHT @@ -89,18 +92,21 @@ Container@LOBBY_MAP_PREVIEW: Width: PARENT_RIGHT - 2 Height: PARENT_BOTTOM - 2 TooltipContainer: TOOLTIP_CONTAINER - Label@MAP_TITLE: + LabelWithTooltip@MAP_TITLE: Y: 142 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@MAP_TYPE: Y: 157 Width: PARENT_RIGHT Height: 25 Font: TinyBold Align: Center + IgnoreMouseOver: true Label@MAP_AUTHOR: Y: 170 Width: PARENT_RIGHT @@ -127,12 +133,14 @@ Container@LOBBY_MAP_PREVIEW: Width: PARENT_RIGHT - 2 Height: PARENT_BOTTOM - 2 TooltipContainer: TOOLTIP_CONTAINER - Label@MAP_TITLE: + LabelWithTooltip@MAP_TITLE: Y: 142 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@MAP_STATUS_SEARCHING: Y: 157 Width: PARENT_RIGHT @@ -140,6 +148,7 @@ Container@LOBBY_MAP_PREVIEW: Font: Tiny Align: Center Text: Searching OpenRA Resource Center... + IgnoreMouseOver: true Container@MAP_STATUS_UNAVAILABLE: Width: PARENT_RIGHT Children: diff --git a/mods/common/chrome/lobby-mappreview.yaml b/mods/common/chrome/lobby-mappreview.yaml index d4d67fd7ff..748e3468c9 100644 --- a/mods/common/chrome/lobby-mappreview.yaml +++ b/mods/common/chrome/lobby-mappreview.yaml @@ -1,5 +1,5 @@ -Container@LOBBY_MAP_PREVIEW: - Logic: LobbyMapPreviewLogic +Container@MAP_PREVIEW: + Logic: MapPreviewLogic Width: PARENT_RIGHT Height: PARENT_BOTTOM Children: @@ -54,12 +54,14 @@ Container@LOBBY_MAP_PREVIEW: Width: PARENT_RIGHT - 2 Height: PARENT_BOTTOM - 2 TooltipContainer: TOOLTIP_CONTAINER - Label@MAP_TITLE: + LabelWithTooltip@MAP_TITLE: Y: 172 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@MAP_STATUS_A: Y: 187 Width: PARENT_RIGHT @@ -67,6 +69,7 @@ Container@LOBBY_MAP_PREVIEW: Font: Tiny Align: Center Text: This map is not compatible + IgnoreMouseOver: true Label@MAP_STATUS_B: Y: 200 Width: PARENT_RIGHT @@ -89,18 +92,21 @@ Container@LOBBY_MAP_PREVIEW: Width: PARENT_RIGHT - 2 Height: PARENT_BOTTOM - 2 TooltipContainer: TOOLTIP_CONTAINER - Label@MAP_TITLE: + LabelWithTooltip@MAP_TITLE: Y: 142 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@MAP_TYPE: Y: 157 Width: PARENT_RIGHT Height: 25 Font: TinyBold Align: Center + IgnoreMouseOver: true Label@MAP_AUTHOR: Y: 170 Width: PARENT_RIGHT @@ -128,12 +134,14 @@ Container@LOBBY_MAP_PREVIEW: Width: PARENT_RIGHT - 2 Height: PARENT_BOTTOM - 2 TooltipContainer: TOOLTIP_CONTAINER - Label@MAP_TITLE: + LabelWithTooltip@MAP_TITLE: Y: 142 Width: PARENT_RIGHT Height: 25 Font: Bold Align: Center + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Label@MAP_STATUS_SEARCHING: Y: 157 Width: PARENT_RIGHT @@ -141,6 +149,7 @@ Container@LOBBY_MAP_PREVIEW: Font: Tiny Align: Center Text: Searching OpenRA Resource Center... + IgnoreMouseOver: true Container@MAP_STATUS_UNAVAILABLE: Width: PARENT_RIGHT Children: