@@ -21,6 +21,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
readonly World world;
|
||||
readonly Widget ingameRoot;
|
||||
bool disableSystemButtons;
|
||||
Widget currentWidget;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public OrderButtonsChromeLogic(Widget widget, World world)
|
||||
@@ -28,6 +29,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
this.world = world;
|
||||
ingameRoot = Ui.Root.Get("INGAME_ROOT");
|
||||
|
||||
Action removeCurrentWidget = () => Ui.Root.RemoveChild(currentWidget);
|
||||
world.GameOver += removeCurrentWidget;
|
||||
|
||||
// Order Buttons
|
||||
var sell = widget.GetOrNull<ButtonWidget>("SELL_BUTTON");
|
||||
if (sell != null)
|
||||
@@ -139,7 +143,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
disableSystemButtons = false;
|
||||
});
|
||||
|
||||
Game.LoadWidget(world, button.MenuContainer, Ui.Root, widgetArgs);
|
||||
currentWidget = Game.LoadWidget(world, button.MenuContainer, Ui.Root, widgetArgs);
|
||||
}
|
||||
|
||||
static void BindOrderButton<T>(World world, ButtonWidget w, string icon)
|
||||
|
||||
Reference in New Issue
Block a user