Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            #region Initialisation
            UI ui = new UI();

            Load_Monsters();

            Menu char_menu = new Menu("Character Menu", ui);
            Menu multi_menu = new Menu("Fight other players", ui);
            Menu training_menu = new Menu("Training", ui);
            Menu monster_menu = new Menu("Monster Enciclopedia", ui);
            Menu options_menu = new Menu("Options", ui);

            BattleMenu dungeon_menu = new BattleMenu("Dungeon", "Explore the dungeon", ui);

            Menu main_menu = new Menu("Main Menu", ui);
            main_menu.Items.Add(char_menu);
            main_menu.Items.Add(dungeon_menu);
            main_menu.Items.Add(multi_menu);
            main_menu.Items.Add(training_menu);
            main_menu.Items.Add(monster_menu);
            main_menu.Items.Add(options_menu);

            #endregion
            Load_Chars(char_menu, ui);

            ui.Push_Menu_Stack(main_menu);
        }
Ejemplo n.º 2
0
        static void Load_Chars(Menu _char_menu, UI ui)
        {
            //characters should be loaded from xml and an approprioate character creatation class/method should be implemented and called from the character menu
            Character sprinkles = new Character("Sprinkles");
            DataHandler.Chars.Add(sprinkles);

            foreach(Character c in DataHandler.Chars) {
                MItemData str = new MItemData(c.Strength.ToString(), "Strength", ui);
                MItemData dex = new MItemData(c.Dexterity.ToString(), "Dexterity", ui);
                MItemData con = new MItemData(c.Constitution.ToString(), "Constitution", ui);
                MItemData inte = new MItemData(c.Intelligence.ToString(), "Intelligence", ui);
                MItemData wis = new MItemData(c.Wisdom.ToString(), "Wisdom", ui);
                MItemData chari = new MItemData(c.Charisma.ToString(), "Charisma", ui);
                MItemData hp = new MItemData(c.HP.ToString(), "HP", ui);

                MItemToogle add = new MItemToogle("Add to party", sprinkles, ui);

                Menu character_menu = new Menu(c.Name, ui);

                character_menu.Items.Add(add);
                character_menu.Items.Add(hp);
                character_menu.Items.Add(str);
                character_menu.Items.Add(dex);
                character_menu.Items.Add(con);
                character_menu.Items.Add(inte);
                character_menu.Items.Add(wis);
                character_menu.Items.Add(chari);

                _char_menu.Items.Add(character_menu);
            }
        }
Ejemplo n.º 3
0
Archivo: UI.cs Proyecto: tgm-git/cdr
 public void Pop_Menu_Stack()
 {
     if(Menu_Stack.Count > 1) {
         menu = Menu_Stack.Pop();
         selected_menu_item = 0;
         menu.Draw();
     }
     else {
         Display_Error_Message("Stack is too small to pop!");
     }
 }
Ejemplo n.º 4
0
Archivo: UI.cs Proyecto: tgm-git/cdr
 public void Push_Menu_Stack(Menu _menu)
 {
     if(_menu != null) {
         Menu_Stack.Push(menu);
         menu = _menu;
         selected_menu_item = 0;
         menu.Draw();
     }
     else {
         Display_Error_Message("Cannot push a null menu to the stack!");
     }
 }
Ejemplo n.º 5
0
Archivo: UI.cs Proyecto: tgm-git/cdr
 public void Push_Menu_Stack()
 {
     if(Validate_Item_Num()) {
         Menu_Stack.Push(menu);
         menu = menu.Items[selected_menu_item] as Menu;
         selected_menu_item = 0;
         menu.Draw();
     }
     else {
         Display_Error_Message("Cannot push a null menu to the stack!");
     }
 }