public NewPurchaseHistoriesUI(Size2 size) { Branch = new ClickUIBranch("Purchases", (int)ClickUIPriorities.Pad); _grid = new GridLayout(size, new List <Definition> { new ConcreteDefinition(120), new ShareDefintion(), new ConcreteDefinition(120) }, 1); var backButton = ImageTextButtonFactory.CreateRotated("<<", Vector2.Zero, NavigateBack, () => _index != 0 && _isInCall); var smartBackButton = new SmartControl(backButton, (int)ClickUIPriorities.Pad); Branch.Add(smartBackButton.Branch); _grid.AddSpatial(smartBackButton, backButton.Transform, 1, 1); var forwardButton = ImageTextButtonFactory.CreateRotated(">>", Vector2.Zero, NavigateForward, () => (_purchaseSupplier?.Current != null || _index + _ordersPerPage < _purchaseUIs.Count) && _isInCall); var smartForwardButton = new SmartControl(forwardButton, (int)ClickUIPriorities.Pad); Branch.Add(smartForwardButton.Branch); _grid.AddSpatial(smartForwardButton, forwardButton.Transform, 3, 1); _branches.Add(smartForwardButton.Branch); _branches.Add(smartBackButton.Branch); World.Subscribe(EventSubscription.Create <PurchaseInspected>(x => Inspect(), this)); World.Subscribe(EventSubscription.Create <PurchasesListed>(x => ListPurchases(), this)); World.Subscribe(EventSubscription.Create <CallResolved>(x => EndCall(), this)); World.Subscribe(EventSubscription.Create <CallStarted>(x => StartCall(x.Call), this)); }
public PoliciesApp() { _gameState = CurrentGameState.State; Branch = new ClickUIBranch("Policies App", (int)ClickUIPriorities.Pad); _pageUi = new PolicyPageUI(_gameState.ActivePolicies, 0, 7); _backButton = ImageTextButtonFactory.CreateRotated("<<", new Vector2(Sizes.Margin, 275), NavigateBack); _nextButton = ImageTextButtonFactory.CreateRotated(">>", new Vector2(1600 - Sizes.SideButton.Width - Sizes.Margin, 275), NavigateForward); UpdateNavButtons(); }