@@ -244,46 +244,6 @@ Action ResetAudioPanel(Widget panel)
244
244
245
245
Action InitInputPanel ( Widget panel )
246
246
{
247
- // TODO: Extract these to a yaml file
248
- var specialHotkeys = new Dictionary < string , string > ( )
249
- {
250
- { "CycleBaseKey" , "Jump to base" } ,
251
- { "ToLastEventKey" , "Jump to last radar event" } ,
252
- { "ToSelectionKey" , "Jump to selection" } ,
253
- { "SelectAllUnitsKey" , "Select all units on screen" } ,
254
- { "SelectUnitsByTypeKey" , "Select units by type" } ,
255
-
256
- { "PlaceBeaconKey" , "Place beacon" } ,
257
-
258
- { "PauseKey" , "Pause / Unpause" } ,
259
- { "SellKey" , "Sell mode" } ,
260
- { "PowerDownKey" , "Power-down mode" } ,
261
- { "RepairKey" , "Repair mode" } ,
262
-
263
- { "NextProductionTabKey" , "Next production tab" } ,
264
- { "PreviousProductionTabKey" , "Previous production tab" } ,
265
- { "CycleProductionBuildingsKey" , "Cycle production facilities" } ,
266
-
267
- { "ToggleStatusBarsKey" , "Toggle status bars" } ,
268
- { "TogglePixelDoubleKey" , "Toggle pixel doubling" } ,
269
- } ;
270
-
271
- var unitHotkeys = new Dictionary < string , string > ( )
272
- {
273
- { "AttackMoveKey" , "Attack Move" } ,
274
- { "StopKey" , "Stop" } ,
275
- { "ScatterKey" , "Scatter" } ,
276
- { "StanceCycleKey" , "Cycle Stance" } ,
277
- { "DeployKey" , "Deploy" } ,
278
- { "GuardKey" , "Guard" }
279
- } ;
280
-
281
- var observerHotkeys = new Dictionary < string , string > ( )
282
- {
283
- { "ObserverCombinedView" , "All Players" } ,
284
- { "ObserverWorldView" , "Disable Shroud" }
285
- } ;
286
-
287
247
var gs = Game . Settings . Game ;
288
248
var ks = Game . Settings . Keys ;
289
249
@@ -304,26 +264,89 @@ Action InitInputPanel(Widget panel)
304
264
var unitTemplate = hotkeyList . Get ( "UNIT_TEMPLATE" ) ;
305
265
hotkeyList . RemoveChildren ( ) ;
306
266
307
- var globalHeader = ScrollItemWidget . Setup ( hotkeyHeader , ( ) => true , ( ) => { } ) ;
308
- globalHeader . Get < LabelWidget > ( "LABEL" ) . GetText = ( ) => "Global Commands" ;
309
- hotkeyList . AddChild ( globalHeader ) ;
267
+ // Game
268
+ {
269
+ var hotkeys = new Dictionary < string , string > ( )
270
+ {
271
+ { "CycleBaseKey" , "Jump to base" } ,
272
+ { "ToLastEventKey" , "Jump to last radar event" } ,
273
+ { "ToSelectionKey" , "Jump to selection" } ,
274
+ { "SelectAllUnitsKey" , "Select all units on screen" } ,
275
+ { "SelectUnitsByTypeKey" , "Select units by type" } ,
276
+
277
+ { "PlaceBeaconKey" , "Place beacon" } ,
278
+
279
+ { "PauseKey" , "Pause / Unpause" } ,
280
+ { "SellKey" , "Sell mode" } ,
281
+ { "PowerDownKey" , "Power-down mode" } ,
282
+ { "RepairKey" , "Repair mode" } ,
283
+
284
+ { "NextProductionTabKey" , "Next production tab" } ,
285
+ { "PreviousProductionTabKey" , "Previous production tab" } ,
286
+ { "CycleProductionBuildingsKey" , "Cycle production facilities" } ,
287
+
288
+ { "ToggleStatusBarsKey" , "Toggle status bars" } ,
289
+ { "TogglePixelDoubleKey" , "Toggle pixel doubling" } ,
290
+ } ;
291
+
292
+ var header = ScrollItemWidget . Setup ( hotkeyHeader , ( ) => true , ( ) => { } ) ;
293
+ header . Get < LabelWidget > ( "LABEL" ) . GetText = ( ) => "Game Commands" ;
294
+ hotkeyList . AddChild ( header ) ;
295
+
296
+ foreach ( var kv in hotkeys )
297
+ BindHotkeyPref ( kv , ks , globalTemplate , hotkeyList ) ;
298
+ }
310
299
311
- foreach ( var kv in specialHotkeys )
312
- BindHotkeyPref ( kv , ks , globalTemplate , hotkeyList ) ;
300
+ // Observer
301
+ {
302
+ var hotkeys = new Dictionary < string , string > ( )
303
+ {
304
+ { "ObserverCombinedView" , "All Players" } ,
305
+ { "ObserverWorldView" , "Disable Shroud" }
306
+ } ;
313
307
314
- var observerHeader = ScrollItemWidget . Setup ( hotkeyHeader , ( ) => true , ( ) => { } ) ;
315
- observerHeader . Get < LabelWidget > ( "LABEL" ) . GetText = ( ) => "Observer Commands" ;
316
- hotkeyList . AddChild ( observerHeader ) ;
308
+ var header = ScrollItemWidget . Setup ( hotkeyHeader , ( ) => true , ( ) => { } ) ;
309
+ header . Get < LabelWidget > ( "LABEL" ) . GetText = ( ) => "Observer Commands" ;
310
+ hotkeyList . AddChild ( header ) ;
317
311
318
- foreach ( var kv in observerHotkeys )
319
- BindHotkeyPref ( kv , ks , globalTemplate , hotkeyList ) ;
312
+ foreach ( var kv in hotkeys )
313
+ BindHotkeyPref ( kv , ks , globalTemplate , hotkeyList ) ;
314
+ }
315
+
316
+ // Unit
317
+ {
318
+ var hotkeys = new Dictionary < string , string > ( )
319
+ {
320
+ { "AttackMoveKey" , "Attack Move" } ,
321
+ { "StopKey" , "Stop" } ,
322
+ { "ScatterKey" , "Scatter" } ,
323
+ { "StanceCycleKey" , "Cycle Stance" } ,
324
+ { "DeployKey" , "Deploy" } ,
325
+ { "GuardKey" , "Guard" }
326
+ } ;
327
+
328
+ var header = ScrollItemWidget . Setup ( hotkeyHeader , ( ) => true , ( ) => { } ) ;
329
+ header . Get < LabelWidget > ( "LABEL" ) . GetText = ( ) => "Unit Commands" ;
330
+ hotkeyList . AddChild ( header ) ;
331
+
332
+ foreach ( var kv in hotkeys )
333
+ BindHotkeyPref ( kv , ks , unitTemplate , hotkeyList ) ;
334
+ }
335
+
336
+ // Developer
337
+ {
338
+ var hotkeys = new Dictionary < string , string > ( )
339
+ {
340
+ { "DevReloadChromeKey" , "Reload Chrome" }
341
+ } ;
320
342
321
- var unitHeader = ScrollItemWidget . Setup ( hotkeyHeader , ( ) => true , ( ) => { } ) ;
322
- unitHeader . Get < LabelWidget > ( "LABEL" ) . GetText = ( ) => "Unit Commands " ;
323
- hotkeyList . AddChild ( unitHeader ) ;
343
+ var header = ScrollItemWidget . Setup ( hotkeyHeader , ( ) => true , ( ) => { } ) ;
344
+ header . Get < LabelWidget > ( "LABEL" ) . GetText = ( ) => "Developer commands " ;
345
+ hotkeyList . AddChild ( header ) ;
324
346
325
- foreach ( var kv in unitHotkeys )
326
- BindHotkeyPref ( kv , ks , unitTemplate , hotkeyList ) ;
347
+ foreach ( var kv in hotkeys )
348
+ BindHotkeyPref ( kv , ks , globalTemplate , hotkeyList ) ;
349
+ }
327
350
328
351
return ( ) =>
329
352
{
0 commit comments