コード例 #1
0
    public void MoMActivation()
    {
        DialogBox db = new DialogBox(new Vector2(0, 1), new Vector2(20, 1), INITIAL_MESSAGE);

        db.ApplyTag("editor");

        abilityDBE = new DialogBoxEditable(new Vector2(0, 2), new Vector2(20, 8), activationComponent.ability.Translate(), delegate { UpdateAbility(); });
        abilityDBE.ApplyTag("editor");
        abilityDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 10), new Vector2(10, 1), UNABLE_BUTTON);

        moveButtonDBE = new DialogBoxEditable(new Vector2(10, 10), new Vector2(10, 1), activationComponent.moveButton.Translate(), delegate { UpdateMoveButton(); });
        moveButtonDBE.ApplyTag("editor");
        moveButtonDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 11), new Vector2(20, 1), ATTACK_MESSAGE);
        db.ApplyTag("editor");

        masterActionsDBE = new DialogBoxEditable(new Vector2(0, 12), new Vector2(20, 8), activationComponent.masterActions.Translate(), delegate { UpdateMasterActions(); });
        masterActionsDBE.ApplyTag("editor");
        masterActionsDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 20), new Vector2(20, 1), NO_ATTACK_MESSAGE);
        db.ApplyTag("editor");

        moveDBE = new DialogBoxEditable(new Vector2(0, 21), new Vector2(20, 8), activationComponent.move.Translate(), delegate { UpdateMove(); });
        moveDBE.ApplyTag("editor");
        moveDBE.AddBorder();
    }
コード例 #2
0
    // This is called when a quest is selected
    public void StartQuest(QuestLoader.Quest q)
    {
        // Fetch all of the quest data and initialise the quest
        quest = new Quest(q);

        // Draw the hero icons, which are buttons for selection
        heroCanvas.SetupUI();

        // Add a finished button to start the quest
        TextButton endSelection = new TextButton(new Vector2(UIScaler.GetRight(-9), UIScaler.GetBottom(-3)), new Vector2(8, 2), "Finished", delegate { EndSelection(); }, Color.green);

        endSelection.SetFont(gameType.GetHeaderFont());
        // Untag as dialog so this isn't cleared away during hero selection
        endSelection.ApplyTag("heroselect");

        // Add a title to the page
        DialogBox db = new DialogBox(new Vector2(8, 1), new Vector2(UIScaler.GetWidthUnits() - 16, 3), "Select " + gameType.HeroesName());

        db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetLargeFont();
        db.SetFont(gameType.GetHeaderFont());
        db.ApplyTag("heroselect");

        TextButton cancelSelection = new TextButton(new Vector2(1, UIScaler.GetBottom(-3)), new Vector2(8, 2), "Back", delegate { Destroyer.QuestSelect(); }, Color.red);

        cancelSelection.SetFont(gameType.GetHeaderFont());
        // Untag as dialog so this isn't cleared away during hero selection
        cancelSelection.ApplyTag("heroselect");
    }
コード例 #3
0
ファイル: NextStageButton.cs プロジェクト: Landar77/valkyrie
    public void Update()
    {
        // Clean up everything marked as 'uiphase'
        foreach (GameObject go in GameObject.FindGameObjectsWithTag("uiphase"))
        {
            Object.Destroy(go);
        }

        StringKey phase;

        if (Game.Get().quest.phase == Quest.MoMPhase.horror)
        {
            phase = HORROR_STEP;
        }
        else if (Game.Get().quest.phase == Quest.MoMPhase.mythos)
        {
            phase = PHASE_MYTHOS;
        }
        else if (Game.Get().quest.phase == Quest.MoMPhase.monsters)
        {
            phase = MONSTER_STEP;
        }
        else
        {
            phase = PHASE_INVESTIGATOR;
        }

        DialogBox db;

        db = new DialogBox(new Vector2(UIScaler.GetHCenter(-6f), UIScaler.GetBottom(-2.5f)), new Vector2(16, 2), phase);
        db.SetFont(Game.Get().gameType.GetHeaderFont());
        db.ApplyTag("uiphase");
        db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont();
        db.AddBorder();
    }
コード例 #4
0
    public void MoMActivation()
    {
        DialogBox db = new DialogBox(new Vector2(0, 1), new Vector2(20, 1), "Initial Message:");

        db.ApplyTag("editor");

        abilityDBE = new DialogBoxEditable(new Vector2(0, 2), new Vector2(20, 8), activationComponent.ability.Translate(), delegate { UpdateAbility(); });
        abilityDBE.ApplyTag("editor");
        abilityDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 10), new Vector2(10, 1), "Unable Button:");

        moveButtonDBE = new DialogBoxEditable(new Vector2(10, 10), new Vector2(10, 1), activationComponent.moveButton.Translate(), delegate { UpdateMoveButton(); });
        moveButtonDBE.ApplyTag("editor");
        moveButtonDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 11), new Vector2(20, 1), "Attack Message:");
        db.ApplyTag("editor");

        masterActionsDBE = new DialogBoxEditable(new Vector2(0, 12), new Vector2(20, 8), activationComponent.masterActions.Translate(), delegate { UpdateMasterActions(); });
        masterActionsDBE.ApplyTag("editor");
        masterActionsDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 20), new Vector2(20, 1), "No Attack Message:");
        db.ApplyTag("editor");

        moveDBE = new DialogBoxEditable(new Vector2(0, 21), new Vector2(20, 8), activationComponent.move.Translate(), delegate { UpdateMove(); });
        moveDBE.ApplyTag("editor");
        moveDBE.AddBorder();
    }
コード例 #5
0
    override public void Update()
    {
        base.Update();
        CameraController.SetCamera(mPlaceComponent.location);
        Game game = Game.Get();

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), CommonStringKeys.MPLACE, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1),
                            new StringKey(null, name.Substring("MPlace".Length), false),
                            delegate { QuestEditorData.ListMPlace(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");


        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(4, 1), CommonStringKeys.POSITION);

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 2), new Vector2(1, 1), CommonStringKeys.POSITION_SNAP, delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        StringKey rotateKey = new StringKey("val", "RIGHT");

        if (mPlaceComponent.rotate)
        {
            rotateKey = new StringKey("val", "DOWN");
        }

        tb = new TextButton(new Vector2(0, 4), new Vector2(8, 1),
                            new StringKey("val", "ROTATE_TO", rotateKey),
                            delegate { Rotate(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        StringKey mast = new StringKey("val", "MONSTER_MINION");

        if (mPlaceComponent.master)
        {
            mast = new StringKey("val", "MONSTER_MASTER");
        }
        tb = new TextButton(new Vector2(0, 6), new Vector2(8, 1), mast, delegate { MasterToggle(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        game.tokenBoard.AddHighlight(mPlaceComponent.location, "MonsterLoc", "editor");
    }
コード例 #6
0
    override public void Update()
    {
        base.Update();
        CameraController.SetCamera(monsterComponent.location);
        Game game = Game.Get();

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(3, 1), CommonStringKeys.SPAWN, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(3, 0), new Vector2(16, 1),
                            new StringKey(null, name.Substring("Spawn".Length), false), delegate { QuestEditorData.ListSpawn(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int       offset = 1;
        DialogBox db     = null;

        for (int heroes = 2; heroes < 5; heroes++)
        {
            int h = heroes;
            db = new DialogBox(new Vector2(0, offset), new Vector2(5, 1), new StringKey("val", "NUMBER_HEROS", heroes));
            db.ApplyTag("editor");

            tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), CommonStringKeys.PLUS, delegate { MonsterPlaceAdd(h); }, Color.green);
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");

            for (int i = 0; i < 8; i++)
            {
                if (monsterComponent.placement[heroes].Length > i)
                {
                    int    mSlot = i;
                    string place = monsterComponent.placement[heroes][i];

                    tb = new TextButton(new Vector2(0, offset), new Vector2(1, 1), CommonStringKeys.MINUS, delegate { MonsterPlaceRemove(h, mSlot); }, Color.red);
                    tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                    tb.ApplyTag("editor");

                    tb = new TextButton(new Vector2(1, offset), new Vector2(19, 1),
                                        new StringKey(null, place, false), delegate { QuestEditorData.SelectComponent(place); });
                    tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                    tb.ApplyTag("editor");
                }
                offset++;
            }
        }

        game.tokenBoard.AddHighlight(monsterComponent.location, "MonsterLoc", "editor");
    }
コード例 #7
0
    public void Activation()
    {
        DialogBox db = new DialogBox(new Vector2(0, 1), new Vector2(20, 1), new StringKey("val", "X_COLON", ABILITY));

        db.ApplyTag("editor");

        abilityDBE = new DialogBoxEditable(
            new Vector2(0, 2), new Vector2(20, 8),
            activationComponent.ability.Translate(),
            delegate { UpdateAbility(); });
        abilityDBE.ApplyTag("editor");
        abilityDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 10), new Vector2(15, 1), new StringKey("val", "X_COLON", MONSTER_MASTER));
        db.ApplyTag("editor");
        TextButton tb = null;

        if (activationComponent.masterFirst)
        {
            tb = new TextButton(new Vector2(15, 10), new Vector2(5, 1), FIRST, delegate { ToggleMasterFirst(); });
        }
        else
        {
            tb = new TextButton(new Vector2(15, 10), new Vector2(5, 1), NOT_FIRST, delegate { ToggleMasterFirst(); });
        }
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        masterActionsDBE = new DialogBoxEditable(
            new Vector2(0, 11), new Vector2(20, 8),
            activationComponent.masterActions.Translate(true),
            delegate { UpdateMasterActions(); });
        masterActionsDBE.ApplyTag("editor");
        masterActionsDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 19), new Vector2(15, 1), new StringKey("val", "X_COLON", MONSTER_MINION));
        db.ApplyTag("editor");
        if (activationComponent.minionFirst)
        {
            tb = new TextButton(new Vector2(15, 19), new Vector2(5, 1), FIRST, delegate { ToggleMinionFirst(); });
        }
        else
        {
            tb = new TextButton(new Vector2(15, 19), new Vector2(5, 1), NOT_FIRST, delegate { ToggleMinionFirst(); });
        }
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        minionActionsDBE = new DialogBoxEditable(
            new Vector2(0, 20), new Vector2(20, 8),
            activationComponent.minionActions.Translate(true),
            delegate { UpdateMinionActions(); });
        minionActionsDBE.ApplyTag("editor");
        minionActionsDBE.AddBorder();
    }
コード例 #8
0
    override public void Update()
    {
        base.Update();
        Game game = Game.Get();

        CameraController.SetCamera(tokenComponent.location);

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), CommonStringKeys.TOKEN, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1),
                            new StringKey(null, name.Substring("Token".Length), false), delegate { QuestEditorData.ListToken(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");


        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(4, 1), CommonStringKeys.POSITION);

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 2), new Vector2(1, 1), CommonStringKeys.POSITION_SNAP, delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, 2), new Vector2(1, 1), CommonStringKeys.POSITION_FREE, delegate { GetPosition(false); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 4), new Vector2(8, 1),
                            new StringKey("val", "ROTATION",
                                          new StringKey(null, tokenComponent.rotation.ToString(), false)),
                            delegate { Rotate(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 6), new Vector2(8, 1),
                            new StringKey(null, tokenComponent.tokenName, false), delegate { Type(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 8), new Vector2(8, 1), CommonStringKeys.EVENT, delegate { QuestEditorData.SelectAsEvent(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        game.quest.ChangeAlpha(tokenComponent.sectionName, 1f);
    }
コード例 #9
0
    override public void Update()
    {
        base.Update();
        CameraController.SetCamera(mPlaceComponent.location);
        Game game = Game.Get();

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), "MPlace", delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1), name.Substring("MPlace".Length), delegate { QuestEditorData.ListMPlace(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");


        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(4, 1), "Position");

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 2), new Vector2(1, 1), "><", delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        string r = "Right";

        if (mPlaceComponent.rotate)
        {
            r = "Down";
        }
        tb = new TextButton(new Vector2(0, 4), new Vector2(8, 1), "Rotate: " + r, delegate { Rotate(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        string mast = "Minion";

        if (mPlaceComponent.master)
        {
            mast = "Master";
        }
        tb = new TextButton(new Vector2(0, 6), new Vector2(8, 1), mast, delegate { MasterToggle(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        game.tokenBoard.AddHighlight(mPlaceComponent.location, "MonsterLoc", "editor");
    }
コード例 #10
0
    override public void Update()
    {
        base.Update();
        Game game = Game.Get();

        CameraController.SetCamera(doorComponent.location);

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(3, 1),
                                       CommonStringKeys.DOOR, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(3, 0), new Vector2(16, 1),
                            new StringKey(null, name.Substring("Door".Length), false),
                            delegate { QuestEditorData.ListDoor(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(4, 1), CommonStringKeys.POSITION);

        db.ApplyTag("editor");

        // This is a snapped position
        tb = new TextButton(new Vector2(4, 2), new Vector2(1, 1), CommonStringKeys.POSITION_SNAP, delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 4), new Vector2(8, 1),
                            new StringKey("val", "ROTATION", doorComponent.rotation),
                            delegate { Rotate(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 6), new Vector2(8, 1), COLOR, delegate { Colour(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 8), new Vector2(8, 1), CommonStringKeys.EVENT, delegate { QuestEditorData.SelectAsEvent(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        game.tokenBoard.AddHighlight(doorComponent.location, "DoorAnchor", "editor");

        game.quest.ChangeAlpha(doorComponent.sectionName, 1f);
    }
コード例 #11
0
    override public void Update()
    {
        base.Update();
        Game       game = Game.Get();
        TextButton tb   = new TextButton(new Vector2(0, 0), new Vector2(4, 1),
                                         CommonStringKeys.QUEST, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        nameDBE = new DialogBoxEditable(
            new Vector2(0, 2), new Vector2(20, 1),
            game.quest.qd.quest.name.Translate(),
            delegate { UpdateQuestName(); });
        nameDBE.ApplyTag("editor");
        nameDBE.AddBorder();

        descriptionDBE = new DialogBoxEditable(
            new Vector2(0, 4), new Vector2(20, 6),
            game.quest.qd.quest.description.Translate(true),
            delegate { UpdateQuestDesc(); });
        descriptionDBE.ApplyTag("editor");
        descriptionDBE.AddBorder();

        DialogBox db = new DialogBox(new Vector2(0, 11), new Vector2(9, 1), REQUIRED_EXPANSIONS);

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(9, 11), new Vector2(1, 1), CommonStringKeys.PLUS, delegate { QuestAddPack(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int offset = 12;
        int index;

        for (index = 0; index < 15; index++)
        {
            if (game.quest.qd.quest.packs.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(0, offset), new Vector2(9, 1),
                                   new StringKey("val", game.quest.qd.quest.packs[index]));
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(9, offset++), new Vector2(1, 1),
                                    CommonStringKeys.MINUS, delegate { QuestRemovePack(i); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }
    }
コード例 #12
0
ファイル: MoraleDisplay.cs プロジェクト: juniorBRL/valkyrie
    // Construct and display
    public MoraleDisplay()
    {
        Game game   = Game.Get();
        int  morale = Mathf.RoundToInt(game.quest.vars.GetValue("$%morale"));

        if (morale < 0)
        {
            morale = 0;
        }
        md = new DialogBox(new Vector2(0.75f, 0.5f), new Vector2(3, 3), morale, Color.red);
        md.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetLargeFont();
        md.AddBorder();
        md.ApplyTag(Game.QUESTUI);
    }
コード例 #13
0
    override public void Update()
    {
        base.Update();
        Game game = Game.Get();

        CameraController.SetCamera(tokenComponent.location);

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), "Token", delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1), name.Substring("Token".Length), delegate { QuestEditorData.ListToken(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");


        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(4, 1), "Position");

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 2), new Vector2(1, 1), "><", delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, 2), new Vector2(1, 1), "~", delegate { GetPosition(false); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 4), new Vector2(8, 1), "Rotation (" + tokenComponent.rotation + ")", delegate { Rotate(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 6), new Vector2(8, 1), tokenComponent.tokenName, delegate { Type(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 8), new Vector2(8, 1), "Event", delegate { QuestEditorData.SelectAsEvent(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        game.quest.ChangeAlpha(tokenComponent.sectionName, 1f);
    }
コード例 #14
0
    public void Activation()
    {
        DialogBox db = new DialogBox(new Vector2(0, 1), new Vector2(20, 1), "Ability:");

        db.ApplyTag("editor");

        abilityDBE = new DialogBoxEditable(new Vector2(0, 2), new Vector2(20, 8), activationComponent.ability.Translate(), delegate { UpdateAbility(); });
        abilityDBE.ApplyTag("editor");
        abilityDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 10), new Vector2(15, 1), "Master:");
        db.ApplyTag("editor");
        TextButton tb = null;

        if (activationComponent.masterFirst)
        {
            tb = new TextButton(new Vector2(15, 10), new Vector2(5, 1), "First", delegate { ToggleMasterFirst(); });
        }
        else
        {
            tb = new TextButton(new Vector2(15, 10), new Vector2(5, 1), "Not First", delegate { ToggleMasterFirst(); });
        }
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        masterActionsDBE = new DialogBoxEditable(new Vector2(0, 11), new Vector2(20, 8), activationComponent.masterActions.Translate(), delegate { UpdateMasterActions(); });
        masterActionsDBE.ApplyTag("editor");
        masterActionsDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 19), new Vector2(15, 1), "Minion:");
        db.ApplyTag("editor");
        if (activationComponent.minionFirst)
        {
            tb = new TextButton(new Vector2(15, 19), new Vector2(5, 1), "First", delegate { ToggleMinionFirst(); });
        }
        else
        {
            tb = new TextButton(new Vector2(15, 10), new Vector2(5, 1), "Not First", delegate { ToggleMinionFirst(); });
        }
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        minionActionsDBE = new DialogBoxEditable(new Vector2(0, 20), new Vector2(20, 8), activationComponent.minionActions.Translate(), delegate { UpdateMinionActions(); });
        minionActionsDBE.ApplyTag("editor");
        minionActionsDBE.AddBorder();
    }
コード例 #15
0
    override public void Update()
    {
        base.Update();
        Game game = Game.Get();

        CameraController.SetCamera(tileComponent.location);

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(3, 1), CommonStringKeys.TILE, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(3, 0), new Vector2(16, 1),
                            new StringKey(null, name.Substring("Tile".Length), false), delegate { QuestEditorData.ListTile(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 2), new Vector2(20, 1),
                            new StringKey(null, tileComponent.tileSideName, false), delegate { ChangeTileSide(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(0, 4), new Vector2(4, 1), CommonStringKeys.POSITION);

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 4), new Vector2(1, 1), CommonStringKeys.POSITION_SNAP, delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(0, 6), new Vector2(8, 1),
                            new StringKey("val", "ROTATION", tileComponent.rotation), delegate { TileRotate(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        game.tokenBoard.AddHighlight(tileComponent.location, "TileAnchor", "editor");

        game.quest.ChangeAlpha(tileComponent.sectionName, 1f);
    }
コード例 #16
0
    override public void Update()
    {
        base.Update();
        Game       game = Game.Get();
        TextButton tb   = new TextButton(new Vector2(0, 0), new Vector2(4, 1), "Quest", delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        dbe1 = new DialogBoxEditable(new Vector2(0, 2), new Vector2(20, 1), game.quest.qd.quest.name, delegate { UpdateQuestName(); });
        dbe1.ApplyTag("editor");
        dbe1.AddBorder();

        dbe2 = new DialogBoxEditable(new Vector2(0, 4), new Vector2(20, 6), game.quest.qd.quest.description, delegate { UpdateQuestDesc(); });
        dbe2.ApplyTag("editor");
        dbe2.AddBorder();

        DialogBox db = new DialogBox(new Vector2(0, 11), new Vector2(9, 1), "Required Expansions:");

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(9, 11), new Vector2(1, 1), "+", delegate { QuestAddPack(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int offset = 12;
        int index;

        for (index = 0; index < 15; index++)
        {
            if (game.quest.qd.quest.packs.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(0, offset), new Vector2(9, 1), game.quest.qd.quest.packs[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(9, offset++), new Vector2(1, 1), "-", delegate { QuestRemovePack(i); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }
    }
コード例 #17
0
ファイル: ShopInterface.cs プロジェクト: juniorBRL/valkyrie
    public void DrawGold()
    {
        DialogBox db = new DialogBox(
            new Vector2(UIScaler.GetHCenter(-16), 24f),
            new Vector2(5, 2),
            new StringKey("val", "GOLD"));

        db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont();
        db.SetFont(game.gameType.GetHeaderFont());
        db.AddBorder();
        db.ApplyTag(Game.SHOP);

        db = new DialogBox(
            new Vector2(UIScaler.GetHCenter(-11), 24f),
            new Vector2(3, 2),
            Mathf.RoundToInt(game.quest.vars.GetValue("$%gold")));
        db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont();
        db.AddBorder();
        db.ApplyTag(Game.SHOP);
    }
コード例 #18
0
    // This is called when a quest is selected
    public void StartQuest(QuestData.Quest q)
    {
        // Fetch all of the quest data and initialise the quest
        quest = new Quest(q);

        // Draw the hero icons, which are buttons for selection
        heroCanvas.SetupUI();

        // Add a finished button to start the quest
        TextButton endSelection = new TextButton(
            new Vector2(UIScaler.GetRight(-8.5f),
                        UIScaler.GetBottom(-2.5f)),
            new Vector2(8, 2),
            CommonStringKeys.FINISHED,
            delegate { EndSelection(); },
            Color.green);

        endSelection.SetFont(gameType.GetHeaderFont());
        // Untag as dialog so this isn't cleared away during hero selection
        endSelection.ApplyTag(Game.HEROSELECT);

        // Add a title to the page
        DialogBox db = new DialogBox(
            new Vector2(8, 1),
            new Vector2(UIScaler.GetWidthUnits() - 16, 3),
            new StringKey("val", "SELECT", gameType.HeroesName())
            );

        db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetLargeFont();
        db.SetFont(gameType.GetHeaderFont());
        db.ApplyTag(Game.HEROSELECT);

        heroCanvas.heroSelection = new HeroSelection();

        TextButton cancelSelection = new TextButton(new Vector2(0.5f, UIScaler.GetBottom(-2.5f)), new Vector2(8, 2), CommonStringKeys.BACK, delegate { Destroyer.QuestSelect(); }, Color.red);

        cancelSelection.SetFont(gameType.GetHeaderFont());
        // Untag as dialog so this isn't cleared away during hero selection
        cancelSelection.ApplyTag(Game.HEROSELECT);
    }
コード例 #19
0
    override public void Update()
    {
        base.Update();
        Game       game = Game.Get();
        TextButton tb   = new TextButton(new Vector2(0, 0), new Vector2(4, 1), "Quest", delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        dbe1 = new DialogBoxEditable(new Vector2(0, 2), new Vector2(20, 1), game.quest.qd.quest.name, delegate { UpdateQuestName(); });
        dbe1.ApplyTag("editor");
        dbe1.AddBorder();

        dbe2 = new DialogBoxEditable(new Vector2(0, 4), new Vector2(20, 6), game.quest.qd.quest.description, delegate { UpdateQuestDesc(); });
        dbe2.ApplyTag("editor");
        dbe2.AddBorder();

        DialogBox db = new DialogBox(new Vector2(0, 11), new Vector2(8, 1), "Minor Peril Level:");

        db.ApplyTag("editor");

        dbeList = new List <DialogBoxEditable>();
        DialogBoxEditable dbeTmp = new DialogBoxEditable(new Vector2(8, 11), new Vector2(3, 1), game.quest.qd.quest.minorPeril.ToString(), delegate { UpdatePeril(0); });

        dbeTmp.ApplyTag("editor");
        dbeTmp.AddBorder();
        dbeList.Add(dbeTmp);

        db = new DialogBox(new Vector2(0, 12), new Vector2(8, 1), "Major Peril Level:");
        db.ApplyTag("editor");

        dbeTmp = new DialogBoxEditable(new Vector2(8, 12), new Vector2(3, 1), game.quest.qd.quest.majorPeril.ToString(), delegate { UpdatePeril(1); });
        dbeTmp.ApplyTag("editor");
        dbeTmp.AddBorder();
        dbeList.Add(dbeTmp);

        db = new DialogBox(new Vector2(0, 13), new Vector2(8, 1), "Deadly Peril Level:");
        db.ApplyTag("editor");

        dbeTmp = new DialogBoxEditable(new Vector2(8, 13), new Vector2(3, 1), game.quest.qd.quest.deadlyPeril.ToString(), delegate { UpdatePeril(2); });
        dbeTmp.ApplyTag("editor");
        dbeTmp.AddBorder();
        dbeList.Add(dbeTmp);

        db = new DialogBox(new Vector2(0, 15), new Vector2(9, 1), "Required Expansions:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(9, 15), new Vector2(1, 1), "+", delegate { QuestAddPack(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int offset = 16;
        int index;

        for (index = 0; index < 8; index++)
        {
            if (game.quest.qd.quest.packs.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(0, offset), new Vector2(9, 1), game.quest.qd.quest.packs[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(9, offset++), new Vector2(1, 1), "-", delegate { QuestRemovePack(i); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }
    }
コード例 #20
0
    virtual public void CreateWindow(bool singleStep = false)
    {
        // If a dialog window is open we force it closed (this shouldn't happen)
        Destroyer.Dialog();

        // ability box - name header
        TextButton tb = new TextButton(
            new Vector2(15, 0.5f),
            new Vector2(UIScaler.GetWidthUnits() - 30, 2),
            monster.monsterData.name,
            delegate { new InfoDialog(monster); });

        tb.ApplyTag("activation");

        DialogBox db     = null;
        float     offset = 2.5f;

        if (monster.currentActivation.effect.Length > 0)
        {
            string effect = monster.currentActivation.effect.Replace("\\n", "\n");
            // ability text
            db = new DialogBox(new Vector2(10, offset), new Vector2(UIScaler.GetWidthUnits() - 20, 4),
                               new StringKey(null, effect, false));
            db.AddBorder();
            db.ApplyTag("activation");
            offset += 4.5f;
        }

        // Activation box
        string activationText = "";

        // Create header
        if (singleStep)
        {
            db = new DialogBox(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), ACTIONS);
        }
        else if (master)
        {
            db = new DialogBox(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), MONSTER_MASTER, Color.red);
        }
        else
        {
            db = new DialogBox(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), MONSTER_MINION);
        }

        if (master)
        {
            activationText = monster.currentActivation.masterActions;
        }
        else
        {
            activationText = monster.currentActivation.minionActions;
        }
        db.AddBorder();
        db.ApplyTag("activation");
        db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont();
        offset += 2;

        // Create activation text box
        db = new DialogBox(new Vector2(10, offset), new Vector2(UIScaler.GetWidthUnits() - 20, 7),
                           new StringKey(null, activationText, false));
        if (master && !singleStep)
        {
            db.AddBorder(Color.red);
        }
        else
        {
            db.AddBorder();
        }
        db.ApplyTag("activation");

        offset += 7.5f;

        // Create finished button
        if (singleStep)
        {
            tb = new TextButton(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), ACTIVATED, delegate { activated(); });
        }
        else if (master)
        {
            tb = new TextButton(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), new StringKey("val", "X_ACTIVATED", MONSTER_MASTER), delegate { activated(); }, Color.red);
        }
        else
        {
            tb = new TextButton(new Vector2(15, offset), new Vector2(UIScaler.GetWidthUnits() - 30, 2), new StringKey("val", "X_ACTIVATED", MONSTER_MINION), delegate { activated(); });
        }
        tb.ApplyTag("activation");
    }
コード例 #21
0
    override public void Update()
    {
        base.Update();
        if (eventComponent.locationSpecified)
        {
            CameraController.SetCamera(eventComponent.location);
        }
        Game game = Game.Get();

        string type = QuestData.Event.type;

        if (eventComponent is QuestData.Door)
        {
            type = QuestData.Door.type;
        }
        if (eventComponent is QuestData.Monster)
        {
            type = QuestData.Monster.type;
        }
        if (eventComponent is QuestData.Token)
        {
            type = QuestData.Token.type;
        }

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), type, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1), name.Substring(type.Length), delegate { QuestEditorData.ListEvent(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        float     offset = 2;
        DialogBox db     = new DialogBox(new Vector2(0, offset), new Vector2(19, 1), "Tests:");

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, offset), new Vector2(1, 1), "+", delegate { AddTestOp(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        offset++;
        foreach (QuestData.Event.VarOperation op in eventComponent.conditions)
        {
            QuestData.Event.VarOperation tmp = op;
            db = new DialogBox(new Vector2(0, offset), new Vector2(9, 1), op.var);
            db.AddBorder();
            db.ApplyTag("editor");
            tb = new TextButton(new Vector2(9, offset), new Vector2(2, 1), op.operation, delegate { SetTestOpp(tmp); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
            tb = new TextButton(new Vector2(11, offset), new Vector2(8, 1), op.value, delegate { SetValue(tmp); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
            tb = new TextButton(new Vector2(19, offset), new Vector2(1, 1), "-", delegate { RemoveOp(tmp); }, Color.red);
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
            offset++;
        }

        offset++;
        db = new DialogBox(new Vector2(0, offset), new Vector2(19, 1), "Assign:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, offset), new Vector2(1, 1), "+", delegate { AddAssignOp(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        offset++;
        foreach (QuestData.Event.VarOperation op in eventComponent.operations)
        {
            QuestData.Event.VarOperation tmp = op;
            db = new DialogBox(new Vector2(0, offset), new Vector2(9, 1), op.var);
            db.AddBorder();
            db.ApplyTag("editor");
            tb = new TextButton(new Vector2(9, offset), new Vector2(2, 1), op.operation, delegate { SetAssignOpp(tmp); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
            tb = new TextButton(new Vector2(11, offset), new Vector2(8, 1), op.value, delegate { SetValue(tmp); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
            tb = new TextButton(new Vector2(19, offset), new Vector2(1, 1), "-", delegate { RemoveOp(tmp); }, Color.red);
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
            offset++;
        }

        if (eventComponent.locationSpecified)
        {
            game.tokenBoard.AddHighlight(eventComponent.location, "EventLoc", "editor");
        }
    }
コード例 #22
0
    override public void Update()
    {
        base.Update();
        //Game game = Game.Get();

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(5, 1), CommonStringKeys.STARTING_ITEM, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, 0), new Vector2(14, 1),
                            new StringKey(null, name.Substring("StartingItem".Length), false), delegate { QuestEditorData.ListStartingItem(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(19, 1), new StringKey("val", "X_COLON", CommonStringKeys.ITEM));

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 2), new Vector2(1, 1), CommonStringKeys.PLUS, delegate { AddItem(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        float offset = 3;

        for (int i = 0; i < itemComponent.itemName.Length; i++)
        {
            int tmp = i;
            db = new DialogBox(new Vector2(0, offset), new Vector2(19, 1),
                               new StringKey(null, itemComponent.itemName[i], false));
            db.ApplyTag("editor");

            if (itemComponent.traits.Length > 0 || itemComponent.itemName.Length > 1)
            {
                tb = new TextButton(new Vector2(19, offset), new Vector2(1, 1), CommonStringKeys.MINUS, delegate { RemoveItem(tmp); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
            offset++;
        }

        offset++;

        db = new DialogBox(new Vector2(0, offset), new Vector2(16, 1), new StringKey("val", "X_COLON", CommonStringKeys.TRAITS));
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(17, offset++), new Vector2(1, 1), CommonStringKeys.PLUS, delegate { AddTrait(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        for (int i = 0; i < itemComponent.traits.Length; i++)
        {
            int tmp = i;
            db = new DialogBox(new Vector2(0, offset), new Vector2(16, 1),
                               new StringKey("val", itemComponent.traits[i]));
            db.ApplyTag("editor");

            if (itemComponent.traits.Length > 1 || itemComponent.itemName.Length > 0)
            {
                tb = new TextButton(new Vector2(17, offset), new Vector2(1, 1), CommonStringKeys.MINUS, delegate { RemoveTrait(tmp); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
            offset++;
        }
    }
コード例 #23
0
    override public void Update()
    {
        base.Update();
        if (eventComponent.locationSpecified)
        {
            CameraController.SetCamera(eventComponent.location);
        }
        Game game = Game.Get();

        string type = QuestData.Event.type;

        if (eventComponent is QuestData.Door)
        {
            type = QuestData.Door.type;
        }
        if (eventComponent is QuestData.Monster)
        {
            type = QuestData.Monster.type;
        }
        if (eventComponent is QuestData.Token)
        {
            type = QuestData.Token.type;
        }

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), type, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1), name.Substring(type.Length), delegate { QuestEditorData.ListEvent(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(4, 1), "Position");

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 2), new Vector2(1, 1), "><", delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, 2), new Vector2(1, 1), "~", delegate { GetPosition(false); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        if (!eventComponent.GetType().IsSubclassOf(typeof(QuestData.Event)))
        {
            if (eventComponent.minCam)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), "Min Cam", delegate { PositionTypeCycle(); });
            }
            else if (eventComponent.maxCam)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), "Max Cam", delegate { PositionTypeCycle(); });
            }
            else if (!eventComponent.locationSpecified)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), "Unused", delegate { PositionTypeCycle(); });
            }
            else if (eventComponent.highlight)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), "Highlight", delegate { PositionTypeCycle(); });
            }
            else
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), "Camera", delegate { PositionTypeCycle(); });
            }
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }

        tb = new TextButton(new Vector2(12, 2), new Vector2(3, 1), "Vars", delegate { QuestEditorData.SelectAsEventVars(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(16, 2), new Vector2(4, 1), "Next Events", delegate { QuestEditorData.SelectAsEventNextEvent(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 3), new Vector2(20, 1), "Dialog:");
        db.ApplyTag("editor");

        eventTextDBE = new DialogBoxEditable(new Vector2(0, 4), new Vector2(20, 8), eventComponent.originalText, delegate { UpdateText(); });
        eventTextDBE.ApplyTag("editor");
        eventTextDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 12), new Vector2(4, 1), "Trigger:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 12), new Vector2(10, 1), eventComponent.trigger, delegate { SetTrigger(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 14), new Vector2(4, 1), "Selection:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 14), new Vector2(8, 1), eventComponent.heroListName, delegate { SetHighlight(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(12, 14), new Vector2(2, 1), "Min");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(14, 14), new Vector2(2, 1), eventComponent.minHeroes.ToString(), delegate { SetHeroCount(false); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(16, 14), new Vector2(2, 1), "Max");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(18, 14), new Vector2(2, 1), eventComponent.maxHeroes.ToString(), delegate { SetHeroCount(true); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 16), new Vector2(9, 1), "Add Components:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(9, 16), new Vector2(1, 1), "+", delegate { AddVisibility(true); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int offset = 17;
        int index;

        for (index = 0; index < 12; index++)
        {
            if (eventComponent.addComponents.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(0, offset), new Vector2(9, 1), eventComponent.addComponents[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(9, offset++), new Vector2(1, 1), "-", delegate { RemoveVisibility(i, true); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        db = new DialogBox(new Vector2(10, 16), new Vector2(9, 1), "Remove Components:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 16), new Vector2(1, 1), "+", delegate { AddVisibility(false); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        offset = 17;
        for (index = 0; index < 12; index++)
        {
            if (eventComponent.removeComponents.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(10, offset), new Vector2(9, 1), eventComponent.removeComponents[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), "-", delegate { RemoveVisibility(i, false); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        if (eventComponent.locationSpecified || eventComponent.maxCam || eventComponent.minCam)
        {
            game.tokenBoard.AddHighlight(eventComponent.location, "EventLoc", "editor");
        }
    }
コード例 #24
0
    override public void Update()
    {
        base.Update();
        Game game = Game.Get();

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(3, 1), PUZZLE, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(
            new Vector2(3, 0), new Vector2(16, 1),
            new StringKey(name.Substring("Puzzle".Length), false),
            delegate { QuestEditorData.ListPuzzle(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(3, 1),
                                     new StringKey("val", "X_COLON", PUZZLE_CLASS));

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, 2), new Vector2(8, 1),
                            new StringKey(puzzleComponent.puzzleClass, false), delegate { Class(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 4), new Vector2(4, 1),
                           new StringKey("val", "X_COLON", CommonStringKeys.SKILL));
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, 4), new Vector2(6, 1),
                            new StringKey(puzzleComponent.skill, false), delegate { Skill(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 6), new Vector2(4, 1),
                           new StringKey("val", "X_COLON", PUZZLE_LEVEL));
        db.ApplyTag("editor");

        levelDBE = new DialogBoxEditable(new Vector2(5, 6), new Vector2(2, 1),
                                         puzzleComponent.puzzleLevel.ToString(), delegate { UpdateLevel(); });
        levelDBE.ApplyTag("editor");
        levelDBE.AddBorder();

        if (!puzzleComponent.puzzleClass.Equals("slide"))
        {
            db = new DialogBox(new Vector2(0, 8), new Vector2(5, 1),
                               new StringKey("val", "X_COLON", PUZZLE_ALT_LEVEL));
            db.ApplyTag("editor");

            altLevelDBE = new DialogBoxEditable(new Vector2(5, 8), new Vector2(2, 1),
                                                puzzleComponent.puzzleAltLevel.ToString(), delegate { UpdateAltLevel(); });
            altLevelDBE.ApplyTag("editor");
            altLevelDBE.AddBorder();

            if (puzzleComponent.puzzleClass.Equals("image"))
            {
                db = new DialogBox(new Vector2(0, 10), new Vector2(3, 1),
                                   new StringKey("val", "X_COLON", IMAGE));
                db.ApplyTag("editor");

                tb = new TextButton(new Vector2(5, 10), new Vector2(8, 1),
                                    new StringKey(puzzleComponent.imageType, false), delegate { Image(); });
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        tb = new TextButton(new Vector2(0, 12), new Vector2(8, 1), CommonStringKeys.EVENT, delegate { QuestEditorData.SelectAsEvent(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");
    }
コード例 #25
0
    override public void Update()
    {
        base.Update();
        Game game = Game.Get();

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(3, 1), "Item", delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(3, 0), new Vector2(16, 1), name.Substring("Item".Length), delegate { QuestEditorData.ListItem(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(19, 1), "Item:");

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 2), new Vector2(1, 1), "+", delegate { AddItem(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        float offset = 3;

        for (int i = 0; i < itemComponent.itemName.Length; i++)
        {
            int tmp = i;
            db = new DialogBox(new Vector2(0, offset), new Vector2(19, 1), itemComponent.itemName[i]);
            db.ApplyTag("editor");

            if (itemComponent.traits.Length > 0 || itemComponent.itemName.Length > 1)
            {
                tb = new TextButton(new Vector2(19, offset), new Vector2(1, 1), "-", delegate { RemoveItem(tmp); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
            offset++;
        }

        offset++;

        db = new DialogBox(new Vector2(0, offset), new Vector2(16, 1), "Traits:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(17, offset++), new Vector2(1, 1), "+", delegate { AddTrait(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        for (int i = 0; i < itemComponent.traits.Length; i++)
        {
            int tmp = i;
            db = new DialogBox(new Vector2(0, offset), new Vector2(16, 1), itemComponent.traits[i]);
            db.ApplyTag("editor");

            if (itemComponent.traits.Length > 1 || itemComponent.itemName.Length > 0)
            {
                tb = new TextButton(new Vector2(17, offset), new Vector2(1, 1), "-", delegate { RemoveTrait(tmp); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
            offset++;
        }
    }
コード例 #26
0
    override public void Update()
    {
        base.Update();
        if (eventComponent.locationSpecified)
        {
            CameraController.SetCamera(eventComponent.location);
        }
        Game game = Game.Get();

        string type = QuestData.Event.type;

        if (eventComponent is QuestData.Door)
        {
            type = QuestData.Door.type;
        }
        if (eventComponent is QuestData.Monster)
        {
            type = QuestData.Monster.type;
        }
        if (eventComponent is QuestData.Token)
        {
            type = QuestData.Token.type;
        }

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1), type, delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1), name.Substring(type.Length), delegate { QuestEditorData.ListEvent(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        string randomButton = "Ordered";

        if (eventComponent.randomEvents)
        {
            randomButton = "Random";
        }
        tb = new TextButton(new Vector2(0, 1), new Vector2(3, 1), randomButton, delegate { ToggleRandom(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(3, 1), new Vector2(10, 1), "Trigger Events:");

        db.ApplyTag("editor");

        string confirmLabel = eventComponent.confirmText;

        if (confirmLabel.Equals(""))
        {
            confirmLabel = "Confirm";
            if (eventComponent.failEvent.Length != 0)
            {
                confirmLabel = "Pass";
            }
        }
        confirmDBE = new DialogBoxEditable(new Vector2(11, 1), new Vector2(6, 1), confirmLabel, delegate { UpdateConfirmLabel(); });
        confirmDBE.ApplyTag("editor");
        confirmDBE.AddBorder();

        tb = new TextButton(new Vector2(19, 1), new Vector2(1, 1), "+", delegate { AddEvent(0); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int offset = 2;
        int index;

        for (index = 0; index < 8; index++)
        {
            if (eventComponent.nextEvent.Length > index)
            {
                int i = index;
                tb = new TextButton(new Vector2(0, offset), new Vector2(1, 1), "-", delegate { RemoveEvent(i); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
                db = new DialogBox(new Vector2(1, offset), new Vector2(18, 1), eventComponent.nextEvent[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), "+", delegate { AddEvent(i + 1); }, Color.green);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        offset++;
        db = new DialogBox(new Vector2(1, offset), new Vector2(10, 1), "Fail Events:");
        db.ApplyTag("editor");

        string failLabel = eventComponent.failText;

        if (failLabel.Equals(""))
        {
            failLabel = "Fail";
        }
        failDBE = new DialogBoxEditable(new Vector2(11, offset), new Vector2(6, 1), failLabel, delegate { UpdateFailLabel(); });
        failDBE.ApplyTag("editor");
        failDBE.AddBorder();

        tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), "+", delegate { AddEvent(0, true); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        for (index = 0; index < 12; index++)
        {
            if (eventComponent.failEvent.Length > index)
            {
                int i = index;
                tb = new TextButton(new Vector2(0, offset), new Vector2(1, 1), "-", delegate { RemoveEvent(i, true); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
                db = new DialogBox(new Vector2(1, offset), new Vector2(18, 1), eventComponent.failEvent[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), "+", delegate { AddEvent(i + 1, true); }, Color.green);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        offset++;
        db = new DialogBox(new Vector2(1, offset), new Vector2(10, 1), "Delayed Events:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), "+", delegate { AddDelayedEvent(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        index            = 0;
        delayedEventsDBE = new List <DialogBoxEditable>();
        foreach (QuestData.Event.DelayedEvent de in eventComponent.delayedEvents)
        {
            int i = index++;

            DialogBoxEditable dbeDelay = new DialogBoxEditable(new Vector2(0, offset), new Vector2(2, 1), de.delay.ToString(), delegate { SetDelayedEvent(i); });
            dbeDelay.ApplyTag("editor");
            dbeDelay.AddBorder();
            delayedEventsDBE.Add(dbeDelay);

            db = new DialogBox(new Vector2(2, offset), new Vector2(17, 1), de.eventName);
            db.AddBorder();
            db.ApplyTag("editor");
            tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), "-", delegate { RemoveDelayedEvent(i); }, Color.red);
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }

        offset++;
        db = new DialogBox(new Vector2(0, offset), new Vector2(5, 1), "Flags:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, offset), new Vector2(1, 1), "+", delegate { AddFlag("flag"); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(7, offset), new Vector2(5, 1), "Set:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(12, offset), new Vector2(1, 1), "+", delegate { AddFlag("set"); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(14, offset), new Vector2(5, 1), "Clear:");
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1), "+", delegate { AddFlag("clear"); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        for (index = 0; index < 8; index++)
        {
            if (eventComponent.flags.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(0, offset + index), new Vector2(5, 1), eventComponent.flags[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(5, offset + index), new Vector2(1, 1), "-", delegate { FlagRemove(i); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        for (index = 0; index < 8; index++)
        {
            if (eventComponent.setFlags.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(7, offset + index), new Vector2(5, 1), eventComponent.setFlags[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(12, offset + index), new Vector2(1, 1), "-", delegate { FlagSetRemove(i); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        for (index = 0; index < 8; index++)
        {
            if (eventComponent.clearFlags.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(14, offset + index), new Vector2(5, 1), eventComponent.clearFlags[index]);
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(19, offset + index), new Vector2(1, 1), "-", delegate { FlagClearRemove(i); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        if (eventComponent.locationSpecified)
        {
            game.tokenBoard.AddHighlight(eventComponent.location, "EventLoc", "editor");
        }
    }
コード例 #27
0
    public void Update()
    {
        // Clean up everything marked as 'uiphase'
        foreach (GameObject go in GameObject.FindGameObjectsWithTag(Game.UIPHASE))
        {
            Object.Destroy(go);
        }

        Color     bgColor = new Color(0.05f, 0, 0, 0.9f);
        StringKey phase;

        if (Game.Get().quest.phase == Quest.MoMPhase.horror)
        {
            phase = HORROR_STEP;
        }
        else if (Game.Get().quest.phase == Quest.MoMPhase.mythos)
        {
            phase = PHASE_MYTHOS;
        }
        else if (Game.Get().quest.phase == Quest.MoMPhase.monsters)
        {
            phase = MONSTER_STEP;
        }
        else
        {
            phase   = PHASE_INVESTIGATOR;
            bgColor = new Color(0, 0.05f, 0, 0.9f);
        }

        TextButton tb = new TextButton(
            new Vector2(UIScaler.GetHCenter(12f), UIScaler.GetBottom(-2.5f)), new Vector2(4, 2),
            CommonStringKeys.TAB, delegate { Next(); });

        // Untag as dialog so this isn't cleared away
        tb.ApplyTag(Game.UIPHASE);
        tb.background.GetComponent <UnityEngine.UI.Image>().color = bgColor;
        tb.SetFont(Game.Get().gameType.GetHeaderFont());

        tb = new TextButton(
            new Vector2(UIScaler.GetHCenter(-16f), UIScaler.GetBottom(-2.5f)), new Vector2(4, 2),
            new StringKey("val", "ITEMS"), delegate { Items(); });
        // Untag as dialog so this isn't cleared away
        tb.ApplyTag(Game.UIPHASE);
        tb.background.GetComponent <UnityEngine.UI.Image>().color = bgColor;
        tb.SetFont(Game.Get().gameType.GetHeaderFont());

        tb = new TextButton(
            new Vector2(UIScaler.GetHCenter(-12f), UIScaler.GetBottom(-2.5f)), new Vector2(4, 2),
            CommonStringKeys.LOG, delegate { Log(); });
        // Untag as dialog so this isn't cleared away
        tb.ApplyTag(Game.UIPHASE);
        tb.background.GetComponent <UnityEngine.UI.Image>().color = bgColor;
        tb.SetFont(Game.Get().gameType.GetHeaderFont());

        tb = new TextButton(
            new Vector2(UIScaler.GetHCenter(-8f), UIScaler.GetBottom(-2.5f)), new Vector2(4, 2),
            CommonStringKeys.SET, delegate { Set(); });
        // Untag as dialog so this isn't cleared away
        tb.ApplyTag(Game.UIPHASE);
        tb.background.GetComponent <UnityEngine.UI.Image>().color = bgColor;
        tb.SetFont(Game.Get().gameType.GetHeaderFont());

        DialogBox db;

        db = new DialogBox(new Vector2(UIScaler.GetHCenter(-4f), UIScaler.GetBottom(-2.5f)), new Vector2(16, 2), phase, Color.white, bgColor);
        db.SetFont(Game.Get().gameType.GetHeaderFont());
        db.ApplyTag(Game.UIPHASE);
        db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont();
        db.AddBorder();
    }
コード例 #28
0
    override public void Update()
    {
        base.Update();
        if (eventComponent.locationSpecified)
        {
            CameraController.SetCamera(eventComponent.location);
        }
        Game game = Game.Get();

        string type = QuestData.Event.type;

        if (eventComponent is QuestData.Door)
        {
            type = QuestData.Door.type;
        }
        if (eventComponent is QuestData.Spawn)
        {
            type = QuestData.Spawn.type;
        }
        if (eventComponent is QuestData.Token)
        {
            type = QuestData.Token.type;
        }

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1),
                                       new StringKey(null, type, false),
                                       delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1),
                            new StringKey(null, name.Substring(type.Length), false),
                            delegate { QuestEditorData.ListEvent(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1),
                            CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        string randomButton = "Ordered";

        if (eventComponent.randomEvents)
        {
            randomButton = "Random";
        }
        tb = new TextButton(new Vector2(0, 1), new Vector2(3, 1), new StringKey("val", randomButton), delegate { ToggleRandom(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(3, 1), new Vector2(3, 1), new StringKey("val", "X_COLON", QUOTA));

        db.ApplyTag("editor");

        // Quota dont need translation
        quotaDBE = new DialogBoxEditable(
            new Vector2(6, 1), new Vector2(2, 1),
            eventComponent.quota.ToString(), delegate { SetQuota(); });
        quotaDBE.ApplyTag("editor");
        quotaDBE.AddBorder();

        db = new DialogBox(new Vector2(8, 1), new Vector2(11, 1), new StringKey("val", "X_COLON", BUTTONS));
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 1), new Vector2(1, 1),
                            CommonStringKeys.PLUS, delegate { AddButton(); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int offset           = 2;
        int button           = 1;
        int index            = 0;
        int lastButtonOffset = 0;

        buttonDBE = new List <DialogBoxEditable>();
        foreach (List <string> l in eventComponent.nextEvent)
        {
            lastButtonOffset = offset;
            int buttonTmp = button++;

            StringKey buttonLabel = eventComponent.buttons[buttonTmp - 1];
            string    colorRGB    = ColorUtil.FromName(eventComponent.buttonColors[buttonTmp - 1]);
            Color     c           = Color.white;
            c[0] = (float)System.Convert.ToInt32(colorRGB.Substring(1, 2), 16) / 255f;
            c[1] = (float)System.Convert.ToInt32(colorRGB.Substring(3, 2), 16) / 255f;
            c[2] = (float)System.Convert.ToInt32(colorRGB.Substring(5, 2), 16) / 255f;

            tb = new TextButton(new Vector2(0, offset), new Vector2(3, 1),
                                new StringKey("val", "COLOR"), delegate { SetButtonColor(buttonTmp); }, c);
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");

            DialogBoxEditable buttonEdit = new DialogBoxEditable(
                new Vector2(3, offset++), new Vector2(16, 1),
                buttonLabel.Translate(),
                delegate { UpdateButtonLabel(buttonTmp); });

            buttonEdit.ApplyTag("editor");
            buttonEdit.AddBorder();
            buttonDBE.Add(buttonEdit);

            index = 0;
            foreach (string s in l)
            {
                int i = index++;
                tb = new TextButton(new Vector2(0, offset), new Vector2(1, 1),
                                    CommonStringKeys.PLUS, delegate { AddEvent(i, buttonTmp); }, Color.green);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
                db = new DialogBox(new Vector2(1, offset), new Vector2(18, 1),
                                   new StringKey(null, s, false));
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1),
                                    CommonStringKeys.MINUS, delegate { RemoveEvent(i, buttonTmp); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
            int tmp = index;
            tb = new TextButton(new Vector2(0, offset), new Vector2(1, 1),
                                CommonStringKeys.PLUS, delegate { AddEvent(tmp, buttonTmp); }, Color.green);
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
            offset++;
        }

        if (lastButtonOffset != 0)
        {
            tb = new TextButton(new Vector2(19, lastButtonOffset), new Vector2(1, 1),
                                CommonStringKeys.MINUS, delegate { RemoveButton(); }, Color.red);
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }


        if (eventComponent.locationSpecified)
        {
            game.tokenBoard.AddHighlight(eventComponent.location, "EventLoc", "editor");
        }
    }
コード例 #29
0
    override public void Update()
    {
        base.Update();
        Game game = Game.Get();

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(6, 1), "UniqueMonster", delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(6, 0), new Vector2(13, 1), name.Substring("UniqueMonster".Length), delegate { QuestEditorData.ListUniqueMonster(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), "E", delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");


        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(3, 1), "Base:");

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(3, 2), new Vector2(18, 1), monsterComponent.baseMonster, delegate { SetBase(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 4), new Vector2(3, 1), "Name:");
        db.ApplyTag("editor");
        if (monsterComponent.baseMonster.Length == 0 || monsterComponent.monsterName.Length > 0)
        {
            nameDBE = new DialogBoxEditable(new Vector2(3, 4), new Vector2(14, 1), monsterComponent.monsterName, delegate { UpdateName(); });
            nameDBE.ApplyTag("editor");
            nameDBE.AddBorder();
            if (monsterComponent.baseMonster.Length > 0)
            {
                tb = new TextButton(new Vector2(17, 4), new Vector2(3, 1), "Reset", delegate { ClearName(); });
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }
        else
        {
            tb = new TextButton(new Vector2(17, 4), new Vector2(3, 1), "Set", delegate { SetName(); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }

        //string imagePath
        //string imagePlace

        db = new DialogBox(new Vector2(0, 6), new Vector2(17, 1), "Info:");
        db.ApplyTag("editor");
        if (monsterComponent.baseMonster.Length == 0 || monsterComponent.info.key.Length > 0)
        {
            infoDBE = new DialogBoxEditable(new Vector2(0, 7), new Vector2(20, 8), monsterComponent.info.Translate(), delegate { UpdateInfo(); });
            infoDBE.ApplyTag("editor");
            infoDBE.AddBorder();
            if (monsterComponent.baseMonster.Length > 0)
            {
                tb = new TextButton(new Vector2(17, 6), new Vector2(3, 1), "Reset", delegate { ClearInfo(); });
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }
        else
        {
            tb = new TextButton(new Vector2(17, 6), new Vector2(3, 1), "Set", delegate { SetInfo(); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }

        //string[] activations
        //string[] traits

        db = new DialogBox(new Vector2(0, 15), new Vector2(3, 1), "Health:");
        db.ApplyTag("editor");
        if (monsterComponent.baseMonster.Length == 0 || monsterComponent.healthDefined)
        {
            healthDBE = new DialogBoxEditable(new Vector2(3, 15), new Vector2(14, 1), monsterComponent.health.ToString(), delegate { UpdateHealth(); });
            healthDBE.ApplyTag("editor");
            healthDBE.AddBorder();
            if (monsterComponent.baseMonster.Length > 0)
            {
                tb = new TextButton(new Vector2(17, 15), new Vector2(3, 1), "Reset", delegate { ClearHealth(); });
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }
        else
        {
            tb = new TextButton(new Vector2(17, 15), new Vector2(3, 1), "Set", delegate { SetHealth(); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }
    }
コード例 #30
0
    override public void Update()
    {
        base.Update();
        if (eventComponent.locationSpecified)
        {
            CameraController.SetCamera(eventComponent.location);
        }
        Game game = Game.Get();

        string type = QuestData.Event.type;

        if (eventComponent is QuestData.Door)
        {
            type = QuestData.Door.type;
        }
        if (eventComponent is QuestData.Spawn)
        {
            type = QuestData.Spawn.type;
        }
        if (eventComponent is QuestData.Token)
        {
            type = QuestData.Token.type;
        }
        if (eventComponent is QuestData.Puzzle)
        {
            type = QuestData.Puzzle.type;
        }

        TextButton tb = new TextButton(new Vector2(0, 0), new Vector2(4, 1),
                                       new StringKey(type, false), delegate { QuestEditorData.TypeSelect(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleRight;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 0), new Vector2(15, 1),
                            new StringKey(name.Substring(type.Length), false),
                            delegate { QuestEditorData.ListEvent(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize  = UIScaler.GetSmallFont();
        tb.button.GetComponent <UnityEngine.UI.Text>().alignment = TextAnchor.MiddleLeft;
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 0), new Vector2(1, 1), CommonStringKeys.E, delegate { Rename(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        DialogBox db = new DialogBox(new Vector2(0, 2), new Vector2(4, 1), CommonStringKeys.POSITION);

        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 2), new Vector2(1, 1),
                            CommonStringKeys.POSITION_SNAP, delegate { GetPosition(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(5, 2), new Vector2(1, 1),
                            CommonStringKeys.POSITION_FREE, delegate { GetPosition(false); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        if (!eventComponent.GetType().IsSubclassOf(typeof(QuestData.Event)))
        {
            if (eventComponent.minCam)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), MIN_CAM, delegate { PositionTypeCycle(); });
            }
            else if (eventComponent.maxCam)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), MAX_CAM, delegate { PositionTypeCycle(); });
            }
            else if (!eventComponent.locationSpecified)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), UNUSED, delegate { PositionTypeCycle(); });
            }
            else if (eventComponent.highlight)
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), HIGHLIGHT, delegate { PositionTypeCycle(); });
            }
            else
            {
                tb = new TextButton(new Vector2(7, 2), new Vector2(4, 1), CAMERA, delegate { PositionTypeCycle(); });
            }
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }

        tb = new TextButton(new Vector2(12, 2), new Vector2(3, 1), VARS, delegate { QuestEditorData.SelectAsEventVars(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        tb = new TextButton(new Vector2(16, 2), new Vector2(4, 1), NEXT_EVENTS, delegate { QuestEditorData.SelectAsEventNextEvent(name); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 3), new Vector2(20, 1), new StringKey("val", "X_COLON", DIALOG));
        db.ApplyTag("editor");

        eventTextDBE = new DialogBoxEditable(new Vector2(0, 4), new Vector2(20, 8), eventComponent.originalText, delegate { UpdateText(); });
        eventTextDBE.ApplyTag("editor");
        eventTextDBE.AddBorder();

        db = new DialogBox(new Vector2(0, 12), new Vector2(4, 1), new StringKey("val", "X_COLON", CommonStringKeys.TRIGGER));
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 12), new Vector2(10, 1),
                            new StringKey(eventComponent.trigger, false), delegate { SetTrigger(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        db = new DialogBox(new Vector2(0, 13), new Vector2(4, 1), new StringKey("val", "X_COLON", AUDIO));
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(4, 13), new Vector2(10, 1), new StringKey(eventComponent.audio, false), delegate { SetAudio(); });
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        if (game.gameType is D2EGameType)
        {
            db = new DialogBox(new Vector2(0, 14), new Vector2(4, 1), new StringKey("val", "X_COLON", SELECTION));
            db.ApplyTag("editor");

            tb = new TextButton(new Vector2(4, 14), new Vector2(8, 1), new StringKey(eventComponent.heroListName, false), delegate { SetHighlight(); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");

            db = new DialogBox(new Vector2(12, 14), new Vector2(2, 1), MIN);
            db.ApplyTag("editor");

            tb = new TextButton(new Vector2(14, 14), new Vector2(2, 1), new StringKey(eventComponent.minHeroes.ToString(), false), delegate { SetHeroCount(false); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");

            db = new DialogBox(new Vector2(16, 14), new Vector2(2, 1), MAX);
            db.ApplyTag("editor");

            tb = new TextButton(new Vector2(18, 14), new Vector2(2, 1), new StringKey(eventComponent.maxHeroes.ToString(), false), delegate { SetHeroCount(true); });
            tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
            tb.ApplyTag("editor");
        }

        db = new DialogBox(new Vector2(0, 16), new Vector2(9, 1), ADD_COMPONENTS);
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(9, 16), new Vector2(1, 1), CommonStringKeys.PLUS,
                            delegate { AddVisibility(true); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        int offset = 17;
        int index;

        for (index = 0; index < 12; index++)
        {
            if (eventComponent.addComponents.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(0, offset), new Vector2(9, 1),
                                   new StringKey(eventComponent.addComponents[index], false)
                                   );
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(9, offset++), new Vector2(1, 1), CommonStringKeys.MINUS,
                                    delegate { RemoveVisibility(i, true); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        db = new DialogBox(new Vector2(10, 16), new Vector2(9, 1), REMOVE_COMPONENTS);
        db.ApplyTag("editor");

        tb = new TextButton(new Vector2(19, 16), new Vector2(1, 1),
                            CommonStringKeys.PLUS,
                            delegate { AddVisibility(false); }, Color.green);
        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");

        offset = 17;
        for (index = 0; index < 12; index++)
        {
            if (eventComponent.removeComponents.Length > index)
            {
                int i = index;
                db = new DialogBox(new Vector2(10, offset), new Vector2(9, 1),
                                   new StringKey(eventComponent.removeComponents[index], false)
                                   );
                db.AddBorder();
                db.ApplyTag("editor");
                tb = new TextButton(new Vector2(19, offset++), new Vector2(1, 1),
                                    CommonStringKeys.MINUS,
                                    delegate { RemoveVisibility(i, false); }, Color.red);
                tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
                tb.ApplyTag("editor");
            }
        }

        if (eventComponent.locationSpecified || eventComponent.maxCam || eventComponent.minCam)
        {
            game.tokenBoard.AddHighlight(eventComponent.location, "EventLoc", "editor");
        }
    }