示例#1
0
        public LoadGameScene(Game game)
            : base(game)
        {
            // list of games
            var saveGameList = Data.SaveGame.FetchAll((SRPGGame)game);

            for(var i = 0; i < saveGameList.Count; i++)
            {
                var saveGame = saveGameList[i];
                var dlg = new SavedGameDialog(saveGame);
                dlg.Bounds = new UniRectangle(
                    new UniScalar(0), new UniScalar(110 * i),
                    new UniScalar(1.0f, -160), new UniScalar(100)
                );
                var fileNumber = i;
                dlg.OnSelect += () => ((SRPGGame) Game).LoadGame(fileNumber);
                Gui.Screen.Desktop.Children.Add(dlg);
            }

            // cancel button
            var button = new ButtonControl();
            button.Bounds = new UniRectangle(
                new UniScalar(1.0f, -150), new UniScalar(0),
                new UniScalar(150), new UniScalar(45)
            );
            button.Text = "Cancel";
            button.Pressed += (s, a) => Game.PopScene();
            Gui.Screen.Desktop.Children.Add(button);

            Gui.Visualizer = FlatGuiVisualizer.FromFile(Game.Services, "Content/Gui/main_gui.xml");
        }
示例#2
0
        public LoadGameScene(Game game) : base(game)
        {
            // list of games
            var saveGameList = Data.SaveGame.FetchAll((SRPGGame)game);

            for (var i = 0; i < saveGameList.Count; i++)
            {
                var saveGame = saveGameList[i];
                var dlg      = new SavedGameDialog(saveGame);
                dlg.Bounds = new UniRectangle(
                    new UniScalar(0), new UniScalar(110 * i),
                    new UniScalar(1.0f, -160), new UniScalar(100)
                    );
                var fileNumber = i;
                dlg.OnSelect += () => ((SRPGGame)Game).LoadGame(fileNumber);
                Gui.Screen.Desktop.Children.Add(dlg);
            }

            // cancel button
            var button = new ButtonControl();

            button.Bounds = new UniRectangle(
                new UniScalar(1.0f, -150), new UniScalar(0),
                new UniScalar(150), new UniScalar(45)
                );
            button.Text     = "Cancel";
            button.Pressed += (s, a) => Game.PopScene();
            Gui.Screen.Desktop.Children.Add(button);

            Gui.Visualizer = FlatGuiVisualizer.FromFile(Game.Services, "Content/Gui/main_gui.xml");
        }