示例#1
0
        public ShoppingItemUI(IItem item, int i, Action whenBought)
        {
            _playerAccount = CurrentGameState.State.PlayerAccount;
            Branch         = new ClickUIBranch(item.Name, (int)ClickUIPriorities.Pad);
            var x = (i % 4) * (Sizes.Item.Width + Sizes.Margin);
            var y = (i / 4) * (Sizes.Item.Height + Sizes.Margin * 2 + Sizes.Button.Height);

            _transform      = new Transform2(new Vector2((int)x, (int)y));
            _productDetails = new ImageWithDescription("Images/Items/" + item.Name.ToLower().Replace(" ", "-").Replace(".", ""), item.Description, new Transform2(Sizes.Item));
            _label          = new Label
            {
                BackgroundColor = Color.Transparent,
                TextColor       = Color.White,
                Font            = "Fonts/14",
                Transform       = new Transform2(new Vector2(0, Sizes.Item.Height + 5), new Size2(Sizes.Item.Width, 30)),
                RawText         = item.Name + " - $" + item.Cost.Amount()
            };
            _amount = item.Cost.Amount();
            _button = ImageTextButtonFactory.Create("Buy", new Vector2(0, Sizes.Item.Height + Sizes.SmallMargin + 30),
                                                    () => { if (_playerAccount.Amount() >= _amount)
                                                            {
                                                                whenBought();
                                                            }
                                                    });
            _disabledButton = new ImageLabel("Buy", "Images/UI/button-disable", new Transform2(new Vector2(0, Sizes.Item.Height + Sizes.SmallMargin + 30), Sizes.Button));
            Branch.Add(_button);
            Branch.Add(_productDetails);
        }
示例#2
0
        public void Init()
        {
            _tooltipLabel = new Label
            {
                Transform           = new Transform2(new Vector2(1270, 124), new Size2(500, 60)),
                BackgroundColor     = Color.Transparent,
                HorizontalAlignment = HorizontalAlignment.Right,
                TextColor           = UiStyle.TextLightPurple
            };

            _confirmationVisuals = new List <IVisual>();
            _confirmationBranch  = new ClickUIBranch("Confirm", 3);
            AddConfirmationButton(UiButtons.MenuRed("Quit", new Vector2(960 - 360 - 100, 500), Confirm));
            AddConfirmationButton(UiButtons.MenuRed("Cancel", new Vector2(960 + 0 + 100, 500), Cancel));
            _confirmationBranch.Add(new ScreenClickable(() => { }));

            _clickables = new List <VisualClickableUIElement>();
            AddIconButton(() => Scene.NavigateTo(GameResources.DilemmasSceneName), "Icons/Dilemmas", "Dilemmas");
            AddIconButton(() => Scene.NavigateTo(GameResources.DialogueMemoriesScene), "Icons/Conversations", "Conversations");
            AddIconButton(() => Scene.NavigateTo(GameResources.OptionsSceneName), "Icons/Options", "Options");
            AddIconButton(() => Scene.NavigateTo(GameResources.SaveLoadSceneName), "Icons/Save", "Save / Load");
            AddIconButton(OpenConfirmationMenu, "Icons/ExitToMenu", "Main Menu");
            HudBranch = new ClickUIBranch("HUD", 2);
            _clickables.ForEach(x => HudBranch.Add(x));
            _newIcon = new ImageBox
            {
                Transform = new Transform2(new Size2(43, 43)),
                Image     = "UI/NewRedIconBorderless"
            };

            Event.SubscribeForever(EventSubscription.Create <ActiveElementChanged>(UpdateTooltip, this));
        }
 public ReturnsCallReadyUI()
 {
     Branch  = new ClickUIBranch("Ready Button", (int)ClickUIPriorities.Pad);
     _button = ImageTextButtonFactory.Create("Ready", Vector2.Zero, StartCall);
     Branch.Add(_button);
     World.Subscribe(EventSubscription.Create <CallResolved>(x => AtEndCall(), this));
 }
示例#4
0
        public NewPurchaseSummaryUI(Purchase purchase, Size2 size)
        {
            Branch = new ClickUIBranch("Purchase Summary", (int)ClickUIPriorities.Pad);
            var goToDetails = new ImageButton("Images/UI/purchase-summary-press", "Images/UI/purchase-summary", "Images/UI/purchase-summary-hover",
                                              new Transform2(new Size2(size.Width, 50)), () => World.Publish(new PurchaseInspected(purchase)));
            var name = new Label
            {
                BackgroundColor     = Color.Transparent,
                TextColor           = Color.White,
                Font                = "Fonts/14",
                Transform           = new Transform2(new Vector2(10, 0), new Size2(size.Width - 20, 50)),
                HorizontalAlignment = HorizontalAlignment.Left,
                RawText             = purchase.ProductName
            };
            var date = new Label
            {
                BackgroundColor     = Color.Transparent,
                TextColor           = Color.White,
                Font                = "Fonts/12",
                Transform           = new Transform2(new Vector2(10, 0), new Size2(size.Width - 20, 50)),
                HorizontalAlignment = HorizontalAlignment.Right,
                RawText             = purchase.Date
            };

            Branch.Add(goToDetails);
            _visuals.Add(goToDetails);
            _visuals.Add(name);
            _visuals.Add(date);
        }
        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));
        }
示例#6
0
 public ExcusesUI()
 {
     Branch        = new ClickUIBranch("Excuses", (int)ClickUIPriorities.Pad);
     _excuseButton = ImageTextButtonFactory.Create("Soothe", new Vector2(0, 0), MakeExcuse);
     World.Subscribe(EventSubscription.Create <CallStarted>(OnCallStart, this));
     World.Subscribe(EventSubscription.Create <CallResolved>(x => OnCallResolved(), this));
 }
示例#7
0
 public NewPurchaseUI(Size2 size)
 {
     Branch = new ClickUIBranch("Purchase UI", (int)ClickUIPriorities.Pad);
     _grid  = new GridLayout(size - new Size2(Sizes.Margin * 2, Sizes.Margin * 2),
                             new List <Definition>
     {
         new ConcreteDefinition(50),
         new ShareDefintion(),
         new ShareDefintion(),
         new ShareDefintion(),
         new ConcreteDefinition(50)
     },
                             new List <Definition>
     {
         new ShareDefintion(2),
         new ShareDefintion(),
         new ShareDefintion(),
         new ShareDefintion(),
         new ShareDefintion(),
         new ShareDefintion(),
         new ShareDefintion(),
         new ShareDefintion(),
         new ShareDefintion(),
         new ConcreteDefinition(90)
     });
     _viewList = new ViewPurchaseListUI();
     Branch.Add(_viewList.Branch);
     World.Subscribe(EventSubscription.Create <PurchaseInspected>(x => OnPurchaseInspected(x.Purchase), this));
     World.Subscribe(EventSubscription.Create <PurchasesListed>(x => OnPurchasesListed(), this));
 }
 public ViewPurchaseListUI()
 {
     Branch  = new ClickUIBranch("View List Button", (int)ClickUIPriorities.Pad);
     _button = ImageTextButtonFactory.Create("Purchases", Vector2.Zero, () => World.Publish(new PurchasesListed()));
     Branch.Add(_button);
     World.Subscribe(EventSubscription.Create <PurchaseInspected>(x => OnPurchaseInspected(), this));
     World.Subscribe(EventSubscription.Create <PurchasesListed>(x => OnPurchasesListed(), this));
 }
示例#9
0
 public ChoicesUI(Transform2 transform)
 {
     Branch    = new ClickUIBranch("Choices", (int)ClickUIPriorities.Pad);
     Transform = transform;
     _grid     = new GridLayout(transform.Size, 3, 1);
     World.Subscribe(EventSubscription.Create <CallStarted>(x => OnCallStart(x.Call), this));
     World.Subscribe(EventSubscription.Create <CallResolved>(x => OnCallResolved(), this));
 }
        public NewSelectSleepDurationUI(Action cancel)
        {
            _grid = new GridLayout(new Size2(1600, 900), 1, 1);
            var innerGrid = new GridLayout(new Size2(250, 525), new List <Definition>
            {
                new ConcreteDefinition(25),
                new ConcreteDefinition(200),
                new ConcreteDefinition(25),
            }, new List <Definition>
            {
                new ConcreteDefinition(25),
                new ConcreteDefinition(50),
                new ConcreteDefinition(25),
                new ConcreteDefinition(70),
                new ConcreteDefinition(10),
                new ConcreteDefinition(50),
                new ConcreteDefinition(10),
                new ConcreteDefinition(70),
                new ConcreteDefinition(25),
                new ConcreteDefinition(70),
                new ConcreteDefinition(25),
                new ConcreteDefinition(70),
                new ConcreteDefinition(25)
            });

            var summary = new Label
            {
                BackgroundColor = Color.Transparent,
                TextColor       = Color.White,
                Font            = "Fonts/16",
                Transform       = new Transform2(innerGrid.GetBlockSize(1, 2, 4, 1)),
                Text            = "How long do you want to sleep for?"
            };
            var upHour        = ImageTextButtonFactory.CreateUpArrow(Vector2.Zero, AddHour);
            var smartUpHour   = new SmartControl(upHour, (int)ClickUIPriorities.Room);
            var downHour      = ImageTextButtonFactory.CreateDownArrow(Vector2.Zero, ReduceHour);
            var smartDownHour = new SmartControl(downHour, (int)ClickUIPriorities.Room);

            _timeLabel = new ImageLabel(_hours + " Hours", "Images/UI/label-small", new Transform2(Sizes.SmallLabel));
            var sleepButton       = ImageTextButtonFactory.Create("Sleep", Vector2.Zero, () => World.Publish(new WentToBed(_hours)));
            var smartSleepButton  = new SmartControl(sleepButton, (int)ClickUIPriorities.Room);
            var cancelButton      = ImageTextButtonFactory.Create("Cancel", Vector2.Zero, cancel);
            var smartCancelButton = new SmartControl(cancelButton, (int)ClickUIPriorities.Room);

            _grid.AddSpatial(innerGrid, new Transform2(innerGrid.Size), 1, 1);
            innerGrid.AddSpatial(new ImageBox(new Transform2(innerGrid.Size), "Images/UI/messenger"), new Transform2(innerGrid.Size), 1, 1, 3, 13);
            innerGrid.AddSpatial(summary, summary.Transform, 2, 2);
            innerGrid.AddSpatial(smartUpHour, new Transform2(new Size2(70, 70)), 2, 4);
            innerGrid.AddSpatial(_timeLabel, new Transform2(Sizes.SmallLabel), 2, 6);
            innerGrid.AddSpatial(smartDownHour, new Transform2(new Size2(70, 70)), 2, 8);
            innerGrid.AddSpatial(smartSleepButton, sleepButton.Transform, 2, 10);
            innerGrid.AddSpatial(smartCancelButton, cancelButton.Transform, 2, 12);
            Branch = new ClickUIBranch("Sleep Duration", (int)ClickUIPriorities.Room);
            Branch.Add(smartUpHour.Branch);
            Branch.Add(smartDownHour.Branch);
            Branch.Add(smartSleepButton.Branch);
            Branch.Add(smartCancelButton.Branch);
        }
示例#11
0
        public DevView()
        {
            Branch = new ClickUIBranch("Dev", (int)ClickUIPriorities.Dev);
            var button4 = ImageTextButtonFactory.Create("Return Specialist 1", new Vector2(Sizes.Margin * 4 + Sizes.Button.Width * 3, Sizes.Margin),
                                                        () => Promote(Job.ReturnSpecialistLevel1));

            _buttons.Add(button4);
            Input.On(Control.Select, Toggle);
        }
示例#12
0
 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();
 }
示例#13
0
 public TogglePad()
 {
     _open    = ImageTextButtonFactory.CreateTrapazoid("Open", Vector2.Zero, () => World.Publish(new PadOpened()));
     _close   = ImageTextButtonFactory.CreateTrapazoid("Close", Vector2.Zero, () => World.Publish(new PadClosed()));
     Branch   = new ClickUIBranch("Toggle Pad", (int)ClickUIPriorities.Overlay);
     _current = _open;
     Branch.Add(_open);
     World.Subscribe(EventSubscription.Create <PadOpened>(x => PadOpened(), this));
     World.Subscribe(EventSubscription.Create <PadClosed>(x => PadClosed(), this));
 }
示例#14
0
 public Pad(ClickUIBranch parentBranch)
 {
     _branch = new ClickUIBranch("Pad", (int)ClickUIPriorities.Pad);
     parentBranch.Add(_branch);
     _menuBar    = new MenuBar(_branch);
     _currentApp = new NoneApp();
     World.Subscribe(EventSubscription.Create <AppChanged>(x => OpenApp(x.App), this));
     // @todo #1 Fix the state transfer architecture
     OpenApp(App.Notification);
     OpenApp(App.Call);
 }
示例#15
0
 public RentApp()
 {
     _gameState         = CurrentGameState.State;
     _playerAccount     = _gameState.PlayerAccount;
     _landlord          = _gameState.Landlord;
     Branch             = new ClickUIBranch("Rent App", (int)ClickUIPriorities.Pad);
     _amountDue         = new ImageLabel("", "Images/UI/label", new Transform2(new Vector2(-(Sizes.Label.Width / 2), 0), Sizes.Label));
     _paymentDueBy      = new ImageLabel("", "Images/UI/label", new Transform2(new Vector2(-(Sizes.Label.Width / 2), Sizes.Label.Height + Sizes.Margin), Sizes.Label));
     _payButton         = ImageTextButtonFactory.Create("PAY", new Vector2(-(Sizes.Button.Width / 2), (Sizes.Label.Height + Sizes.Margin) * 2), () => World.Publish(new RentPaid()));
     _disabledPayButton = new ImageLabel("PAY", "Images/UI/button-disable", new Transform2(new Vector2(-(Sizes.Button.Width / 2), (Sizes.Label.Height + Sizes.Margin) * 2), Sizes.Button));
 }
示例#16
0
 public Overlay()
 {
     // @todo #1 update toggle button colors
     Branch     = new ClickUIBranch("Overlay", (int)ClickUIPriorities.Overlay);
     _clockUi   = new ClockUI();
     _togglePad = new TogglePad();
     _moneyUI   = new MoneyUI();
     _energyUI  = new EnergyUI();
     _hungerUI  = new HungerUI();
     Branch.Add(_togglePad.Branch);
 }
示例#17
0
        public void Init()
        {
#if DEBUG
            GameObjects.InitIfNeeded();
#endif
            Input.ClearTransientBindings();
            _clickUi        = new ClickUI();
            _tutorialBranch = new ClickUIBranch("Tutorial", 10);
            _clickUi.Add(_tutorialBranch);
            _automata.Add(_clickUi);
            OnInit();
        }
示例#18
0
 public ShoppingCompanyUI(IShoppingCompany company)
 {
     Branch   = new ClickUIBranch("McKing Jr's", (int)ClickUIPriorities.Pad);
     _company = company;
     for (var i = 0; i < _company.Items.Count; i++)
     {
         var item   = _company.Items[i];
         var option = new ShoppingItemUI(item, i, () => _company.Buy(item));
         _itemsUI.Add(option);
         Branch.Add(option.Branch);
     }
 }
示例#19
0
 private void InitUiElements()
 {
     _subview    = new NoSubView();
     _objectives = new ObjectivesView();
     _objectives.Init();
     _investigateRoomBranch = new ClickUIBranch("Location Investigation", 1);
     _locationNameLabel     = UiLabels.HeaderLabel(_location.Name, Color.White);
     _clickUi        = new ClickUI();
     _tutorialBranch = new ClickUIBranch("Tutorial", 25);
     _tutorialBranch.Add(_objectives.TutorialButton);
     _clickUi.Add(_tutorialBranch);
 }
示例#20
0
 public NotificationUI(PlayerNotification notification, List <NotificationUI> items)
 {
     Branch = new ClickUIBranch("Notification", (int)ClickUIPriorities.Pad);
     _label = new Label
     {
         BackgroundColor = Color.Transparent,
         TextColor       = Color.White,
         Transform       = new Transform2(new Vector2(Sizes.Margin, 0), new Size2(Sizes.Notification.Width - Sizes.Button.Width - Sizes.Margin * 2, 90)),
         Text            = $"{notification.Time} - {notification.Sender} - {notification.Message}",
     };
     _button = ImageTextButtonFactory.Create("Dismiss", new Vector2(Sizes.Notification.Width - Sizes.Margin - Sizes.Button.Width, Sizes.SmallMargin), () => items.Remove(this));
     Branch.Add(_button);
 }
示例#21
0
 public ThoughtUI()
 {
     Input.On(Control.A, Dismiss);
     Branch = new ClickUIBranch("Thought", (int)ClickUIPriorities.Thoughts);
     _label = new Label
     {
         TextColor       = Color.White,
         BackgroundColor = Color.Transparent,
     };
     _button = ImageTextButtonFactory.Create("Dismiss",
                                             new Vector2(Sizes.LargeLabel.Width - Sizes.SmallMargin - Sizes.Button.Width, Sizes.LargeLabel.Height - Sizes.SmallMargin - Sizes.Button.Height),
                                             Dismiss);
     World.Subscribe(EventSubscription.Create <HadAThought>(Think, this));
 }
示例#22
0
        public RoomUI()
        {
            _gameState = CurrentGameState.State;
            Branch     = new ClickUIBranch("Room", (int)ClickUIPriorities.Room);
            _map       = ApartmentMapFactory.Create();
            Branch.Add(_map.Branch);
            _sleep = new NewSelectSleepDurationUI(() => { _preparingForBed = false; Branch.Remove(_sleep.Branch); });
            _gameState.PlayerCharacter = new PlayerCharacter(_gameState.CharacterSex, _map,
                                                             new Transform2(new Vector2(TileSize.Size.Width * 2, TileSize.Size.Height * 3)));

            World.Subscribe(EventSubscription.Create <PreparingForBed>(PrepareForBed, this));
            World.Subscribe(EventSubscription.Create <WentToBed>((e) => WentToBed(), this));
            World.Subscribe(EventSubscription.Create <Awaken>(Awaken, this));
            World.Subscribe(EventSubscription.Create <CollapsedWithExhaustion>((e) => WentToBed(), this));
        }
示例#23
0
 private ChoiceUI(string title, Action backAction, bool backButtonActive, params OptionUI[] options)
 {
     _title = new Label
     {
         Text      = title,
         Font      = GuiFonts.Header,
         TextColor = UiColors.InGame_Text,
         Transform = new Transform2(new Vector2(0.22.VW(), 0.1.VH()), new Size2(0.75.VW(), 80))
     };
     _options    = options.ToList();
     _backButton = new TextButton(new Rectangle(700, 800, 200, 35), backAction, "Back", UiColors.Buttons_Default, UiColors.Buttons_Hover, UiColors.Buttons_Press, () => backButtonActive);
     Branch      = new ClickUIBranch("Choice", 2);
     Branch.Add(_backButton);
     _options.ForEach(x => Branch.Add(x));
 }
示例#24
0
 public MenuBar(ClickUIBranch parentBranch)
 {
     _branch = new ClickUIBranch("Menu Bar", (int)ClickUIPriorities.Pad);
     parentBranch.Add(_branch);
     _callApp         = ImageTextButtonFactory.Create("Calls", new Vector2(Sizes.Margin, Sizes.Margin), () => ChangeApp(App.Call));
     _foodApp         = ImageTextButtonFactory.Create("Shopping", new Vector2(Sizes.Margin * 2 + Sizes.Button.Width, Sizes.Margin), () => ChangeApp(App.Shopping));
     _notificationApp = ImageTextButtonFactory.Create("Notification", new Vector2(Sizes.Margin * 3 + Sizes.Button.Width * 2, Sizes.Margin), () => ChangeApp(App.Notification));
     _rentApp         = ImageTextButtonFactory.Create("Rent", new Vector2(Sizes.Margin * 4 + Sizes.Button.Width * 3, Sizes.Margin), () => ChangeApp(App.Rent));
     _policiesApp     = ImageTextButtonFactory.Create("Policies", new Vector2(Sizes.Margin * 5 + Sizes.Button.Width * 4, Sizes.Margin), () => ChangeApp(App.Policies));
     _branch.Add(_callApp);
     _branch.Add(_foodApp);
     _branch.Add(_notificationApp);
     _branch.Add(_rentApp);
     _branch.Add(_policiesApp);
 }
示例#25
0
        public ReturnCallApp()
        {
            Branch             = new ClickUIBranch("Call App", (int)ClickUIPriorities.Pad);
            _callBranch        = new ClickUIBranch("In Call Branch", (int)ClickUIPriorities.Pad);
            _betweenCallBranch = new ClickUIBranch("Between Call Branch", (int)ClickUIPriorities.Pad);

            _callGrid = new GridLayout(new Size2(1600, 720),
                                       new List <Definition>
            {
                new ConcreteDefinition(25),
                new ConcreteDefinition(250),
                new ConcreteDefinition(525),
                new ShareDefintion()
            },
                                       new List <Definition>
            {
                new ShareDefintion(),
                new ConcreteDefinition(70)
            });

            var callerGrid          = new CallerGrid(_callGrid.GetBlockSize(2, 1));
            var messengerGrid       = new MessengerGrid(_callGrid.GetBlockSize(3, 1));
            var purchaseHistoryGrid = new PurchaseHistoryGrid(_callGrid.GetBlockSize(4, 1));

            _betweenCallGrid = new BetweenCallGrid(_callGrid.GetBlockSize(1, 1, 4, 2));
            var excuses = new ExcusesUI();
            var callChoicesTransform = new Transform2(_callGrid.GetBlockSize(4, 2));
            var callChoices          = new ChoicesUI(callChoicesTransform);

            _callGrid.AddSpatial(callerGrid, new Transform2(_callGrid.GetBlockSize(2, 1)), 2, 1);
            _callGrid.AddSpatial(messengerGrid, new Transform2(_callGrid.GetBlockSize(3, 1)), 3, 1);
            _callGrid.AddSpatial(purchaseHistoryGrid, new Transform2(_callGrid.GetBlockSize(4, 1)), 4, 1);
            _callGrid.AddSpatial(callChoices, callChoicesTransform, 4, 2);
            _callGrid.AddSpatial(excuses, excuses.Transform, 3, 2);

            _callBranch.Add(callChoices.Branch);
            _callBranch.Add(purchaseHistoryGrid.Branch);
            _callBranch.Add(excuses.Branch);
            _betweenCallBranch.Add(_betweenCallGrid.Branch);
            _automatons.Add(messengerGrid);
            _automatons.Add(callerGrid);
            _automatons.Add(_betweenCallGrid);

            _toDraw = _betweenCallGrid;
            Branch.Add(_betweenCallBranch);
            World.Subscribe(EventSubscription.Create <CallStarted>(x => OnCallStart(), this));
            World.Subscribe(EventSubscription.Create <CallResolved>(x => OnCallEnd(), this));
        }
示例#26
0
        public ShoppingApp()
        {
            Branch           = new ClickUIBranch("Item App", (int)ClickUIPriorities.Pad);
            _companiesBranch = new ClickUIBranch("Companies", (int)ClickUIPriorities.Pad);
            Branch.Add(_companiesBranch);

            for (var i = 0; i < _companies.Count; i++)
            {
                var company   = _companies[i];
                var companyUI = new ShoppingCompanyUI(company);
                var option    = new ShoppingCompanyOptionUI(company, i, () => NavigateToCompany(companyUI));
                _companyOptionUIs.Add(option);
                _companiesBranch.Add(option.Branch);
            }
            _return = ImageTextButtonFactory.Create("Return", new Vector2(1000, 625), NavigateToCompanySelection);
        }
        public PurchaseHistoryGrid(Size2 size)
        {
            Branch = new ClickUIBranch("Purchase History", (int)ClickUIPriorities.Pad);
            _grid  = new GridLayout(size, 1, new List <Definition> {
                new ShareDefintion()
            });

            var purchases = new NewPurchaseHistoriesUI(_grid.GetBlockSize(1, 1, 2, 1));
            var purchase  = new NewPurchaseUI(_grid.GetBlockSize(1, 1, 2, 1));

            _grid.AddSpatial(purchases, new Transform2(_grid.GetBlockSize(1, 1)), 1, 1);
            _grid.AddSpatial(purchase, purchase.Transform, 1, 1);

            Branch.Add(purchases.Branch);
            Branch.Add(purchase.Branch);
            World.Subscribe(EventSubscription.Create <CallResolved>(x => OnCallResolved(), this));
        }
示例#28
0
        public BetweenCallGrid(Size2 size)
        {
            Branch = new ClickUIBranch("BetweenCalls", (int)ClickUIPriorities.Pad);
            _grid  = new GridLayout(size, 1, 3);

            var rating    = new ReturnsRatingsUI();
            var ready     = new ReturnsCallReadyUI();
            var summaries = new CallSummaryUI();

            _spinner = new Spinner();

            _grid.AddSpatial(rating, rating.Transform, 1, 1);
            _grid.AddSpatial(ready, ready.Transform, 1, 2);
            _grid.AddSpatial(summaries, summaries.Transform, 1, 3);
            _grid.AddSpatial(_spinner, _spinner.Transform, 1, 2);

            Branch.Add(ready.Branch);
        }
示例#29
0
        public ShoppingCompanyOptionUI(IShoppingCompany company, int i, Action whenBought)
        {
            Branch = new ClickUIBranch(company.Name, (int)ClickUIPriorities.Pad);
            var x = (i % 4) * (Sizes.Item.Width + Sizes.Margin);
            var y = (i / 4) * (Sizes.Item.Height + Sizes.Margin * 2 + Sizes.Button.Height);

            _transform      = new Transform2(new Vector2((int)x, (int)y));
            _productDetails = new ImageWithDescription("Images/Companies/" + company.Name.ToLower().Replace(" ", "-").Replace(".", "").Replace("'", ""), company.Description, new Transform2(Sizes.Item));
            _label          = new Label
            {
                BackgroundColor = Color.Transparent,
                TextColor       = Color.White,
                Font            = "Fonts/14",
                Transform       = new Transform2(new Vector2(0, Sizes.Item.Height + 5), new Size2(Sizes.Item.Width, 30)),
                RawText         = company.Name
            };
            _button = ImageTextButtonFactory.Create("Shop", new Vector2(0, Sizes.Item.Height + Sizes.SmallMargin + 30), whenBought);
            Branch.Add(_button);
            Branch.Add(_productDetails);
        }
示例#30
0
        public void Init()
        {
            _player           = new PlayerCharacterView(() => !_isInTheMiddleOfDialog);
            _dialogueAdvancer = new ScreenClickable(AdvanceChatVisuals);
            _clickUI          = new ClickUI();
            _clickUI.Add(GameObjects.Hud.HudBranch);
            _personMemoriesBranch = new ClickUIBranch("People", 1);
            _clickUI.Add(_personMemoriesBranch);
            _dialogMemoriesBranch = new ClickUIBranch("Dialogs", 1);
            _clickUI.Add(_dialogMemoriesBranch);
            _characterOptions = new List <IVisual>();
            var people = GameObjects.Characters.People.Where(p => p.GetOldDialogs().Count != 0);

            people.ForEachIndex((p, i) =>
            {
                var button = p.CreateButton(RememberDialogsWithPerson, i, people.Count());
                _characterOptions.Add(button);
                _personMemoriesBranch.Add(button);
            });
        }