From 9f723be65af0c5c2e51e63b523300dd9d216cf11 Mon Sep 17 00:00:00 2001 From: Ivaylo Draganov Date: Fri, 29 Apr 2022 15:04:58 +0300 Subject: [PATCH] Add checkbox to settings for toggling transient notifications --- .../Logic/Settings/DisplaySettingsLogic.cs | 7 +++++ mods/cnc/chrome/settings-display.yaml | 15 +++++++-- mods/common/chrome/settings-display.yaml | 31 +++++++++++++------ 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs index 954ab95bef..b01d1e216e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs @@ -289,6 +289,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic feedbackCheckbox.IsChecked = () => gs.TextNotificationPoolFilters.HasFlag(TextNotificationPoolFilters.Feedback); feedbackCheckbox.OnClick = () => toggleFilterFlag(TextNotificationPoolFilters.Feedback); } + + var transientsCheckbox = panel.GetOrNull("TRANSIENTS_CHECKBOX"); + if (transientsCheckbox != null) + { + transientsCheckbox.IsChecked = () => gs.TextNotificationPoolFilters.HasFlag(TextNotificationPoolFilters.Transients); + transientsCheckbox.OnClick = () => toggleFilterFlag(TextNotificationPoolFilters.Transients); + } } static void ShowStatusBarsDropdown(DropDownButtonWidget dropdown, GameSettings s) diff --git a/mods/cnc/chrome/settings-display.yaml b/mods/cnc/chrome/settings-display.yaml index c4a603e791..590028c643 100644 --- a/mods/cnc/chrome/settings-display.yaml +++ b/mods/cnc/chrome/settings-display.yaml @@ -163,14 +163,23 @@ Container@DISPLAY_PANEL: Height: 20 Children: Container@UI_FEEDBACK_CHECKBOX_CONTAINER: - X: PARENT_RIGHT / 2 + 10 - Width: PARENT_RIGHT / 2 - 20 + X: 10 + Width: PARENT_RIGHT / 2 - 10 Children: Checkbox@UI_FEEDBACK_CHECKBOX: Width: PARENT_RIGHT Height: 20 Font: Regular - Text: UI Feedback in Transients Panel + Text: Show UI Feedback Notifications + Container@TRANSIENTS_CHECKBOX_CONTAINER: + X: PARENT_RIGHT / 2 + 10 + Width: PARENT_RIGHT / 2 - 20 + Children: + Checkbox@TRANSIENTS_CHECKBOX: + Width: PARENT_RIGHT + Height: 20 + Font: Regular + Text: Show Game Event Notifications Container@SPACER: Background@SECTION_HEADER: X: 5 diff --git a/mods/common/chrome/settings-display.yaml b/mods/common/chrome/settings-display.yaml index f94f0da430..8f4b686505 100644 --- a/mods/common/chrome/settings-display.yaml +++ b/mods/common/chrome/settings-display.yaml @@ -158,6 +158,28 @@ Container@DISPLAY_PANEL: Height: 20 Font: Regular Text: Player Stance Colors + Container@ROW: + Width: PARENT_RIGHT - 24 + Height: 20 + Children: + Container@UI_FEEDBACK_CHECKBOX_CONTAINER: + X: 10 + Width: PARENT_RIGHT / 2 - 10 + Children: + Checkbox@UI_FEEDBACK_CHECKBOX: + Width: PARENT_RIGHT + Height: 20 + Font: Regular + Text: Show UI Feedback Notifications + Container@TRANSIENTS_CHECKBOX_CONTAINER: + X: PARENT_RIGHT / 2 + 10 + Width: PARENT_RIGHT / 2 - 20 + Children: + Checkbox@TRANSIENTS_CHECKBOX: + Width: PARENT_RIGHT + Height: 20 + Font: Regular + Text: Show Game Event Notifications Container@ROW: Width: PARENT_RIGHT - 24 Height: 20 @@ -171,15 +193,6 @@ Container@DISPLAY_PANEL: Height: 20 Font: Regular Text: Pause Menu Background - Container@UI_FEEDBACK_CHECKBOX_CONTAINER: - X: PARENT_RIGHT / 2 + 10 - Width: PARENT_RIGHT / 2 - 20 - Children: - Checkbox@UI_FEEDBACK_CHECKBOX: - Width: PARENT_RIGHT - Height: 20 - Font: Regular - Text: UI Feedback in Transients Panel Container@SPACER: Background@SECTION_HEADER: X: 5