Esempio n. 1
0
        public LifeInstanceEditor(LifeInstance item)
        {
            InitializeComponent();
            this.item             = item;
            infoEnable.Tag        = infoBox;
            limitedNameEnable.Tag = limitedNameBox;
            mobTimeEnable.Tag     = mobTimeBox;
            teamEnable.Tag        = teamBox;

            xInput.Value    = item.X;
            yInput.Value    = item.Y;
            rx0Box.Value    = item.rx0Shift;
            rx1Box.Value    = item.rx1Shift;
            yShiftBox.Value = item.yShift;

            LoadOptionalInt(item.Info, infoEnable, infoBox);
            LoadOptionalInt(item.Team, teamEnable, teamBox);
            LoadOptionalInt(item.MobTime, mobTimeEnable, mobTimeBox);
            LoadOptionalStr(item.LimitedName, limitedNameEnable, limitedNameBox);

            hideBox.Checked = item.Hide;
            flipBox.Checked = item.Flip;

            pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item, "\r\n");
        }
Esempio n. 2
0
 private void InitializeComponentCustom()
 {
     // helper classes
     handler              = new InputHandler(multiBoard);
     hcsm                 = new HaCreatorStateManager(multiBoard, ribbon, tabs, handler);
     hcsm.CloseRequested += hcsm_CloseRequested;
     hcsm.FirstMapLoaded += hcsm_FirstMapLoaded;
 }
Esempio n. 3
0
 public TileInstanceEditor(TileInstance item)
 {
     InitializeComponent();
     this.item      = item;
     xInput.Value   = item.X;
     yInput.Value   = item.Y;
     zInput.Value   = item.Z;
     pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item, "\r\n");
 }
        public MirrorFieldEditor(MirrorFieldData mirrorFieldData)
        {
            InitializeComponent();
            this._mirrorFieldData = mirrorFieldData;


            checkBox_reflection.Checked = mirrorFieldData.ReflectionInfo.Reflection;
            checkBox_alphaTest.Checked  = mirrorFieldData.ReflectionInfo.AlphaTest;

            trackBar_gradient.Value = mirrorFieldData.ReflectionInfo.Gradient;
            trackBar_alpha.Value    = mirrorFieldData.ReflectionInfo.Alpha;

            numericUpDown_xOffsetValue.Value = (decimal)mirrorFieldData.Offset.X;
            numericUpDown_yOffsetValue.Value = (decimal)mirrorFieldData.Offset.Y;

            comboBox_objectForOverlay.SelectedIndex = 0; // "mirror"
            int i = 0;

            foreach (string comboBoxItem in comboBox_objectForOverlay.Items)
            {
                if (comboBoxItem == mirrorFieldData.ReflectionInfo.ObjectForOverlay)
                {
                    comboBox_objectForOverlay.SelectedIndex = i;
                    break;
                }
            }

            //numericUpDown_xOffsetValue.Value = mirrorFieldData.

            pathLabel.Text = HaCreatorStateManager.CreateItemDescription(_mirrorFieldData);

            /*rBox.Checked = this._mirrorFieldData.r;
             * flipBox.Checked = this._mirrorFieldData.Flip;
             * hideBox.Checked = !this._mirrorFieldData.hide.HasValue ? false : this._mirrorFieldData.hide.Value;
             * if (this._mirrorFieldData.Name != null)
             * {
             *  nameEnable.Checked = true;
             *  nameBox.Text = this._mirrorFieldData.Name;
             * }
             * flowBox.Checked = this._mirrorFieldData.flow;
             *
             * SetOptionalInt(rxInt, rxBox, this._mirrorFieldData.rx);
             * SetOptionalInt(ryInt, ryBox, this._mirrorFieldData.ry);
             * SetOptionalInt(cxInt, cxBox, this._mirrorFieldData.cx);
             * SetOptionalInt(cyInt, cyBox, this._mirrorFieldData.cy);
             *
             * if (this._mirrorFieldData.tags == null)
             *  tagsEnable.Checked = false;
             * else
             * {
             *  tagsEnable.Checked = true; tagsBox.Text = this._mirrorFieldData.tags;
             * }*/
        }
Esempio n. 5
0
        public PortalPanel(HaCreatorStateManager hcsm)
        {
            this.hcsm = hcsm;
            InitializeComponent();

            foreach (string pt in Program.InfoManager.PortalTypeById)
            {
                PortalInfo  pInfo = PortalInfo.GetPortalInfoByType(pt);
                ImageViewer item  = portalImageContainer.Add(pInfo.Image, Tables.PortalTypeNames[pt], true);
                item.Tag        = pInfo;
                item.MouseDown += new MouseEventHandler(portal_MouseDown);
                item.MouseUp   += new MouseEventHandler(ImageViewer.item_MouseUp);
            }
        }
Esempio n. 6
0
        public void Initialize(HaCreatorStateManager hcsm)
        {
            this.hcsm = hcsm;

            List <string> sortedBgSets = new List <string>();

            foreach (KeyValuePair <string, WzImage> bS in Program.InfoManager.BackgroundSets)
            {
                sortedBgSets.Add(bS.Key);
            }
            sortedBgSets.Sort();
            foreach (string bS in sortedBgSets)
            {
                bgSetListBox.Items.Add(bS);
            }
        }
Esempio n. 7
0
 public GeneralInstanceEditor(BoardItem item)
 {
     InitializeComponent();
     this.item    = item;
     xInput.Value = item.X;
     yInput.Value = item.Y;
     if (item.Z == -1)
     {
         zInput.Enabled = false;
     }
     else
     {
         zInput.Value = item.Z;
     }
     pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item, "\r\n");
 }
Esempio n. 8
0
        public ObjectInstanceEditor(ObjectInstance item)
        {
            InitializeComponent();
            cxBox.Tag       = cxInt;
            cyBox.Tag       = cyInt;
            rxBox.Tag       = rxInt;
            ryBox.Tag       = ryInt;
            nameEnable.Tag  = nameBox;
            questEnable.Tag = new Control[] { questAdd, questRemove, questList };
            tagsEnable.Tag  = tagsBox;

            this.item       = item;
            xInput.Value    = item.X;
            yInput.Value    = item.Y;
            zInput.Value    = item.Z;
            rBox.Checked    = item.r;
            flipBox.Checked = item.Flip;
            hideBox.Checked = !item.hide.HasValue ? false : item.hide.Value;
            pathLabel.Text  = HaCreatorStateManager.CreateItemDescription(item);
            if (item.Name != null)
            {
                nameEnable.Checked = true;
                nameBox.Text       = item.Name;
            }
            flowBox.Checked = item.flow;
            SetOptionalInt(rxInt, rxBox, item.rx);
            SetOptionalInt(ryInt, ryBox, item.ry);
            SetOptionalInt(cxInt, cxBox, item.cx);
            SetOptionalInt(cyInt, cyBox, item.cy);
            if (item.tags == null)
            {
                tagsEnable.Checked = false;
            }
            else
            {
                tagsEnable.Checked = true; tagsBox.Text = item.tags;
            }

            if (item.QuestInfo != null)
            {
                questEnable.Checked = true;
                foreach (ObjectInstanceQuest info in item.QuestInfo)
                {
                    questList.Items.Add(info);
                }
            }
        }
Esempio n. 9
0
        public void Initialize(HaCreatorStateManager hcsm)
        {
            this.hcsm = hcsm;

            ImageViewer[] commonItems = new ImageViewer[] {
                miscItemsContainer.Add(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.FootholdColor)), "Foothold", true),
                miscItemsContainer.Add(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.RopeColor)), "Rope", true),
                miscItemsContainer.Add(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.ChairColor)), "Chair", true),
                miscItemsContainer.Add(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.ToolTipColor)), "Tooltip", true),
                miscItemsContainer.Add(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.MiscColor)), "Clock", true)
            };
            foreach (ImageViewer item in commonItems)
            {
                item.MouseDown += new MouseEventHandler(commonItem_Click);
                item.MouseUp   += new MouseEventHandler(ImageViewer.item_MouseUp);
            }
        }
Esempio n. 10
0
        public void Initialize(HaCreatorStateManager hcsm)
        {
            this.hcsm = hcsm;

            foreach (string pt in Program.InfoManager.PortalTypeById)
            {
                PortalInfo pInfo = PortalInfo.GetPortalInfoByType(pt);
                try
                {
                    ImageViewer item = portalImageContainer.Add(pInfo.Image, Tables.PortalTypeNames[pt], true);
                    item.Tag        = pInfo;
                    item.MouseDown += new MouseEventHandler(portal_MouseDown);
                    item.MouseUp   += new MouseEventHandler(ImageViewer.item_MouseUp);
                }
                catch (KeyNotFoundException e) { }
            }
        }
 public ReactorInstanceEditor(ReactorInstance item)
 {
     InitializeComponent();
     this.item      = item;
     xInput.Value   = item.X;
     yInput.Value   = item.Y;
     pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item);
     if (item.Name == null)
     {
         useName.Checked = false;
     }
     else
     {
         nameBox.Text = item.Name;
     }
     timeBox.Value = item.ReactorTime;
 }
 public RopeInstanceEditor(RopeAnchor item)
 {
     InitializeComponent();
     this.item     = item;
     xInput.Value  = item.X;
     yInput.Value  = item.Y;
     ufBox.Checked = item.ParentRope.uf;
     if (item.ParentRope.ladder)
     {
         ladderBox.Checked = true;
     }
     else
     {
         ladderBox.Checked = false;
     }
     pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item);
 }
Esempio n. 13
0
        public void Initialize(HaCreatorStateManager hcsm)
        {
            this.hcsm = hcsm;
            hcsm.SetTilePanel(this);

            List <string> sortedTileSets = new List <string>();

            foreach (KeyValuePair <string, WzImage> tS in Program.InfoManager.TileSets)
            {
                sortedTileSets.Add(tS.Key);
            }
            sortedTileSets.Sort();
            foreach (string tS in sortedTileSets)
            {
                tileSetList.Items.Add(tS);
            }
        }
        public void Initialize(HaCreatorStateManager hcsm)
        {
            this.hcsm = hcsm;
            hcsm.SetObjPanel(this);

            List <string> sortedObjSets = new List <string>();

            foreach (KeyValuePair <string, WzImage> oS in Program.InfoManager.ObjectSets)
            {
                sortedObjSets.Add(oS.Key);
            }
            sortedObjSets.Sort();
            foreach (string oS in sortedObjSets)
            {
                objSetListBox.Items.Add(oS);
            }
        }
Esempio n. 15
0
        public void Initialize(HaCreatorStateManager hcsm)
        {
            this.hcsm = hcsm;

            foreach (KeyValuePair <string, ReactorInfo> entry in Program.InfoManager.Reactors)
            {
                reactors.Add(entry.Value.ID);
            }
            foreach (KeyValuePair <string, string> entry in Program.InfoManager.NPCs)
            {
                npcs.Add(entry.Key + " - " + entry.Value);
            }
            foreach (KeyValuePair <string, string> entry in Program.InfoManager.Mobs)
            {
                mobs.Add(entry.Key + " - " + entry.Value);
            }

            ReloadLifeList();
        }
Esempio n. 16
0
        public TooltipInstanceEditor(ToolTipInstance item)
        {
            InitializeComponent();
            this.item      = item;
            xInput.Value   = item.X;
            yInput.Value   = item.Y;
            pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item);

            if (item.Title != null)
            {
                useTitleBox.Checked = true;
                titleBox.Text       = item.Title;
            }
            if (item.Desc != null)
            {
                useDescBox.Checked = true;
                descBox.Text       = item.Desc;
            }
        }
Esempio n. 17
0
        private void HaEditor2_Loaded(object sender, RoutedEventArgs e)
        {
            // helper classes
            handler              = new InputHandler(multiBoard);
            hcsm                 = new HaCreatorStateManager(multiBoard, ribbon, tabControl1, handler, textblock_CursorX, textblock_CursorY, textblock_RCursorX, textblock_RCursorY, textblock_selectedItem);
            hcsm.CloseRequested += Hcsm_CloseRequested;
            hcsm.FirstMapLoaded += Hcsm_FirstMapLoaded;

            tilePanel.Initialize(hcsm);
            objPanel.Initialize(hcsm);
            lifePanel.Initialize(hcsm);
            portalPanel.Initialize(hcsm);
            bgPanel.Initialize(hcsm);
            commonPanel.Initialize(hcsm);

            if (!hcsm.backupMan.AttemptRestore())
            {
                hcsm.LoadMap(new Load(multiBoard, tabControl1, hcsm.MakeRightClickHandler()));
            }
        }
Esempio n. 18
0
 public BackgroundInstanceEditor(BackgroundInstance item)
 {
     InitializeComponent();
     this.item    = item;
     xInput.Value = item.BaseX;
     yInput.Value = item.BaseY;
     if (item.Z == -1)
     {
         zInput.Enabled = false;
     }
     else
     {
         zInput.Value = item.Z;
     }
     pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item, "\r\n");
     typeBox.Items.AddRange((object[])Tables.BackgroundTypeNames.Cast <object>());
     typeBox.SelectedIndex = (int)item.type;
     alphaBox.Value        = item.a;
     front.Checked         = item.front;
     rxBox.Value           = item.rx;
     ryBox.Value           = item.ry;
     cxBox.Value           = item.cx;
     cyBox.Value           = item.cy;
 }
        public BackgroundInstanceEditor(BackgroundInstance item)
        {
            InitializeComponent();

            this.item    = item;
            xInput.Value = item.BaseX;
            yInput.Value = item.BaseY;
            if (item.Z == -1)
            {
                zInput.Enabled = false;
            }
            else
            {
                zInput.Value = item.Z;
            }

            pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item);
            typeBox.Items.AddRange((object[])Tables.BackgroundTypeNames.Cast <object>());
            typeBox.SelectedIndex = (int)item.type;
            alphaBox.Value        = item.a;
            front.Checked         = item.front;
            rxBox.Value           = item.rx;
            ryBox.Value           = item.ry;
            cxBox.Value           = item.cx;
            cyBox.Value           = item.cy;

            // Resolutions
            foreach (MapRenderResolution val in Enum.GetValues(typeof(MapRenderResolution)))
            {
                ComboBoxItem comboBoxItem = new ComboBoxItem();
                comboBoxItem.Tag     = val;
                comboBoxItem.Content = val.ToString().Replace("Res_", "").Replace("_", " ").Replace("PercScaled", "% scale");

                comboBox_screenMode.Items.Add(comboBoxItem);
            }
            comboBox_screenMode.DisplayMember = "Content";

            int i = 0;

            foreach (ComboBoxItem citem in comboBox_screenMode.Items)
            {
                if ((int)((MapRenderResolution)citem.Tag) == item.screenMode)
                {
                    comboBox_screenMode.SelectedIndex = i;
                    break;
                }
                i++;
            }
            if (item.screenMode < 0)
            {
                comboBox_screenMode.SelectedIndex = 0;
            }

            // Spine
            if (item.SpineAni != null)
            {
                checkBox_spineAni.Checked = true;
                textBox_spineAni.Text     = item.SpineAni;
            }
            checkBox_spineRandomStart.Checked = item.SpineRandomStart;
        }
Esempio n. 20
0
        public BackgroundInstanceEditor(BackgroundInstance item)
        {
            InitializeComponent();

            this.item    = item;
            xInput.Value = item.BaseX;
            yInput.Value = item.BaseY;
            if (item.Z == -1)
            {
                zInput.Enabled = false;
            }
            else
            {
                zInput.Value = item.Z;
            }

            pathLabel.Text = HaCreatorStateManager.CreateItemDescription(item);
            typeBox.Items.AddRange((object[])Tables.BackgroundTypeNames.Cast <object>());
            typeBox.SelectedIndex = (int)item.type;
            alphaBox.Value        = item.a;
            front.Checked         = item.front;
            rxBox.Value           = item.rx;
            ryBox.Value           = item.ry;
            cxBox.Value           = item.cx;
            cyBox.Value           = item.cy;

            // Resolutions
            foreach (RenderResolution val in Enum.GetValues(typeof(RenderResolution)))
            {
                ComboBoxItem comboBoxItem = new ComboBoxItem();
                comboBoxItem.Tag     = val;
                comboBoxItem.Content = val.ToString().Replace("Res_", "").Replace("_", " ").Replace("PercScaled", "% scale");

                comboBox_screenMode.Items.Add(comboBoxItem);
            }
            comboBox_screenMode.DisplayMember = "Content";

            int i = 0;

            foreach (ComboBoxItem citem in comboBox_screenMode.Items)
            {
                if ((int)((RenderResolution)citem.Tag) == item.screenMode)
                {
                    comboBox_screenMode.SelectedIndex = i;
                    break;
                }
                i++;
            }
            if (item.screenMode < 0)
            {
                comboBox_screenMode.SelectedIndex = 0;
            }

            // Spine
            BackgroundInfo baseInfo = (BackgroundInfo)item.BaseInfo;

            if (baseInfo.WzSpineAnimationItem == null)
            {
                groupBox_spine.Enabled = false; // disable editing
            }
            else
            {
                groupBox_spine.Enabled = true; // editing

                foreach (Animation ani in baseInfo.WzSpineAnimationItem.SkeletonData.Animations)
                {
                    ComboBoxItem comboBoxItem = new ComboBoxItem();
                    comboBoxItem.Tag     = ani;
                    comboBoxItem.Content = ani.Name;

                    comboBox_spineAnimation.Items.Add(comboBoxItem);
                }
                comboBox_spineAnimation.DisplayMember = "Content";

                int i_animation = 0;
                foreach (ComboBoxItem citem in comboBox_spineAnimation.Items)
                {
                    if (((Animation)citem.Tag).Name == item.SpineAni)
                    {
                        comboBox_spineAnimation.SelectedIndex = i_animation;
                        break;
                    }
                    i_animation++;
                }

                // spineRandomStart checkbox
                checkBox_spineRandomStart.Checked = item.SpineRandomStart;
            }
        }