Пример #1
0
    public void AddEvent(int index, int button, bool replace = false)
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();

        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(delegate(string s) { SelectAddEvent(index, button, replace, s); }, new StringKey("val", "SELECT", CommonStringKeys.EVENT));

        select.AddNewComponentItem("Event");
        select.AddNewComponentItem("Spawn");
        if (game.gameType is MoMGameType)
        {
            select.AddNewComponentItem("Puzzle");
        }

        foreach (KeyValuePair <string, QuestData.QuestComponent> kv in game.quest.qd.components)
        {
            if (kv.Value is QuestData.Event)
            {
                select.AddItem(kv.Value);
            }
        }

        select.Draw();
    }
Пример #2
0
    public void AddVisibility(bool add, int index = -1)
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();

        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(delegate(string s) { SelectAddVisibility(add, index, s); }, new StringKey("val", "SELECT", new StringKey("val", "COMPONENT")));

        Dictionary <string, IEnumerable <string> > traits = new Dictionary <string, IEnumerable <string> >();

        traits.Add(CommonStringKeys.TYPE.Translate(), new string[] { "Special" });

        select.AddItem("#boardcomponents", traits);
        select.AddItem("#monsters", traits);
        select.AddItem("#shop", traits);

        if (game.gameType is D2EGameType || game.gameType is IAGameType)
        {
            select.AddNewComponentItem("Door");
        }
        select.AddNewComponentItem("Tile");
        select.AddNewComponentItem("Token");
        select.AddNewComponentItem("UI");
        select.AddNewComponentItem("QItem");

        foreach (KeyValuePair <string, QuestData.QuestComponent> kv in game.quest.qd.components)
        {
            if (kv.Value is QuestData.Door || kv.Value is QuestData.Tile || kv.Value is QuestData.Token || kv.Value is QuestData.UI)
            {
                select.AddItem(kv.Value);
            }
            if (kv.Value is QuestData.Spawn)
            {
                select.AddItem(kv.Value);
            }
            if (kv.Value is QuestData.QItem)
            {
                select.AddItem(kv.Value);
            }
        }
        select.Draw();
    }
    public void AddActivation(int index = -1)
    {
        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(delegate(string s) { SelectAddActivation(index, s); }, new StringKey("val", "SELECT", CommonStringKeys.ACTIVATION));

        select.AddNewComponentItem("Activation");
        foreach (KeyValuePair <string, QuestData.QuestComponent> kv in Game.Get().quest.qd.components)
        {
            if (kv.Value is QuestData.Activation)
            {
                select.AddItem(kv.Value);
            }
        }
        select.Draw();
    }
    public void SetActivation()
    {
        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(SelectSetActivation, new StringKey("val", "SELECT", CommonStringKeys.ACTIVATION));

        select.AddItem("{NONE}", "");
        select.AddNewComponentItem("Event");
        foreach (QuestData.QuestComponent c in Game.Get().quest.qd.components.Values)
        {
            if (c.typeDynamic.IndexOf("Event") == 0)
            {
                select.AddItem(c);
            }
        }
        select.Draw();
    }
    public void SetHorrorEvent()
    {
        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(SelectSetHorror, new StringKey("val", "SELECT", new StringKey("val", "horror")));

        select.AddItem("{NONE}", "");
        select.AddNewComponentItem("Event");
        foreach (KeyValuePair <string, QuestData.QuestComponent> kv in Game.Get().quest.qd.components)
        {
            if (kv.Value.typeDynamic.Equals("Event"))
            {
                select.AddItem(kv.Value);
            }
        }
        select.Draw();
    }
Пример #6
0
    public void MonsterPlaceAdd(int heroes, int slot = -1)
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();
        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(delegate(string s) { MonsterPlaceAddSelection(heroes, slot, s); }, CommonStringKeys.SELECT_ITEM);

        select.AddNewComponentItem("MPlace");

        foreach (KeyValuePair <string, QuestData.QuestComponent> kv in game.quest.qd.components)
        {
            if (kv.Value is QuestData.MPlace)
            {
                select.AddItem(kv.Value);
            }
        }
        select.Draw();
    }
Пример #7
0
    public void PickInpsect()
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();

        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(SelectInspectEvent, new StringKey("val", "SELECT", CommonStringKeys.SELECT_ITEM));

        select.AddItem("{NONE}", "", true);
        select.AddNewComponentItem("Event");

        foreach (KeyValuePair <string, QuestData.QuestComponent> kv in game.quest.qd.components)
        {
            if (kv.Value.typeDynamic.Equals("Event"))
            {
                select.AddItem(kv.Value);
            }
        }
        select.Draw();
    }
Пример #8
0
    // Open component selection top level
    // Menu for selection of all component types, includes delete options
    public static void TypeSelect(string type = "")
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();
        UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(SelectComponent, CommonStringKeys.SELECT_ITEM);

        select.AddNewComponentItem("Tile");
        select.AddNewComponentItem("Token");
        select.AddNewComponentItem("Spawn");
        select.AddNewComponentItem("Event");
        select.AddNewComponentItem("CustomMonster");
        select.AddNewComponentItem("UI");
        select.AddNewComponentItem("QItem");
        if (game.gameType is D2EGameType || game.gameType is IAGameType)
        {
            select.AddNewComponentItem("Activation");
            select.AddNewComponentItem("Door");
            select.AddNewComponentItem("MPlace");
        }
        else
        {
            select.AddNewComponentItem("Puzzle");
        }

        Dictionary <string, IEnumerable <string> > traits = new Dictionary <string, IEnumerable <string> >();

        traits.Add(new StringKey("val", "TYPE").Translate(), new string[] { "Quest" });
        select.AddItem(CommonStringKeys.QUEST.Translate(), "Quest", traits);

        foreach (QuestData.QuestComponent c in game.quest.qd.components.Values)
        {
            if (!(c is PerilData))
            {
                select.AddItem(c);
            }
        }

        select.Draw();
        if (type.Length > 0)
        {
            select.SelectTrait(new StringKey("val", "TYPE").Translate(), new StringKey("val", type.ToUpper()).Translate());
        }
    }