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 TabWidth = 30;
|
||||||
public readonly int ArrowWidth = 20;
|
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;
|
int contentWidth = 0;
|
||||||
float listOffset = 0;
|
float listOffset = 0;
|
||||||
@@ -284,18 +288,18 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var hotkey = Hotkey.FromKeyInput(e);
|
var hotkey = Hotkey.FromKeyInput(e);
|
||||||
|
if (hotkey == PreviousProductionTabKey.GetValue())
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
|
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
|
||||||
return SelectNextTab(true);
|
return SelectNextTab(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hotkey == NextProductionTabKey.GetValue())
|
||||||
|
{
|
||||||
|
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
|
||||||
|
return SelectNextTab(false);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -719,6 +719,8 @@ Container@PLAYER_WIDGETS:
|
|||||||
PaletteWidget: PRODUCTION_PALETTE
|
PaletteWidget: PRODUCTION_PALETTE
|
||||||
TypesContainer: PRODUCTION_TYPES
|
TypesContainer: PRODUCTION_TYPES
|
||||||
BackgroundContainer: PRODUCTION_BACKGROUND
|
BackgroundContainer: PRODUCTION_BACKGROUND
|
||||||
|
PreviousProductionTabKey: PreviousProductionTab
|
||||||
|
NextProductionTabKey: NextProductionTab
|
||||||
X: WINDOW_RIGHT - 204
|
X: WINDOW_RIGHT - 204
|
||||||
Y: 268
|
Y: 268
|
||||||
Width: 194
|
Width: 194
|
||||||
|
|||||||
Reference in New Issue
Block a user