Normalize ButtonWidgets
This commit is contained in:
@@ -18,24 +18,32 @@ namespace OpenRA.Widgets
|
|||||||
public class ButtonWidget : Widget
|
public class ButtonWidget : Widget
|
||||||
{
|
{
|
||||||
public string Text = "";
|
public string Text = "";
|
||||||
public bool Bold = false;
|
|
||||||
public bool Depressed = false;
|
public bool Depressed = false;
|
||||||
public int VisualHeight = ChromeMetrics.GetInt("ButtonDepth");
|
public int VisualHeight = ChromeMetrics.GetInt("ButtonDepth");
|
||||||
|
public string Font = ChromeMetrics.GetString("ButtonFont");
|
||||||
public Func<string> GetText;
|
public Func<string> GetText;
|
||||||
|
public Func<bool> IsDisabled = () => false;
|
||||||
|
public Action OnClick = () => {};
|
||||||
|
|
||||||
|
[Obsolete] public bool Bold = false;
|
||||||
|
|
||||||
|
|
||||||
public ButtonWidget()
|
public ButtonWidget()
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
GetText = () => { return Text; };
|
GetText = () => { return Text; };
|
||||||
|
OnMouseUp = mi => { if (!IsDisabled()) OnClick(); return true; };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ButtonWidget(ButtonWidget widget)
|
protected ButtonWidget(ButtonWidget widget)
|
||||||
: base(widget)
|
: base(widget)
|
||||||
{
|
{
|
||||||
Text = widget.Text;
|
Text = widget.Text;
|
||||||
|
Font = widget.Font;
|
||||||
Depressed = widget.Depressed;
|
Depressed = widget.Depressed;
|
||||||
VisualHeight = widget.VisualHeight;
|
VisualHeight = widget.VisualHeight;
|
||||||
GetText = widget.GetText;
|
GetText = widget.GetText;
|
||||||
|
OnMouseUp = mi => { if (!IsDisabled()) OnClick(); return true; };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool LoseFocus(MouseInput mi)
|
public override bool LoseFocus(MouseInput mi)
|
||||||
@@ -86,16 +94,24 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
public override void DrawInner()
|
public override void DrawInner()
|
||||||
{
|
{
|
||||||
var font = (Bold) ? Game.Renderer.Fonts["Bold"] : Game.Renderer.Fonts["Regular"];
|
var rb = RenderBounds;
|
||||||
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
|
if (Font == "Regular" && Bold)
|
||||||
WidgetUtils.DrawPanel(Depressed ? "dialog3" : "dialog2", RenderBounds);
|
Font = "Bold";
|
||||||
|
|
||||||
|
var font = Game.Renderer.Fonts[Font];
|
||||||
|
var state = IsDisabled() ? "button-disabled" :
|
||||||
|
Depressed ? "button-pressed" :
|
||||||
|
rb.Contains(Viewport.LastMousePos) ? "button-hover" :
|
||||||
|
"button";
|
||||||
|
|
||||||
|
WidgetUtils.DrawPanel(state, rb);
|
||||||
var text = GetText();
|
var text = GetText();
|
||||||
|
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
|
||||||
|
|
||||||
font.DrawText(text,
|
font.DrawText(text,
|
||||||
RenderOrigin + new int2(UsableWidth / 2, Bounds.Height / 2)
|
new int2(rb.X + UsableWidth / 2, rb.Y + Bounds.Height / 2)
|
||||||
- new int2(font.Measure(text).X / 2,
|
- new int2(font.Measure(text).X / 2,
|
||||||
font.Measure(text).Y / 2) + stateOffset, Color.White);
|
font.Measure(text).Y / 2) + stateOffset, IsDisabled() ? Color.Gray : Color.White);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Widget Clone() { return new ButtonWidget(this); }
|
public override Widget Clone() { return new ButtonWidget(this); }
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
pathCheckbox.OnClick = () => Order(world, "DevPathDebug");
|
pathCheckbox.OnClick = () => Order(world, "DevPathDebug");
|
||||||
|
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("GIVE_CASH_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("GIVE_CASH_BUTTON").OnClick = () =>
|
||||||
world.IssueOrder(new Order("DevGiveCash", world.LocalPlayer.PlayerActor, false));
|
world.IssueOrder(new Order("DevGiveCash", world.LocalPlayer.PlayerActor, false));
|
||||||
|
|
||||||
var fastBuildCheckbox = panel.GetWidget<CncCheckboxWidget>("INSTANT_BUILD_CHECKBOX");
|
var fastBuildCheckbox = panel.GetWidget<CncCheckboxWidget>("INSTANT_BUILD_CHECKBOX");
|
||||||
@@ -66,10 +66,10 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
buildAnywhereCheckbox.IsChecked = () => devTrait.BuildAnywhere;
|
buildAnywhereCheckbox.IsChecked = () => devTrait.BuildAnywhere;
|
||||||
buildAnywhereCheckbox.OnClick = () => Order(world, "DevBuildAnywhere");
|
buildAnywhereCheckbox.OnClick = () => Order(world, "DevBuildAnywhere");
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("GIVE_EXPLORATION_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("GIVE_EXPLORATION_BUTTON").OnClick = () =>
|
||||||
world.IssueOrder(new Order("DevGiveExploration", world.LocalPlayer.PlayerActor, false));
|
world.IssueOrder(new Order("DevGiveExploration", world.LocalPlayer.PlayerActor, false));
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("CLOSE_BUTTON").OnClick = Widget.CloseWindow;
|
panel.GetWidget<ButtonWidget>("CLOSE_BUTTON").OnClick = Widget.CloseWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Order(World world, string order)
|
public void Order(World world, string order)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
}
|
}
|
||||||
|
|
||||||
var panel = widget.GetWidget("CONNECTING_PANEL");
|
var panel = widget.GetWidget("CONNECTING_PANEL");
|
||||||
panel.GetWidget<CncMenuButtonWidget>("ABORT_BUTTON").OnClick = () => { Widget.CloseWindow(); onAbort(); };
|
panel.GetWidget<ButtonWidget>("ABORT_BUTTON").OnClick = () => { Widget.CloseWindow(); onAbort(); };
|
||||||
|
|
||||||
widget.GetWidget<LabelWidget>("CONNECTING_DESC").GetText = () =>
|
widget.GetWidget<LabelWidget>("CONNECTING_DESC").GetText = () =>
|
||||||
"Connecting to {0}:{1}...".F(host, port);
|
"Connecting to {0}:{1}...".F(host, port);
|
||||||
@@ -106,8 +106,8 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
[ObjectCreator.Param] Action onAbort)
|
[ObjectCreator.Param] Action onAbort)
|
||||||
{
|
{
|
||||||
var panel = widget.GetWidget("CONNECTIONFAILED_PANEL");
|
var panel = widget.GetWidget("CONNECTIONFAILED_PANEL");
|
||||||
panel.GetWidget<CncMenuButtonWidget>("ABORT_BUTTON").OnClick = () => { Widget.CloseWindow(); onAbort(); };
|
panel.GetWidget<ButtonWidget>("ABORT_BUTTON").OnClick = () => { Widget.CloseWindow(); onAbort(); };
|
||||||
panel.GetWidget<CncMenuButtonWidget>("RETRY_BUTTON").OnClick = () => { Widget.CloseWindow(); onRetry(); };
|
panel.GetWidget<ButtonWidget>("RETRY_BUTTON").OnClick = () => { Widget.CloseWindow(); onRetry(); };
|
||||||
|
|
||||||
widget.GetWidget<LabelWidget>("CONNECTING_DESC").GetText = () =>
|
widget.GetWidget<LabelWidget>("CONNECTING_DESC").GetText = () =>
|
||||||
"Could not connect to {0}:{1}".F(host, port);
|
"Could not connect to {0}:{1}".F(host, port);
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
if (world.LocalPlayer != null)
|
if (world.LocalPlayer != null)
|
||||||
widget.GetWidget("PLAYER_WIDGETS").IsVisible = () => true;
|
widget.GetWidget("PLAYER_WIDGETS").IsVisible = () => true;
|
||||||
|
|
||||||
ingameRoot.GetWidget<CncMenuButtonWidget>("DIPLOMACY_BUTTON").IsDisabled = () => true;
|
ingameRoot.GetWidget<ButtonWidget>("DIPLOMACY_BUTTON").IsDisabled = () => true;
|
||||||
ingameRoot.GetWidget<CncMenuButtonWidget>("OPTIONS_BUTTON").OnClick = () =>
|
ingameRoot.GetWidget<ButtonWidget>("OPTIONS_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
ingameRoot.IsVisible = () => false;
|
ingameRoot.IsVisible = () => false;
|
||||||
Game.LoadWidget(world, "INGAME_MENU", Widget.RootWidget, new WidgetArgs()
|
Game.LoadWidget(world, "INGAME_MENU", Widget.RootWidget, new WidgetArgs()
|
||||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var cheatsButton = ingameRoot.GetWidget<CncMenuButtonWidget>("CHEATS_BUTTON");
|
var cheatsButton = ingameRoot.GetWidget<ButtonWidget>("CHEATS_BUTTON");
|
||||||
cheatsButton.OnClick = () => Game.OpenWindow("CHEATS_PANEL", new WidgetArgs());
|
cheatsButton.OnClick = () => Game.OpenWindow("CHEATS_PANEL", new WidgetArgs());
|
||||||
cheatsButton.IsVisible = () => world.LobbyInfo.GlobalSettings.AllowCheats;
|
cheatsButton.IsVisible = () => world.LobbyInfo.GlobalSettings.AllowCheats;
|
||||||
|
|
||||||
@@ -108,16 +108,16 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
|
|
||||||
Action doNothing = () => {};
|
Action doNothing = () => {};
|
||||||
|
|
||||||
menu.GetWidget<CncMenuButtonWidget>("QUIT_BUTTON").OnClick = () =>
|
menu.GetWidget<ButtonWidget>("QUIT_BUTTON").OnClick = () =>
|
||||||
PromptConfirmAction("Quit", "Are you sure you want to quit?", onQuit, doNothing);
|
PromptConfirmAction("Quit", "Are you sure you want to quit?", onQuit, doNothing);
|
||||||
|
|
||||||
Action onSurrender = () => world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false));
|
Action onSurrender = () => world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false));
|
||||||
var surrenderButton = menu.GetWidget<CncMenuButtonWidget>("SURRENDER_BUTTON");
|
var surrenderButton = menu.GetWidget<ButtonWidget>("SURRENDER_BUTTON");
|
||||||
surrenderButton.IsDisabled = () => (world.LocalPlayer == null || world.LocalPlayer.WinState != WinState.Undefined);
|
surrenderButton.IsDisabled = () => (world.LocalPlayer == null || world.LocalPlayer.WinState != WinState.Undefined);
|
||||||
surrenderButton.OnClick = () =>
|
surrenderButton.OnClick = () =>
|
||||||
PromptConfirmAction("Surrender", "Are you sure you want to surrender?", onSurrender, doNothing);
|
PromptConfirmAction("Surrender", "Are you sure you want to surrender?", onSurrender, doNothing);
|
||||||
|
|
||||||
menu.GetWidget<CncMenuButtonWidget>("MUSIC_BUTTON").OnClick = () =>
|
menu.GetWidget<ButtonWidget>("MUSIC_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
hideButtons = true;
|
hideButtons = true;
|
||||||
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
||||||
@@ -126,7 +126,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
menu.GetWidget<CncMenuButtonWidget>("PREFERENCES_BUTTON").OnClick = () =>
|
menu.GetWidget<ButtonWidget>("PREFERENCES_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
hideButtons = true;
|
hideButtons = true;
|
||||||
Widget.OpenWindow("SETTINGS_PANEL", new WidgetArgs()
|
Widget.OpenWindow("SETTINGS_PANEL", new WidgetArgs()
|
||||||
@@ -136,7 +136,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
menu.GetWidget<CncMenuButtonWidget>("RESUME_BUTTON").OnClick = () =>
|
menu.GetWidget<ButtonWidget>("RESUME_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Widget.RootWidget.RemoveChild(menu);
|
Widget.RootWidget.RemoveChild(menu);
|
||||||
world.WorldActor.Trait<DesaturatedPaletteEffect>().Active = false;
|
world.WorldActor.Trait<DesaturatedPaletteEffect>().Active = false;
|
||||||
@@ -151,13 +151,13 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
prompt.GetWidget<LabelWidget>("PROMPT_TITLE").GetText = () => title;
|
prompt.GetWidget<LabelWidget>("PROMPT_TITLE").GetText = () => title;
|
||||||
prompt.GetWidget<LabelWidget>("PROMPT_TEXT").GetText = () => text;
|
prompt.GetWidget<LabelWidget>("PROMPT_TEXT").GetText = () => text;
|
||||||
|
|
||||||
prompt.GetWidget<CncMenuButtonWidget>("CONFIRM_BUTTON").OnClick = () =>
|
prompt.GetWidget<ButtonWidget>("CONFIRM_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
prompt.IsVisible = () => false;
|
prompt.IsVisible = () => false;
|
||||||
onConfirm();
|
onConfirm();
|
||||||
};
|
};
|
||||||
|
|
||||||
prompt.GetWidget<CncMenuButtonWidget>("CANCEL_BUTTON").OnClick = () =>
|
prompt.GetWidget<ButtonWidget>("CANCEL_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
prompt.IsVisible = () => false;
|
prompt.IsVisible = () => false;
|
||||||
onCancel();
|
onCancel();
|
||||||
|
|||||||
@@ -35,16 +35,16 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
{ "installData", installData }
|
{ "installData", installData }
|
||||||
};
|
};
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
|
||||||
Widget.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);
|
Widget.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("INSTALL_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
|
||||||
Widget.OpenWindow("INSTALL_FROMCD_PANEL", args);
|
Widget.OpenWindow("INSTALL_FROMCD_PANEL", args);
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
|
panel.GetWidget<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
panel.GetWidget<CncMenuButtonWidget>("MODS_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("MODS_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
|
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||||
{
|
{
|
||||||
@@ -72,11 +72,11 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
progressBar = panel.GetWidget<ProgressBarWidget>("PROGRESS_BAR");
|
progressBar = panel.GetWidget<ProgressBarWidget>("PROGRESS_BAR");
|
||||||
statusLabel = panel.GetWidget<LabelWidget>("STATUS_LABEL");
|
statusLabel = panel.GetWidget<LabelWidget>("STATUS_LABEL");
|
||||||
|
|
||||||
var backButton = panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON");
|
var backButton = panel.GetWidget<ButtonWidget>("BACK_BUTTON");
|
||||||
backButton.OnClick = Widget.CloseWindow;
|
backButton.OnClick = Widget.CloseWindow;
|
||||||
backButton.IsVisible = () => false;
|
backButton.IsVisible = () => false;
|
||||||
|
|
||||||
var retryButton = panel.GetWidget<CncMenuButtonWidget>("RETRY_BUTTON");
|
var retryButton = panel.GetWidget<ButtonWidget>("RETRY_BUTTON");
|
||||||
retryButton.OnClick = PromptForCD;
|
retryButton.OnClick = PromptForCD;
|
||||||
retryButton.IsVisible = () => false;
|
retryButton.IsVisible = () => false;
|
||||||
|
|
||||||
@@ -177,10 +177,10 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
{
|
{
|
||||||
statusLabel.GetText = () => "Initializing...";
|
statusLabel.GetText = () => "Initializing...";
|
||||||
progressBar.SetIndeterminate(true);
|
progressBar.SetIndeterminate(true);
|
||||||
var retryButton = panel.GetWidget<CncMenuButtonWidget>("RETRY_BUTTON");
|
var retryButton = panel.GetWidget<ButtonWidget>("RETRY_BUTTON");
|
||||||
retryButton.IsVisible = () => false;
|
retryButton.IsVisible = () => false;
|
||||||
|
|
||||||
var cancelButton = panel.GetWidget<CncMenuButtonWidget>("CANCEL_BUTTON");
|
var cancelButton = panel.GetWidget<ButtonWidget>("CANCEL_BUTTON");
|
||||||
|
|
||||||
// Save the package to a temp file
|
// Save the package to a temp file
|
||||||
var file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
|
var file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
CountryNames = Rules.Info["world"].Traits.WithInterface<OpenRA.Traits.CountryInfo>().ToDictionary(a => a.Race, a => a.Name);
|
CountryNames = Rules.Info["world"].Traits.WithInterface<OpenRA.Traits.CountryInfo>().ToDictionary(a => a.Race, a => a.Name);
|
||||||
CountryNames.Add("random", "Random");
|
CountryNames.Add("random", "Random");
|
||||||
|
|
||||||
var mapButton = lobby.GetWidget<CncMenuButtonWidget>("CHANGEMAP_BUTTON");
|
var mapButton = lobby.GetWidget<ButtonWidget>("CHANGEMAP_BUTTON");
|
||||||
mapButton.OnClick = () =>
|
mapButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
var onSelect = new Action<Map>(m =>
|
var onSelect = new Action<Map>(m =>
|
||||||
@@ -205,7 +205,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
};
|
};
|
||||||
mapButton.IsVisible = () => mapButton.Visible && Game.IsHost;
|
mapButton.IsVisible = () => mapButton.Visible && Game.IsHost;
|
||||||
|
|
||||||
var disconnectButton = lobby.GetWidget<CncMenuButtonWidget>("DISCONNECT_BUTTON");
|
var disconnectButton = lobby.GetWidget<ButtonWidget>("DISCONNECT_BUTTON");
|
||||||
disconnectButton.OnClick = () => { Widget.CloseWindow(); onExit(); };
|
disconnectButton.OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
|
|
||||||
var gameStarting = false;
|
var gameStarting = false;
|
||||||
@@ -221,7 +221,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command(
|
allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command(
|
||||||
"allowcheats {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowCheats)));
|
"allowcheats {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowCheats)));
|
||||||
|
|
||||||
var startGameButton = lobby.GetWidget<CncMenuButtonWidget>("START_GAME_BUTTON");
|
var startGameButton = lobby.GetWidget<ButtonWidget>("START_GAME_BUTTON");
|
||||||
startGameButton.IsVisible = () => Game.IsHost;
|
startGameButton.IsVisible = () => Game.IsHost;
|
||||||
startGameButton.IsDisabled = () => gameStarting;
|
startGameButton.IsDisabled = () => gameStarting;
|
||||||
startGameButton.OnClick = () =>
|
startGameButton.OnClick = () =>
|
||||||
@@ -254,7 +254,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
chatPanel = lobby.GetWidget<CncScrollPanelWidget>("CHAT_DISPLAY");
|
chatPanel = lobby.GetWidget<CncScrollPanelWidget>("CHAT_DISPLAY");
|
||||||
chatTemplate = chatPanel.GetWidget("CHAT_TEMPLATE");
|
chatTemplate = chatPanel.GetWidget("CHAT_TEMPLATE");
|
||||||
|
|
||||||
lobby.GetWidget<CncMenuButtonWidget>("MUSIC_BUTTON").OnClick = () =>
|
lobby.GetWidget<ButtonWidget>("MUSIC_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
||||||
{
|
{
|
||||||
@@ -627,8 +627,8 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
lumSlider.SetOffset(ramp.L / 255f);
|
lumSlider.SetOffset(ramp.L / 255f);
|
||||||
};
|
};
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("SAVE_BUTTON").OnClick = () => onSelect(ramp);
|
panel.GetWidget<ButtonWidget>("SAVE_BUTTON").OnClick = () => onSelect(ramp);
|
||||||
panel.GetWidget<CncMenuButtonWidget>("RANDOM_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("RANDOM_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
var hue = (byte)Game.CosmeticRandom.Next(255);
|
var hue = (byte)Game.CosmeticRandom.Next(255);
|
||||||
var sat = (byte)Game.CosmeticRandom.Next(255);
|
var sat = (byte)Game.CosmeticRandom.Next(255);
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
panel.GetWidget<LabelWidget>("CURMAP_THEATER").GetText = () => Rules.TileSets[map.Tileset].Name;
|
panel.GetWidget<LabelWidget>("CURMAP_THEATER").GetText = () => Rules.TileSets[map.Tileset].Name;
|
||||||
panel.GetWidget<LabelWidget>("CURMAP_PLAYERS").GetText = () => map.PlayerCount.ToString();
|
panel.GetWidget<LabelWidget>("CURMAP_PLAYERS").GetText = () => map.PlayerCount.ToString();
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BUTTON_OK").OnClick = () => { Widget.CloseWindow(); onSelect(map); };
|
panel.GetWidget<ButtonWidget>("BUTTON_OK").OnClick = () => { Widget.CloseWindow(); onSelect(map); };
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BUTTON_CANCEL").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
panel.GetWidget<ButtonWidget>("BUTTON_CANCEL").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BUTTON_INSTALL").IsDisabled = () => true;
|
panel.GetWidget<ButtonWidget>("BUTTON_INSTALL").IsDisabled = () => true;
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BUTTON_INSTALL").OnClick = () => InstallMap();
|
panel.GetWidget<ButtonWidget>("BUTTON_INSTALL").OnClick = () => InstallMap();
|
||||||
|
|
||||||
scrollpanel = panel.GetWidget<ScrollPanelWidget>("MAP_LIST");
|
scrollpanel = panel.GetWidget<ScrollPanelWidget>("MAP_LIST");
|
||||||
itemTemplate = scrollpanel.GetWidget<ScrollItemWidget>("MAP_TEMPLATE");
|
itemTemplate = scrollpanel.GetWidget<ScrollItemWidget>("MAP_TEMPLATE");
|
||||||
|
|||||||
@@ -16,47 +16,7 @@ using OpenRA.Widgets;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Cnc.Widgets
|
namespace OpenRA.Mods.Cnc.Widgets
|
||||||
{
|
{
|
||||||
public class CncMenuButtonWidget : ButtonWidget
|
public class CncCheckboxWidget : ButtonWidget
|
||||||
{
|
|
||||||
public Func<bool> IsDisabled = () => false;
|
|
||||||
public Action OnClick = () => {};
|
|
||||||
public string Font = "Bold";
|
|
||||||
|
|
||||||
public CncMenuButtonWidget()
|
|
||||||
: base()
|
|
||||||
{
|
|
||||||
OnMouseUp = mi => { if (!IsDisabled()) OnClick(); return true; };
|
|
||||||
}
|
|
||||||
|
|
||||||
protected CncMenuButtonWidget(CncMenuButtonWidget other)
|
|
||||||
: base(other)
|
|
||||||
{
|
|
||||||
OnMouseUp = mi => { if (!IsDisabled()) OnClick(); return true; };
|
|
||||||
Font = other.Font;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int2 ChildOrigin { get { return RenderOrigin; } }
|
|
||||||
public override void DrawInner()
|
|
||||||
{
|
|
||||||
var rb = RenderBounds;
|
|
||||||
var font = Game.Renderer.Fonts[Font];
|
|
||||||
var state = IsDisabled() ? "button-disabled" :
|
|
||||||
Depressed ? "button-pressed" :
|
|
||||||
rb.Contains(Viewport.LastMousePos) ? "button-hover" :
|
|
||||||
"button";
|
|
||||||
|
|
||||||
WidgetUtils.DrawPanel(state, rb);
|
|
||||||
var text = GetText();
|
|
||||||
|
|
||||||
font.DrawText(text,
|
|
||||||
new int2(rb.X + UsableWidth / 2, rb.Y + Bounds.Height / 2)
|
|
||||||
- new int2(font.Measure(text).X / 2,
|
|
||||||
font.Measure(text).Y / 2), IsDisabled() ? Color.Gray : Color.White);
|
|
||||||
}
|
|
||||||
public override Widget Clone() { return new CncMenuButtonWidget(this); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CncCheckboxWidget : CncMenuButtonWidget
|
|
||||||
{
|
{
|
||||||
public CncCheckboxWidget()
|
public CncCheckboxWidget()
|
||||||
: base() { }
|
: base() { }
|
||||||
@@ -338,7 +298,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ScrollItemWidget : CncMenuButtonWidget
|
public class ScrollItemWidget : ButtonWidget
|
||||||
{
|
{
|
||||||
public ScrollItemWidget()
|
public ScrollItemWidget()
|
||||||
: base()
|
: base()
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
var mainMenu = widget.GetWidget("MAIN_MENU");
|
var mainMenu = widget.GetWidget("MAIN_MENU");
|
||||||
mainMenu.IsVisible = () => Menu == MenuType.Main;
|
mainMenu.IsVisible = () => Menu == MenuType.Main;
|
||||||
|
|
||||||
mainMenu.GetWidget<CncMenuButtonWidget>("SOLO_BUTTON").OnClick = StartSkirmishGame;
|
mainMenu.GetWidget<ButtonWidget>("SOLO_BUTTON").OnClick = StartSkirmishGame;
|
||||||
mainMenu.GetWidget<CncMenuButtonWidget>("MULTIPLAYER_BUTTON").OnClick = () => Menu = MenuType.Multiplayer;
|
mainMenu.GetWidget<ButtonWidget>("MULTIPLAYER_BUTTON").OnClick = () => Menu = MenuType.Multiplayer;
|
||||||
|
|
||||||
mainMenu.GetWidget<CncMenuButtonWidget>("REPLAYS_BUTTON").OnClick = () =>
|
mainMenu.GetWidget<ButtonWidget>("REPLAYS_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Menu = MenuType.None;
|
Menu = MenuType.None;
|
||||||
Widget.OpenWindow("REPLAYBROWSER_PANEL", new WidgetArgs()
|
Widget.OpenWindow("REPLAYBROWSER_PANEL", new WidgetArgs()
|
||||||
@@ -57,15 +57,15 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
mainMenu.GetWidget<CncMenuButtonWidget>("SETTINGS_BUTTON").OnClick = () => Menu = MenuType.Settings;
|
mainMenu.GetWidget<ButtonWidget>("SETTINGS_BUTTON").OnClick = () => Menu = MenuType.Settings;
|
||||||
mainMenu.GetWidget<CncMenuButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
|
mainMenu.GetWidget<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
|
||||||
|
|
||||||
// Multiplayer menu
|
// Multiplayer menu
|
||||||
var multiplayerMenu = widget.GetWidget("MULTIPLAYER_MENU");
|
var multiplayerMenu = widget.GetWidget("MULTIPLAYER_MENU");
|
||||||
multiplayerMenu.IsVisible = () => Menu == MenuType.Multiplayer;
|
multiplayerMenu.IsVisible = () => Menu == MenuType.Multiplayer;
|
||||||
|
|
||||||
multiplayerMenu.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = () => Menu = MenuType.Main;
|
multiplayerMenu.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => Menu = MenuType.Main;
|
||||||
multiplayerMenu.GetWidget<CncMenuButtonWidget>("JOIN_BUTTON").OnClick = () =>
|
multiplayerMenu.GetWidget<ButtonWidget>("JOIN_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Menu = MenuType.None;
|
Menu = MenuType.None;
|
||||||
Widget.OpenWindow("SERVERBROWSER_PANEL", new WidgetArgs()
|
Widget.OpenWindow("SERVERBROWSER_PANEL", new WidgetArgs()
|
||||||
@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
multiplayerMenu.GetWidget<CncMenuButtonWidget>("CREATE_BUTTON").OnClick = () =>
|
multiplayerMenu.GetWidget<ButtonWidget>("CREATE_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Menu = MenuType.None;
|
Menu = MenuType.None;
|
||||||
Widget.OpenWindow("CREATESERVER_PANEL", new WidgetArgs()
|
Widget.OpenWindow("CREATESERVER_PANEL", new WidgetArgs()
|
||||||
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
multiplayerMenu.GetWidget<CncMenuButtonWidget>("DIRECTCONNECT_BUTTON").OnClick = () =>
|
multiplayerMenu.GetWidget<ButtonWidget>("DIRECTCONNECT_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Menu = MenuType.None;
|
Menu = MenuType.None;
|
||||||
Widget.OpenWindow("DIRECTCONNECT_PANEL", new WidgetArgs()
|
Widget.OpenWindow("DIRECTCONNECT_PANEL", new WidgetArgs()
|
||||||
@@ -99,7 +99,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
var settingsMenu = widget.GetWidget("SETTINGS_MENU");
|
var settingsMenu = widget.GetWidget("SETTINGS_MENU");
|
||||||
settingsMenu.IsVisible = () => Menu == MenuType.Settings;
|
settingsMenu.IsVisible = () => Menu == MenuType.Settings;
|
||||||
|
|
||||||
settingsMenu.GetWidget<CncMenuButtonWidget>("MODS_BUTTON").OnClick = () =>
|
settingsMenu.GetWidget<ButtonWidget>("MODS_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Menu = MenuType.None;
|
Menu = MenuType.None;
|
||||||
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
|
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||||
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
settingsMenu.GetWidget<CncMenuButtonWidget>("MUSIC_BUTTON").OnClick = () =>
|
settingsMenu.GetWidget<ButtonWidget>("MUSIC_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Menu = MenuType.None;
|
Menu = MenuType.None;
|
||||||
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
||||||
@@ -118,7 +118,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
settingsMenu.GetWidget<CncMenuButtonWidget>("PREFERENCES_BUTTON").OnClick = () =>
|
settingsMenu.GetWidget<ButtonWidget>("PREFERENCES_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Menu = MenuType.None;
|
Menu = MenuType.None;
|
||||||
Widget.OpenWindow("SETTINGS_PANEL", new WidgetArgs()
|
Widget.OpenWindow("SETTINGS_PANEL", new WidgetArgs()
|
||||||
@@ -127,7 +127,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
{ "onExit", () => Menu = MenuType.Settings },
|
{ "onExit", () => Menu = MenuType.Settings },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
settingsMenu.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = () => Menu = MenuType.Main;
|
settingsMenu.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => Menu = MenuType.Main;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveShellmapUI()
|
void RemoveShellmapUI()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
{
|
{
|
||||||
var panel = widget.GetWidget("MODS_PANEL");
|
var panel = widget.GetWidget("MODS_PANEL");
|
||||||
var modList = panel.GetWidget<ScrollPanelWidget>("MOD_LIST");
|
var modList = panel.GetWidget<ScrollPanelWidget>("MOD_LIST");
|
||||||
var loadButton = panel.GetWidget<CncMenuButtonWidget>("LOAD_BUTTON");
|
var loadButton = panel.GetWidget<ButtonWidget>("LOAD_BUTTON");
|
||||||
loadButton.OnClick = () =>
|
loadButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
// TODO: This is crap
|
// TODO: This is crap
|
||||||
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
};
|
};
|
||||||
loadButton.IsDisabled = () => currentMod.Id == Game.CurrentMods.Keys.First();
|
loadButton.IsDisabled = () => currentMod.Id == Game.CurrentMods.Keys.First();
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
currentMod = Mod.AllMods[Game.modData.Manifest.Mods[0]];
|
currentMod = Mod.AllMods[Game.modData.Manifest.Mods[0]];
|
||||||
|
|
||||||
// Mod list
|
// Mod list
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
installed = Rules.Music.Where(m => m.Value.Exists).Any();
|
installed = Rules.Music.Where(m => m.Value.Exists).Any();
|
||||||
Func<bool> noMusic = () => !installed;
|
Func<bool> noMusic = () => !installed;
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
|
|
||||||
Action<string> afterInstall = path =>
|
Action<string> afterInstall = path =>
|
||||||
{
|
{
|
||||||
@@ -57,30 +57,30 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
BuildMusicTable(panel);
|
BuildMusicTable(panel);
|
||||||
};
|
};
|
||||||
|
|
||||||
var installButton = panel.GetWidget<CncMenuButtonWidget>("INSTALL_BUTTON");
|
var installButton = panel.GetWidget<ButtonWidget>("INSTALL_BUTTON");
|
||||||
installButton.OnClick = () =>
|
installButton.OnClick = () =>
|
||||||
Widget.OpenWindow("INSTALL_MUSIC_PANEL", new WidgetArgs() {{ "afterInstall", afterInstall }});
|
Widget.OpenWindow("INSTALL_MUSIC_PANEL", new WidgetArgs() {{ "afterInstall", afterInstall }});
|
||||||
installButton.IsVisible = () => music.Length < 2; // Hack around ra shipping (only) hellmarch by default
|
installButton.IsVisible = () => music.Length < 2; // Hack around ra shipping (only) hellmarch by default
|
||||||
|
|
||||||
panel.GetWidget("NO_MUSIC_LABEL").IsVisible = noMusic;
|
panel.GetWidget("NO_MUSIC_LABEL").IsVisible = noMusic;
|
||||||
|
|
||||||
var playButton = panel.GetWidget<CncMenuButtonWidget>("BUTTON_PLAY");
|
var playButton = panel.GetWidget<ButtonWidget>("BUTTON_PLAY");
|
||||||
playButton.OnClick = Play;
|
playButton.OnClick = Play;
|
||||||
playButton.IsDisabled = noMusic;
|
playButton.IsDisabled = noMusic;
|
||||||
|
|
||||||
var pauseButton = panel.GetWidget<CncMenuButtonWidget>("BUTTON_PAUSE");
|
var pauseButton = panel.GetWidget<ButtonWidget>("BUTTON_PAUSE");
|
||||||
pauseButton.OnClick = Pause;
|
pauseButton.OnClick = Pause;
|
||||||
pauseButton.IsDisabled = noMusic;
|
pauseButton.IsDisabled = noMusic;
|
||||||
|
|
||||||
var stopButton = panel.GetWidget<CncMenuButtonWidget>("BUTTON_STOP");
|
var stopButton = panel.GetWidget<ButtonWidget>("BUTTON_STOP");
|
||||||
stopButton.OnClick = Stop;
|
stopButton.OnClick = Stop;
|
||||||
stopButton.IsDisabled = noMusic;
|
stopButton.IsDisabled = noMusic;
|
||||||
|
|
||||||
var nextButton = panel.GetWidget<CncMenuButtonWidget>("BUTTON_NEXT");
|
var nextButton = panel.GetWidget<ButtonWidget>("BUTTON_NEXT");
|
||||||
nextButton.OnClick = () => { currentSong = GetNextSong(); Play(); };
|
nextButton.OnClick = () => { currentSong = GetNextSong(); Play(); };
|
||||||
nextButton.IsDisabled = noMusic;
|
nextButton.IsDisabled = noMusic;
|
||||||
|
|
||||||
var prevButton = panel.GetWidget<CncMenuButtonWidget>("BUTTON_PREV");
|
var prevButton = panel.GetWidget<ButtonWidget>("BUTTON_PREV");
|
||||||
prevButton.OnClick = () => { currentSong = GetPrevSong(); Play(); };
|
prevButton.OnClick = () => { currentSong = GetPrevSong(); Play(); };
|
||||||
prevButton.IsDisabled = noMusic;
|
prevButton.IsDisabled = noMusic;
|
||||||
|
|
||||||
@@ -194,11 +194,11 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
progressBar = panel.GetWidget<ProgressBarWidget>("PROGRESS_BAR");
|
progressBar = panel.GetWidget<ProgressBarWidget>("PROGRESS_BAR");
|
||||||
statusLabel = panel.GetWidget<LabelWidget>("STATUS_LABEL");
|
statusLabel = panel.GetWidget<LabelWidget>("STATUS_LABEL");
|
||||||
|
|
||||||
var backButton = panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON");
|
var backButton = panel.GetWidget<ButtonWidget>("BACK_BUTTON");
|
||||||
backButton.OnClick = Widget.CloseWindow;
|
backButton.OnClick = Widget.CloseWindow;
|
||||||
backButton.IsVisible = () => false;
|
backButton.IsVisible = () => false;
|
||||||
|
|
||||||
var retryButton = panel.GetWidget<CncMenuButtonWidget>("RETRY_BUTTON");
|
var retryButton = panel.GetWidget<ButtonWidget>("RETRY_BUTTON");
|
||||||
retryButton.OnClick = PromptForCD;
|
retryButton.OnClick = PromptForCD;
|
||||||
retryButton.IsVisible = () => false;
|
retryButton.IsVisible = () => false;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
{
|
{
|
||||||
panel = widget.GetWidget("REPLAYBROWSER_PANEL");
|
panel = widget.GetWidget("REPLAYBROWSER_PANEL");
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("CANCEL_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
panel.GetWidget<ButtonWidget>("CANCEL_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
|
|
||||||
var rl = panel.GetWidget<ScrollPanelWidget>("REPLAY_LIST");
|
var rl = panel.GetWidget<ScrollPanelWidget>("REPLAY_LIST");
|
||||||
var replayDir = Path.Combine(Platform.SupportDir, "Replays");
|
var replayDir = Path.Combine(Platform.SupportDir, "Replays");
|
||||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
SelectReplay(files.FirstOrDefault());
|
SelectReplay(files.FirstOrDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
var watch = panel.GetWidget<CncMenuButtonWidget>("WATCH_BUTTON");
|
var watch = panel.GetWidget<ButtonWidget>("WATCH_BUTTON");
|
||||||
watch.IsDisabled = () => currentSummary == null || currentMap == null || currentSummary.Duration == 0;
|
watch.IsDisabled = () => currentSummary == null || currentMap == null || currentSummary.Duration == 0;
|
||||||
watch.OnClick = () =>
|
watch.OnClick = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
var sl = panel.GetWidget<ScrollPanelWidget>("SERVER_LIST");
|
var sl = panel.GetWidget<ScrollPanelWidget>("SERVER_LIST");
|
||||||
|
|
||||||
// Menu buttons
|
// Menu buttons
|
||||||
var refreshButton = panel.GetWidget<CncMenuButtonWidget>("REFRESH_BUTTON");
|
var refreshButton = panel.GetWidget<ButtonWidget>("REFRESH_BUTTON");
|
||||||
refreshButton.IsDisabled = () => refreshing;
|
refreshButton.IsDisabled = () => refreshing;
|
||||||
refreshButton.OnClick = () =>
|
refreshButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
refreshing = true;
|
refreshing = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
var join = panel.GetWidget<CncMenuButtonWidget>("JOIN_BUTTON");
|
var join = panel.GetWidget<ButtonWidget>("JOIN_BUTTON");
|
||||||
join.IsDisabled = () => currentServer == null || !ServerBrowserDelegate.CanJoin(currentServer);
|
join.IsDisabled = () => currentServer == null || !ServerBrowserDelegate.CanJoin(currentServer);
|
||||||
join.OnClick = () =>
|
join.OnClick = () =>
|
||||||
{
|
{
|
||||||
@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
CncConnectingLogic.Connect(host, port, openLobby, onExit);
|
CncConnectingLogic.Connect(host, port, openLobby, onExit);
|
||||||
};
|
};
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
|
|
||||||
// Server list
|
// Server list
|
||||||
serverTemplate = sl.GetWidget<ScrollItemWidget>("SERVER_TEMPLATE");
|
serverTemplate = sl.GetWidget<ScrollItemWidget>("SERVER_TEMPLATE");
|
||||||
@@ -224,7 +224,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
ipField.Text = last.Length > 1 ? last[0] : "localhost";
|
ipField.Text = last.Length > 1 ? last[0] : "localhost";
|
||||||
portField.Text = last.Length > 2 ? last[1] : "1234";
|
portField.Text = last.Length > 2 ? last[1] : "1234";
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("JOIN_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("JOIN_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
int port;
|
int port;
|
||||||
if (!int.TryParse(portField.Text, out port))
|
if (!int.TryParse(portField.Text, out port))
|
||||||
@@ -237,7 +237,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
CncConnectingLogic.Connect(ipField.Text, port, openLobby, onExit);
|
CncConnectingLogic.Connect(ipField.Text, port, openLobby, onExit);
|
||||||
};
|
};
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
this.onExit = onExit;
|
this.onExit = onExit;
|
||||||
|
|
||||||
var settings = Game.Settings;
|
var settings = Game.Settings;
|
||||||
panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
|
||||||
panel.GetWidget<CncMenuButtonWidget>("CREATE_BUTTON").OnClick = CreateAndJoin;
|
panel.GetWidget<ButtonWidget>("CREATE_BUTTON").OnClick = CreateAndJoin;
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("MAP_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("MAP_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Widget.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
|
Widget.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
var panel = widget.GetWidget("SETTINGS_PANEL");
|
var panel = widget.GetWidget("SETTINGS_PANEL");
|
||||||
|
|
||||||
// General pane
|
// General pane
|
||||||
var generalButton = panel.GetWidget<CncMenuButtonWidget>("GENERAL_BUTTON");
|
var generalButton = panel.GetWidget<ButtonWidget>("GENERAL_BUTTON");
|
||||||
generalButton.OnClick = () => Settings = PanelType.General;
|
generalButton.OnClick = () => Settings = PanelType.General;
|
||||||
generalButton.IsDisabled = () => Settings == PanelType.General;
|
generalButton.IsDisabled = () => Settings == PanelType.General;
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
var inputPane = panel.GetWidget("INPUT_CONTROLS");
|
var inputPane = panel.GetWidget("INPUT_CONTROLS");
|
||||||
inputPane.IsVisible = () => Settings == PanelType.Input;
|
inputPane.IsVisible = () => Settings == PanelType.Input;
|
||||||
|
|
||||||
var inputButton = panel.GetWidget<CncMenuButtonWidget>("INPUT_BUTTON");
|
var inputButton = panel.GetWidget<ButtonWidget>("INPUT_BUTTON");
|
||||||
inputButton.OnClick = () => Settings = PanelType.Input;
|
inputButton.OnClick = () => Settings = PanelType.Input;
|
||||||
inputButton.IsDisabled = () => Settings == PanelType.Input;
|
inputButton.IsDisabled = () => Settings == PanelType.Input;
|
||||||
|
|
||||||
@@ -151,13 +151,13 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
groupModifierDropdown.GetText = () => groupAddModifier.ToString();
|
groupModifierDropdown.GetText = () => groupAddModifier.ToString();
|
||||||
|
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("CANCEL_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("CANCEL_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
Widget.CloseWindow();
|
Widget.CloseWindow();
|
||||||
onExit();
|
onExit();
|
||||||
};
|
};
|
||||||
|
|
||||||
panel.GetWidget<CncMenuButtonWidget>("SAVE_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("SAVE_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
var s = Game.Settings;
|
var s = Game.Settings;
|
||||||
s.Player.Name = nameTextfield.Text;
|
s.Player.Name = nameTextfield.Text;
|
||||||
|
|||||||
@@ -67,21 +67,21 @@ Container@CHEATS_PANEL:
|
|||||||
Width:200
|
Width:200
|
||||||
Height:20
|
Height:20
|
||||||
Text:Show Unit Paths
|
Text:Show Unit Paths
|
||||||
CncMenuButton@CLOSE_BUTTON:
|
Button@CLOSE_BUTTON:
|
||||||
Id:CLOSE_BUTTON
|
Id:CLOSE_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:109
|
Y:109
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Close
|
Text:Close
|
||||||
CncMenuButton@GIVE_CASH:
|
Button@GIVE_CASH:
|
||||||
Id:GIVE_CASH_BUTTON
|
Id:GIVE_CASH_BUTTON
|
||||||
X:300
|
X:300
|
||||||
Y:109
|
Y:109
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Give Cash
|
Text:Give Cash
|
||||||
CncMenuButton@GIVE_EXPLORATION:
|
Button@GIVE_EXPLORATION:
|
||||||
Id:GIVE_EXPLORATION_BUTTON
|
Id:GIVE_EXPLORATION_BUTTON
|
||||||
X:450
|
X:450
|
||||||
Y:109
|
Y:109
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Container@CONNECTING_PANEL:
|
|||||||
Text:Connecting...
|
Text:Connecting...
|
||||||
Font:Bold
|
Font:Bold
|
||||||
Align:Center
|
Align:Center
|
||||||
CncMenuButton@ABORT_BUTTON:
|
Button@ABORT_BUTTON:
|
||||||
Id:ABORT_BUTTON
|
Id:ABORT_BUTTON
|
||||||
X:230
|
X:230
|
||||||
Y:89
|
Y:89
|
||||||
@@ -62,13 +62,13 @@ Container@CONNECTIONFAILED_PANEL:
|
|||||||
Text:Failed to connect
|
Text:Failed to connect
|
||||||
Font:Bold
|
Font:Bold
|
||||||
Align:Center
|
Align:Center
|
||||||
CncMenuButton@RETRY_BUTTON:
|
Button@RETRY_BUTTON:
|
||||||
Id:RETRY_BUTTON
|
Id:RETRY_BUTTON
|
||||||
Y:89
|
Y:89
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Retry
|
Text:Retry
|
||||||
CncMenuButton@ABORT_BUTTON:
|
Button@ABORT_BUTTON:
|
||||||
Id:ABORT_BUTTON
|
Id:ABORT_BUTTON
|
||||||
X:230
|
X:230
|
||||||
Y:89
|
Y:89
|
||||||
|
|||||||
@@ -129,21 +129,21 @@ Container@CREATESERVER_PANEL:
|
|||||||
MaxLength:5
|
MaxLength:5
|
||||||
Height:25
|
Height:25
|
||||||
Text:1234
|
Text:1234
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:259
|
Y:259
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@MAP_BUTTON:
|
Button@MAP_BUTTON:
|
||||||
Id:MAP_BUTTON
|
Id:MAP_BUTTON
|
||||||
X:314
|
X:314
|
||||||
Y:259
|
Y:259
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Choose Map
|
Text:Choose Map
|
||||||
CncMenuButton@CREATE_BUTTON:
|
Button@CREATE_BUTTON:
|
||||||
Id:CREATE_BUTTON
|
Id:CREATE_BUTTON
|
||||||
X:464
|
X:464
|
||||||
Y:259
|
Y:259
|
||||||
|
|||||||
@@ -44,14 +44,14 @@ Container@DIRECTCONNECT_PANEL:
|
|||||||
Y:50
|
Y:50
|
||||||
Width:200
|
Width:200
|
||||||
Height:25
|
Height:25
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:89
|
Y:89
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@JOIN_BUTTON:
|
Button@JOIN_BUTTON:
|
||||||
Id:JOIN_BUTTON
|
Id:JOIN_BUTTON
|
||||||
X:230
|
X:230
|
||||||
Y:89
|
Y:89
|
||||||
|
|||||||
@@ -17,21 +17,21 @@ Container@INGAME_ROOT:
|
|||||||
Id:STRATEGIC_PROGRESS
|
Id:STRATEGIC_PROGRESS
|
||||||
X: WINDOW_RIGHT/2
|
X: WINDOW_RIGHT/2
|
||||||
Y: 40
|
Y: 40
|
||||||
CncMenuButton@OPTIONS_BUTTON:
|
Button@OPTIONS_BUTTON:
|
||||||
Id:OPTIONS_BUTTON
|
Id:OPTIONS_BUTTON
|
||||||
X:5
|
X:5
|
||||||
Y:5
|
Y:5
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Options
|
Text:Options
|
||||||
CncMenuButton@DIPLOMACY_BUTTON:
|
Button@DIPLOMACY_BUTTON:
|
||||||
Id:DIPLOMACY_BUTTON
|
Id:DIPLOMACY_BUTTON
|
||||||
X:150
|
X:150
|
||||||
Y:5
|
Y:5
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Diplomacy
|
Text:Diplomacy
|
||||||
CncMenuButton@CHEATS_BUTTON:
|
Button@CHEATS_BUTTON:
|
||||||
Id:CHEATS_BUTTON
|
Id:CHEATS_BUTTON
|
||||||
X:295
|
X:295
|
||||||
Y:5
|
Y:5
|
||||||
|
|||||||
@@ -26,35 +26,35 @@ Container@INGAME_MENU:
|
|||||||
Width:740
|
Width:740
|
||||||
Height:35
|
Height:35
|
||||||
Children:
|
Children:
|
||||||
CncMenuButton@QUIT_BUTTON:
|
Button@QUIT_BUTTON:
|
||||||
Id:QUIT_BUTTON
|
Id:QUIT_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Quit
|
Text:Quit
|
||||||
CncMenuButton@SURRENDER_BUTTON:
|
Button@SURRENDER_BUTTON:
|
||||||
Id:SURRENDER_BUTTON
|
Id:SURRENDER_BUTTON
|
||||||
X:150
|
X:150
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Surrender
|
Text:Surrender
|
||||||
CncMenuButton@MUSIC_BUTTON:
|
Button@MUSIC_BUTTON:
|
||||||
Id:MUSIC_BUTTON
|
Id:MUSIC_BUTTON
|
||||||
X:300
|
X:300
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Music
|
Text:Music
|
||||||
CncMenuButton@PREFERENCES_BUTTON:
|
Button@PREFERENCES_BUTTON:
|
||||||
Id:PREFERENCES_BUTTON
|
Id:PREFERENCES_BUTTON
|
||||||
X:450
|
X:450
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Settings
|
Text:Settings
|
||||||
CncMenuButton@RESUME_BUTTON:
|
Button@RESUME_BUTTON:
|
||||||
Id:RESUME_BUTTON
|
Id:RESUME_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:0
|
Y:0
|
||||||
@@ -89,13 +89,13 @@ Container@INGAME_MENU:
|
|||||||
Font:Bold
|
Font:Bold
|
||||||
WordWrap:true
|
WordWrap:true
|
||||||
Align:Center
|
Align:Center
|
||||||
CncMenuButton@CANCEL_BUTTON:
|
Button@CANCEL_BUTTON:
|
||||||
Id:CANCEL_BUTTON
|
Id:CANCEL_BUTTON
|
||||||
Y:89
|
Y:89
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Cancel
|
Text:Cancel
|
||||||
CncMenuButton@CONFIRM_BUTTON:
|
Button@CONFIRM_BUTTON:
|
||||||
Id:CONFIRM_BUTTON
|
Id:CONFIRM_BUTTON
|
||||||
X:230
|
X:230
|
||||||
Y:89
|
Y:89
|
||||||
|
|||||||
@@ -44,27 +44,27 @@ Container@INSTALL_PANEL:
|
|||||||
WordWrap:true
|
WordWrap:true
|
||||||
Text:OpenRA can download these files (excluding music and videos) from the internet, or you can install from the original C&C CD.
|
Text:OpenRA can download these files (excluding music and videos) from the internet, or you can install from the original C&C CD.
|
||||||
Font:Bold
|
Font:Bold
|
||||||
CncMenuButton@QUIT_BUTTON:
|
Button@QUIT_BUTTON:
|
||||||
Id:QUIT_BUTTON
|
Id:QUIT_BUTTON
|
||||||
Y:149
|
Y:149
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Quit
|
Text:Quit
|
||||||
CncMenuButton@MODS_BUTTON:
|
Button@MODS_BUTTON:
|
||||||
Id:MODS_BUTTON
|
Id:MODS_BUTTON
|
||||||
X:150
|
X:150
|
||||||
Y:149
|
Y:149
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Change Mod
|
Text:Change Mod
|
||||||
CncMenuButton@DOWNLOAD_BUTTON:
|
Button@DOWNLOAD_BUTTON:
|
||||||
Id:DOWNLOAD_BUTTON
|
Id:DOWNLOAD_BUTTON
|
||||||
X:350
|
X:350
|
||||||
Y:149
|
Y:149
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Download
|
Text:Download
|
||||||
CncMenuButton@INSTALL_BUTTON:
|
Button@INSTALL_BUTTON:
|
||||||
Id:INSTALL_BUTTON
|
Id:INSTALL_BUTTON
|
||||||
X:500
|
X:500
|
||||||
Y:149
|
Y:149
|
||||||
@@ -111,13 +111,13 @@ Container@INSTALL_FROMCD_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
Align:Left
|
Align:Left
|
||||||
Text:Waiting for CD
|
Text:Waiting for CD
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
Y:149
|
Y:149
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@RETRY_BUTTON:
|
Button@RETRY_BUTTON:
|
||||||
Id:RETRY_BUTTON
|
Id:RETRY_BUTTON
|
||||||
X:500
|
X:500
|
||||||
Y:149
|
Y:149
|
||||||
@@ -164,13 +164,13 @@ Container@INSTALL_DOWNLOAD_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
Align:Left
|
Align:Left
|
||||||
Text:Initialising...
|
Text:Initialising...
|
||||||
CncMenuButton@CANCEL_BUTTON:
|
Button@CANCEL_BUTTON:
|
||||||
Id:CANCEL_BUTTON
|
Id:CANCEL_BUTTON
|
||||||
Y:149
|
Y:149
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Cancel
|
Text:Cancel
|
||||||
CncMenuButton@RETRY_BUTTON:
|
Button@RETRY_BUTTON:
|
||||||
Id:RETRY_BUTTON
|
Id:RETRY_BUTTON
|
||||||
X:500
|
X:500
|
||||||
Y:149
|
Y:149
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ Container@SERVER_LOBBY:
|
|||||||
Height:25
|
Height:25
|
||||||
X:5
|
X:5
|
||||||
Y:0-1
|
Y:0-1
|
||||||
CncMenuButton@KICK:
|
Button@KICK:
|
||||||
Id:KICK
|
Id:KICK
|
||||||
Text:X
|
Text:X
|
||||||
Width:25
|
Width:25
|
||||||
@@ -209,7 +209,7 @@ Container@SERVER_LOBBY:
|
|||||||
Height:25
|
Height:25
|
||||||
X:5
|
X:5
|
||||||
Y:0-1
|
Y:0-1
|
||||||
CncMenuButton@JOIN:
|
Button@JOIN:
|
||||||
Id:JOIN
|
Id:JOIN
|
||||||
Text:Play in this slot
|
Text:Play in this slot
|
||||||
Font:Regular
|
Font:Regular
|
||||||
@@ -240,7 +240,7 @@ Container@SERVER_LOBBY:
|
|||||||
Width:150
|
Width:150
|
||||||
Height:25
|
Height:25
|
||||||
Font:Regular
|
Font:Regular
|
||||||
CncMenuButton@JOIN:
|
Button@JOIN:
|
||||||
Id:JOIN
|
Id:JOIN
|
||||||
Text:Play in this slot
|
Text:Play in this slot
|
||||||
Font:Regular
|
Font:Regular
|
||||||
@@ -354,28 +354,28 @@ Container@SERVER_LOBBY:
|
|||||||
Height:25
|
Height:25
|
||||||
Align:Right
|
Align:Right
|
||||||
Text:Chat:
|
Text:Chat:
|
||||||
CncMenuButton@DISCONNECT_BUTTON:
|
Button@DISCONNECT_BUTTON:
|
||||||
Id:DISCONNECT_BUTTON
|
Id:DISCONNECT_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Leave Game
|
Text:Leave Game
|
||||||
CncMenuButton@MUSIC_BUTTON:
|
Button@MUSIC_BUTTON:
|
||||||
Id:MUSIC_BUTTON
|
Id:MUSIC_BUTTON
|
||||||
X:300
|
X:300
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Music
|
Text:Music
|
||||||
CncMenuButton@CHANGEMAP_BUTTON:
|
Button@CHANGEMAP_BUTTON:
|
||||||
Id:CHANGEMAP_BUTTON
|
Id:CHANGEMAP_BUTTON
|
||||||
X:450
|
X:450
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Change Map
|
Text:Change Map
|
||||||
CncMenuButton@START_GAME_BUTTON:
|
Button@START_GAME_BUTTON:
|
||||||
Id:START_GAME_BUTTON
|
Id:START_GAME_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:499
|
Y:499
|
||||||
@@ -389,14 +389,14 @@ Background@COLOR_CHOOSER:
|
|||||||
Width:315
|
Width:315
|
||||||
Height:130
|
Height:130
|
||||||
Children:
|
Children:
|
||||||
CncMenuButton@SAVE_BUTTON:
|
Button@SAVE_BUTTON:
|
||||||
Id:SAVE_BUTTON
|
Id:SAVE_BUTTON
|
||||||
X:210
|
X:210
|
||||||
Y:90
|
Y:90
|
||||||
Width:90
|
Width:90
|
||||||
Height:25
|
Height:25
|
||||||
Text:Save
|
Text:Save
|
||||||
CncMenuButton@RANDOM_BUTTON:
|
Button@RANDOM_BUTTON:
|
||||||
Id:RANDOM_BUTTON
|
Id:RANDOM_BUTTON
|
||||||
X:15
|
X:15
|
||||||
Y:90
|
Y:90
|
||||||
|
|||||||
@@ -38,35 +38,35 @@ Container@MENU_BACKGROUND:
|
|||||||
Align:Center
|
Align:Center
|
||||||
Font:Bold
|
Font:Bold
|
||||||
Contrast:True
|
Contrast:True
|
||||||
CncMenuButton@SOLO_BUTTON:
|
Button@SOLO_BUTTON:
|
||||||
Id:SOLO_BUTTON
|
Id:SOLO_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Singleplayer
|
Text:Singleplayer
|
||||||
CncMenuButton@MULTIPLAYER_BUTTON:
|
Button@MULTIPLAYER_BUTTON:
|
||||||
Id:MULTIPLAYER_BUTTON
|
Id:MULTIPLAYER_BUTTON
|
||||||
X:150
|
X:150
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Multiplayer
|
Text:Multiplayer
|
||||||
CncMenuButton@SETTINGS_BUTTON:
|
Button@SETTINGS_BUTTON:
|
||||||
Id:SETTINGS_BUTTON
|
Id:SETTINGS_BUTTON
|
||||||
X:300
|
X:300
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Settings
|
Text:Settings
|
||||||
CncMenuButton@REPLAYS_BUTTON:
|
Button@REPLAYS_BUTTON:
|
||||||
Id:REPLAYS_BUTTON
|
Id:REPLAYS_BUTTON
|
||||||
X:450
|
X:450
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text: Replays
|
Text: Replays
|
||||||
CncMenuButton@QUIT_BUTTON:
|
Button@QUIT_BUTTON:
|
||||||
Id:QUIT_BUTTON
|
Id:QUIT_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:0
|
Y:0
|
||||||
@@ -87,28 +87,28 @@ Container@MENU_BACKGROUND:
|
|||||||
Align:Center
|
Align:Center
|
||||||
Font:Bold
|
Font:Bold
|
||||||
Contrast:True
|
Contrast:True
|
||||||
CncMenuButton@CREATE_BUTTON:
|
Button@CREATE_BUTTON:
|
||||||
Id:CREATE_BUTTON
|
Id:CREATE_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Create Server
|
Text:Create Server
|
||||||
CncMenuButton@JOIN_BUTTON:
|
Button@JOIN_BUTTON:
|
||||||
Id:JOIN_BUTTON
|
Id:JOIN_BUTTON
|
||||||
X:150
|
X:150
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Find Server
|
Text:Find Server
|
||||||
CncMenuButton@DIRECTCONNECT_BUTTON:
|
Button@DIRECTCONNECT_BUTTON:
|
||||||
Id:DIRECTCONNECT_BUTTON
|
Id:DIRECTCONNECT_BUTTON
|
||||||
X:300
|
X:300
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Direct Connect
|
Text:Direct Connect
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:0
|
Y:0
|
||||||
@@ -129,28 +129,28 @@ Container@MENU_BACKGROUND:
|
|||||||
Align:Center
|
Align:Center
|
||||||
Font:Bold
|
Font:Bold
|
||||||
Contrast:True
|
Contrast:True
|
||||||
CncMenuButton@MODS_BUTTON:
|
Button@MODS_BUTTON:
|
||||||
Id:MODS_BUTTON
|
Id:MODS_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Mods
|
Text:Mods
|
||||||
CncMenuButton@MUSIC_BUTTON:
|
Button@MUSIC_BUTTON:
|
||||||
Id:MUSIC_BUTTON
|
Id:MUSIC_BUTTON
|
||||||
X:150
|
X:150
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Music
|
Text:Music
|
||||||
CncMenuButton@PREFERENCES_BUTTON:
|
Button@PREFERENCES_BUTTON:
|
||||||
Id:PREFERENCES_BUTTON
|
Id:PREFERENCES_BUTTON
|
||||||
X:300
|
X:300
|
||||||
Y:0
|
Y:0
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Preferences
|
Text:Preferences
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:0
|
Y:0
|
||||||
|
|||||||
@@ -189,21 +189,21 @@ Container@MAPCHOOSER_PANEL:
|
|||||||
Width:117
|
Width:117
|
||||||
Height:20
|
Height:20
|
||||||
WordWrap:True
|
WordWrap:True
|
||||||
CncMenuButton@BUTTON_CANCEL:
|
Button@BUTTON_CANCEL:
|
||||||
Id:BUTTON_CANCEL
|
Id:BUTTON_CANCEL
|
||||||
X:0
|
X:0
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Cancel
|
Text:Cancel
|
||||||
CncMenuButton@BUTTON_INSTALL:
|
Button@BUTTON_INSTALL:
|
||||||
Id:BUTTON_INSTALL
|
Id:BUTTON_INSTALL
|
||||||
X:450
|
X:450
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Install Map
|
Text:Install Map
|
||||||
CncMenuButton@BUTTON_OK:
|
Button@BUTTON_OK:
|
||||||
Id:BUTTON_OK
|
Id:BUTTON_OK
|
||||||
X:600
|
X:600
|
||||||
Y:499
|
Y:499
|
||||||
|
|||||||
@@ -78,14 +78,14 @@ Container@MODS_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
Text:Version
|
Text:Version
|
||||||
Font:Bold
|
Font:Bold
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@LOAD_BUTTON:
|
Button@LOAD_BUTTON:
|
||||||
Id:LOAD_BUTTON
|
Id:LOAD_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:499
|
Y:499
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ Container@MUSIC_PANEL:
|
|||||||
Y:320
|
Y:320
|
||||||
Width:170
|
Width:170
|
||||||
Children:
|
Children:
|
||||||
CncMenuButton@BUTTON_PREV:
|
Button@BUTTON_PREV:
|
||||||
Id:BUTTON_PREV
|
Id:BUTTON_PREV
|
||||||
Width:35
|
Width:35
|
||||||
Height:35
|
Height:35
|
||||||
@@ -90,7 +90,7 @@ Container@MUSIC_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
ImageCollection:music
|
ImageCollection:music
|
||||||
ImageName:prev
|
ImageName:prev
|
||||||
CncMenuButton@BUTTON_PLAY:
|
Button@BUTTON_PLAY:
|
||||||
Id:BUTTON_PLAY
|
Id:BUTTON_PLAY
|
||||||
X:45
|
X:45
|
||||||
Width:35
|
Width:35
|
||||||
@@ -104,7 +104,7 @@ Container@MUSIC_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
ImageCollection:music
|
ImageCollection:music
|
||||||
ImageName:play
|
ImageName:play
|
||||||
CncMenuButton@BUTTON_PAUSE:
|
Button@BUTTON_PAUSE:
|
||||||
Id:BUTTON_PAUSE
|
Id:BUTTON_PAUSE
|
||||||
Visible:false
|
Visible:false
|
||||||
X:45
|
X:45
|
||||||
@@ -119,7 +119,7 @@ Container@MUSIC_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
ImageCollection:music
|
ImageCollection:music
|
||||||
ImageName:pause
|
ImageName:pause
|
||||||
CncMenuButton@BUTTON_STOP:
|
Button@BUTTON_STOP:
|
||||||
Id:BUTTON_STOP
|
Id:BUTTON_STOP
|
||||||
X:90
|
X:90
|
||||||
Width:35
|
Width:35
|
||||||
@@ -133,7 +133,7 @@ Container@MUSIC_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
ImageCollection:music
|
ImageCollection:music
|
||||||
ImageName:stop
|
ImageName:stop
|
||||||
CncMenuButton@BUTTON_NEXT:
|
Button@BUTTON_NEXT:
|
||||||
Id:BUTTON_NEXT
|
Id:BUTTON_NEXT
|
||||||
X:135
|
X:135
|
||||||
Width:35
|
Width:35
|
||||||
@@ -169,14 +169,14 @@ Container@MUSIC_PANEL:
|
|||||||
Width:70
|
Width:70
|
||||||
Height:20
|
Height:20
|
||||||
Text:Loop
|
Text:Loop
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:399
|
Y:399
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@INSTALL_BUTTON:
|
Button@INSTALL_BUTTON:
|
||||||
Id:INSTALL_BUTTON
|
Id:INSTALL_BUTTON
|
||||||
X:220
|
X:220
|
||||||
Y:399
|
Y:399
|
||||||
@@ -223,13 +223,13 @@ Container@INSTALL_MUSIC_PANEL:
|
|||||||
Height:25
|
Height:25
|
||||||
Align:Left
|
Align:Left
|
||||||
Text:Waiting for file
|
Text:Waiting for file
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
Y:149
|
Y:149
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@RETRY_BUTTON:
|
Button@RETRY_BUTTON:
|
||||||
Id:RETRY_BUTTON
|
Id:RETRY_BUTTON
|
||||||
X:500
|
X:500
|
||||||
Y:149
|
Y:149
|
||||||
|
|||||||
@@ -333,27 +333,27 @@ Container@SETTINGS_PANEL:
|
|||||||
# Y:85
|
# Y:85
|
||||||
# Width:350
|
# Width:350
|
||||||
# Height:150
|
# Height:150
|
||||||
CncMenuButton@GENERAL_BUTTON:
|
Button@GENERAL_BUTTON:
|
||||||
Id:GENERAL_BUTTON
|
Id:GENERAL_BUTTON
|
||||||
Y:249
|
Y:249
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:General
|
Text:General
|
||||||
CncMenuButton@INPUT_BUTTON:
|
Button@INPUT_BUTTON:
|
||||||
Id:INPUT_BUTTON
|
Id:INPUT_BUTTON
|
||||||
X:150
|
X:150
|
||||||
Y:249
|
Y:249
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Input
|
Text:Input
|
||||||
CncMenuButton@CANCEL_BUTTON:
|
Button@CANCEL_BUTTON:
|
||||||
Id:CANCEL_BUTTON
|
Id:CANCEL_BUTTON
|
||||||
X:450
|
X:450
|
||||||
Y:249
|
Y:249
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Cancel
|
Text:Cancel
|
||||||
CncMenuButton@SAVE_BUTTON:
|
Button@SAVE_BUTTON:
|
||||||
Id:SAVE_BUTTON
|
Id:SAVE_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:249
|
Y:249
|
||||||
|
|||||||
@@ -96,14 +96,14 @@ Container@REPLAYBROWSER_PANEL:
|
|||||||
Y:40
|
Y:40
|
||||||
Width:70
|
Width:70
|
||||||
Height:20
|
Height:20
|
||||||
CncMenuButton@CANCEL_BUTTON:
|
Button@CANCEL_BUTTON:
|
||||||
Id:CANCEL_BUTTON
|
Id:CANCEL_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:299
|
Y:299
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@WATCH_BUTTON:
|
Button@WATCH_BUTTON:
|
||||||
Id:WATCH_BUTTON
|
Id:WATCH_BUTTON
|
||||||
X:380
|
X:380
|
||||||
Y:299
|
Y:299
|
||||||
|
|||||||
@@ -191,21 +191,21 @@ Container@SERVERBROWSER_PANEL:
|
|||||||
VAlign:Top
|
VAlign:Top
|
||||||
Width:70
|
Width:70
|
||||||
Height:20
|
Height:20
|
||||||
CncMenuButton@BACK_BUTTON:
|
Button@BACK_BUTTON:
|
||||||
Id:BACK_BUTTON
|
Id:BACK_BUTTON
|
||||||
X:0
|
X:0
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Back
|
Text:Back
|
||||||
CncMenuButton@REFRESH_BUTTON:
|
Button@REFRESH_BUTTON:
|
||||||
Id:REFRESH_BUTTON
|
Id:REFRESH_BUTTON
|
||||||
X:450
|
X:450
|
||||||
Y:499
|
Y:499
|
||||||
Width:140
|
Width:140
|
||||||
Height:35
|
Height:35
|
||||||
Text:Refresh
|
Text:Refresh
|
||||||
CncMenuButton@JOIN_BUTTON:
|
Button@JOIN_BUTTON:
|
||||||
Id:JOIN_BUTTON
|
Id:JOIN_BUTTON
|
||||||
X:600
|
X:600
|
||||||
Y:499
|
Y:499
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# General dumping-ground for UI element sizes, etc.
|
# General dumping-ground for UI element sizes, etc.
|
||||||
|
|
||||||
Metrics:
|
Metrics:
|
||||||
ButtonDepth: 1
|
ButtonDepth: 0
|
||||||
|
ButtonFont: Bold
|
||||||
@@ -237,3 +237,51 @@ progressbar-thumb: dialog.png
|
|||||||
corner-tr: 594,0,1,1
|
corner-tr: 594,0,1,1
|
||||||
corner-bl: 512,82,1,1
|
corner-bl: 512,82,1,1
|
||||||
corner-br: 594,82,1,1
|
corner-br: 594,82,1,1
|
||||||
|
|
||||||
|
# A copy of dialog2
|
||||||
|
button: dialog.png
|
||||||
|
background: 513,1,126,126
|
||||||
|
border-r: 639,1,1,126
|
||||||
|
border-l: 512,1,1,126
|
||||||
|
border-b: 513,127,126,1
|
||||||
|
border-t: 513,0,126,1
|
||||||
|
corner-tl: 512,0,1,1
|
||||||
|
corner-tr: 594,0,1,1
|
||||||
|
corner-bl: 512,82,1,1
|
||||||
|
corner-br: 594,82,1,1
|
||||||
|
|
||||||
|
# A copy of dialog2
|
||||||
|
button-hover: dialog.png
|
||||||
|
background: 513,1,126,126
|
||||||
|
border-r: 639,1,1,126
|
||||||
|
border-l: 512,1,1,126
|
||||||
|
border-b: 513,127,126,1
|
||||||
|
border-t: 513,0,126,1
|
||||||
|
corner-tl: 512,0,1,1
|
||||||
|
corner-tr: 594,0,1,1
|
||||||
|
corner-bl: 512,82,1,1
|
||||||
|
corner-br: 594,82,1,1
|
||||||
|
|
||||||
|
# A copy of dialog2
|
||||||
|
button-disabled: dialog.png
|
||||||
|
background: 513,1,126,126
|
||||||
|
border-r: 639,1,1,126
|
||||||
|
border-l: 512,1,1,126
|
||||||
|
border-b: 513,127,126,1
|
||||||
|
border-t: 513,0,126,1
|
||||||
|
corner-tl: 512,0,1,1
|
||||||
|
corner-tr: 594,0,1,1
|
||||||
|
corner-bl: 512,82,1,1
|
||||||
|
corner-br: 594,82,1,1
|
||||||
|
|
||||||
|
# A copy of dialog3
|
||||||
|
button-pressed: dialog.png
|
||||||
|
background: 641,1,126,126
|
||||||
|
border-r: 767,1,1,126
|
||||||
|
border-l: 640,1,1,126
|
||||||
|
border-b: 641,127,126,1
|
||||||
|
border-t: 641,0,126,1
|
||||||
|
corner-tl: 640,0,1,1
|
||||||
|
corner-tr: 722,0,1,1
|
||||||
|
corner-bl: 640,82,1,1
|
||||||
|
corner-br: 722,82,1,1
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# General dumping-ground for UI element sizes, etc.
|
# General dumping-ground for UI element sizes, etc.
|
||||||
|
|
||||||
Metrics:
|
Metrics:
|
||||||
ButtonDepth: 1
|
ButtonDepth: 1
|
||||||
|
ButtonFont: Regular
|
||||||
Reference in New Issue
Block a user