From dd95b199b7c01979efd6fc76d6bc34364163fcaa Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 29 Oct 2023 11:29:02 +0000 Subject: [PATCH] Fix a collection of mission browser UI issues. --- .../Widgets/Logic/MissionBrowserLogic.cs | 5 +- mods/cnc/chrome/gamesave-browser.yaml | 2 +- mods/cnc/chrome/missionbrowser.yaml | 43 +++---- mods/common/chrome/missionbrowser.yaml | 41 ++++--- mods/d2k/chrome/missionbrowser.yaml | 114 +++++++++--------- 5 files changed, 105 insertions(+), 100 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index 1d6b56c009..a1fad3f656 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -84,7 +84,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic var title = widget.GetOrNull("MISSIONBROWSER_TITLE"); if (title != null) - title.GetText = () => playingVideo != PlayingVideo.None ? selectedMap.Title : title.Text; + { + var label = TranslationProvider.GetString(title.Text); + title.GetText = () => playingVideo != PlayingVideo.None ? selectedMap.Title : label; + } widget.Get("MISSION_INFO").IsVisible = () => selectedMap != null; diff --git a/mods/cnc/chrome/gamesave-browser.yaml b/mods/cnc/chrome/gamesave-browser.yaml index 780f7a6154..a58fb69d1e 100644 --- a/mods/cnc/chrome/gamesave-browser.yaml +++ b/mods/cnc/chrome/gamesave-browser.yaml @@ -2,7 +2,7 @@ Container@GAMESAVE_BROWSER_PANEL: Logic: GameSaveBrowserLogic X: (WINDOW_RIGHT - WIDTH) / 2 Y: (WINDOW_BOTTOM - HEIGHT) / 2 - Width: 714 + Width: 716 Height: 435 Children: Label@LOAD_TITLE: diff --git a/mods/cnc/chrome/missionbrowser.yaml b/mods/cnc/chrome/missionbrowser.yaml index 64e8380be3..2502a6ff39 100644 --- a/mods/cnc/chrome/missionbrowser.yaml +++ b/mods/cnc/chrome/missionbrowser.yaml @@ -2,7 +2,7 @@ Container@MISSIONBROWSER_PANEL: Logic: MissionBrowserLogic X: (WINDOW_RIGHT - WIDTH) / 2 Y: (WINDOW_BOTTOM - HEIGHT) / 2 - Width: 714 + Width: 716 Height: 435 Children: Label@MISSIONBROWSER_TITLE: @@ -20,7 +20,7 @@ Container@MISSIONBROWSER_PANEL: ScrollPanel@MISSION_LIST: X: 15 Y: 15 - Width: 311 + Width: 313 Height: PARENT_BOTTOM - 30 Children: ScrollItem@HEADER: @@ -49,7 +49,7 @@ Container@MISSIONBROWSER_PANEL: TooltipContainer: TOOLTIP_CONTAINER TooltipTemplate: SIMPLE_TOOLTIP Container@MISSION_INFO: - X: 337 + X: 339 Y: 15 Width: 362 Height: PARENT_BOTTOM - 30 @@ -67,10 +67,25 @@ Container@MISSIONBROWSER_PANEL: IgnoreMouseOver: True IgnoreMouseInput: True ShowSpawnPoints: False + Container@MISSION_TABS: + Width: PARENT_RIGHT + Y: PARENT_BOTTOM - 31 + Children: + Button@MISSIONINFO_TAB: + Width: 178 + Height: 31 + Font: Bold + Text: button-missionbrowser-panel-mission-info + Button@OPTIONS_TAB: + X: 184 + Width: 178 + Height: 31 + Font: Bold + Text: button-missionbrowser-panel-mission-options Container@MISSION_DETAIL: Y: 213 Width: PARENT_RIGHT - Height: 170 + Height: PARENT_BOTTOM - 213 - 30 Children: ScrollPanel@MISSION_DESCRIPTION_PANEL: Height: PARENT_BOTTOM @@ -119,6 +134,7 @@ Container@MISSIONBROWSER_PANEL: Y: 25 Height: 25 Visible: False + PanelRoot: MISSION_DROPDOWN_PANEL_ROOT TooltipContainer: TOOLTIP_CONTAINER LabelForInput@B_DESC: X: PARENT_RIGHT / 2 + 5 @@ -132,24 +148,8 @@ Container@MISSIONBROWSER_PANEL: Y: 25 Height: 25 Visible: False + PanelRoot: MISSION_DROPDOWN_PANEL_ROOT TooltipContainer: TOOLTIP_CONTAINER - Container@MISSION_TABS: - Width: PARENT_RIGHT - Y: PARENT_BOTTOM - 50 - Children: - Button@MISSIONINFO_TAB: - Width: PARENT_RIGHT / 2 - Y: 25 - Height: 28 - Font: Bold - Text: button-missionbrowser-panel-mission-info - Button@OPTIONS_TAB: - X: PARENT_RIGHT / 2 - Width: PARENT_RIGHT / 2 - Y: 25 - Height: 28 - Font: Bold - Text: button-missionbrowser-panel-mission-options Button@BACK_BUTTON: Y: PARENT_BOTTOM - 1 Width: 140 @@ -204,6 +204,7 @@ Container@MISSIONBROWSER_PANEL: Y: 1 Width: 684 Height: 402 + Container@MISSION_DROPDOWN_PANEL_ROOT: TooltipContainer@TOOLTIP_CONTAINER: Background@FULLSCREEN_PLAYER: diff --git a/mods/common/chrome/missionbrowser.yaml b/mods/common/chrome/missionbrowser.yaml index 79c82bb1f1..32cced93b6 100644 --- a/mods/common/chrome/missionbrowser.yaml +++ b/mods/common/chrome/missionbrowser.yaml @@ -61,13 +61,28 @@ Background@MISSIONBROWSER_PANEL: IgnoreMouseOver: True IgnoreMouseInput: True ShowSpawnPoints: False + Container@MISSION_TABS: + Width: PARENT_RIGHT + Y: PARENT_BOTTOM - 31 + Children: + Button@MISSIONINFO_TAB: + Width: PARENT_RIGHT / 2 + Height: 31 + Font: Bold + Text: button-missionbrowser-panel-mission-info + Button@OPTIONS_TAB: + X: PARENT_RIGHT / 2 + Width: PARENT_RIGHT / 2 + Height: 31 + Font: Bold + Text: button-missionbrowser-panel-mission-options Container@MISSION_DETAIL: Y: 212 Width: PARENT_RIGHT - Height: 155 + Height: PARENT_BOTTOM - 212 Children: ScrollPanel@MISSION_DESCRIPTION_PANEL: - Height: PARENT_BOTTOM + Height: PARENT_BOTTOM - 30 Width: PARENT_RIGHT TopBottomSpacing: 5 Children: @@ -77,7 +92,7 @@ Background@MISSIONBROWSER_PANEL: VAlign: Top Font: Small ScrollPanel@MISSION_OPTIONS: - Height: PARENT_BOTTOM + Height: PARENT_BOTTOM - 30 Width: PARENT_RIGHT TopBottomSpacing: 5 Children: @@ -113,6 +128,7 @@ Background@MISSIONBROWSER_PANEL: Y: 25 Height: 25 Visible: False + PanelRoot: MISSION_DROPDOWN_PANEL_ROOT TooltipContainer: TOOLTIP_CONTAINER LabelForInput@B_DESC: X: PARENT_RIGHT / 2 + 5 @@ -126,24 +142,8 @@ Background@MISSIONBROWSER_PANEL: Y: 25 Height: 25 Visible: False + PanelRoot: MISSION_DROPDOWN_PANEL_ROOT TooltipContainer: TOOLTIP_CONTAINER - Container@MISSION_TABS: - Width: PARENT_RIGHT - Y: PARENT_BOTTOM - 50 - Children: - Button@MISSIONINFO_TAB: - Width: PARENT_RIGHT / 2 - Y: 25 - Height: 28 - Font: Bold - Text: button-missionbrowser-panel-mission-info - Button@OPTIONS_TAB: - X: PARENT_RIGHT / 2 - Width: PARENT_RIGHT / 2 - Y: 25 - Height: 28 - Font: Bold - Text: button-missionbrowser-panel-mission-options Button@START_BRIEFING_VIDEO_BUTTON: X: 20 Y: PARENT_BOTTOM - 45 @@ -199,6 +199,7 @@ Background@MISSIONBROWSER_PANEL: Y: 1 Width: PARENT_RIGHT - 2 Height: PARENT_BOTTOM - 2 + Container@MISSION_DROPDOWN_PANEL_ROOT: TooltipContainer@TOOLTIP_CONTAINER: Background@FULLSCREEN_PLAYER: diff --git a/mods/d2k/chrome/missionbrowser.yaml b/mods/d2k/chrome/missionbrowser.yaml index ecdf76fb96..9c668373d9 100644 --- a/mods/d2k/chrome/missionbrowser.yaml +++ b/mods/d2k/chrome/missionbrowser.yaml @@ -2,7 +2,7 @@ Background@MISSIONBROWSER_PANEL: Logic: MissionBrowserLogic X: (WINDOW_RIGHT - WIDTH) / 2 Y: (WINDOW_BOTTOM - HEIGHT) / 2 - Width: 880 + Width: 682 Height: 591 Children: Label@MISSIONBROWSER_TITLE: @@ -16,7 +16,7 @@ Background@MISSIONBROWSER_PANEL: X: 20 Y: 50 Width: 190 - Height: 405 + Height: 483 Children: ScrollItem@HEADER: Background: scrollheader @@ -42,43 +42,15 @@ Background@MISSIONBROWSER_PANEL: Height: 25 TooltipContainer: TOOLTIP_CONTAINER TooltipTemplate: SIMPLE_TOOLTIP - Button@START_BRIEFING_VIDEO_BUTTON: - X: 20 - Y: 455 - Width: 190 - Height: 25 - Text: button-missionbrowser-panel-start-briefing-video - Font: Bold - Button@STOP_BRIEFING_VIDEO_BUTTON: - X: 20 - Y: 455 + HEIGHT - Width: 190 - Height: 25 - Text: button-missionbrowser-panel-stop-briefing-video - Font: Bold - Button@START_INFO_VIDEO_BUTTON: - X: 20 - Y: 455 + 2 * HEIGHT - Width: 190 - Height: 25 - Text: button-missionbrowser-panel-start-info-video - Font: Bold - Button@STOP_INFO_VIDEO_BUTTON: - X: 20 - Y: 455 + 3 * HEIGHT - Width: 190 - Height: 25 - Text: button-missionbrowser-panel-stop-info-video - Font: Bold Container@MISSION_INFO: X: 220 Y: 50 - Width: 642 - Height: 800 + Width: PARENT_RIGHT - 240 + Height: 483 Children: Background@MISSION_BG: Width: PARENT_RIGHT - Height: 327 + Height: 225 Background: dialog3 Children: MapPreview@MISSION_PREVIEW: @@ -89,14 +61,29 @@ Background@MISSIONBROWSER_PANEL: IgnoreMouseOver: True IgnoreMouseInput: True ShowSpawnPoints: False - Container@MISSION_DETAIL: - Y: 337 + Container@MISSION_TABS: Width: PARENT_RIGHT - Height: 146 + Y: PARENT_BOTTOM - 31 + Children: + Button@MISSIONINFO_TAB: + Width: PARENT_RIGHT / 2 + Height: 31 + Font: Bold + Text: button-missionbrowser-panel-mission-info + Button@OPTIONS_TAB: + X: PARENT_RIGHT / 2 + Width: PARENT_RIGHT / 2 + Height: 31 + Font: Bold + Text: button-missionbrowser-panel-mission-options + Container@MISSION_DETAIL: + Y: 235 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM - 235 Children: ScrollPanel@MISSION_DESCRIPTION_PANEL: - Height: PARENT_BOTTOM Width: PARENT_RIGHT + Height: PARENT_BOTTOM - 30 TopBottomSpacing: 5 Children: Label@MISSION_DESCRIPTION: @@ -105,8 +92,8 @@ Background@MISSIONBROWSER_PANEL: VAlign: Top Font: Small ScrollPanel@MISSION_OPTIONS: - Height: PARENT_BOTTOM Width: PARENT_RIGHT + Height: PARENT_BOTTOM - 30 TopBottomSpacing: 5 Children: Container@CHECKBOX_ROW_TEMPLATE: @@ -141,6 +128,7 @@ Background@MISSIONBROWSER_PANEL: Y: 25 Height: 25 Visible: False + PanelRoot: MISSION_DROPDOWN_PANEL_ROOT TooltipContainer: TOOLTIP_CONTAINER LabelForInput@B_DESC: X: PARENT_RIGHT / 2 + 5 @@ -154,25 +142,36 @@ Background@MISSIONBROWSER_PANEL: Y: 25 Height: 25 Visible: False + PanelRoot: MISSION_DROPDOWN_PANEL_ROOT TooltipContainer: TOOLTIP_CONTAINER - Container@MISSION_TABS: - Width: 320 - X: 220 - Y: PARENT_BOTTOM - 84 - Children: - Button@MISSIONINFO_TAB: - Width: PARENT_RIGHT / 2 - Y: 25 - Height: 28 - Font: Bold - Text: button-missionbrowser-panel-mission-info - Button@OPTIONS_TAB: - X: PARENT_RIGHT / 2 - Width: PARENT_RIGHT / 2 - Y: 25 - Height: 28 - Font: Bold - Text: button-missionbrowser-panel-mission-options + Button@START_BRIEFING_VIDEO_BUTTON: + X: 20 + Y: PARENT_BOTTOM - 45 + Width: 130 + Height: 25 + Text: button-missionbrowser-panel-start-briefing-video + Font: Bold + Button@STOP_BRIEFING_VIDEO_BUTTON: + X: 20 + Y: PARENT_BOTTOM - 45 + Width: 130 + Height: 25 + Text: button-missionbrowser-panel-stop-briefing-video + Font: Bold + Button@START_INFO_VIDEO_BUTTON: + X: 160 + Y: PARENT_BOTTOM - 45 + Width: 130 + Height: 25 + Text: button-missionbrowser-panel-start-info-video + Font: Bold + Button@STOP_INFO_VIDEO_BUTTON: + X: 160 + Y: PARENT_BOTTOM - 45 + Width: 130 + Height: 25 + Text: button-missionbrowser-panel-stop-info-video + Font: Bold Button@STARTGAME_BUTTON: X: PARENT_RIGHT - 140 - 130 Y: PARENT_BOTTOM - 45 @@ -189,7 +188,7 @@ Background@MISSIONBROWSER_PANEL: Font: Bold Key: escape Background@MISSION_BIN: - X: 220 + X: 20 Y: 50 Width: 642 Height: 483 @@ -202,6 +201,7 @@ Background@MISSIONBROWSER_PANEL: Height: 480 AspectRatio: 1.2 DrawOverlay: False + Container@MISSION_DROPDOWN_PANEL_ROOT: TooltipContainer@TOOLTIP_CONTAINER: Background@FULLSCREEN_PLAYER: