Add hotkey settings panel with a hotkey remap dialog

* Add HotkeyDialogLogic.cs
* Add dialog-hotkey.yaml to all mods
* Add `GetFirstDuplicate` method to HotkeyManager to aid in validation
* Add "Player" and/or "Spectator" type to all hotkeys to allow for
validation based on overlapping types
* Change settings.yaml and SettingsLogic.cs to work with the new dialog
This commit is contained in:
Ivaylo Draganov
2019-05-10 13:51:23 +03:00
committed by abcdefg30
parent 9783fdaf78
commit c9ff54bfd5
23 changed files with 619 additions and 156 deletions

View File

@@ -0,0 +1,69 @@
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:

View File

@@ -58,25 +58,31 @@ Background@SETTINGS_PANEL:
Height: 25
Children:
Button@DISPLAY_TAB:
X: 115
X: 70
Width: 90
Height: 25
Text: Display
Font: Bold
Button@AUDIO_TAB:
X: 205
X: 70 + WIDTH
Width: 90
Height: 25
Text: Audio
Font: Bold
Button@INPUT_TAB:
X: 295
X: 70 + 2 * WIDTH
Width: 90
Height: 25
Text: Input
Font: Bold
Button@HOTKEYS_TAB:
X: 70 + 3 * WIDTH
Width: 90
Height: 25
Text: Hotkeys
Font: Bold
Button@ADVANCED_TAB:
X: 385
X: 70 + 4 * WIDTH
Width: 90
Height: 25
Text: Advanced
@@ -457,19 +463,19 @@ Background@SETTINGS_PANEL:
Ticks: 5
MinimumValue: 1
MaximumValue: 100
Label@HOTKEYS_TITLE:
Y: 165
Width: PARENT_RIGHT
Font: Bold
Text: Hotkeys
Align: Center
Container@HOTKEYS_PANEL:
X: 5
Y: 50
Width: PARENT_RIGHT - 10
Height: PARENT_BOTTOM
Children:
ScrollPanel@HOTKEY_LIST:
X: 15
Y: 185
Width: 560
Y: 40
Width: PARENT_RIGHT - 30
TopBottomSpacing: 4
ItemSpacing: 4
Height: 160
Height: 183
Children:
ScrollItem@HEADER:
BaseName: scrollheader
@@ -504,10 +510,12 @@ Background@SETTINGS_PANEL:
Width: PARENT_RIGHT - 85
Height: 25
Align: Right
HotkeyEntry@HOTKEY:
Button@HOTKEY:
X: PARENT_RIGHT - WIDTH
Width: 80
Height: 25
Align: Left
TooltipContainer: TOOLTIP_CONTAINER
Container@THREE_COLUMN:
Width: 173
Height: 25
@@ -518,10 +526,31 @@ Background@SETTINGS_PANEL:
Width: PARENT_RIGHT - 84
Height: 25
Align: Right
HotkeyEntry@HOTKEY:
Button@HOTKEY:
X: PARENT_RIGHT - WIDTH + 1
Width: 80
Height: 25
Align: Left
TooltipContainer: TOOLTIP_CONTAINER
Background@HOTKEY_DIALOG_PLACEHOLDER:
X: 15
Y: 232
Width: PARENT_RIGHT - 30
Height: 108
Background: dialog3
Children:
Label@HOTKEY_DIALOG_HELPTEXT:
Y: PARENT_BOTTOM / 2 - 12
Width: PARENT_RIGHT
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
Container@ADVANCED_PANEL:
X: 5
Y: 50
@@ -647,3 +676,4 @@ Background@SETTINGS_PANEL:
Height: 20
Font: Regular
Text: Strict Activity checking
TooltipContainer@TOOLTIP_CONTAINER:

View File

@@ -1,111 +1,111 @@
CycleBase: H
Description: Jump to base
Types: World
Types: World, Player, Spectator
ToLastEvent: SPACE
Description: Jump to last radar event
Types: World
Types: World, Player, Spectator
ToSelection: HOME
Description: Jump to selection
Types: World
Types: World, Player, Spectator
SelectAllUnits: Q
Description: Select all combat units
Types: World
Types: World, Player, Spectator
SelectUnitsByType: W
Description: Select units by type
Types: World
Types: World, Player, Spectator
RemoveFromControlGroup:
Description: Remove from control group
Types: World
Types: World, Player
Pause: PAUSE
Description: Pause / Unpause
Types: World
Types: World, Player, Spectator
Sell: Z
Description: Sell mode
Types: OrderGenerator
Types: OrderGenerator, Player
Repair: C
Description: Repair mode
Types: OrderGenerator
Types: OrderGenerator, Player
PlaceBeacon: B
Description: Place beacon
Types: OrderGenerator
Types: OrderGenerator, Player, Spectator
CycleStatusBars: COMMA
Description: Cycle status bars display
Types: World
Types: World, Player, Spectator
TogglePixelDouble: PERIOD
Description: Toggle pixel doubling
Types: World
Types: World, Player, Spectator
ToggleMute: M
Description: Toggle audio mute
Types: World, Menu
Types: World, Menu, Player, Spectator
TogglePlayerStanceColor: COMMA Ctrl
Description: Toggle player stance colors
Types: World
Types: World, Player, Spectator
TakeScreenshot: P Ctrl
Description: Take screenshot
Types: World, Menu
Types: World, Menu, Player, Spectator
AttackMove: A
Description: Attack Move
Types: Unit
Types: Unit, Player
Stop: S
Description: Stop
Types: Unit
Types: Unit, Player
Scatter: X Ctrl
Description: Scatter
Types: Unit
Types: Unit, Player
Deploy: F
Description: Deploy
Types: Unit
Types: Unit, Player
Guard: D
Description: Guard
Types: Unit
Types: Unit, Player
StanceAttackAnything: A Alt
Description: Attack anything
Types: Stance
Types: Stance, Player
StanceDefend: S Alt
Description: Defend
Types: Stance
Types: Stance, Player
StanceReturnFire: D Alt
Description: Return fire
Types: Stance
Types: Stance, Player
StanceHoldFire: F Alt
Description: Hold fire
Types: Stance
Types: Stance, Player
StopMusic: AUDIOSTOP
Description: Stop
Types: Music
Types: Music, Player, Spectator
PauseMusic: AUDIOPLAY
Description: Pause or Resume
Types: Music
Types: Music, Player, Spectator
PrevMusic: AUDIOPREV
Description: Previous
Types: Music
Types: Music, Player, Spectator
NextMusic: AUDIONEXT
Description: Next
Types: Music
Types: Music, Player, Spectator

View File

@@ -1,26 +1,26 @@
ObserverCombinedView: MINUS
Description: All Players
Types: Observer
Types: Observer, Spectator
ObserverWorldView: EQUALS
Description: Disable Shroud
Types: Observer
Types: Observer, Spectator
ReplaySpeedSlow: F9
Description: Slow speed
Types: Replay
Types: Replay, Spectator
ReplaySpeedRegular: F10
Description: Regular speed
Types: Replay
Types: Replay, Spectator
ReplaySpeedFast: F11
Description: Fast speed
Types: Replay
Types: Replay, Spectator
ReplaySpeedMax: F12
Description: Maximum speed
Types: Replay
Types: Replay, Spectator
StatisticsNone: F1
Description: Disable statistics
@@ -28,15 +28,15 @@ StatisticsNone: F1
StatisticsBasic: F2
Description: Basic statistics
Types: Observer, Replay
Types: Observer, Replay, Spectator
StatisticsEconomy: F3
Description: Economy statistics
Types: Observer, Replay
Types: Observer, Replay, Spectator
StatisticsProduction: F4
Description: Production statistics
Types: Observer, Replay
Types: Observer, Replay, Spectator
StatisticsSupportPowers: F5
Description: Support Power statistics
@@ -44,12 +44,12 @@ StatisticsSupportPowers: F5
StatisticsCombat: F6
Description: Combat statistics
Types: Observer, Replay
Types: Observer, Replay, Spectator
StatisticsGraph: F7
Description: Statistics graph
Types: Observer, Replay
Types: Observer, Replay, Spectator
StatisticsArmyGraph: F8
Description: Army value graph
Types: Observer, Replay
Types: Observer, Replay, Spectator

View File

@@ -1,99 +1,99 @@
CycleProductionBuildings: TAB
Description: Next facility
Types: Production
Types: Production, Player, Spectator
Production01: F1
Description: Slot 01
Types: ProductionSlot
Types: ProductionSlot, Player
Production02: F2
Description: Slot 02
Types: ProductionSlot
Types: ProductionSlot, Player
Production03: F3
Description: Slot 03
Types: ProductionSlot
Types: ProductionSlot, Player
Production04: F4
Description: Slot 04
Types: ProductionSlot
Types: ProductionSlot, Player
Production05: F5
Description: Slot 05
Types: ProductionSlot
Types: ProductionSlot, Player
Production06: F6
Description: Slot 06
Types: ProductionSlot
Types: ProductionSlot, Player
Production07: F7
Description: Slot 07
Types: ProductionSlot
Types: ProductionSlot, Player
Production08: F8
Description: Slot 08
Types: ProductionSlot
Types: ProductionSlot, Player
Production09: F9
Description: Slot 09
Types: ProductionSlot
Types: ProductionSlot, Player
Production10: F10
Description: Slot 10
Types: ProductionSlot
Types: ProductionSlot, Player
Production11: F11
Description: Slot 11
Types: ProductionSlot
Types: ProductionSlot, Player
Production12: F12
Description: Slot 12
Types: ProductionSlot
Types: ProductionSlot, Player
Production13: F1 CTRL
Description: Slot 13
Types: ProductionSlot
Types: ProductionSlot, Player
Production14: F2 CTRL
Description: Slot 14
Types: ProductionSlot
Types: ProductionSlot, Player
Production15: F3 CTRL
Description: Slot 15
Types: ProductionSlot
Types: ProductionSlot, Player
Production16: F4 CTRL
Description: Slot 16
Types: ProductionSlot
Types: ProductionSlot, Player
Production17: F5 CTRL
Description: Slot 17
Types: ProductionSlot
Types: ProductionSlot, Player
Production18: F6 CTRL
Description: Slot 18
Types: ProductionSlot
Types: ProductionSlot, Player
Production19: F7 CTRL
Description: Slot 19
Types: ProductionSlot
Types: ProductionSlot, Player
Production20: F8 CTRL
Description: Slot 20
Types: ProductionSlot
Types: ProductionSlot, Player
Production21: F9 CTRL
Description: Slot 21
Types: ProductionSlot
Types: ProductionSlot, Player
Production22: F10 CTRL
Description: Slot 22
Types: ProductionSlot
Types: ProductionSlot, Player
Production23: F11 CTRL
Description: Slot 23
Types: ProductionSlot
Types: ProductionSlot, Player
Production24: F12 CTRL
Description: Slot 24
Types: ProductionSlot
Types: ProductionSlot, Player

View File

@@ -1,7 +1,7 @@
NextProductionTab: PAGEDOWN
Description: Next tab
Types: Production
Types: Production, Player
PreviousProductionTab: PAGEUP
Description: Previous tab
Types: Production
Types: Production, Player

View File

@@ -1,23 +1,23 @@
SupportPower01:
Description: Slot 01
Types: SupportPower
Types: SupportPower, Player
SupportPower02:
Description: Slot 02
Types: SupportPower
Types: SupportPower, Player
SupportPower03:
Description: Slot 03
Types: SupportPower
Types: SupportPower, Player
SupportPower04:
Description: Slot 04
Types: SupportPower
Types: SupportPower, Player
SupportPower05:
Description: Slot 05
Types: SupportPower
Types: SupportPower, Player
SupportPower06:
Description: Slot 06
Types: SupportPower
Types: SupportPower, Player

View File

@@ -1,63 +1,63 @@
MapScrollUp: UP
Description: Scroll up
Types: Viewport
Types: Viewport, Player, Spectator
MapScrollDown: DOWN
Description: Scroll down
Types: Viewport
Types: Viewport, Player, Spectator
MapScrollLeft: LEFT
Description: Scroll left
Types: Viewport
Types: Viewport, Player, Spectator
MapScrollRight: RIGHT
Description: Scroll right
Types: Viewport
Types: Viewport, Player, Spectator
MapJumpToTopEdge: UP Alt
Description: Jump to top edge
Types: Viewport
Types: Viewport, Player, Spectator
MapJumpToBottomEdge: DOWN Alt
Description: Jump to bottom edge
Types: Viewport
Types: Viewport, Player, Spectator
MapJumpToLeftEdge: LEFT Alt
Description: Jump to left edge
Types: Viewport
Types: Viewport, Player, Spectator
MapJumpToRightEdge: RIGHT Alt
Description: Jump to right edge
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkSave01: Q Ctrl
Description: Record bookmark 1
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkRestore01: Q Alt
Description: Jump to bookmark 1
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkSave02: W Ctrl
Description: Record bookmark 2
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkRestore02: W Alt
Description: Jump to bookmark 2
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkSave03: E Ctrl
Description: Record bookmark 3
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkRestore03: E Alt
Description: Jump to bookmark 3
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkSave04: R Ctrl
Description: Record bookmark 4
Types: Viewport
Types: Viewport, Player, Spectator
MapBookmarkRestore04: R Alt
Description: Jump to bookmark 4
Types: Viewport
Types: Viewport, Player, Spectator

View File

@@ -11,6 +11,7 @@ Metrics:
GameStartedColor: FFA500
HotkeyColor: FFFFFF
HotkeyColorDisabled: 808080
HotkeyColorInvalid: FF0000
HotkeyFont: Regular
IncompatibleGameColor: A9A9A9
IncompatibleGameStartedColor: D2691E