diff --git a/OpenRA.Mods.Common/Widgets/HotkeyEntryWidget.cs b/OpenRA.Mods.Common/Widgets/HotkeyEntryWidget.cs index 1174f3e8c778..93b706ecc253 100644 --- a/OpenRA.Mods.Common/Widgets/HotkeyEntryWidget.cs +++ b/OpenRA.Mods.Common/Widgets/HotkeyEntryWidget.cs @@ -24,10 +24,7 @@ public class HotkeyEntryWidget : Widget public int LeftMargin = 5; public int RightMargin = 5; - public Action OnTakeFocus = () => { }; public Action OnLoseFocus = () => { }; - public Action OnEscape = () => { }; - public Action OnReturn = () => { }; public Func IsDisabled = () => false; public Func IsValid = () => false; @@ -49,7 +46,6 @@ protected HotkeyEntryWidget(HotkeyEntryWidget widget) public override bool TakeKeyboardFocus() { - OnTakeFocus(); return base.TakeKeyboardFocus(); } @@ -62,6 +58,12 @@ public override bool YieldKeyboardFocus() return base.YieldKeyboardFocus(); } + public bool ForceYieldKeyboardFocus() + { + OnLoseFocus(); + return base.YieldKeyboardFocus(); + } + public override bool HandleMouseInput(MouseInput mi) { if (IsDisabled()) @@ -95,15 +97,9 @@ public override bool HandleKeyPress(KeyInput e) if (!HasKeyboardFocus || IgnoreKeys.Contains(e.Key)) return false; - if (e.Key != Keycode.ESCAPE && e.Key != Keycode.RETURN) + if (e.Key != Keycode.ESCAPE && e.Key != Keycode.RETURN && e.Key != Keycode.KP_ENTER) Key = Hotkey.FromKeyInput(e); - if (e.Key == Keycode.ESCAPE) - OnEscape(); - - if (e.Key == Keycode.RETURN) - OnReturn(); - YieldKeyboardFocus(); return true; diff --git a/OpenRA.Mods.Common/Widgets/Logic/HotkeyDialogLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/HotkeyDialogLogic.cs deleted file mode 100644 index 76f17c2a51a9..000000000000 --- a/OpenRA.Mods.Common/Widgets/Logic/HotkeyDialogLogic.cs +++ /dev/null @@ -1,149 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2019 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 OpenRA.Primitives; -using OpenRA.Widgets; - -namespace OpenRA.Mods.Common.Widgets.Logic -{ - public class HotkeyDialogLogic : ChromeLogic - { - readonly Widget panel; - readonly ButtonWidget resetButton, clearButton, cancelButton; - readonly LabelWidget duplicateNotice, defaultNotice, originalNotice; - readonly Action onSave; - readonly HotkeyDefinition definition; - readonly HotkeyManager manager; - readonly HotkeyEntryWidget hotkeyEntry; - readonly bool isFirstValidation = true; - Hotkey currentHotkey; - HotkeyDefinition duplicateHotkey; - bool isValid = false; - bool isValidating = false; - - [ObjectCreator.UseCtor] - public HotkeyDialogLogic(Widget widget, Action onSave, HotkeyDefinition hotkeyDefinition, HotkeyManager hotkeyManager) - { - panel = widget; - this.onSave = onSave; - definition = hotkeyDefinition; - manager = hotkeyManager; - currentHotkey = manager[definition.Name].GetValue(); - hotkeyEntry = panel.Get("HOTKEY_ENTRY"); - resetButton = panel.Get("RESET_BUTTON"); - clearButton = panel.Get("CLEAR_BUTTON"); - cancelButton = panel.Get("CANCEL_BUTTON"); - duplicateNotice = panel.Get("DUPLICATE_NOTICE"); - defaultNotice = panel.Get("DEFAULT_NOTICE"); - originalNotice = panel.Get("ORIGINAL_NOTICE"); - - panel.Get("HOTKEY_LABEL").GetText = () => hotkeyDefinition.Description + ":"; - - duplicateNotice.TextColor = ChromeMetrics.Get("NoticeErrorColor"); - duplicateNotice.GetText = () => - { - return (duplicateHotkey != null) ? duplicateNotice.Text.F(duplicateHotkey.Description) : duplicateNotice.Text; - }; - defaultNotice.TextColor = ChromeMetrics.Get("NoticeInfoColor"); - originalNotice.TextColor = ChromeMetrics.Get("NoticeInfoColor"); - originalNotice.Text = originalNotice.Text.F(hotkeyDefinition.Default.DisplayString()); - - resetButton.OnClick = Reset; - clearButton.OnClick = Clear; - cancelButton.OnClick = Cancel; - - hotkeyEntry.Key = currentHotkey; - hotkeyEntry.IsValid = () => isValid; - hotkeyEntry.OnTakeFocus = OnHotkeyEntryTakeFocus; - hotkeyEntry.OnLoseFocus = OnHotkeyEntryLoseFocus; - hotkeyEntry.OnEscape = Cancel; - hotkeyEntry.OnReturn = Cancel; - hotkeyEntry.TakeKeyboardFocus(); - - Validate(); - isFirstValidation = false; - } - - void OnHotkeyEntryTakeFocus() - { - cancelButton.Disabled = manager.GetFirstDuplicate(definition.Name, currentHotkey, definition) != null; - } - - void OnHotkeyEntryLoseFocus() - { - cancelButton.Disabled = true; - if (!isValidating) - Validate(); - } - - void Validate() - { - isValidating = true; - - duplicateHotkey = manager.GetFirstDuplicate(definition.Name, hotkeyEntry.Key, definition); - isValid = duplicateHotkey == null; - - duplicateNotice.Visible = !isValid; - clearButton.Disabled = !hotkeyEntry.Key.IsValid(); - - if (hotkeyEntry.Key == definition.Default || (!hotkeyEntry.Key.IsValid() && !definition.Default.IsValid())) - { - defaultNotice.Visible = !duplicateNotice.Visible; - originalNotice.Visible = false; - resetButton.Disabled = true; - } - else - { - defaultNotice.Visible = false; - originalNotice.Visible = !duplicateNotice.Visible; - resetButton.Disabled = false; - } - - if (isValid && !isFirstValidation) - { - currentHotkey = hotkeyEntry.Key; - hotkeyEntry.YieldKeyboardFocus(); - Save(); - } - else - hotkeyEntry.TakeKeyboardFocus(); - - isValidating = false; - } - - void Save() - { - manager.Set(definition.Name, hotkeyEntry.Key); - Game.Settings.Save(); - onSave(); - } - - void Cancel() - { - cancelButton.Disabled = true; - hotkeyEntry.Key = currentHotkey; - Validate(); - } - - void Reset() - { - hotkeyEntry.Key = definition.Default; - Validate(); - } - - void Clear() - { - hotkeyEntry.Key = Hotkey.Invalid; - Validate(); - } - } -} diff --git a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs index bc914ffce6cf..748dbc1d4249 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs @@ -39,6 +39,12 @@ enum PanelType { Display, Audio, Input, Hotkeys, Advanced } SoundDevice soundDevice; PanelType settingsPanel = PanelType.Display; + ButtonWidget selectedHotkeyButton; + HotkeyEntryWidget hotkeyEntryWidget; + HotkeyDefinition duplicateHotkeyDefinition, selectedHotkeyDefinition; + bool isHotkeyValid; + bool isHotkeyDefault; + static SettingsLogic() { var original = Game.Settings; @@ -125,7 +131,7 @@ static void BindSliderPref(Widget parent, string id, object group, string pref) ss.OnChange += x => field.SetValue(group, x); } - static void BindHotkeyPref(HotkeyDefinition hd, HotkeyManager manager, Widget template, Widget parent, Widget remapDialogRoot, Widget remapDialogPlaceholder) + void BindHotkeyPref(HotkeyDefinition hd, Widget template, Widget parent) { var key = template.Clone() as Widget; key.Id = hd.Name; @@ -134,50 +140,34 @@ static void BindHotkeyPref(HotkeyDefinition hd, HotkeyManager manager, Widget te key.Get("FUNCTION").GetText = () => hd.Description + ":"; var remapButton = key.Get("HOTKEY"); - WidgetUtils.TruncateButtonToTooltip(remapButton, manager[hd.Name].GetValue().DisplayString()); - - if (manager.GetFirstDuplicate(hd.Name, manager[hd.Name].GetValue(), hd) != null) - remapButton.GetColor = () => ChromeMetrics.Get("HotkeyColorInvalid"); - - remapButton.OnClick = () => - { - remapDialogRoot.RemoveChildren(); - - if (remapButton.IsHighlighted()) - { - remapButton.IsHighlighted = () => false; - - if (remapDialogPlaceholder != null) - remapDialogPlaceholder.Visible = true; + WidgetUtils.TruncateButtonToTooltip(remapButton, modData.Hotkeys[hd.Name].GetValue().DisplayString()); - return; - } + remapButton.IsHighlighted = () => selectedHotkeyDefinition == hd; - if (remapDialogPlaceholder != null) - remapDialogPlaceholder.Visible = false; + var hotkeyValidColor = ChromeMetrics.Get("HotkeyColor"); + var hotkeyInvalidColor = ChromeMetrics.Get("HotkeyColorInvalid"); - var siblings = parent.Children; - foreach (var sibling in siblings) - { - var button = sibling.GetOrNull("HOTKEY"); - if (button != null) - button.IsHighlighted = () => false; - } + remapButton.GetColor = () => + { + return modData.Hotkeys.GetFirstDuplicate(hd.Name, modData.Hotkeys[hd.Name].GetValue(), hd) != null ? + hotkeyInvalidColor : + hotkeyValidColor; + }; - remapButton.IsHighlighted = () => true; + if (selectedHotkeyDefinition == hd) + { + selectedHotkeyButton = remapButton; + hotkeyEntryWidget.Key = modData.Hotkeys[hd.Name].GetValue(); + ValidateHotkey(); + } - Ui.LoadWidget("HOTKEY_DIALOG", remapDialogRoot, new WidgetArgs - { - { - "onSave", () => - { - WidgetUtils.TruncateButtonToTooltip(remapButton, manager[hd.Name].GetValue().DisplayString()); - remapButton.GetColor = () => ChromeMetrics.Get("ButtonTextColor"); - } - }, - { "hotkeyDefinition", hd }, - { "hotkeyManager", manager }, - }); + remapButton.OnClick = () => + { + selectedHotkeyDefinition = hd; + selectedHotkeyButton = remapButton; + hotkeyEntryWidget.Key = modData.Hotkeys[hd.Name].GetValue(); + ValidateHotkey(); + hotkeyEntryWidget.TakeKeyboardFocus(); }; parent.AddChild(key); @@ -463,6 +453,7 @@ Action InitInputPanel(Widget panel) Action InitHotkeysPanel(Widget panel) { + var hotkeyDialogRoot = panel.Get("HOTKEY_DIALOG_ROOT"); var hotkeyList = panel.Get("HOTKEY_LIST"); hotkeyList.Layout = new GridLayout(hotkeyList); var hotkeyHeader = hotkeyList.Get("HEADER"); @@ -475,6 +466,8 @@ Action InitHotkeysPanel(Widget panel) MiniYaml hotkeyGroups; if (logicArgs.TryGetValue("HotkeyGroups", out hotkeyGroups)) { + InitHotkeyRemapDialog(panel); + foreach (var hg in hotkeyGroups.Nodes) { var templateNode = hg.Value.Nodes.FirstOrDefault(n => n.Key == "Template"); @@ -489,16 +482,28 @@ Action InitHotkeysPanel(Widget panel) var types = FieldLoader.GetValue("Types", typesNode.Value.Value); var added = new HashSet(); var template = templates.Get(templateNode.Value.Value); - var remapDialogRoot = panel.Get("HOTKEY_DIALOG_ROOT"); - var remapDialogPlaceholder = panel.GetOrNull("HOTKEY_DIALOG_PLACEHOLDER"); + foreach (var t in types) + { foreach (var hd in modData.Hotkeys.Definitions.Where(k => k.Types.Contains(t))) + { if (added.Add(hd)) - BindHotkeyPref(hd, modData.Hotkeys, template, hotkeyList, remapDialogRoot, remapDialogPlaceholder); + { + if (selectedHotkeyDefinition == null) + selectedHotkeyDefinition = hd; + + BindHotkeyPref(hd, template, hotkeyList); + } + } + } } } - return () => { }; + return () => + { + hotkeyEntryWidget.Key = modData.Hotkeys[selectedHotkeyDefinition.Name].GetValue(); + hotkeyEntryWidget.ForceYieldKeyboardFocus(); + }; } Action ResetInputPanel(Widget panel) @@ -532,7 +537,7 @@ Action ResetHotkeysPanel(Widget panel) foreach (var hd in modData.Hotkeys.Definitions) { modData.Hotkeys.Set(hd.Name, hd.Default); - panel.Get(hd.Name).Get("HOTKEY").Key = hd.Default; + WidgetUtils.TruncateButtonToTooltip(panel.Get(hd.Name).Get("HOTKEY"), hd.Default.DisplayString()); } }; } @@ -745,5 +750,68 @@ void MakeMouseFocusSettingsLive() else Game.Renderer.ReleaseWindowMouseFocus(); } + + void InitHotkeyRemapDialog(Widget panel) + { + var label = new CachedTransform(hd => hd.Description + ":"); + panel.Get("HOTKEY_LABEL").GetText = () => label.Update(selectedHotkeyDefinition); + + var duplicateNotice = panel.Get("DUPLICATE_NOTICE"); + duplicateNotice.TextColor = ChromeMetrics.Get("NoticeErrorColor"); + duplicateNotice.IsVisible = () => !isHotkeyValid; + var duplicateNoticeText = new CachedTransform(hd => hd != null ? duplicateNotice.Text.F(hd.Description) : duplicateNotice.Text); + duplicateNotice.GetText = () => duplicateNoticeText.Update(duplicateHotkeyDefinition); + + var defaultNotice = panel.Get("DEFAULT_NOTICE"); + defaultNotice.TextColor = ChromeMetrics.Get("NoticeInfoColor"); + defaultNotice.IsVisible = () => isHotkeyValid && isHotkeyDefault; + + var originalNotice = panel.Get("ORIGINAL_NOTICE"); + originalNotice.TextColor = ChromeMetrics.Get("NoticeInfoColor"); + originalNotice.IsVisible = () => isHotkeyValid && !isHotkeyDefault; + var originalNoticeText = new CachedTransform(hd => originalNotice.Text.F(hd.Default.DisplayString())); + originalNotice.GetText = () => originalNoticeText.Update(selectedHotkeyDefinition); + + var resetButton = panel.Get("RESET_HOTKEY_BUTTON"); + resetButton.IsDisabled = () => isHotkeyDefault; + resetButton.OnClick = ResetHotkey; + + var clearButton = panel.Get("CLEAR_HOTKEY_BUTTON"); + clearButton.IsDisabled = () => !hotkeyEntryWidget.Key.IsValid(); + clearButton.OnClick = ClearHotkey; + + hotkeyEntryWidget = panel.Get("HOTKEY_ENTRY"); + hotkeyEntryWidget.IsValid = () => isHotkeyValid; + hotkeyEntryWidget.OnLoseFocus = ValidateHotkey; + } + + void ValidateHotkey() + { + duplicateHotkeyDefinition = modData.Hotkeys.GetFirstDuplicate(selectedHotkeyDefinition.Name, hotkeyEntryWidget.Key, selectedHotkeyDefinition); + isHotkeyValid = duplicateHotkeyDefinition == null; + isHotkeyDefault = hotkeyEntryWidget.Key == selectedHotkeyDefinition.Default || (!hotkeyEntryWidget.Key.IsValid() && !selectedHotkeyDefinition.Default.IsValid()); + + if (isHotkeyValid) + SaveHotkey(); + } + + void SaveHotkey() + { + WidgetUtils.TruncateButtonToTooltip(selectedHotkeyButton, hotkeyEntryWidget.Key.DisplayString()); + modData.Hotkeys.Set(selectedHotkeyDefinition.Name, hotkeyEntryWidget.Key); + Game.Settings.Save(); + } + + void ResetHotkey() + { + hotkeyEntryWidget.Key = selectedHotkeyDefinition.Default; + hotkeyEntryWidget.YieldKeyboardFocus(); + } + + void ClearHotkey() + { + hotkeyEntryWidget.Key = Hotkey.Invalid; + hotkeyEntryWidget.YieldKeyboardFocus(); + } } } diff --git a/mods/cnc/chrome/dialog-hotkey.yaml b/mods/cnc/chrome/dialog-hotkey.yaml deleted file mode 100644 index 655db94a04e2..000000000000 --- a/mods/cnc/chrome/dialog-hotkey.yaml +++ /dev/null @@ -1,83 +0,0 @@ -Background@HOTKEY_DIALOG: - Logic: HotkeyDialogLogic - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Background: panel-gray - Children: - Label@HOTKEY_LABEL: - X: 15 - Y: 14 - Width: PARENT_RIGHT - 40 - Height: 25 - Font: Bold - HotkeyEntry@HOTKEY_ENTRY: - X: 15 - Y: 40 - Width: 382 - Height: 25 - Container@NOTICES: - X: 15 - Y: 65 - Width: PARENT_RIGHT - 40 - Height: 25 - Children: - Label@DEFAULT_NOTICE: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Font: Tiny - Align: Left - Text: This is the default hotkey. - Label@ORIGINAL_NOTICE: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Font: Tiny - Align: Left - Text: The default is "{0}" - Label@DUPLICATE_NOTICE: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Font: Tiny - Align: Left - Text: This hotkey is already used for "{0}" - Button@CLEAR_BUTTON: - X: PARENT_RIGHT - 65 - 15 - 2 * (WIDTH + 10) - Y: 40 - Width: 25 - Height: 25 - TooltipText: Unbind the hotkey - TooltipContainer: TOOLTIP_CONTAINER - TooltipTemplate: SIMPLE_TOOLTIP - Children: - Image: - ImageCollection: lobby-bits - ImageName: kick - X: 7 - Y: 8 - IgnoreMouseOver: True - Button@RESET_BUTTON: - X: PARENT_RIGHT - 65 - 15 - WIDTH - 10 - Y: 40 - Width: 25 - Height: 25 - TooltipText: Reset to default - TooltipContainer: TOOLTIP_CONTAINER - TooltipTemplate: SIMPLE_TOOLTIP - Children: - Image@IMAGE_RELOAD: - X: 5 - Y: 5 - Width: 16 - Height: 16 - ImageCollection: reload-icon - ImageName: enabled - IgnoreMouseOver: True - Button@CANCEL_BUTTON: - X: PARENT_RIGHT - WIDTH - 15 - Y: 40 - Width: 65 - Height: 25 - Text: Cancel - TooltipText: Cancel the operation - TooltipContainer: TOOLTIP_CONTAINER - TooltipTemplate: SIMPLE_TOOLTIP - TooltipContainer@TOOLTIP_CONTAINER: diff --git a/mods/cnc/chrome/settings.yaml b/mods/cnc/chrome/settings.yaml index c17d16f818eb..f5e9d09abfa3 100644 --- a/mods/cnc/chrome/settings.yaml +++ b/mods/cnc/chrome/settings.yaml @@ -480,7 +480,7 @@ Container@SETTINGS_PANEL: Width: PARENT_RIGHT - 15 TopBottomSpacing: 4 ItemSpacing: 4 - Height: 210 + Height: 242 Children: ScrollItem@HEADER: Width: 528 @@ -526,23 +526,80 @@ Container@SETTINGS_PANEL: Height: 25 Align: Left TooltipContainer: TOOLTIP_CONTAINER - Background@HOTKEY_DIALOG_PLACEHOLDER: - Y: 225 + Background@HOTKEY_DIALOG_ROOT: + Y: 255 Width: PARENT_RIGHT - 15 - Height: 105 + Height: 75 Background: panel-gray Children: - Label@HOTKEY_DIALOG_HELPTEXT: - Y: PARENT_BOTTOM / 2 - 12 - Width: PARENT_RIGHT + Label@HOTKEY_LABEL: + X: 15 + Y: 14 + Width: 220 - 15 - 10 Height: 25 - Font: Tiny - Align: Center - Text: Click on a hotkey to start rebinding - Container@HOTKEY_DIALOG_ROOT: - Y: 225 - Width: PARENT_RIGHT - 15 - Height: 105 + Font: Bold + Align: Right + HotkeyEntry@HOTKEY_ENTRY: + X: 220 + Y: 15 + Width: 254 + Height: 25 + Container@NOTICES: + X: 220 + Y: 40 + Width: 254 + Height: 25 + Children: + Label@DEFAULT_NOTICE: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Font: Tiny + Align: Left + Text: This is the default + Label@ORIGINAL_NOTICE: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Font: Tiny + Align: Left + Text: The default is "{0}" + Label@DUPLICATE_NOTICE: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Font: Tiny + Align: Left + Text: This is already used for "{0}" + Button@CLEAR_HOTKEY_BUTTON: + X: PARENT_RIGHT - 25 - 15 - WIDTH - 10 + Y: 15 + Width: 25 + Height: 25 + TooltipText: Unbind the hotkey + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP + Children: + Image: + ImageCollection: lobby-bits + ImageName: kick + X: 7 + Y: 8 + IgnoreMouseOver: True + Button@RESET_HOTKEY_BUTTON: + X: PARENT_RIGHT - WIDTH - 15 + Y: 15 + Width: 25 + Height: 25 + TooltipText: Reset to default + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP + Children: + Image@IMAGE_RELOAD: + X: 5 + Y: 5 + Width: 16 + Height: 16 + ImageCollection: reload-icon + ImageName: enabled + IgnoreMouseOver: True Container@ADVANCED_PANEL: Width: PARENT_RIGHT Height: PARENT_BOTTOM diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 5023dcf8d570..ec37281b08c5 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -128,7 +128,6 @@ ChromeLayout: cnc|chrome/assetbrowser.yaml cnc|chrome/missionbrowser.yaml cnc|chrome/editor.yaml - cnc|chrome/dialog-hotkey.yaml Voices: cnc|audio/voices.yaml diff --git a/mods/common/chrome/dialog-hotkey.yaml b/mods/common/chrome/dialog-hotkey.yaml deleted file mode 100644 index 49371f32fa27..000000000000 --- a/mods/common/chrome/dialog-hotkey.yaml +++ /dev/null @@ -1,69 +0,0 @@ -Background@HOTKEY_DIALOG: - Logic: HotkeyDialogLogic - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Background: dialog3 - Children: - Label@HOTKEY_LABEL: - X: 20 - Y: 14 - Width: PARENT_RIGHT - 40 - Height: 25 - Font: Bold - HotkeyEntry@HOTKEY_ENTRY: - X: 20 - Y: 40 - Width: 280 - Height: 25 - Container@NOTICES: - X: 20 - Y: 65 - Width: PARENT_RIGHT - 40 - Height: 25 - Children: - Label@DEFAULT_NOTICE: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Font: Tiny - Align: Left - Text: This is the default - Label@ORIGINAL_NOTICE: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Font: Tiny - Align: Left - Text: The default is "{0}" - Label@DUPLICATE_NOTICE: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Font: Tiny - Align: Left - Text: This hotkey is already used for "{0}" - Button@CLEAR_BUTTON: - X: PARENT_RIGHT - 3 * WIDTH - 40 - Y: 41 - Width: 65 - Height: 25 - Text: Clear - TooltipText: Unbind the hotkey - TooltipContainer: TOOLTIP_CONTAINER - TooltipTemplate: SIMPLE_TOOLTIP - Button@RESET_BUTTON: - X: PARENT_RIGHT - 2 * WIDTH - 30 - Y: 41 - Width: 65 - Height: 25 - Text: Reset - TooltipText: Reset to default - TooltipContainer: TOOLTIP_CONTAINER - TooltipTemplate: SIMPLE_TOOLTIP - Button@CANCEL_BUTTON: - X: PARENT_RIGHT - WIDTH - 20 - Y: 41 - Width: 65 - Height: 25 - Text: Cancel - TooltipText: Cancel the operation - TooltipContainer: TOOLTIP_CONTAINER - TooltipTemplate: SIMPLE_TOOLTIP - TooltipContainer@TOOLTIP_CONTAINER: diff --git a/mods/common/chrome/settings.yaml b/mods/common/chrome/settings.yaml index a3df32821d03..bb12c8c39d83 100644 --- a/mods/common/chrome/settings.yaml +++ b/mods/common/chrome/settings.yaml @@ -482,7 +482,7 @@ Background@SETTINGS_PANEL: Width: PARENT_RIGHT - 30 TopBottomSpacing: 4 ItemSpacing: 4 - Height: 183 + Height: 222 Children: ScrollItem@HEADER: BaseName: scrollheader @@ -539,25 +539,69 @@ Background@SETTINGS_PANEL: Height: 25 Align: Left TooltipContainer: TOOLTIP_CONTAINER - Background@HOTKEY_DIALOG_PLACEHOLDER: + Background@HOTKEY_DIALOG_ROOT: X: 15 - Y: 232 + Y: 270 Width: PARENT_RIGHT - 30 - Height: 108 + Height: 73 Background: dialog3 Children: - Label@HOTKEY_DIALOG_HELPTEXT: - Y: PARENT_BOTTOM / 2 - 12 - Width: PARENT_RIGHT + Label@HOTKEY_LABEL: + X: 15 + Y: 19 + Width: 219 - 15 - 10 Height: 25 - Font: Tiny - Align: Center - Text: Click on a hotkey to start rebinding - Container@HOTKEY_DIALOG_ROOT: - X: 15 - Y: 232 - Width: PARENT_RIGHT - 30 - Height: 108 + Font: Bold + Align: Right + HotkeyEntry@HOTKEY_ENTRY: + X: 219 + Y: 20 + Width: 170 + Height: 25 + Container@NOTICES: + X: 219 + Y: 42 + Width: 170 + Height: 25 + Children: + Label@DEFAULT_NOTICE: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Font: Tiny + Align: Left + Text: This is the default + Label@ORIGINAL_NOTICE: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Font: Tiny + Align: Left + Text: The default is "{0}" + Label@DUPLICATE_NOTICE: + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Font: Tiny + Align: Left + Text: This is already used for "{0}" + Button@CLEAR_HOTKEY_BUTTON: + X: PARENT_RIGHT - 2 * WIDTH - 30 + Y: 20 + Width: 65 + Height: 25 + Text: Clear + Font: Bold + TooltipText: Unbind the hotkey + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP + Button@RESET_HOTKEY_BUTTON: + X: PARENT_RIGHT - WIDTH - 20 + Y: 20 + Width: 65 + Height: 25 + Text: Reset + Font: Bold + TooltipText: Reset to default + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP Container@ADVANCED_PANEL: X: 5 Y: 50 diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 745e46a12415..8cddaab406d9 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -109,7 +109,6 @@ ChromeLayout: common|chrome/replaybrowser.yaml common|chrome/gamesave-browser.yaml common|chrome/gamesave-loading.yaml - common|chrome/dialog-hotkey.yaml Weapons: d2k|weapons/debris.yaml diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 46575b8321cd..3678dc0377f8 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -124,7 +124,6 @@ ChromeLayout: common|chrome/confirmation-dialogs.yaml common|chrome/editor.yaml common|chrome/playerprofile.yaml - common|chrome/dialog-hotkey.yaml Weapons: ra|weapons/explosions.yaml diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index fb3dc9b75d78..cc48d95a5521 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -172,7 +172,6 @@ ChromeLayout: common|chrome/missionbrowser.yaml common|chrome/confirmation-dialogs.yaml common|chrome/editor.yaml - common|chrome/dialog-hotkey.yaml Voices: ts|audio/voices.yaml