Move hardcoded production tab keys into yaml.
This commit is contained in:
@@ -68,7 +68,11 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public readonly int TabWidth = 30;
|
||||
public readonly int ArrowWidth = 20;
|
||||
public Dictionary<string, ProductionTabGroup> Groups;
|
||||
|
||||
public readonly NamedHotkey PreviousProductionTabKey = new NamedHotkey();
|
||||
public readonly NamedHotkey NextProductionTabKey = new NamedHotkey();
|
||||
|
||||
public readonly Dictionary<string, ProductionTabGroup> Groups;
|
||||
|
||||
int contentWidth = 0;
|
||||
float listOffset = 0;
|
||||
@@ -284,18 +288,18 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
return false;
|
||||
|
||||
var hotkey = Hotkey.FromKeyInput(e);
|
||||
|
||||
if (hotkey == Game.Settings.Keys.NextProductionTabKey)
|
||||
{
|
||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
|
||||
return SelectNextTab(false);
|
||||
}
|
||||
else if (hotkey == Game.Settings.Keys.PreviousProductionTabKey)
|
||||
if (hotkey == PreviousProductionTabKey.GetValue())
|
||||
{
|
||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
|
||||
return SelectNextTab(true);
|
||||
}
|
||||
|
||||
if (hotkey == NextProductionTabKey.GetValue())
|
||||
{
|
||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
|
||||
return SelectNextTab(false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,6 +719,8 @@ Container@PLAYER_WIDGETS:
|
||||
PaletteWidget: PRODUCTION_PALETTE
|
||||
TypesContainer: PRODUCTION_TYPES
|
||||
BackgroundContainer: PRODUCTION_BACKGROUND
|
||||
PreviousProductionTabKey: PreviousProductionTab
|
||||
NextProductionTabKey: NextProductionTab
|
||||
X: WINDOW_RIGHT - 204
|
||||
Y: 268
|
||||
Width: 194
|
||||
|
||||
Reference in New Issue
Block a user