Remove Game.Zoom.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
@@ -16,18 +17,24 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
class IngameMenuLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public IngameMenuLogic(Widget widget, World world, Action onExit)
|
||||
public IngameMenuLogic(Widget widget, World world, Action onExit, WorldRenderer worldRenderer)
|
||||
{
|
||||
widget.Get<ButtonWidget>("DISCONNECT").OnClick = () =>
|
||||
{
|
||||
onExit();
|
||||
LeaveGame(world);
|
||||
};
|
||||
|
||||
widget.Get<ButtonWidget>("SETTINGS").OnClick = () =>
|
||||
{
|
||||
widget.Visible = false;
|
||||
Ui.OpenWindow("SETTINGS_MENU", new WidgetArgs { { "onExit", () => { widget.Visible = true; } } });
|
||||
Ui.OpenWindow("SETTINGS_MENU", new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => widget.Visible = true },
|
||||
{ "worldRenderer", worldRenderer },
|
||||
});
|
||||
};
|
||||
|
||||
widget.Get<ButtonWidget>("MUSIC").OnClick = () =>
|
||||
{
|
||||
widget.Visible = false;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
widget.Get<ButtonWidget>("MAINMENU_BUTTON_SETTINGS").OnClick = () =>
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Ui.OpenWindow("SETTINGS_MENU", new WidgetArgs()
|
||||
Game.OpenWindow("SETTINGS_MENU", new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => Menu = MenuType.Main }
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
SoundDevice soundDevice;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public SettingsMenuLogic(Action onExit)
|
||||
public SettingsMenuLogic(Action onExit, WorldRenderer worldRenderer)
|
||||
{
|
||||
bg = Ui.Root.Get<BackgroundWidget>("SETTINGS_MENU");
|
||||
var tabs = bg.Get<ContainerWidget>("TAB_CONTAINER");
|
||||
@@ -133,7 +134,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
pixelDoubleCheckbox.OnClick = () =>
|
||||
{
|
||||
gs.PixelDouble ^= true;
|
||||
Game.Zoom = gs.PixelDouble ? 2 : 1;
|
||||
worldRenderer.Viewport.Zoom = gs.PixelDouble ? 2 : 1;
|
||||
};
|
||||
|
||||
var capFrameRateCheckbox = display.Get<CheckboxWidget>("CAPFRAMERATE_CHECKBOX");
|
||||
|
||||
Reference in New Issue
Block a user