示例#1
0
        ContextMenuTemplate GetUsableObjectMenu(Creature creature)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts = new List <string>();
            return(template);
        }
示例#2
0
        public ContextMenuTemplate GetSpawnMonsterMenu(BoardTile tile)
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures);
            template.font     = contextMenuTextures.baseFont;

            template.tags = new List <List <string> >()
            {
                new List <string>()
                {
                    "SpawnMonster", SRDLibrary.Monsters.Commoner.ToString()
                },
                new List <string>()
                {
                    "SpawnMonster", SRDLibrary.Monsters.Goblin.ToString()
                },
                new List <string>()
                {
                    "SpawnMonster", SRDLibrary.Monsters.Cultist.ToString()
                },
                new List <string>()
                {
                    "SpawnMonster", SRDLibrary.Monsters.CultFanatic.ToString()
                }
            };
            template.texts = new List <string>()
            {
                "Commoner", "Goblin", "Cultist", "Cult Fanatic"
            };


            return(template);
        }
示例#3
0
 public void MakeEquipMenu(ref ContextMenuTemplate template)
 {
     template.texts = new List <string>()
     {
         "Weapons",
         "Armors",
         "Other",
     };
     template.tags = new List <List <string> >()
     {
         new List <string>()
         {
             ContextMenu.DefaultTags.ParentMenu.ToString()
         },
         new List <string>()
         {
             ContextMenu.DefaultTags.ParentMenu.ToString()
         },
         new List <string>()
         {
             ContextMenu.DefaultTags.ParentMenu.ToString()
         },
     };
     template.childMenus = new List <ContextMenuTemplate>()
     {
         MakeWeaponEquipMenu(template),
         MakeArmorEquipMenu(template),
         MakeOtherItemEquipMenu(template)
     };
 }
示例#4
0
        ContextMenuTemplate GetAttackMenu(Creature creature)
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures);
            template.font     = contextMenuTextures.baseFont;
            template.tags     = new List <List <string> >();
            template.texts    = new List <string>();

            List <Weapon> weapons = creature.GetAttackWeapons();

            if (weapons.Count > 0)
            {
                for (int w = 0; w < weapons.Count; w++)
                {
                    if (weapons[w].weaponType != WeaponTypes.Shield)
                    {
                        template.texts.Add(weapons[w].name);
                        template.tags.Add(new List <string>()
                        {
                            CombatActions.Attack.ToString(), w.ToString()
                        });
                    }
                }
            }

            return(template);
        }
示例#5
0
        public ContextMenuTemplate GetContextMenuEncounterControls()
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures);
            template.font     = contextMenuTextures.baseFont;

            template.texts = new List <string>()
            {
                string.Format("Current Turn : {0}", turn),
                "End Turn"
            };
            template.tags = new List <List <string> >()
            {
                new List <string>()
                {
                    ContextMenu.DefaultTags.NotButton.ToString()
                },
                new List <string>()
                {
                    EncounterControls.EndTurn.ToString()
                }
            };


            return(template);
        }
        //For Context Menu
        private void TreeTemplates_MouseUp(object sender, MouseEventArgs e)
        {
            // Show menu only if the right mouse button is clicked.
            if (e.Button == MouseButtons.Right)
            {
                // Point where the mouse is clicked.
                Point p = new Point(e.X, e.Y);

                // Get the node that the user has clicked.
                TreeNode node = TreeTemplates.GetNodeAt(p);
                if (node != null)
                {
                    TreeTemplates.SelectedNode = node;
                    if (TreeTemplates.SelectedNode.Tag.GetType() == typeof(Template))
                    {
                        mnuExplore.Visible       = true;
                        btnSeeinExplorer.Visible = true;
                    }
                    else
                    {
                        mnuExplore.Visible       = false;
                        btnSeeinExplorer.Visible = true;
                    }
                    ContextMenuTemplate.Show(TreeTemplates, p);
                    //break;
                }
            }
        }
示例#7
0
        public ContextMenuTemplate GetNonEncounterContextMenuTemplate()
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(menuTextureSet.blankTileTextures);
            template.font     = menuTextureSet.baseFont;

            template.texts = new List <string>()
            {
                "New Encounter"
            };
            template.tags = new List <List <string> >()
            {
                new List <string>()
                {
                    "NewEncounter"
                }
            };

            template.childMenus = new List <ContextMenuTemplate>()
            {
            };

            return(template);
        }
示例#8
0
 public ContextMenuTemplate GetCreatureLanguageChoices(Creature creature)
 {
     if (!creature.languages.Contains(DnDManager.Languages.Choose.ToString()))
     {
         return(null);
     }
     else
     {
         ContextMenuTemplate template = BaseControlsTemplate();
         template.texts = new List <string>();
         template.tags  = new List <List <string> >();
         foreach (string s in DnDManager.languages)
         {
             if (!creature.languages.Contains(s))
             {
                 template.texts.Add(s);
                 template.tags.Add(new List <string>()
                 {
                     CreatureMenuOtherOptions.ChooseLanguage.ToString(), s
                 });
             }
         }
         return(template);
     }
 }
示例#9
0
        void ScrollMenuTest()
        {
            ContextMenuTemplate scrollTestTemplate = new ContextMenuTemplate();

            scrollTestTemplate.tags = new List <List <string> >()
            {
                new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>()
            };
            scrollTestTemplate.texts = new List <string>()
            {
                "Test", "Test2", "Test3", "Test4", "Test5", "Test6", "Test7", "Test8", "Test9", "Test10", "Test11", "Test12", "Test13", "Test14", "Test15", "Test16"
            };
            scrollTestTemplate.textures        = ButtonTextures.FromList(contextMenuTextureSet.baseTextures);
            scrollTestTemplate.numberOfColumns = 1;

            List <ButtonTextures> scrollTextures = new List <ButtonTextures>(new ButtonTextures[5]);

            scrollTextures[(int)ScrollAreaTextures.ArrowDown]          = new ButtonTextures(Content.Load <Texture2D>("scrollDownArrow"), Content.Load <Texture2D>("scrollDownArrowInactive"), Content.Load <Texture2D>("scrollDownArrowInactive"), Content.Load <Texture2D>("scrollDownArrowInactive"), Content.Load <Texture2D>("scrollDownArrowInactive"));
            scrollTextures[(int)ScrollAreaTextures.ArrowUp]            = new ButtonTextures(Content.Load <Texture2D>("scrollUpArrow"), Content.Load <Texture2D>("scrollUpArrowInactive"), Content.Load <Texture2D>("scrollUpArrowInactive"), Content.Load <Texture2D>("scrollUpArrowInactive"), Content.Load <Texture2D>("scrollUpArrowInactive"));
            scrollTextures[(int)ScrollAreaTextures.Background]         = new ButtonTextures();
            scrollTextures[(int)ScrollAreaTextures.Scroller]           = new ButtonTextures();
            scrollTextures[(int)ScrollAreaTextures.ScrollerBackground] = new ButtonTextures();

            ScrollMenuTemplate scrollMenuTemplate = new ScrollMenuTemplate(scrollTestTemplate);

            scrollMenuTemplate.downArrow       = scrollTextures[(int)ScrollAreaTextures.ArrowDown];
            scrollMenuTemplate.upArrow         = scrollTextures[(int)ScrollAreaTextures.ArrowUp];
            scrollMenuTemplate.numberOfButtons = 6;

            //new ScrollArea(scrollTestTemplate, new List<Vector2>() { new Vector2(500, 450), new Vector2(50, 30), new Vector2(50, 130) }, scrollTextures, new Vector2(100, 20), new Vector2(100, 20), 4);
            //new ScrollMenu(scrollMenuTemplate, new Vector2(500, 500));
            new DropDownMenu(scrollMenuTemplate, new Vector2(500, 300), scrollTestTemplate.textures, new Vector2(600, 100), "Test Dropdown");
        }
示例#10
0
        public CreatureContextMenu MakeCommandMenu(BoardTile tile, Creature creature)
        {
            ContextMenuTemplate menu        = GetCommandMenu(creature, tile);
            CreatureContextMenu commandMenu = new CreatureContextMenu(tile, creature ?? default(Creature), menu);

            contextMenu = commandMenu;
            return(commandMenu);
        }
示例#11
0
        public ContextMenuTemplate GetCreatureItemChoicesMenu(Creature creature)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts      = new List <string>();
            template.tags       = new List <List <string> >();
            template.childMenus = new List <ContextMenuTemplate>();
            if (creature.itemChoices.Count > 0)
            {
                int index = 0;

                foreach (List <List <string> > set in creature.itemChoices)
                {
                    template.texts.Add("Equipment Option");
                    template.tags.Add(new List <string>()
                    {
                        ContextMenu.DefaultTags.ParentMenu.ToString()
                    });

                    ContextMenuTemplate setTemplate = BaseControlsTemplate();
                    setTemplate.texts = new List <string>();
                    setTemplate.tags  = new List <List <string> >();
                    foreach (List <string> items in set)
                    {
                        List <string> tags = new List <string>()
                        {
                            CreatureMenuOtherOptions.ChooseItems.ToString(), index.ToString()
                        };
                        string itemString = "";
                        for (int i = 0; i < items.Count; i++)
                        {
                            if (i > 0)
                            {
                                itemString += " & ";
                            }
                            itemString += items[i];
                            tags.Add(items[i]);
                        }
                        setTemplate.texts.Add(itemString);
                        setTemplate.tags.Add(tags);
                    }


                    template.childMenus.Add(setTemplate);

                    index++;
                }
            }
            if (creature.weaponChoices.Count > 0)
            {
                for (int i = 0; i < creature.weaponChoices.Count; i++)
                {
                    GetWeaponChoices(ref template, creature.weaponChoices[i], i);
                }
            }

            return(template);
        }
示例#12
0
        ContextMenuTemplate GetEquipMenu(Creature creature)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts = new List <string>();
            template.tags  = new List <List <string> >();

            creature.inventory.MakeEquipMenu(ref template);

            return(template);
        }
示例#13
0
        public ContextMenuTemplate BaseControlsTemplate()
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures);
            template.font     = contextMenuTextures.baseFont;
            template.texts    = new List <string>();
            template.tags     = new List <List <string> >();

            return(template);
        }
示例#14
0
        public virtual ContextMenuTemplate ChildMenuBase()
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(caster.encounter.contextMenuTextures.blankTileTextures);
            template.font     = caster.encounter.contextMenuTextures.baseFont;
            template.texts    = new List <string>();
            template.tags     = new List <List <string> >();

            return(template);
        }
示例#15
0
        public ContextMenuTemplate BaseChildMenuTemplate()
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures   = ButtonTextures.FromList(creature.encounter.contextMenuTextures.blankTileTextures);
            template.font       = creature.encounter.contextMenuTextures.baseFont;
            template.texts      = new List <string>();
            template.tags       = new List <List <string> >();
            template.childMenus = new List <ContextMenuTemplate>();
            template.inactives  = new List <bool>();

            return(template);
        }
示例#16
0
        public ContextMenuTemplate GetSpawnQuickCharacterSubClassMenu(string race, string subRace, string playerClass)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts      = new List <string>(DnDManager.classes[playerClass].subClasses);
            template.tags       = new List <List <string> >();
            template.childMenus = new List <ContextMenuTemplate>();
            for (int i = 0; i < DnDManager.classes[playerClass].subClasses.Count; i++)
            {
                template.tags.Add(new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                });
                template.childMenus.Add(GetSpawnQuickCharacterLevelMenu(race, subRace, playerClass, DnDManager.classes[playerClass].subClasses[i]));
            }

            return(template);
        }
示例#17
0
        public ContextMenuTemplate GetCreatureFeatChoiceMenu(Creature creature)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts      = new List <string>();
            template.tags       = new List <List <string> >();
            template.childMenus = new List <ContextMenuTemplate>();
            foreach (Feat feat in creature.feats)
            {
                if (feat.HasChoices())
                {
                    template.texts.Add(feat.name);
                    template.tags.Add(new List <string>()
                    {
                        ContextMenu.DefaultTags.ParentMenu.ToString()
                    });
                    ContextMenuTemplate childMenu = BaseControlsTemplate();
                    childMenu.childMenus = new List <ContextMenuTemplate>();
                    foreach (string s in feat.featChoices)
                    {
                        childMenu.texts.Add(s);
                        if (feat.FeatChoiceChildMenu(s) == null)
                        {
                            childMenu.tags.Add(new List <string>()
                            {
                                CreatureMenuOtherOptions.FeatChoices.ToString(), creature.feats.IndexOf(feat).ToString(), s
                            });
                            childMenu.childMenus.Add(null);
                        }
                        else
                        {
                            childMenu.tags.Add(new List <string>()
                            {
                                ContextMenu.DefaultTags.ParentMenu.ToString()
                            });
                            childMenu.childMenus.Add(feat.FeatChoiceChildMenu(s));
                        }
                    }
                    template.childMenus.Add(childMenu);
                }
            }

            return(template);
        }
示例#18
0
        public ContextMenuTemplate GetContextMenuBlankTile(BoardTile tile)
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures);
            template.font     = contextMenuTextures.baseFont;

            template.texts = new List <string>()
            {
                "Spawn Monster",
                "Spawn Quick Character",
                "Spawn Character",
                "Destroy Encounter"
            };
            template.tags = new List <List <string> >()
            {
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    EncounterControls.SpawnCharacter.ToString()
                },
                new List <string>()
                {
                    EncounterControls.DestroyEncounter.ToString()
                }
            };

            template.childMenus = new List <ContextMenuTemplate>()
            {
                GetSpawnMonsterMenu(tile), GetSpawnQuickCharacterSpeciesMenu()
            };

            return(template);
        }
示例#19
0
        public ContextMenuTemplate GetSpawnQuickCharacterClassMenu(string race, string subRace)
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures);
            template.font     = contextMenuTextures.baseFont;

            template.texts      = new List <string>(DnDManager.classes.Keys);
            template.tags       = new List <List <string> >();
            template.childMenus = new List <ContextMenuTemplate>();
            for (int i = 0; i < DnDManager.classes.Keys.Count; i++)
            {
                template.tags.Add(new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                });
                template.childMenus.Add(GetSpawnQuickCharacterSubClassMenu(race, subRace, DnDManager.classes.Keys.ElementAt <string>(i)));
            }

            return(template);
        }
示例#20
0
        public ContextMenuTemplate GetSpawnQuickCharacterLevelMenu(string race, string subrace, string playerClass, string subClass)
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures        = ButtonTextures.FromList(contextMenuTextures.blankTileTextures);
            template.font            = contextMenuTextures.baseFont;
            template.numberOfColumns = 2;

            template.texts = new List <string>();
            template.tags  = new List <List <string> >();
            for (int i = 0; i < 20; i++)
            {
                template.texts.Add((i + 1).ToString());
                template.tags.Add(new List <string>()
                {
                    EncounterControls.SpawnQuickCharacter.ToString(), race, subrace, playerClass, subClass, (i + 1).ToString()
                });
            }

            return(template);
        }
示例#21
0
        public ContextMenuTemplate GetSpawnQuickCharacterSubSpeciesMenu(string race)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            if (DnDManager.species[race].subSpecies == null || DnDManager.species[race].subSpecies.Count < 1)
            {
                template.texts = new List <string>()
                {
                    "None"
                };
                template.tags = new List <List <string> >()
                {
                    new List <string>()
                    {
                        ContextMenu.DefaultTags.ParentMenu.ToString()
                    }
                };
                template.childMenus = new List <ContextMenuTemplate>()
                {
                    GetSpawnQuickCharacterClassMenu(race, null)
                };
                return(template);
            }

            template.texts      = new List <string>(DnDManager.species[race].subSpecies);
            template.tags       = new List <List <string> >();
            template.childMenus = new List <ContextMenuTemplate>();
            for (int i = 0; i < DnDManager.species[race].subSpecies.Count; i++)
            {
                template.tags.Add(new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                });
                template.childMenus.Add(GetSpawnQuickCharacterClassMenu(race, DnDManager.species[race].subSpecies[i]));
            }

            return(template);
        }
示例#22
0
        public ContextMenuTemplate MakeOtherItemEquipMenu(ContextMenuTemplate baseTemplate)
        {
            ContextMenuTemplate template = new ContextMenuTemplate();

            template.textures = baseTemplate.textures;
            template.font     = baseTemplate.font;
            template.texts    = new List <string>();
            template.tags     = new List <List <string> >();

            foreach (Item item in wondrousItems)
            {
                if (item.Equippable(creature))
                {
                    template.texts.Add(item.name);
                    template.tags.Add(new List <string>()
                    {
                        CreatureMenuOtherOptions.EquipItem.ToString(), items.IndexOf(item).ToString()
                    });
                }
            }

            return(template);
        }
示例#23
0
        ContextMenuTemplate GetFeatMenu(Creature creature)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts      = new List <string>();
            template.tags       = new List <List <string> >();
            template.inactives  = new List <bool>();
            template.childMenus = new List <ContextMenuTemplate>();

            for (int i = 0; i < creature.feats.Count; i++)
            {
                if (creature.feats[i].IsUsable())
                {
                    template.texts.Add(creature.feats[i].name);
                    template.inactives.Add(false);
                    template.childMenus.Add(creature.feats[i].ChildMenu());
                    template.tags.Add(new List <string>()
                    {
                        CombatActions.UseFeat.ToString(), i.ToString()
                    });
                }
            }
            return(template);
        }
示例#24
0
        public ContextMenuTemplate GetCreatureSkillChoiceMenu(Creature creature)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts = new List <string>();
            template.tags  = new List <List <string> >();
            if (creature.skillChoices.Count > 0)
            {
                foreach (Skills skill in creature.skillChoices[0])
                {
                    if (!creature.skillProficiencies.Contains(skill))
                    {
                        template.texts.Add(skill.ToString());
                        template.tags.Add(new List <string>()
                        {
                            CreatureMenuOtherOptions.ChooseSkill.ToString(), skill.ToString()
                        });
                    }
                }
            }


            return(template);
        }
 public EncounterControlsContextMenu(Vector2 position, ContextMenuTemplate template) : base(template, position)
 {
     destroyOnOtherClick = true;
 }
 public EncounterControlsContextMenu(BoardTile tile, ContextMenuTemplate template1, ContextMenuTemplate template2) : base(template1, template2, new Vector2(0, 0), tile)
 {
     this.tile           = tile;
     destroyOnOtherClick = true;
 }
 public CreatureContextMenu(BoardTile tile, Creature creature, ContextMenuTemplate template) : base(template, new Vector2(0, 0), tile)
 {
     this.tile           = tile;
     this.creature       = creature;
     destroyOnOtherClick = true;
 }
示例#28
0
        public ContextMenuTemplate SpellControls()
        {
            if (!(spells.Count > 0))
            {
                return(null);
            }
            ContextMenuTemplate spellControls = new ContextMenuTemplate();

            ContextMenuTemplate[] spellControlsEachLevel = new ContextMenuTemplate[10];

            for (int i = 0; i <= 9; i++)
            {
                spellControlsEachLevel[i]            = new ContextMenuTemplate();
                spellControlsEachLevel[i].textures   = ButtonTextures.FromList(contextMenuTextures.baseTextures);
                spellControlsEachLevel[i].font       = contextMenuTextures.baseFont;
                spellControlsEachLevel[i].texts      = new List <string>();
                spellControlsEachLevel[i].tags       = new List <List <string> >();
                spellControlsEachLevel[i].inactives  = new List <bool>();
                spellControlsEachLevel[i].childMenus = new List <ContextMenuTemplate>();
            }

            foreach (Spell spell in spells)
            {
                if (!spell.hideInSpellbook)
                {
                    spellControlsEachLevel[spell.spellLevel].texts.Add(spell.name);
                    if (spell.childMenu)
                    {
                        spellControlsEachLevel[spell.spellLevel].tags.Add(new List <string>()
                        {
                            ContextMenu.DefaultTags.ParentMenu.ToString()
                        });
                    }
                    else
                    {
                        spellControlsEachLevel[spell.spellLevel].tags.Add(new List <string>()
                        {
                            CombatActions.CastSpell.ToString(), spells.IndexOf(spell).ToString()
                        });
                    }
                    spellControlsEachLevel[spell.spellLevel].inactives.Add(!spell.CheckCastable(owner));
                    spellControlsEachLevel[spell.spellLevel].childMenus.Add(spell.GetChildMenu());
                }
            }

            spellControls.textures   = ButtonTextures.FromList(contextMenuTextures.baseTextures);
            spellControls.font       = contextMenuTextures.baseFont;
            spellControls.texts      = new List <string>();
            spellControls.tags       = new List <List <string> >();
            spellControls.childMenus = new List <ContextMenuTemplate>();
            if (spellsByLevel[0].Count > 0)
            {
                spellControls.texts.Add("Cantrips");
                spellControls.tags.Add(new List <string>()
                {
                    0.ToString(), ContextMenu.DefaultTags.ParentMenu.ToString()
                });
                spellControls.childMenus.Add(spellControlsEachLevel[0]);
            }
            for (int i = 1; i <= 9; i++)
            {
                if (ContainsSpellLevel(i))
                {
                    spellControls.texts.Add(string.Format("Level {0}", i));
                    spellControls.tags.Add(new List <string>()
                    {
                        i.ToString(), ContextMenu.DefaultTags.ParentMenu.ToString()
                    });
                    spellControls.childMenus.Add(spellControlsEachLevel[i]);
                }
            }

            return(spellControls);
        }
示例#29
0
        public void GetWeaponChoices(ref ContextMenuTemplate template, string weaponCategory, int choiceIndex)
        {
            if (weaponCategory == WeaponChoices.SimpleWeapon.ToString())
            {
                template.texts.Add("Simple Weapon");
                template.tags.Add(new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                });
                ContextMenuTemplate options = BaseControlsTemplate();
                options.texts = new List <string>();
                options.tags  = new List <List <string> >();
                foreach (string s in DnDManager.simpleMeleeWeapons)
                {
                    options.texts.Add(s);
                    options.tags.Add(new List <string>()
                    {
                        CreatureMenuOtherOptions.ChooseWeapon.ToString(), choiceIndex.ToString(), s
                    });
                }
                foreach (string s in DnDManager.simpleRangedWeapons)
                {
                    options.texts.Add(s);
                    options.tags.Add(new List <string>()
                    {
                        CreatureMenuOtherOptions.ChooseWeapon.ToString(), choiceIndex.ToString(), s
                    });
                }

                template.childMenus.Add(options);
            }
            else if (weaponCategory == WeaponChoices.MartialWeapon.ToString())
            {
                template.texts.Add("Martial Weapon");
                template.tags.Add(new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                });
                ContextMenuTemplate options = BaseControlsTemplate();
                options.texts = new List <string>();
                options.tags  = new List <List <string> >();
                foreach (string s in DnDManager.martialMeleeWeapons)
                {
                    options.texts.Add(s);
                    options.tags.Add(new List <string>()
                    {
                        CreatureMenuOtherOptions.ChooseWeapon.ToString(), choiceIndex.ToString(), s
                    });
                }
                foreach (string s in DnDManager.martialRangedWeapons)
                {
                    options.texts.Add(s);
                    options.tags.Add(new List <string>()
                    {
                        CreatureMenuOtherOptions.ChooseWeapon.ToString(), choiceIndex.ToString(), s
                    });
                }

                template.childMenus.Add(options);
            }
            else if (weaponCategory == WeaponChoices.MartialMeleeWeapon.ToString())
            {
                template.texts.Add("Martial Melee Weapon");
                template.tags.Add(new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                });
                ContextMenuTemplate options = BaseControlsTemplate();
                options.texts = new List <string>();
                options.tags  = new List <List <string> >();
                foreach (string s in DnDManager.martialMeleeWeapons)
                {
                    options.texts.Add(s);
                    options.tags.Add(new List <string>()
                    {
                        CreatureMenuOtherOptions.ChooseWeapon.ToString(), choiceIndex.ToString(), s
                    });
                }
                template.childMenus.Add(options);
            }
        }
示例#30
0
        ContextMenuTemplate GetChoicesMenu(Creature creature)
        {
            ContextMenuTemplate template = BaseControlsTemplate();

            template.texts = new List <string>()
            {
                "Change Name",
                "Change Stats",
                "Add Item",
                "Change Weapon",
                "Add Feat",
                "Choose Language",
                "Choose Skill",
                "Choose Items",
                "Choose Feat"
            };
            template.tags = new List <List <string> >()
            {
                new List <string>()
                {
                    "ChangeName"
                },
                new List <string>()
                {
                    "ChangeStats"
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
                new List <string>()
                {
                    ContextMenu.DefaultTags.ParentMenu.ToString()
                },
            };
            template.childMenus = new List <ContextMenuTemplate>()
            {
                null,
                null,
                null,
                null,
                null,
                GetCreatureLanguageChoices(creature),
                GetCreatureSkillChoiceMenu(creature),
                GetCreatureItemChoicesMenu(creature),
                GetCreatureFeatChoiceMenu(creature)
            };
            template.inactives = new List <bool>()
            {
                false,
                false,
                false,
                false,
                false,
                !creature.languages.Contains(DnDManager.Languages.Choose.ToString()),
                creature.skillChoices.Count < 1,
                (creature.itemChoices.Count < 1 && creature.weaponChoices.Count < 1),
                !creature.HasFeatChoices()
            };

            return(template);
        }