예제 #1
0
        private void LoadTileSetList()
        {
            if (tileSetList.SelectedItem == null)
            {
                return;
            }
            tileImagesContainer.Controls.Clear();
            WzImage tileSetImage = Program.InfoManager.TileSets[(string)tileSetList.SelectedItem];

            if (tileSetImage == null)
            {
                return;
            }
            foreach (WzSubProperty tCat in tileSetImage.WzProperties)
            {
                if (tCat.Name == "info")
                {
                    continue;
                }
                if (ApplicationSettings.randomTiles)
                {
                    WzCanvasProperty canvasProp = (WzCanvasProperty)tCat["0"];
                    if (canvasProp == null)
                    {
                        continue;
                    }
                    KoolkLVItem item        = tileImagesContainer.createItem(canvasProp.PngProperty.GetPNG(false), tCat.Name, true);
                    TileInfo[]  randomInfos = new TileInfo[tCat.WzProperties.Count];
                    for (int i = 0; i < randomInfos.Length; i++)
                    {
                        WzCanvasProperty tile = (WzCanvasProperty)tCat.WzProperties[i];
                        if (tile.HCTag == null)
                        {
                            tile.HCTag = TileInfo.Load(tile, (string)tileSetList.SelectedItem, tCat.Name, tile.Name);
                        }
                        randomInfos[i] = (TileInfo)tile.HCTag;
                    }
                    item.Tag        = randomInfos;
                    item.MouseDown += new MouseEventHandler(tileItem_Click);
                    item.MouseUp   += new MouseEventHandler(item_MouseUp);
                }
                else
                {
                    foreach (WzCanvasProperty tile in tCat.WzProperties)
                    {
                        if (tile.HCTag == null)
                        {
                            tile.HCTag = TileInfo.Load(tile, (string)tileSetList.SelectedItem, tCat.Name, tile.Name);
                        }
                        KoolkLVItem item = tileImagesContainer.createItem(tile.PngProperty.GetPNG(false), tCat.Name + "/" + tile.Name, true);
                        item.Tag        = tile.HCTag;
                        item.MouseDown += new MouseEventHandler(tileItem_Click);
                        item.MouseUp   += new MouseEventHandler(item_MouseUp);
                    }
                }
            }
        }
예제 #2
0
        private void bgSetListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (bgSetListBox.SelectedItem == null)
            {
                return;
            }
            bgImageContainer.Controls.Clear();
            WzImage bgSetImage = Program.InfoManager.BackgroundSets[(string)bgSetListBox.SelectedItem];

            if (!bgSetImage.Parsed)
            {
                bgSetImage.ParseImage();
            }
            if (aniBg.Checked)
            {
                IWzImageProperty aniProp = bgSetImage["ani"];
                if (aniProp == null || aniProp.WzProperties == null)
                {
                    return;
                }
                foreach (WzSubProperty aniBgProp in aniProp.WzProperties)
                {
                    if (aniBgProp.HCTag == null)
                    {
                        aniBgProp.HCTag = BackgroundInfo.Load(aniBgProp, (string)bgSetListBox.SelectedItem, true, aniBgProp.Name);
                    }
                    KoolkLVItem aniItem = bgImageContainer.createItem(((BackgroundInfo)aniBgProp.HCTag).Image, aniBgProp.Name, true);
                    aniItem.Tag        = aniBgProp.HCTag;
                    aniItem.MouseDown += new MouseEventHandler(bgItem_Click);
                    aniItem.MouseUp   += new MouseEventHandler(item_MouseUp);
                }
            }
            else
            {
                IWzImageProperty backProp = bgSetImage["back"];
                foreach (WzCanvasProperty backBg in backProp.WzProperties)
                {
                    if (backBg.HCTag == null)
                    {
                        backBg.HCTag = BackgroundInfo.Load(backBg, (string)bgSetListBox.SelectedItem, false, backBg.Name);
                    }
                    KoolkLVItem aniItem = bgImageContainer.createItem(((BackgroundInfo)backBg.HCTag).Image, backBg.Name, true);
                    aniItem.Tag        = backBg.HCTag;
                    aniItem.MouseDown += new MouseEventHandler(bgItem_Click);
                    aniItem.MouseUp   += new MouseEventHandler(item_MouseUp);
                }
            }
        }
예제 #3
0
        private void objL1ListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (objL1ListBox.SelectedItem == null)
            {
                return;
            }
            objImagesContainer.Controls.Clear();
            IWzImageProperty l1Prop = Program.InfoManager.ObjectSets[(string)objSetListBox.SelectedItem][(string)objL0ListBox.SelectedItem][(string)objL1ListBox.SelectedItem];

            foreach (WzSubProperty l2Prop in l1Prop.WzProperties)
            {
                if (l2Prop.HCTag == null)
                {
                    l2Prop.HCTag = ObjectInfo.Load(l2Prop, (string)objSetListBox.SelectedItem, (string)objL0ListBox.SelectedItem, (string)objL1ListBox.SelectedItem, l2Prop.Name);
                }
                ObjectInfo       info      = (ObjectInfo)l2Prop.HCTag;
                WzCanvasProperty objCanvas = (WzCanvasProperty)l2Prop["0"];
                KoolkLVItem      item      = objImagesContainer.createItem(objCanvas.PngProperty.GetPNG(false), l2Prop.Name, true);
                item.Tag        = l2Prop.HCTag;
                item.MouseDown += new MouseEventHandler(objItem_Click);
                item.MouseUp   += new MouseEventHandler(item_MouseUp);
            }
        }
예제 #4
0
        void commonItem_Click(object sender, MouseEventArgs e)
        {
            KoolkLVItem item = (KoolkLVItem)sender;

            switch (item.Name)
            {
            case "Foothold":
                SetVisibleEditedTypes(ItemTypes.Footholds);
                multiBoard.SelectedBoard.Mouse.SetFootholdMode();
                multiBoard.Focus();
                multiBoard.RenderFrame();
                break;

            case "Rope":
                SetVisibleEditedTypes(ItemTypes.Ropes);
                multiBoard.SelectedBoard.Mouse.SetRopeMode();
                multiBoard.Focus();
                multiBoard.RenderFrame();
                break;

            case "Chair":
                SetVisibleEditedTypes(ItemTypes.Chairs);
                multiBoard.SelectedBoard.Mouse.SetChairMode();
                multiBoard.Focus();
                multiBoard.RenderFrame();
                break;

            case "Tooltip":
                SetVisibleEditedTypes(ItemTypes.Footholds);
                multiBoard.SelectedBoard.Mouse.SetTooltipMode();
                multiBoard.Focus();
                multiBoard.RenderFrame();
                break;
            }
            item.Selected = true;
        }
예제 #5
0
        private void InitializeCustomComponent()
        {
            Tabs.Parent = this;
            if (Environment.OSVersion.Version.Major >= 6)
            {
                FormBorderStyle = FormBorderStyle.Sizable;
            }
            else
            {
                FormBorderStyle = FormBorderStyle.None;
            }
            MaximizedBounds           = SystemInformation.WorkingArea;
            styleManager.ManagerStyle = UserSettings.applicationStyle;
            viewTiles.Tag             = ItemTypes.Tiles;
            viewObjs.Tag        = ItemTypes.Objects;
            viewMobs.Tag        = ItemTypes.Mobs;
            viewNpcs.Tag        = ItemTypes.NPCs;
            viewPortals.Tag     = ItemTypes.Portals;
            viewReactors.Tag    = ItemTypes.Reactors;
            viewRopes.Tag       = ItemTypes.Ropes;
            viewFhs.Tag         = ItemTypes.Footholds;
            viewTooltips.Tag    = ItemTypes.ToolTips;
            viewSeats.Tag       = ItemTypes.Chairs;
            viewBackgrounds.Tag = ItemTypes.Backgrounds;
            checkboxes          = new CheckBoxItem[] { viewTiles, viewObjs, viewMobs, viewNpcs, viewPortals, viewReactors, viewRopes, viewFhs, viewTooltips, viewSeats, viewBackgrounds };

            cordsLabel.Visible = UserSettings.ShowMousePos;
            itemDescLabel.Text = "";
            cordsLabel.Text    = "";

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

            foreach (DictionaryEntry tS in Program.InfoManager.TileSets)
            {
                sortedTileSets.Add((string)tS.Key);
            }
            sortedTileSets.Sort();
            foreach (string tS in sortedTileSets)
            {
                tileSetList.Items.Add(tS);
            }

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

            foreach (DictionaryEntry oS in Program.InfoManager.ObjectSets)
            {
                sortedObjSets.Add((string)oS.Key);
            }
            sortedObjSets.Sort();
            foreach (string oS in sortedObjSets)
            {
                objSetListBox.Items.Add(oS);
            }

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

            foreach (DictionaryEntry bS in Program.InfoManager.BackgroundSets)
            {
                sortedBgSets.Add((string)bS.Key);
            }
            sortedBgSets.Sort();
            foreach (string bS in sortedBgSets)
            {
                bgSetListBox.Items.Add(bS);
            }

            for (int i = 0; i < Program.InfoManager.Portals.Length; i++)
            {
                PortalInfo  pInfo = PortalInfo.GetPortalInfoByType((PortalType)i);
                KoolkLVItem item  = portalImageContainer.createItem(pInfo.Image, Tables.PortalTypeNames[i], true);
                item.Tag        = pInfo;
                item.MouseDown += new MouseEventHandler(portal_MouseDown);
                item.MouseUp   += new MouseEventHandler(item_MouseUp);
            }

            KoolkLVItem[] commonItems = new KoolkLVItem[] {
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.FootholdColor)), "Foothold", true),
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.RopeColor)), "Rope", true),
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.ChairColor)), "Chair", true),
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.ToolTipColor)), "Tooltip", true)
            };
            foreach (KoolkLVItem item in commonItems)
            {
                item.MouseDown += new MouseEventHandler(commonItem_Click);
                item.MouseUp   += new MouseEventHandler(item_MouseUp);
            }
            ReloadLifeList();
        }
예제 #6
0
        private void InitializeCustomComponent()
        {
            Tabs.Parent = this;
            if (Environment.OSVersion.Version.Major >= 6)
                FormBorderStyle = FormBorderStyle.Sizable;
            else
                FormBorderStyle = FormBorderStyle.None;
            MaximizedBounds = SystemInformation.WorkingArea;
            styleManager.ManagerStyle = UserSettings.applicationStyle;
            viewTiles.Tag = ItemTypes.Tiles;
            viewObjs.Tag = ItemTypes.Objects;
            viewMobs.Tag = ItemTypes.Mobs;
            viewNpcs.Tag = ItemTypes.NPCs;
            viewPortals.Tag = ItemTypes.Portals;
            viewReactors.Tag = ItemTypes.Reactors;
            viewRopes.Tag = ItemTypes.Ropes;
            viewFhs.Tag = ItemTypes.Footholds;
            viewTooltips.Tag = ItemTypes.ToolTips;
            viewSeats.Tag = ItemTypes.Chairs;
            viewBackgrounds.Tag = ItemTypes.Backgrounds;
            checkboxes = new CheckBoxItem[] { viewTiles, viewObjs, viewMobs, viewNpcs, viewPortals, viewReactors, viewRopes, viewFhs, viewTooltips, viewSeats, viewBackgrounds };

            cordsLabel.Visible = UserSettings.ShowMousePos;
            itemDescLabel.Text = "";
            cordsLabel.Text = "";

            List<string> sortedTileSets = new List<string>();
            foreach (DictionaryEntry tS in Program.InfoManager.TileSets)
                sortedTileSets.Add((string)tS.Key);
            sortedTileSets.Sort();
            foreach (string tS in sortedTileSets)
                tileSetList.Items.Add(tS);

            List<string> sortedObjSets = new List<string>();
            foreach (DictionaryEntry oS in Program.InfoManager.ObjectSets)
                sortedObjSets.Add((string)oS.Key);
            sortedObjSets.Sort();
            foreach (string oS in sortedObjSets)
                objSetListBox.Items.Add(oS);

            List<string> sortedBgSets = new List<string>();
            foreach (DictionaryEntry bS in Program.InfoManager.BackgroundSets)
                sortedBgSets.Add((string)bS.Key);
            sortedBgSets.Sort();
            foreach (string bS in sortedBgSets)
                bgSetListBox.Items.Add(bS);

            for (int i = 0; i < Program.InfoManager.Portals.Length; i++)
            {
                PortalInfo pInfo = PortalInfo.GetPortalInfoByType((PortalType)i);
                KoolkLVItem item = portalImageContainer.createItem(pInfo.Image, Tables.PortalTypeNames[i], true);
                item.Tag = pInfo;
                item.MouseDown += new MouseEventHandler(portal_MouseDown);
                item.MouseUp += new MouseEventHandler(item_MouseUp);
            }

            KoolkLVItem[] commonItems = new KoolkLVItem[] { 
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.FootholdColor)), "Foothold", true),
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.RopeColor)), "Rope", true),
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.ChairColor)), "Chair", true),
                miscItemsContainer.createItem(CreateColoredBitmap(WzInfoTools.XNAToDrawingColor(UserSettings.ToolTipColor)), "Tooltip", true)
            };
            foreach (KoolkLVItem item in commonItems)
            {
                item.MouseDown += new MouseEventHandler(commonItem_Click);
                item.MouseUp += new MouseEventHandler(item_MouseUp);
            }
            ReloadLifeList();
        }