示例#1
0
    override public float AddSubComponents(float offset)
    {
        Game game = Game.Get();

        nameUIE = new UIElementEditable(Game.EDITOR, scrollArea.GetScrollTransform());
        nameUIE.SetLocation(0.5f, offset, 19, 1);
        nameUIE.SetText(game.quest.qd.quest.name.Translate());
        nameUIE.SetButton(delegate { UpdateQuestName(); });
        nameUIE.SetSingleLine();
        new UIElementBorder(nameUIE);
        offset += 2;

        UIElement ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());

        ui.SetLocation(0, offset, 5, 1);
        ui.SetText(new StringKey("val", "X_COLON", HIDDEN));

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(5, offset, 3, 1);
        ui.SetButton(delegate { ToggleHidden(); });
        new UIElementBorder(ui);
        if (game.quest.qd.quest.hidden)
        {
            ui.SetText(CommonStringKeys.TRUE);
        }
        else
        {
            ui.SetText(CommonStringKeys.FALSE);
        }
        offset += 2;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0, offset, 5, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "IMAGE")));

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(5, offset, 3, 1);
        ui.SetButton(delegate { Image(); });
        ui.SetText(game.quest.qd.quest.image);
        new UIElementBorder(ui);
        offset += 2;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0.4f, offset, 8, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "DEFAULTMUSICON")));
        ui.SetTextAlignment(TextAnchor.MiddleLeft);

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(8, offset, 3, 1);
        ui.SetButton(delegate { ToggleDefaultMusicOff(); });
        new UIElementBorder(ui);
        if (game.quest.qd.quest.defaultMusicOn)
        {
            ui.SetText(CommonStringKeys.TRUE);
        }
        else
        {
            ui.SetText(CommonStringKeys.FALSE);
        }
        offset += 2;


        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0.5f, offset++, 8, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "DESCRIPTION")));
        ui.SetTextAlignment(TextAnchor.MiddleLeft);

        descriptionUIE = new UIElementEditablePaneled(Game.EDITOR, scrollArea.GetScrollTransform());
        descriptionUIE.SetLocation(0.5f, offset, 19, 30);
        descriptionUIE.SetText(game.quest.qd.quest.description.Translate(true));
        offset += descriptionUIE.HeightToTextPadding(1);
        descriptionUIE.SetButton(delegate { UpdateQuestDesc(); });
        new UIElementBorder(descriptionUIE);
        offset += 1;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0.5f, offset++, 30, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "SYNOPSYS")));
        ui.SetTextAlignment(TextAnchor.MiddleLeft);

        synopsysUIE = new UIElementEditablePaneled(Game.EDITOR, scrollArea.GetScrollTransform());
        synopsysUIE.SetLocation(0.5f, offset, 19, 4);
        synopsysUIE.SetText(game.quest.qd.quest.synopsys.Translate(true));
        offset += synopsysUIE.HeightToTextPadding(1);
        synopsysUIE.SetButton(delegate { UpdateQuestSynopsys(); });
        synopsysUIE.SetMaxCharacters(100);
        new UIElementBorder(synopsysUIE);
        offset += 1;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0.5f, offset++, 8, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "AUTHORS")));
        ui.SetTextAlignment(TextAnchor.MiddleLeft);

        authorsUIE = new UIElementEditablePaneled(Game.EDITOR, scrollArea.GetScrollTransform());
        authorsUIE.SetLocation(0.5f, offset, 19, 16);
        authorsUIE.SetText(game.quest.qd.quest.authors.Translate(true));
        offset += authorsUIE.HeightToTextPadding(1);
        authorsUIE.SetButton(delegate { UpdateQuestAuth(); });
        new UIElementBorder(authorsUIE);
        offset += 1;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0.5f, offset++, 35, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "AUTHORS_SHORT")));
        ui.SetTextAlignment(TextAnchor.MiddleLeft);

        authors_shortUIE = new UIElementEditable(Game.EDITOR, scrollArea.GetScrollTransform());
        authors_shortUIE.SetLocation(0.5f, offset, 19, 1f);
        authors_shortUIE.SetText(game.quest.qd.quest.authors_short.Translate(true));
        offset += authors_shortUIE.HeightToTextPadding(0);
        authors_shortUIE.SetButton(delegate { UpdateQuestShortAuth(); });
        authors_shortUIE.SetSingleLine();
        authors_shortUIE.SetMaxCharacters(75);
        new UIElementBorder(authors_shortUIE);
        offset += 1;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0.5f, offset, 10, 1);
        ui.SetText(REQUIRED_EXPANSIONS);

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(10.5f, offset, 1, 1);
        ui.SetButton(delegate { QuestAddPack(); });
        ui.SetText(CommonStringKeys.PLUS, Color.green);
        new UIElementBorder(ui, Color.green);

        offset += 1;
        int index;

        for (index = 0; index < game.quest.qd.quest.packs.Length; index++)
        {
            int i = index;
            ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
            ui.SetLocation(0.5f, offset, 10, 1);
            ui.SetText(new StringKey("val", game.quest.qd.quest.packs[index]));
            new UIElementBorder(ui);

            ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
            ui.SetLocation(10.5f, offset, 1, 1);
            ui.SetButton(delegate { QuestRemovePack(i); });
            ui.SetText(CommonStringKeys.MINUS, Color.red);
            new UIElementBorder(ui, Color.red);
            offset += 1;
        }
        offset += 1;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0, offset, 7.5f, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "MIN_X", game.gameType.HeroesName())));

        minHeroUIE = new UIElementEditable(Game.EDITOR, scrollArea.GetScrollTransform());
        minHeroUIE.SetLocation(7.5f, offset, 2, 1);
        minHeroUIE.SetText(game.quest.qd.quest.minHero.ToString());
        minHeroUIE.SetSingleLine();
        minHeroUIE.SetButton(delegate { UpdateMinHero(); });
        new UIElementBorder(minHeroUIE);

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(9.5f, offset, 7.5f, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "MAX_X", game.gameType.HeroesName())));

        maxHeroUIE = new UIElementEditable(Game.EDITOR, scrollArea.GetScrollTransform());
        maxHeroUIE.SetLocation(17, offset, 2, 1);
        maxHeroUIE.SetText(game.quest.qd.quest.maxHero.ToString());
        maxHeroUIE.SetSingleLine();
        maxHeroUIE.SetButton(delegate { UpdateMaxHero(); });
        new UIElementBorder(maxHeroUIE);
        offset += 2;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0, offset, 7.5f, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "MIN_X", new StringKey("val", "DURATION"))));

        minLengthUIE = new UIElementEditable(Game.EDITOR, scrollArea.GetScrollTransform());
        minLengthUIE.SetLocation(7.5f, offset, 2, 1);
        minLengthUIE.SetText(game.quest.qd.quest.lengthMin.ToString());
        minLengthUIE.SetSingleLine();
        minLengthUIE.SetButton(delegate { UpdateMinLength(); });
        new UIElementBorder(minLengthUIE);

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(9.5f, offset, 7.5f, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "MAX_X", new StringKey("val", "DURATION"))));

        maxLengthUIE = new UIElementEditable(Game.EDITOR, scrollArea.GetScrollTransform());
        maxLengthUIE.SetLocation(17, offset, 2, 1);
        maxLengthUIE.SetText(game.quest.qd.quest.lengthMax.ToString());
        maxLengthUIE.SetSingleLine();
        maxLengthUIE.SetButton(delegate { UpdateMaxLength(); });
        new UIElementBorder(maxLengthUIE);
        offset += 2;

        ui = new UIElement(Game.EDITOR, scrollArea.GetScrollTransform());
        ui.SetLocation(0, offset, 7.5f, 1);
        ui.SetText(new StringKey("val", "X_COLON", new StringKey("val", "DIFFICULTY")));

        difficultyUIE = new UIElementEditable(Game.EDITOR, scrollArea.GetScrollTransform());
        difficultyUIE.SetLocation(7.5f, offset, 3, 1);
        difficultyUIE.SetText(game.quest.qd.quest.difficulty.ToString());
        difficultyUIE.SetSingleLine();
        difficultyUIE.SetButton(delegate { UpdateDifficulty(); });
        new UIElementBorder(difficultyUIE);
        offset += 2;

        return(offset);
    }