Esempio n. 1
0
        private void Load()
        {
            Audio.Frequency.Set(1);
            Audio.Volume.Set(.05);

            _stack = new ScreenStack(false);
            Add(_stack);

            Window.Title = $"Qsor - {Version}";

            AddInternal(KeyBindingInputHandler = new GlobalKeyBindingInputHandler(this));

            if (!DebugUtils.IsDebugBuild)
            {
                _stack.Anchor = Anchor.Centre;
                _stack.Origin = Anchor.Centre;

                _stack.Push(new IntroScreen());

                Scheduler.AddDelayed(() =>
                {
                    _stack.Exit();

                    Scheduler.AddDelayed(() => _stack.Push(new MainMenuScreen()), 2000);
                }, 6000);
            }
            else
            {
                _stack.Push(new MainMenuScreen());
            }
        }
Esempio n. 2
0
        public void TestTwoScreens()
        {
            var ss = new ScreenStack();

            Assert.AreEqual(null, ss.CurrentScreen);
            var screen1 = new Screen();
            var screen2 = new Screen();

            ss.Push(screen1);
            ss.Update(0);
            Assert.AreSame(screen1, ss.CurrentScreen);

            screen1.Push(screen2);
            ss.Update(0);
            Assert.AreSame(screen2, ss.CurrentScreen);

            ss.Pop();
            ss.Update(0);
            Assert.AreSame(screen1, ss.CurrentScreen);

            ss.Pop();
            ss.Update(0);
            Assert.AreEqual(null, ss.CurrentScreen);

            Assert.Throws <InvalidOperationException>(ss.Pop);
        }
 public TestSceneFirstRunScreenBehaviour()
 {
     AddStep("load screen", () =>
     {
         Child = new ScreenStack(new ScreenBehaviour());
     });
 }
Esempio n. 4
0
        private void Load()
        {
            AddStep("Add ResultScreen", () =>
            {
                if (_stack?.IsAlive ?? false)
                {
                    return;
                }

                Add(_stack = new ScreenStack {
                    RelativeSizeAxes = Axes.Both
                });

                LoadComponentAsync(new ResultScreen
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    RelativeSizeAxes = Axes.Both,
                    Scale            = new Vector2(1f),
                    Alpha            = 1f,
                }, _stack.Push);
            });

            AddStep("Remove ResultScreen", () => this._stack?.Expire());
        }
Esempio n. 5
0
 public ChimpanzeeMemoryTestGame()
 {
     Add(screenStack = new ScreenStack {
         RelativeSizeAxes = osu.Framework.Graphics.Axes.Both
     });
     screenStack.Push(new PlayScreen());
 }
Esempio n. 6
0
        private void load()
        {
            Window.WindowBorder = WindowBorder.Hidden;

            Window.Title = "The Cursed Constellations Installer";
            Window.Size  = new Size(1600, 900);
            Resources.AddStore(new DllResourceStore(mainResourceFile));
            largeTextureStore = new LargeTextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            largeTextureStore.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            dependencies.Cache(largeTextureStore);


            // Fonts
            AddFont(Resources, @"Fonts/Ageo-Light");
            AddFont(Resources, @"Fonts/Ageo-LightItalic");
            AddFont(Resources, @"Fonts/Ageo-Medium");

            AddFont(Resources, @"Fonts/Ageo-Regular");
            AddFont(Resources, @"Fonts/Ageo-RegularItalic");
            AddFont(Resources, @"Fonts/Ageo-Thin");

            installerScreenStack = new ScreenStack();
            installerScreenStack.RelativeSizeAxes = Axes.Both;
            Add(installerScreenStack);


            installerScreenStack.Push(backgroundScreen = new BackgroundScreen());
        }
        public void UnsupportedReplaceFactoryTest()
        {
            // - Arrange
            var registry    = new ScreenRegistry();
            var screenStack = new ScreenStack();
            var specs       = new NavigatorSpecification(false, false, false);

            var screenA         = new Mock <Screen>().Object;
            var screenB         = new ScreenStub();
            var screenBResolver = new Mock <IScreenResolver>().Object;

            registry.Register(typeof(ScreenStub), screenBResolver);

            screenStack.Push(screenB, screenA, screenA);

            var cf = new DefaultCommandsFactory(registry);

            // - Act
            var commands = cf.ReplaceScreen(screenStack, specs, screenB);

            // - Assert
            Assert.AreEqual(2, commands.Count);
            Assert.IsInstanceOf <BackNavCommand>(
                commands.ElementAtOrDefault(0));
            Assert.IsInstanceOf <ForwardNavCommand>(
                commands.ElementAtOrDefault(1));
        }
 public TestSceneFirstRunScreenUIScale()
 {
     AddStep("load screen", () =>
     {
         Child = new ScreenStack(new ScreenUIScale());
     });
 }
Esempio n. 9
0
        private void updateSize()
        {
            if (targetMode == ScalingMode.NoScaling)
            {
                if (requiresBackgroundVisible)
                {
                    if (backgroundStack == null)
                    {
                        AddInternal(backgroundStack = new ScreenStack
                        {
                            Alpha = 0,
                            Depth = float.MaxValue
                        });

                        // TODO: Replace this so consumers can add their own background screen for their scaling containers.
                        backgroundStack?.Push(new SimpleBackgroundScreen());
                    }

                    backgroundStack.FadeIn(200);
                }
                else
                {
                    backgroundStack.FadeOut(200);
                }
            }

            sizableContainer.ScaleTo(scaleBindable.Value, 200, Easing.OutElastic);
        }
Esempio n. 10
0
    public override void Init()
    {
        ScreenStack.SetBackgroundCol(new Color(0.15f, 0.5f, 0.1f));
        SetStage(new FStage("MATCH"));
        SetPixelOffset(0, 0, Screen.width, Screen.height);

        tMatch.Init();
        tMatch.tState = EMatchState.Kickoff;
        tTeamAI.Init();


        EFormation eForm = EFormation.E442;
        Formation  tForm = new Formation();

        tForm.SetFormation(eForm);

        for (int iPlayer = 0; iPlayer < tUIPlayer.Length; ++iPlayer)
        {
            tTeamAI.GetPlayerAI(iPlayer).SetFormationPos(tForm.GetFormationPosition(iPlayer));

            tUIPlayer[iPlayer] = new UIMatchPlayer();
            tUIPlayer[iPlayer].SetParent(this);
            tUIPlayer[iPlayer].Init();
            tUIPlayer[iPlayer].SetPlayerAI(tTeamAI.GetPlayerAI(iPlayer));
        }
    }
Esempio n. 11
0
        public void UpdateUnderGameScreen()
        {
            var screens = new ScreenStack();

            var screen = new Mock <IScreen>();

            screen.Setup(x => x.IsActive).Returns(true);

            var gamescreen = new Mock <IGameScreen>();

            gamescreen.Setup(x => x.TransitionState).Returns(TransitionState.Active);
            gamescreen.Setup(x => x.CoverOtherScreens).Returns(false);
            gamescreen.Setup(x => x.IsActive).Returns(true);

            screens.Screens.Add(screen.Object);
            screens.Screens.Add(gamescreen.Object);

            var time  = new GameTime();
            var input = new Mock <IInputHandler>();

            input.Setup(x => x.HandleInput(It.IsAny <IGameScreen>())).Callback(() => { });
            screens.Update(new GameTime(), input.Object, false);

            gamescreen.Verify(x => x.Update(It.IsAny <GameTime>(),
                                            It.IsAny <bool>(),
                                            It.IsAny <bool>()), Times.Once);
            screen.Verify(x => x.Update(It.IsAny <GameTime>(),
                                        It.IsAny <bool>(),
                                        It.IsAny <bool>()), Times.Once);
        }
Esempio n. 12
0
        private void Load()
        {
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(typeof(QsorGame).Assembly), @"Resources"));

            Audio.Frequency.Set(1);
            Audio.Volume.Set(.2);

            AddInternal(BeatmapManager);

            _stack = new ScreenStack
            {
                RelativeSizeAxes = Axes.Both,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                FillMode         = FillMode.Fill,
            };
            Add(_stack);

            _stack.Push(new BeatmapScreen
            {
                RelativeSizeAxes = Axes.Both,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                FillMode         = FillMode.Fill,
            });
        }
Esempio n. 13
0
        private void load()
        {
            NotificationOverlay notifications;

            dependencies.Cache(notifications = new NotificationOverlay());

            ConfirmationOverlay confirmationOverlay;

            dependencies.Cache(confirmationOverlay = new ConfirmationOverlay());

            ScreenStack screens = new ScreenStack();

            screens.Push(new MainMenuScreen());

            Add(new BasicContextMenuContainer
            {
                RelativeSizeAxes = Axes.Both,
                Child            = new IWannaTooltipContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        screens,
                        notifications,
                        confirmationOverlay
                    }
                }
            });
        }
Esempio n. 14
0
        public void Setup()
        {
            Add(_stack = new ScreenStack
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                RelativeSizeAxes = Axes.Both,
                Size             = new Vector2(0.8f),
            });

            if (!File.Exists(path))
            {
                _ = new DefaultFolder();
            }

            for (int i = 0; i < 4; i++)
            {
                Enum.TryParse(gameini.Get <string>((SettingsConfig)i), out Key key);
                keys[i] = key;
            }

            AddStep("GameplayScreen", AddGameplayScreen);
            AddStep("AddRemoveGameplayScreen", AddRemoveGameplayScreen);
            AddStep("Fail", Fail);
            AddStep("Remove GameplayScreen", () =>
            {
                _gameplayScreen?.track?.Stop();
                _gameplayScreen?.Expire();
            });
        }
 public TestSceneFirstRunScreenBundledBeatmaps()
 {
     AddStep("load screen", () =>
     {
         Child = new ScreenStack(new ScreenBeatmaps());
     });
 }
Esempio n. 16
0
        public LD44Game()
        {
            _graphics      = new GraphicsDeviceManager(this);
            _screens       = new ScreenStack();
            _inputBindings = new InputBindings();

            Content.RootDirectory = "Content";
        }
Esempio n. 17
0
 private void load()
 {
     Child = screenStack = new ScreenStack {
         RelativeSizeAxes = Axes.Both
     };
     //mainMenu = new MainMenuScreen();
     game = new GameplayScreen();
 }
 public void SetupTest() => Schedule(() =>
 {
     Clear();
     Add(stack = new ScreenStack(baseScreen = new TestScreen())
     {
         RelativeSizeAxes = Axes.Both
     });
 });
Esempio n. 19
0
 private void load()
 {
     // Add your top-level game components here.
     // A screen stack and sample screen has been provided for convenience, but you can replace it if you don't want to use screens.
     Child = screenStack = new ScreenStack {
         RelativeSizeAxes = Axes.Both
     };
 }
Esempio n. 20
0
        private void load(TextureStore textures)
        {
            if (workingProject == null)
            {
                workingProject = WorkingProject.Parse(null, store, textures, api);
                SaveProject(false);
            }

            initialRelations = workingProject.DatabaseObject.Relations == null ? null : new List <FileRelation>(workingProject.DatabaseObject.Relations);

            InternalChildren = new[]
            {
                new Container
                {
                    Depth            = 4,
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding
                    {
                        Top = 30,
                    },
                    Child = screenContainer = new ScreenStack
                    {
                        RelativeSizeAxes = Axes.Both,
                    },
                },
                new Container
                {
                    Depth            = 3,
                    RelativeSizeAxes = Axes.X,
                    Height           = 30,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = Colour4.Gray,
                        },
                        tabsBar = new EditorTabChanger(),
                        new CloseButton
                        {
                            Action = confirmClose,
                        },
                    },
                },
            };

            tabsBar.Current.ValueChanged       += changeEditorScreen;
            CurrentEditingElement.ValueChanged += _ => tabsBar.Current.Value = tabsBar.Current.Value switch
            {
                EditorScreenOption.Objetos => EditorScreenOption.Objetos,
                EditorScreenOption.Eventos => EditorScreenOption.Eventos,
                _ => EditorScreenOption.Objetos,
            };

            AddInternal(imagePicker);

            tabsBar.Current.Value = EditorScreenOption.Inicio;
        }
Esempio n. 21
0
        public override void OnKeyUp(int key)
        {
            BaseScreen bs = ScreenStack.Peek();

            if (bs != null)
            {
                bs.OnKeyUp(key);
            }
        }
Esempio n. 22
0
 public ScreenStackCacheContainer()
 {
     Add(backgroundScreenStack = new BackgroundScreenStack {
         RelativeSizeAxes = Axes.Both
     });
     Add(ScreenStack = new ScreenStack {
         RelativeSizeAxes = Axes.Both
     });
 }
Esempio n. 23
0
        public void PopScreenWhenEmptyTest()
        {
            // - Arrange
            var screenStack = new ScreenStack();

            // - Act & Assert
            Assert.Throws <InvalidOperationException>(
                () => screenStack.Pop());
        }
Esempio n. 24
0
 public TestCasePlayerLoader()
 {
     InputManager.Add(backgroundStack = new BackgroundScreenStack {
         RelativeSizeAxes = Axes.Both
     });
     InputManager.Add(stack = new ScreenStack {
         RelativeSizeAxes = Axes.Both
     });
 }
Esempio n. 25
0
        public ScreenBreadcrumbControl(ScreenStack stack)
        {
            stack.ScreenPushed += onPushed;
            stack.ScreenExited += onExited;

            onPushed(null, stack.CurrentScreen);

            Current.ValueChanged += current => current.NewValue.MakeCurrent();
        }
 public TestSceneEngineLoader()
 {
     Child = screenStack = new ScreenStack
     {
         RelativeSizeAxes = Axes.Both,
         Anchor           = Anchor.Centre,
         Origin           = Anchor.Centre
     };
 }
Esempio n. 27
0
 protected override void LoadComplete()
 {
     base.LoadComplete();
     Add(stack = new ScreenStack()
     {
         RelativeSizeAxes = Axes.Both
     });
     LoadComponent(loginContainer = new Login());
     stack.Push(loginContainer);
 }
Esempio n. 28
0
        public void Apply(Navigator navigator, ScreenStack screens)
        {
            if (screens.IsRoot)
            {
                return;
            }

            screens.Clear();
            navigator.BackToRoot();
        }
Esempio n. 29
0
        public ScreenBreadcrumbControl(ScreenStack stack)
        {
            stack.ScreenPushed += onPushed;
            stack.ScreenExited += onExited;

            if (stack.CurrentScreen != null)
            {
                onPushed(null, stack.CurrentScreen);
            }
        }
Esempio n. 30
0
 public HenHenGame()
 {
     Raylib_cs.Raylib.SetExitKey(Raylib_cs.KeyboardKey.KEY_NULL);
     LoadImages();
     menuActionsHandler    = new(Inputs);
     interfaceInputManager = new(ScreenStack, MenuActions.Next);
     menuActionsHandler.Propagator.Listeners.Add(interfaceInputManager);
     positionalInterfaceInputManager = new(Inputs, ScreenStack);
     ScreenStack.Push(new MainMenuScreen());
 }
Esempio n. 31
0
        public GameWorld()
        {
            GraphicsDeviceManager manager = new GraphicsDeviceManager(this);
            manager.PreferredBackBufferWidth = Settings.screenWidth;
            manager.PreferredBackBufferHeight = Settings.screenHeight;
            exitStatus = false;

            Content.RootDirectory = "Content";
            screens = new ScreenStack();
            controller = new Controller(PlayerIndex.One);
        }