예제 #1
0
파일: MenuItem.cs 프로젝트: mildsauce45/UPF
        public MenuItem(string label, Action selectedAction, BorderTextures textures = null)
        {
            _textures = textures;

            Label = label;
            SelectedAction = selectedAction;

            var child = new StackPanel { Orientation = Orientation.Horizontal };

            pointer = new Image(Textures.Pointer) { VerticalAlignment = Enums.VerticalAlignment.Center };
            labelText = new TextBlock(label);

            PointerPadding = 10;

            child.AddChild(pointer);
            child.AddChild(labelText);

            Child = child;
        }
예제 #2
0
        private void SetupContinueMenu()
        {
            frame.Clear();

            var menu = new Menu();
            menu.SelectKey = "Interact";

            if (!SaveDataHelper.DataLoaded)
                SaveDataHelper.ReadGameData();

            for (int i = 0; i < GameConstants.Ranges.NUM_OF_GAME_SAVES; i++)
            {
                var data = SaveDataHelper.GetGameData(i);
                if (data != null)
                {
                    int closureIndex = i;
                    menu.AddItem(string.Format("{0} - Lvl. {1}", data.Party[0].Name, data.Party[0].Level), () => ContinueGame(closureIndex));
                }
                else
                {
                    menu.AddItem("-", () => { });
                }
            }

            var sp = new StackPanel();
            sp.HorizontalAlignment = HorizontalAlignment.Center;
            sp.VerticalAlignment = VerticalAlignment.Center;

            sp.AddChild(menu);

            frame.AddPanel(sp);
        }
예제 #3
0
        private void SetupInitialMenu()
        {
            frame.Clear();

            var menu = new Menu();
            menu.SelectKey = "Interact";

            menu.AddItem("BEGIN A NEW QUEST", StartNewGame);

            if (SaveDataHelper.SaveDataExists())
            {
                menu.AddItem("CONTINUE A QUEST", LoadExistingGame);
                menu.AddItem("DELETE A QUEST", () => { });
            }

            var sp = new StackPanel();
            sp.HorizontalAlignment = HorizontalAlignment.Center;
            sp.VerticalAlignment = VerticalAlignment.Center;

            sp.AddChild(menu);

            frame.AddPanel(sp);
        }