split Widget static bits into Ui static class
This commit is contained in:
@@ -16,6 +16,7 @@ namespace OpenRA.Mods.RA
|
||||
public class NullLoadScreen : ILoadScreen
|
||||
{
|
||||
public void Init(Dictionary<string, string> info) {}
|
||||
|
||||
public void Display()
|
||||
{
|
||||
if (Game.Renderer == null)
|
||||
@@ -28,8 +29,8 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public void StartGame()
|
||||
{
|
||||
Widget.ResetAll();
|
||||
Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Widget.RootWidget, "INIT_SETUP" );
|
||||
Ui.ResetAll();
|
||||
Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Ui.RootWidget, "INIT_SETUP" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA
|
||||
public void WorldLoaded(World world)
|
||||
{
|
||||
// Remove all open widgets
|
||||
Widget.ResetAll();
|
||||
Ui.ResetAll();
|
||||
|
||||
if (world.LocalPlayer != null)
|
||||
Game.OpenWindow(world, Info.Widget);
|
||||
@@ -63,9 +63,9 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
// Clear any existing widget state
|
||||
if (Info.ClearRootWidget)
|
||||
Widget.ResetAll();
|
||||
Ui.ResetAll();
|
||||
|
||||
Game.LoadWidget(world, Info.Widget, Widget.RootWidget, new WidgetArgs());
|
||||
Game.LoadWidget(world, Info.Widget, Ui.RootWidget, new WidgetArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
void TestAndContinue()
|
||||
{
|
||||
Widget.ResetAll();
|
||||
Ui.ResetAll();
|
||||
if (!FileSystem.Exists(Info["TestFile"]))
|
||||
{
|
||||
var args = new WidgetArgs()
|
||||
@@ -84,13 +84,13 @@ namespace OpenRA.Mods.RA
|
||||
{ "continueLoading", () => TestAndContinue() },
|
||||
{ "installData", Info }
|
||||
};
|
||||
Widget.OpenWindow(Info["InstallerMenuWidget"], args);
|
||||
Ui.OpenWindow(Info["InstallerMenuWidget"], args);
|
||||
}
|
||||
else
|
||||
{
|
||||
Game.LoadShellMap();
|
||||
Widget.ResetAll();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
Ui.ResetAll();
|
||||
Ui.OpenWindow("MAINMENU_BG");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Scripting
|
||||
if (music)
|
||||
Sound.PlayMusic();
|
||||
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
Sound.SoundVolumeModifier = oldModifier;
|
||||
w.EnableTick = true;
|
||||
onComplete();
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
// Show connection failed dialog
|
||||
CloseWindow();
|
||||
Widget.OpenWindow("CONNECTIONFAILED_PANEL", new WidgetArgs()
|
||||
Ui.OpenWindow("CONNECTIONFAILED_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "onAbort", onAbort },
|
||||
{ "onRetry", onRetry },
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
void CloseWindow()
|
||||
{
|
||||
Game.ConnectionStateChanged -= ConnectionStateChanged;
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
}
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
public static void Connect(string host, int port, Action onConnect, Action onAbort)
|
||||
{
|
||||
Game.JoinServer(host, port);
|
||||
Widget.OpenWindow("CONNECTING_PANEL", new WidgetArgs()
|
||||
Ui.OpenWindow("CONNECTING_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "host", host },
|
||||
{ "port", port },
|
||||
@@ -85,8 +85,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
public ConnectionFailedLogic(Widget widget, string host, int port, Action onRetry, Action onAbort)
|
||||
{
|
||||
var panel = widget;
|
||||
panel.GetWidget<ButtonWidget>("ABORT_BUTTON").OnClick = () => { Widget.CloseWindow(); onAbort(); };
|
||||
panel.GetWidget<ButtonWidget>("RETRY_BUTTON").OnClick = () => { Widget.CloseWindow(); onRetry(); };
|
||||
panel.GetWidget<ButtonWidget>("ABORT_BUTTON").OnClick = () => { Ui.CloseWindow(); onAbort(); };
|
||||
panel.GetWidget<ButtonWidget>("RETRY_BUTTON").OnClick = () => { Ui.CloseWindow(); onRetry(); };
|
||||
|
||||
widget.GetWidget<LabelWidget>("CONNECTING_DESC").GetText = () =>
|
||||
"Could not connect to {0}:{1}".F(host, port);
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
[ObjectCreator.UseCtor]
|
||||
public DeveloperModeLogic(World world)
|
||||
{
|
||||
var devmodeBG = Widget.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG");
|
||||
var devModeButton = Widget.RootWidget.GetWidget<ButtonWidget>("INGAME_DEVELOPERMODE_BUTTON");
|
||||
var devmodeBG = Ui.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG");
|
||||
var devModeButton = Ui.RootWidget.GetWidget<ButtonWidget>("INGAME_DEVELOPERMODE_BUTTON");
|
||||
devModeButton.OnClick = () => devmodeBG.Visible ^= true;
|
||||
|
||||
var devTrait = world.LocalPlayer.PlayerActor.Trait<DeveloperMode>();
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
public DiplomacyLogic(World world)
|
||||
{
|
||||
this.world = world;
|
||||
var root = Widget.RootWidget.GetWidget("INGAME_ROOT");
|
||||
var root = Ui.RootWidget.GetWidget("INGAME_ROOT");
|
||||
var diplomacyBG = root.GetWidget("DIPLOMACY_BG");
|
||||
var diplomacy = root.GetWidget<ButtonWidget>("INGAME_DIPLOMACY_BUTTON");
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Game.Settings.Player.LastServer = "{0}:{1}".F(ipField.Text, port);
|
||||
Game.Settings.Save();
|
||||
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
ConnectionLogic.Connect(ipField.Text, port, openLobby, onExit);
|
||||
};
|
||||
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
afterInstall();
|
||||
});
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
var dl = new Download(installData["PackageURL"], file, onDownloadProgress, onDownloadComplete);
|
||||
|
||||
cancelButton.OnClick = () => { dl.Cancel(); Widget.CloseWindow(); };
|
||||
cancelButton.OnClick = () => { dl.Cancel(); Ui.CloseWindow(); };
|
||||
retryButton.OnClick = () => { dl.Cancel(); ShowDownloadDialog(); };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Game.AddChatLine += AddChatLine;
|
||||
Game.BeforeGameStart += UnregisterEvents;
|
||||
|
||||
var r = Widget.RootWidget;
|
||||
var r = Ui.RootWidget;
|
||||
gameRoot = r.GetWidget("INGAME_ROOT");
|
||||
var optionsBG = gameRoot.GetWidget("INGAME_OPTIONS_BG");
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
optionsBG.GetWidget<ButtonWidget>("DISCONNECT").OnClick = () => LeaveGame(optionsBG);
|
||||
|
||||
optionsBG.GetWidget<ButtonWidget>("SETTINGS").OnClick = () => Widget.OpenWindow("SETTINGS_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("MUSIC").OnClick = () => Widget.OpenWindow("MUSIC_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("SETTINGS").OnClick = () => Ui.OpenWindow("SETTINGS_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("MUSIC").OnClick = () => Ui.OpenWindow("MUSIC_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("RESUME").OnClick = () => optionsBG.Visible = false;
|
||||
|
||||
optionsBG.GetWidget<ButtonWidget>("SURRENDER").OnClick = () =>
|
||||
@@ -74,8 +74,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
pane.Visible = false;
|
||||
Game.Disconnect();
|
||||
Game.LoadShellMap();
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
Ui.CloseWindow();
|
||||
Ui.OpenWindow("MAINMENU_BG");
|
||||
}
|
||||
|
||||
void UnregisterEvents()
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Game.AddChatLine += AddChatLine;
|
||||
Game.BeforeGameStart += UnregisterEvents;
|
||||
|
||||
var r = Widget.RootWidget;
|
||||
var r = Ui.RootWidget;
|
||||
gameRoot = r.GetWidget("OBSERVER_ROOT");
|
||||
var optionsBG = gameRoot.GetWidget("INGAME_OPTIONS_BG");
|
||||
|
||||
@@ -37,12 +37,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
optionsBG.Visible = false;
|
||||
Game.Disconnect();
|
||||
Game.LoadShellMap();
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
Ui.CloseWindow();
|
||||
Ui.OpenWindow("MAINMENU_BG");
|
||||
};
|
||||
|
||||
optionsBG.GetWidget<ButtonWidget>("SETTINGS").OnClick = () => Widget.OpenWindow("SETTINGS_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("MUSIC").OnClick = () => Widget.OpenWindow("MUSIC_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("SETTINGS").OnClick = () => Ui.OpenWindow("SETTINGS_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("MUSIC").OnClick = () => Ui.OpenWindow("MUSIC_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("RESUME").OnClick = () => optionsBG.Visible = false;
|
||||
optionsBG.GetWidget<ButtonWidget>("SURRENDER").IsVisible = () => false;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
ConnectionLogic.Connect(om.Host, om.Port, onConnect, onExit);
|
||||
};
|
||||
|
||||
Widget.OpenWindow("CONNECTIONFAILED_PANEL", new WidgetArgs()
|
||||
Ui.OpenWindow("CONNECTIONFAILED_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "onAbort", onExit },
|
||||
{ "onRetry", onRetry },
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Game.AddChatLine -= AddChatLine;
|
||||
Game.ConnectionStateChanged -= ConnectionStateChanged;
|
||||
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
}
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
@@ -135,7 +135,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Game.Settings.Save();
|
||||
});
|
||||
|
||||
Widget.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
|
||||
Ui.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "initialMap", Map.Uid },
|
||||
{ "onExit", () => {} },
|
||||
@@ -192,7 +192,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
var musicButton = lobby.GetWidget<ButtonWidget>("MUSIC_BUTTON");
|
||||
if (musicButton != null)
|
||||
musicButton.OnClick = () => Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs
|
||||
musicButton.OnClick = () => Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs
|
||||
{ { "onExit", () => {} } });
|
||||
|
||||
// Add a bot on the first lobbyinfo update
|
||||
@@ -247,7 +247,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
MapUid = orderManager.LobbyInfo.GlobalSettings.Map;
|
||||
Map = new Map(Game.modData.AvailableMaps[MapUid].Path);
|
||||
|
||||
var title = Widget.RootWidget.GetWidget<LabelWidget>("TITLE");
|
||||
var title = Ui.RootWidget.GetWidget<LabelWidget>("TITLE");
|
||||
title.Text = orderManager.LobbyInfo.GlobalSettings.ServerName;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,20 +21,22 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
rootMenu = widget;
|
||||
|
||||
Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Widget.RootWidget, "PERF_BG" );
|
||||
Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Ui.RootWidget, "PERF_BG" );
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_JOIN").OnClick = () => OpenGamePanel("JOINSERVER_BG");
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_CREATE").OnClick = () => OpenGamePanel("CREATESERVER_BG");
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_DIRECTCONNECT").OnClick = () => OpenGamePanel("DIRECTCONNECT_BG");
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_SETTINGS").OnClick = () => Widget.OpenWindow("SETTINGS_MENU");
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_MUSIC").OnClick = () => Widget.OpenWindow("MUSIC_MENU");
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_SETTINGS").OnClick = () => Ui.OpenWindow("SETTINGS_MENU");
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_MUSIC").OnClick = () => Ui.OpenWindow("MUSIC_MENU");
|
||||
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_MODS").OnClick = () =>
|
||||
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||
Ui.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => {} },
|
||||
{ "onSwitch", RemoveShellmapUI }
|
||||
});
|
||||
|
||||
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_REPLAY_VIEWER").OnClick = () =>
|
||||
Widget.OpenWindow("REPLAYBROWSER_BG", new WidgetArgs()
|
||||
Ui.OpenWindow("REPLAYBROWSER_BG", new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => {} },
|
||||
{ "onStart", RemoveShellmapUI }
|
||||
@@ -49,7 +51,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
void OpenGamePanel(string id)
|
||||
{
|
||||
Widget.OpenWindow(id, new WidgetArgs()
|
||||
Ui.OpenWindow(id, new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => {} },
|
||||
{ "openLobby", () => OpenLobbyPanel() }
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
map = Game.modData.AvailableMaps[WidgetUtils.ChooseInitialMap(initialMap)];
|
||||
|
||||
widget.GetWidget<ButtonWidget>("BUTTON_OK").OnClick = () => { Widget.CloseWindow(); onSelect(map); };
|
||||
widget.GetWidget<ButtonWidget>("BUTTON_CANCEL").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||
widget.GetWidget<ButtonWidget>("BUTTON_OK").OnClick = () => { Ui.CloseWindow(); onSelect(map); };
|
||||
widget.GetWidget<ButtonWidget>("BUTTON_CANCEL").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
|
||||
scrollpanel = widget.GetWidget<ScrollPanelWidget>("MAP_LIST");
|
||||
itemTemplate = scrollpanel.GetWidget<ScrollItemWidget>("MAP_TEMPLATE");
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
loadButton.OnClick = () => LoadMod(currentMod.Id, onSwitch);
|
||||
loadButton.IsDisabled = () => currentMod.Id == Game.CurrentMods.Keys.First();
|
||||
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
currentMod = Mod.AllMods[Game.modData.Manifest.Mods[0]];
|
||||
|
||||
// Mod list
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
onSwitch();
|
||||
Game.InitializeWithMods(mods);
|
||||
});
|
||||
|
||||
@@ -34,14 +34,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
public MusicPlayerLogic()
|
||||
{
|
||||
bg = Widget.RootWidget.GetWidget("MUSIC_MENU");
|
||||
bg = Ui.RootWidget.GetWidget("MUSIC_MENU");
|
||||
CurrentSong = GetNextSong();
|
||||
|
||||
bg.GetWidget( "BUTTON_PAUSE" ).IsVisible = () => Sound.MusicPlaying;
|
||||
bg.GetWidget( "BUTTON_PLAY" ).IsVisible = () => !Sound.MusicPlaying;
|
||||
|
||||
bg.GetWidget<ButtonWidget>("BUTTON_CLOSE").OnClick =
|
||||
() => { Game.Settings.Save(); Widget.CloseWindow(); };
|
||||
() => { Game.Settings.Save(); Ui.CloseWindow(); };
|
||||
|
||||
bg.GetWidget("BUTTON_INSTALL").IsVisible = () => false;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
public OrderButtonsChromeLogic(World world)
|
||||
{
|
||||
/* todo: attach this to the correct widget, to remove the lookups below */
|
||||
var r = Widget.RootWidget;
|
||||
var r = Ui.RootWidget;
|
||||
var gameRoot = r.GetWidget("INGAME_ROOT");
|
||||
|
||||
var moneybin = gameRoot.GetWidget("INGAME_MONEY_BIN");
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
public PerfDebugLogic()
|
||||
{
|
||||
var r = Widget.RootWidget;
|
||||
var r = Ui.RootWidget;
|
||||
var perfRoot = r.GetWidget("PERF_BG");
|
||||
perfRoot.IsVisible = () => perfRoot.Visible && Game.Settings.Debug.PerfGraph;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
statusLabel = panel.GetWidget<LabelWidget>("STATUS_LABEL");
|
||||
|
||||
backButton = panel.GetWidget<ButtonWidget>("BACK_BUTTON");
|
||||
backButton.OnClick = Widget.CloseWindow;
|
||||
backButton.OnClick = Ui.CloseWindow;
|
||||
|
||||
retryButton = panel.GetWidget<ButtonWidget>("RETRY_BUTTON");
|
||||
retryButton.OnClick = CheckForDisk;
|
||||
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
continueLoading();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,15 +22,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var panel = widget.GetWidget("INSTALL_PANEL");
|
||||
var args = new WidgetArgs()
|
||||
{
|
||||
{ "afterInstall", () => { Widget.CloseWindow(); continueLoading(); } },
|
||||
{ "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
|
||||
{ "installData", installData }
|
||||
};
|
||||
|
||||
panel.GetWidget<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
|
||||
Widget.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);
|
||||
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);
|
||||
|
||||
panel.GetWidget<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
|
||||
Widget.OpenWindow("INSTALL_FROMCD_PANEL", args);
|
||||
Ui.OpenWindow("INSTALL_FROMCD_PANEL", args);
|
||||
|
||||
panel.GetWidget<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
panel = widget;
|
||||
|
||||
panel.GetWidget<ButtonWidget>("CANCEL_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||
panel.GetWidget<ButtonWidget>("CANCEL_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
|
||||
var rl = panel.GetWidget<ScrollPanelWidget>("REPLAY_LIST");
|
||||
var replayDir = Path.Combine(Platform.SupportDir, "Replays");
|
||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
if (currentReplay != null)
|
||||
{
|
||||
Game.JoinReplay(currentReplay.Filename);
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
onStart();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,11 +64,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var host = currentServer.Address.Split(':')[0];
|
||||
var port = int.Parse(currentServer.Address.Split(':')[1]);
|
||||
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
ConnectionLogic.Connect(host, port, openLobby, onExit);
|
||||
};
|
||||
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
|
||||
// Server list
|
||||
serverTemplate = sl.GetWidget<ScrollItemWidget>("SERVER_TEMPLATE");
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
this.onExit = onExit;
|
||||
|
||||
var settings = Game.Settings;
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
panel.GetWidget<ButtonWidget>("CREATE_BUTTON").OnClick = CreateAndJoin;
|
||||
|
||||
map = Game.modData.AvailableMaps[ WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map) ];
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
panel.GetWidget<ButtonWidget>("MAP_BUTTON").OnClick = () =>
|
||||
{
|
||||
Widget.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
|
||||
Ui.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "initialMap", map.Uid },
|
||||
{ "onExit", () => {} },
|
||||
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
// Create and join the server
|
||||
Game.CreateServer(settings);
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
ConnectionLogic.Connect(IPAddress.Loopback.ToString(), Game.Settings.Server.ListenPort, onCreate, onExit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
public SettingsMenuLogic()
|
||||
{
|
||||
bg = Widget.RootWidget.GetWidget<BackgroundWidget>("SETTINGS_MENU");
|
||||
bg = Ui.RootWidget.GetWidget<BackgroundWidget>("SETTINGS_MENU");
|
||||
var tabs = bg.GetWidget<ContainerWidget>("TAB_CONTAINER");
|
||||
|
||||
//Tabs
|
||||
@@ -122,7 +122,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
int.TryParse(windowHeight.Text, out y);
|
||||
gs.WindowedSize = new int2(x,y);
|
||||
Game.Settings.Save();
|
||||
Widget.CloseWindow();
|
||||
Ui.CloseWindow();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
if( world.LocalPlayer == null ) return;
|
||||
if( world.LocalPlayer.WinState != WinState.Undefined ) return;
|
||||
|
||||
var radarBin = Widget.RootWidget.GetWidget<RadarBinWidget>(RadarBin);
|
||||
var radarBin = Ui.RootWidget.GetWidget<RadarBinWidget>(RadarBin);
|
||||
|
||||
powerCollection = "power-" + world.LocalPlayer.Country.Race;
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
|
||||
if (WorldInteractionController != null)
|
||||
{
|
||||
var controller = Widget.RootWidget.GetWidget<WorldInteractionControllerWidget>(WorldInteractionController);
|
||||
var controller = Ui.RootWidget.GetWidget<WorldInteractionControllerWidget>(WorldInteractionController);
|
||||
controller.HandleMouseInput(fakemi);
|
||||
fakemi.Event = MouseInputEvent.Up;
|
||||
controller.HandleMouseInput(fakemi);
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
|
||||
if (WorldInteractionController != null)
|
||||
{
|
||||
var controller = Widget.RootWidget.GetWidget<WorldInteractionControllerWidget>(WorldInteractionController);
|
||||
var controller = Ui.RootWidget.GetWidget<WorldInteractionControllerWidget>(WorldInteractionController);
|
||||
controller.HandleMouseInput(fakemi);
|
||||
fakemi.Event = MouseInputEvent.Up;
|
||||
controller.HandleMouseInput(fakemi);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public void SelectionChanged()
|
||||
{
|
||||
var palette = Widget.RootWidget.GetWidget<BuildPaletteWidget>("INGAME_BUILD_PALETTE");
|
||||
var palette = Ui.RootWidget.GetWidget<BuildPaletteWidget>("INGAME_BUILD_PALETTE");
|
||||
if (palette == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user