Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added scrollbars to the keys-tab of the settings menu

  • Loading branch information...
commit 313168c635a70a81deae4908444c094d7656ad08 1 parent 8395d0f
Tirili authored
View
78 OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs
@@ -140,31 +140,85 @@ public SettingsMenuLogic()
: keyConfig.ModifierToSelectTab == Modifiers.Alt ? "Alt + <Hotkey>"
: "Ctrl + <Hotkey>";
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("DEFENSETABKEYNAME"),
+ var specialHotkeyList = keys.GetWidget<ScrollPanelWidget>("SPECIALHOTKEY_LIST");
+
+ var specialHotkeyTemplate = specialHotkeyList.GetWidget<ScrollItemWidget>("SPECIALHOTKEY_TEMPLATE");
+
+ var item11 = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
+ item11.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Select Defense Tab on Build Palette:";
+ SetupKeyBinding( item11.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.DefenseTabKey, k => keyConfig.DefenseTabKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("FOCUSBASEKEYNAME"),
+ specialHotkeyList.AddChild(item11);
+
+ var item12 = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
+ item12.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Move Viewport to Base:";
+ SetupKeyBinding( item12.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.FocusBaseKey, k => keyConfig.FocusBaseKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("SELLKEYNAME"),
+ specialHotkeyList.AddChild(item12);
+
+ var item13 = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
+ item13.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Switch to Sell-Cursor:";
+ SetupKeyBinding( item13.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.SellKey, k => keyConfig.SellKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("POWERDOWNKEYNAME"),
+ specialHotkeyList.AddChild(item13);
+
+ var item14 = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
+ item14.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Switch to Power-Down-Cursor:";
+ SetupKeyBinding( item14.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.PowerDownKey, k => keyConfig.PowerDownKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("REPAIRKEYNAME"),
+ specialHotkeyList.AddChild(item14);
+
+ var item15 = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
+ item15.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Switch to Repair-Cursor:";
+ SetupKeyBinding( item15.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.RepairKey, k => keyConfig.RepairKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("PLACENORMALBUILDINGKEYNAME"),
+ specialHotkeyList.AddChild(item15);
+
+ var item16 = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
+ item16.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Place Normal-Building:";
+ SetupKeyBinding( item16.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.PlaceNormalBuildingKey, k => keyConfig.PlaceNormalBuildingKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("PLACEDEFENSEBUILDINGKEYNAME"),
+ specialHotkeyList.AddChild(item16);
+
+ var item17 = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
+ item17.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Place Defence-Building:";
+ SetupKeyBinding( item17.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.PlaceDefenceBuildingKey, k => keyConfig.PlaceDefenceBuildingKey = k );
+ specialHotkeyList.AddChild(item17);
+
+ var unitCommandHotkeyList = keys.GetWidget<ScrollPanelWidget>("UNITCOMMANDHOTKEY_LIST");
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("ATTACKMOVEKEYNAME"),
+ var unitCommandHotkeyTemplate = unitCommandHotkeyList.GetWidget<ScrollItemWidget>("UNITCOMMANDHOTKEY_TEMPLATE");
+
+ var item21 = ScrollItemWidget.Setup(unitCommandHotkeyTemplate, () => false, () => {});
+ item21.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Attack Move:";
+ SetupKeyBinding( item21.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.AttackMoveKey, k => keyConfig.AttackMoveKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("STOPKEYNAME"),
+ unitCommandHotkeyList.AddChild(item21);
+
+ var item22 = ScrollItemWidget.Setup(unitCommandHotkeyTemplate, () => false, () => {});
+ item22.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Stop:";
+ SetupKeyBinding( item22.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.StopKey, k => keyConfig.StopKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("SCATTERKEYNAME"),
+ unitCommandHotkeyList.AddChild(item22);
+
+ var item23 = ScrollItemWidget.Setup(unitCommandHotkeyTemplate, () => false, () => {});
+ item23.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Scatter:";
+ SetupKeyBinding( item23.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.ScatterKey, k => keyConfig.ScatterKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("STANCECYCLEKEYNAME"),
+ unitCommandHotkeyList.AddChild(item23);
+
+ var item24 = ScrollItemWidget.Setup(unitCommandHotkeyTemplate, () => false, () => {});
+ item24.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Cycle Stance:";
+ SetupKeyBinding( item24.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.StanceCycleKey, k => keyConfig.StanceCycleKey = k );
- SetupKeyBinding( keys.GetWidget<TextFieldWidget>("DEPLOYKEYNAME"),
+ unitCommandHotkeyList.AddChild(item24);
+
+ var item25 = ScrollItemWidget.Setup(unitCommandHotkeyTemplate, () => false, () => {});
+ item25.GetWidget<LabelWidget>("FUNCTION").GetText = () => "Deploy:";
+ SetupKeyBinding( item25.GetWidget<TextFieldWidget>("HOTKEY"),
() => keyConfig.DeployKey, k => keyConfig.DeployKey = k );
+ unitCommandHotkeyList.AddChild(item25);
// Debug
var debug = bg.GetWidget("DEBUG_PANE");
View
210 mods/ra/chrome/settings.yaml
@@ -303,171 +303,69 @@ Background@SETTINGS_MENU:
X:0
Y:200
Text: Special Hotkeys:
- Label@KEYS_DEFENSETABKEY_NAME:
- Id:KEYS_DEFENSETABKEY_NAME
+ ScrollPanel@SPECIALHOTKEY_LIST:
+ Id:SPECIALHOTKEY_LIST
X:0
- Y:230
- Text: Select Defense Tab on Build Palette:
- TextField@DEFENSETABKEYNAME:
- Id:DEFENSETABKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
Y:220
- MaxLength:16
- Label@KEYS_FOCUSBASEKEY_NAME:
- Id:KEYS_FOCUSBASEKEY_NAME
- X:0
- Y:260
- Text: Move Viewport to Base:
- TextField@FOCUSBASEKEYNAME:
- Id:FOCUSBASEKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:250
- MaxLength:16
- Label@KEYS_SELLKEY_NAME:
- Id:KEYS_SELLKEY_NAME
- X:0
- Y:290
- Text: Switch to Sell-Cursor:
- TextField@SELLKEYNAME:
- Id:SELLKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:280
- MaxLength:16
- Label@KEYS_POWERDOWNKEY_NAME:
- Id:KEYS_POWERDOWNKEY_NAME
- X:0
- Y:320
- Text: Switch to Power-Down-Cursor:
- TextField@POWERDOWNKEYNAME:
- Id:POWERDOWNKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:310
- MaxLength:16
- Label@KEYS_REPAIRKEY_NAME:
- Id:KEYS_REPAIRKEY_NAME
- X:0
- Y:350
- Text: Switch to Repair-Cursor:
- TextField@REPAIRKEYNAME:
- Id:REPAIRKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:340
- MaxLength:16
- Label@KEYS_PLACENORMALBUILDINGKEY_NAME:
- Id:KEYS_PLACENORMALBUILDINGKEY_NAME
- X:0
- Y:380
- Text: Place Normal-Building:
- TextField@PLACENORMALBUILDINGKEYNAME:
- Id:PLACENORMALBUILDINGKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:370
- MaxLength:16
- Label@KEYS_PLACEDEFENSEBUILDINGKEY_NAME:
- Id:KEYS_PLACEDEFENSEBUILDINGKEY_NAME
- X:0
- Y:410
- Text: Place Defence-Building:
- TextField@PLACEDEFENSEBUILDINGKEYNAME:
- Id:PLACEDEFENSEBUILDINGKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:400
- MaxLength:16
+ Width:449
+ Height:75
+ Children:
+ ScrollItem@SPECIALHOTKEY_TEMPLATE:
+ Id:SPECIALHOTKEY_TEMPLATE
+ Width:PARENT_RIGHT-27
+ Height:25
+ X:2
+ Y:0
+ Visible:false
+ Children:
+ Label@FUNCTION:
+ X:10
+ Id:FUNCTION
+ Width:200
+ Height:25
+ TextField@HOTKEY:
+ Id:HOTKEY
+ X:250
+ Width:139
+ Height:25
+ MaxLength:16
Label@KEYS_UNITCOMMANDSHEADLINE:
Id:KEYS_UNITCOMMANDSHEADLINE
X:0
- Y:450
+ Y:320
Text: Hotkeys for Unit Commands:
- Label@KEYS_ATTACKMOVEKEY_NAME:
- Id:KEYS_ATTACKMOVEKEY_NAME
- X:0
- Y:490
- Text: Attack Move:
- TextField@ATTACKMOVEKEYNAME:
- Id:ATTACKMOVEKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:480
- MaxLength:16
- Label@KEYS_STOPKEY_NAME:
- Id:KEYS_STOPKEY_NAME
- X:0
- Y:520
- Text: Stop:
- TextField@STOPKEYNAME:
- Id:STOPKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:510
- MaxLength:16
- Label@KEYS_SCATTERKEY_NAME:
- Id:KEYS_SCATTERKEY_NAME
- X:0
- Y:550
- Text: Scatter:
- TextField@SCATTERKEYNAME:
- Id:SCATTERKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:540
- MaxLength:16
- Label@KEYS_STANCECYCLEKEY_NAME:
- Id:KEYS_STANCECYCLE_NAME
+ ScrollPanel@UNITCOMMANDHOTKEY_LIST:
+ Id:UNITCOMMANDHOTKEY_LIST
X:0
- Y:580
- Text: Cycle Stance:
- TextField@STANCECYCLEKEYNAME:
- Id:STANCECYCLEKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:570
- MaxLength:16
- Label@KEYS_DEPLOYKEY_NAME:
- Id:KEYS_DEPLOYKEY_NAME
- X:0
- Y:610
- Text: Deploy:
- TextField@DEPLOYKEYNAME:
- Id:DEPLOYKEYNAME
- Text:Name
- Width:139
- Height:25
- X:240
- Y:600
- MaxLength:16
+ Y:340
+ Width:449
+ Height:75
+ Children:
+ ScrollItem@UNITCOMMANDHOTKEY_TEMPLATE:
+ Id:UNITCOMMANDHOTKEY_TEMPLATE
+ Width:PARENT_RIGHT-27
+ Height:25
+ X:2
+ Y:0
+ Visible:false
+ Children:
+ Label@FUNCTION:
+ X:10
+ Id:FUNCTION
+ Width:200
+ Height:25
+ TextField@HOTKEY:
+ Id:HOTKEY
+ X:250
+ Width:139
+ Height:25
+ MaxLength:16
Label@HOTKEY_INFO:
Id:HOTKEY_INFO
- X:10
- Y:650
+ Y:422
+ X:0
+ Height:25
+ Font:Tiny
Text: To change the Hotkey Mapping edit the YAML-Files in /mods/ra/rules/.
Container@DEBUG_PANE:
Id:DEBUG_PANE
Please sign in to comment.
Something went wrong with that request. Please try again.