protected virtual void LoadMenu() { this.pieMenu = new PieMenu(); this.planetMenu = new PieMenuNode(); this.planetMenu.Add(new PieMenuNode("View Planet", ResourceManager.TextureDict["UI/viewPlanetIcon"], new SimpleDelegate(this.ViewPlanet))); this.planetMenu.Add(new PieMenuNode("Mark for Colonization", ResourceManager.TextureDict["UI/viewPlanetIcon"], new SimpleDelegate(this.MarkForColonization))); this.shipMenu = new PieMenuNode(); this.shipMenu.Add(new PieMenuNode("Commandeer Ship", ResourceManager.TextureDict["UI/viewPlanetIcon"], new SimpleDelegate(this.ViewShip))); }
protected void LoadShipMenuNodes(int which) { this.shipMenu.Children.Clear(); if (which == 1) { if (this.SelectedShip != null && this.SelectedShip == this.playerShip) this.shipMenu.Add(new PieMenuNode("Relinquish Control", ResourceManager.TextureDict["UI/viewPlanetIcon"], new SimpleDelegate(this.ViewShip))); else this.shipMenu.Add(new PieMenuNode(Localizer.Token(1412), ResourceManager.TextureDict["UI/viewPlanetIcon"], new SimpleDelegate(this.ViewShip))); PieMenuNode newChild1 = new PieMenuNode(Localizer.Token(1413), ResourceManager.TextureDict["UI/OrdersIcon"], (SimpleDelegate)null); this.shipMenu.Add(newChild1); if (this.SelectedShip != null && (double)this.SelectedShip.CargoSpace_Max > 0.0) { PieMenuNode newChild2 = new PieMenuNode(Localizer.Token(1414), ResourceManager.TextureDict["UI/PatrolIcon"], new SimpleDelegate(this.DoTransport)); newChild1.Add(newChild2); PieMenuNode newChild3 = new PieMenuNode(Localizer.Token(1415), ResourceManager.TextureDict["UI/marketIcon"], new SimpleDelegate(this.DoTransportGoods)); newChild1.Add(newChild3); } PieMenuNode newChild4 = new PieMenuNode(Localizer.Token(1416), ResourceManager.TextureDict["UI/marketIcon"], new SimpleDelegate(this.DoExplore)); newChild1.Add(newChild4); PieMenuNode newChild5 = new PieMenuNode("Empire Defense", ResourceManager.TextureDict["UI/PatrolIcon"], new SimpleDelegate(this.DoDefense)); newChild1.Add(newChild5); PieMenuNode newChild6 = new PieMenuNode(Localizer.Token(1417), ResourceManager.TextureDict["UI/FollowIcon"], (SimpleDelegate)null); this.shipMenu.Add(newChild6); if (this.SelectedShip != null && this.SelectedShip.Role != "station" && this.SelectedShip.Role != "platform") { PieMenuNode newChild2 = new PieMenuNode(Localizer.Token(1418), ResourceManager.TextureDict["UI/FollowIcon"], new SimpleDelegate(this.RefitTo)); newChild6.Add(newChild2); } if (this.SelectedShip != null && (this.SelectedShip.Role == "station" || this.SelectedShip.Role == "platform")) { PieMenuNode newChild2 = new PieMenuNode("Scuttle", ResourceManager.TextureDict["UI/HoldPositionIcon"], new SimpleDelegate(this.OrderScuttle)); newChild6.Add(newChild2); } else { if (this.SelectedShip == null || !(this.SelectedShip.Role != "station") || (!(this.SelectedShip.Role != "platform") || !(this.SelectedShip.Role != "construction"))) return; PieMenuNode newChild2 = new PieMenuNode(Localizer.Token(1419), ResourceManager.TextureDict["UI/HoldPositionIcon"], new SimpleDelegate(this.OrderScrap)); newChild6.Add(newChild2); } } else this.shipMenu.Add(new PieMenuNode(Localizer.Token(1420), ResourceManager.TextureDict["UI/viewPlanetIcon"], new SimpleDelegate(this.ContactLeader))); }
public void ShowPieMenu(PieMenuNode node) { this.pieMenu.RootNode = node; this.ShowPieMenu(); }
public void Add(PieMenuNode newChild) { if (this.children == null) { this.children = new List<PieMenuNode>(); } newChild.parent = this; this.children.Add(newChild); }
private void NewMenu(object sender) { this.rootNode = this.newMenuNode; this.t.Reset(Direction.Ascending); this.t.OnTransitionEnd = null; }
public void Show(PieMenuNode rootNode, Vector2 position) { this.rootNode = rootNode; this.Show(position); }
public void ChangeTo(PieMenuNode newNode) { if (newNode == null) { this.t.OnTransitionEnd = this.hideDelegate; this.t.Reset(Direction.Descending); return; } this.t.OnTransitionEnd = this.newMenuDelegate; this.newMenuNode = newNode; this.t.Reset(Direction.Descending); }