added a new hotkey to trigger pixel doubling

closes #5122
This commit is contained in:
Matthias Mailänder
2014-04-18 17:49:55 +02:00
parent 657141bce0
commit 9c483a912e
3 changed files with 14 additions and 1 deletions

View File

@@ -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

View File

@@ -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<string, string>()

View File

@@ -65,6 +65,9 @@ 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())
return false;
@@ -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;
}
}
}