Implement new viewport size/zoom UI.

This commit is contained in:
Paul Chote
2019-12-11 18:48:43 +00:00
committed by tovl
parent 860117daf9
commit 1dcb903580
17 changed files with 319 additions and 253 deletions

View File

@@ -0,0 +1,38 @@
#region Copyright & License Information
/*
* Copyright 2007-2019 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System.Collections.Generic;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Lint;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic.Ingame
{
[ChromeLogicArgsHotkeys("ResetZoomKey")]
public class ResetZoomHotkeyLogic : SingleHotkeyBaseLogic
{
readonly Viewport viewport;
[ObjectCreator.UseCtor]
public ResetZoomHotkeyLogic(Widget widget, ModData modData, WorldRenderer worldRenderer, Dictionary<string, MiniYaml> logicArgs)
: base(widget, modData, "ResetZoomKey", "WORLD_KEYHANDLER", logicArgs)
{
viewport = worldRenderer.Viewport;
}
protected override bool OnHotkeyActivated(KeyInput e)
{
viewport.ToggleZoom();
return true;
}
}
}