diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index fd45367c62..ae463b48f4 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -169,6 +169,8 @@ namespace OpenRA public Hotkey ObserverCombinedView = new Hotkey(Keycode.MINUS, Modifiers.None); public Hotkey ObserverWorldView = new Hotkey(Keycode.EQUALS, Modifiers.None); + + public Hotkey TogglePixelDoubleKey = new Hotkey(Keycode.PERIOD, Modifiers.None); } public class IrcSettings diff --git a/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs index 4d0ad0d796..a347a56747 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs @@ -271,6 +271,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { "CycleProductionBuildingsKey", "Cycle production facilities" }, { "ToggleStatusBarsKey", "Toggle status bars" }, + { "TogglePixelDoubleKey", "Toggle pixel doubling" }, }; var unitHotkeys = new Dictionary() diff --git a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs index 9ef94a0a16..2bc1929b5e 100644 --- a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs +++ b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs @@ -65,8 +65,11 @@ namespace OpenRA.Mods.RA.Widgets if (key == ks.ToggleStatusBarsKey) return ToggleStatusBars(); + if (key == ks.TogglePixelDoubleKey) + return TogglePixelDouble(); + // Put all functions that aren't unit-specific before this line! - if (!world.Selection.Actors.Any()) + if (!world.Selection.Actors.Any()) return false; if (key == ks.AttackMoveKey) @@ -253,5 +256,12 @@ namespace OpenRA.Mods.RA.Widgets Game.Settings.Game.AlwaysShowStatusBars ^= true; return true; } + + bool TogglePixelDouble() + { + Game.Settings.Graphics.PixelDouble ^= true; + worldRenderer.Viewport.Zoom = Game.Settings.Graphics.PixelDouble ? 2 : 1; + return true; + } } }