create widgets on demand
This commit is contained in:
@@ -21,9 +21,6 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
var gameRoot = r.GetWidget("INGAME_ROOT");
|
||||
var optionsBG = gameRoot.GetWidget("INGAME_OPTIONS_BG");
|
||||
|
||||
Game.BeforeGameStart += () => Widget.OpenWindow("INGAME_ROOT");
|
||||
Game.AfterGameStart += () => gameRoot.GetWidget<RadarBinWidget>("INGAME_RADAR_BIN").SetWorld(Game.world);
|
||||
|
||||
r.GetWidget("INGAME_OPTIONS_BUTTON").OnMouseUp = mi => {
|
||||
optionsBG.Visible = !optionsBG.Visible;
|
||||
return true;
|
||||
|
||||
@@ -163,6 +163,9 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
int updateTicks = 0;
|
||||
public override void Tick(World w)
|
||||
{
|
||||
if( world != w )
|
||||
SetWorld( w );
|
||||
|
||||
var hasRadarNew = world.Queries.OwnedBy[world.LocalPlayer]
|
||||
.WithTrait<ProvidesRadar>()
|
||||
.Any(a => a.Trait.IsActive);
|
||||
|
||||
Reference in New Issue
Block a user