Esempio n. 1
0
        protected override void OnInit()
        {
            _playerCharacter = new PlayerCharacterView(() => true);
            var header = UiLabels.FullWidthHeaderLabel("New Game", Color.White);

            header.Transform.Location = new Vector2(header.Transform.Location.X, 158);
            Add(header);

            _keyboard = new KeyboardTyping(GameResources.DefaultPlayerCharacterName);
            Add(_keyboard);
            var yStart = 331;

            Add(new Label {
                Text = "Character Name", Transform = new Transform2(new Vector2(758, yStart), new Size2(400, 50))
            });
            Add(new ColoredRectangle {
                Color = Color.FromNonPremultiplied(31, 185, 219, 199), Transform = new Transform2(new Vector2(758, yStart + 60 - 2), new Size2(404, 79))
            });
            _textboxLabel = new Label {
                Text = GameResources.DefaultPlayerCharacterName, Transform = new Transform2(new Vector2(760, yStart + 60), new Size2(400, 75)), BackgroundColor = Color.FromNonPremultiplied(25, 75, 110, 255)
            };
            Add(_textboxLabel);

            yStart = 541;
            Add(new Label {
                Text = "Difficulty", Transform = new Transform2(new Vector2(860, yStart), new Size2(200, 50))
            });
            Add(new ColoredRectangle {
                Color = Color.FromNonPremultiplied(31, 185, 219, 199), Transform = new Transform2(new Vector2(758, yStart + 60 - 2), new Size2(404, 79))
            });
            _shouldGuideLabel = new Label {
                Text = "Guide Me a Little", Transform = new Transform2(new Vector2(760, yStart + 60), new Size2(400, 75)), BackgroundColor = Color.FromNonPremultiplied(25, 75, 110, 255)
            };
            Add(_shouldGuideLabel);
            Add(UiButtons.MenuSmallBlue("Guide Me", new Vector2(700, yStart + 170), () =>
            {
                CurrentGameState.ShowObjectives = true;
                _shouldGuideLabel.Text          = "Guide Me a Little";
            }));
            Add(UiButtons.MenuSmallBlue("I'm A Pro", new Vector2(980, yStart + 170), () =>
            {
                CurrentGameState.ShowObjectives = false;
                _shouldGuideLabel.Text          = "I Know What I'm Doing";
            }));

            Input.On(Control.Start, StartGame);
            Add(UiButtons.Menu("Begin", new Vector2(780, 900), StartGame));
        }
Esempio n. 2
0
 protected override void OnInit()
 {
     Add(UiButtons.Back(() => Scene.NavigateTo(GameResources.DilemmasSceneName)));
     _header = UiLabels.FullWidthHeaderLabel(_dilemmaDescription, Color.White);
     _deductions.ForEachIndex((d, i) =>
     {
         var position = Position(i);
         var button   = d.CreateButton(position);
         AddUi(button);
         AddVisual(button);
         if (d.IsNew)
         {
             AddVisual(d.CreateNewIndicator(position));
         }
     });
 }
Esempio n. 3
0
        protected override void OnInit()
        {
            Audio.PlayMusic("Pondering", 0.78f);
            _header = UiLabels.FullWidthHeaderLabel("Current Investigation", Color.White);

            Add(UiButtons.Back(() => Scene.NavigateTo(CurrentGameState.CurrentLocation)));
            if (GameObjects.Dilemmas.HasTheory)
            {
                Add(UiButtons.MenuRed("Resolve", new Vector2(UI.OfScreenWidth(0.5f) - 180, 980), () => Scene.NavigateTo(GameResources.EndingSceneName)));
            }

            GameObjects.Dilemmas.GetActiveDilemmas().ForEach(d =>
            {
                Add(d.CreateButton());
                d.GetVisuals().ForEach(AddVisual);
            });
            Add(new DilemmasTutorial());
        }
Esempio n. 4
0
        protected override void OnInit()
        {
            _savingEnabled    = CurrentGameState.CurrentLocation != GameResources.MainMenuSceneName;
            _headerText       = UiLabels.FullWidthHeaderLabel("Game", Color.White);
            _changeModeButton = UiButtons.MenuSmallBlue("Load", new Vector2(840, 960),
                                                        () => SetMode(_mode == SaveMode.Save ? SaveMode.Load : SaveMode.Save));
            if (_savingEnabled)
            {
                Add(_changeModeButton);
            }
            SetMode(_savingEnabled ? SaveMode.Save : SaveMode.Load);
            Add(UiButtons.BackBlue(() => Scene.NavigateTo(CurrentGameState.CurrentLocation)));

            var positions = new[] { new Vector2(320, 200), new Vector2(1120, 200), new Vector2(320, 600), new Vector2(1120, 600), };

            for (var i = 0; i < 4; i++)
            {
                var s = new SaveSlotView(positions[i], SaveSlot.Create(i), () => _mode);
                s.Init();
                AddUi(s);
            }
        }