Esempio n. 1
0
        /// <summary>
        /// Load portal target map
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void LoadPortalTargetMap_Click(object sender, EventArgs e)
        {
            PortalInstance portal = (PortalInstance)target;

            if (portal.tm != MapConstants.MaxMap)
            {
                multiboard.HaCreatorStateManager.LoadMap(portal.tm);
            }
        }
Esempio n. 2
0
        public PortalInstanceEditor(PortalInstance item)
        {
            InitializeComponent();
            ptComboBox.Items.AddRange((object[])Tables.PortalTypeNames.Cast<object>());
            this.item = item;
            styleManager.ManagerStyle = UserSettings.applicationStyle;

            rowMan = new ControlRowManager(new ControlRow[] { 
                new ControlRow(new Control[] { pnLabel, pnBox }, 26, "pn"),
                new ControlRow(new Control[] { tmLabel, tmBox, btnBrowseMap, thisMap }, 26, "tm"),
                new ControlRow(new Control[] { tnLabel, tnBox, btnBrowseTn, leftBlankLabel }, 26, "tn"),
                new ControlRow(new Control[] { scriptLabel, scriptBox }, 26, "script"),
                new ControlRow(new Control[] { delayEnable, delayBox }, 26, "delay"),
                new ControlRow(new Control[] { rangeEnable, xRangeLabel, hRangeBox, yRangeLabel, vRangeBox }, 26, "range"),
                new ControlRow(new Control[] { impactLabel, hImpactEnable, hImpactBox, vImpactEnable, vImpactBox }, 26, "impact"),
                new ControlRow(new Control[] { hideTooltip, onlyOnce }, 26, "bool"),
                new ControlRow(new Control[] { imageLabel, portalImageList, portalImageBox }, okButton.Top - portalImageList.Top, "image"),
                new ControlRow(new Control[] { okButton, cancelButton }, 26, "buttons")
            }, this);

            delayEnable.Tag = delayBox;
            hImpactEnable.Tag = hImpactBox;
            vImpactEnable.Tag = vImpactBox;

            xInput.Value = item.X;
            yInput.Value = item.Y;
            ptComboBox.SelectedIndex = (int)item.pt;
            pnBox.Text = item.pn;
            if (item.tm == item.Board.MapInfo.id) thisMap.Checked = true;
            else tmBox.Value = item.tm;
            tnBox.Text = item.tn;
            if (item.script != null) scriptBox.Text = item.script;
            SetOptionalInt(item.delay, delayEnable, delayBox);
            SetOptionalInt(item.hRange, rangeEnable, hRangeBox);
            SetOptionalInt(item.vRange, rangeEnable, vRangeBox);
            SetOptionalInt(item.horizontalImpact, hImpactEnable, hImpactBox);
            if (item.verticalImpact != null) vImpactBox.Value = (int)item.verticalImpact;
            onlyOnce.Checked = item.onlyOnce;
            hideTooltip.Checked = item.hideTooltip;
            if (item.image != null)
            {
                portalImageList.SelectedItem = item.image;
            }
        }