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; } }
/// <summary> /// /// </summary> /// <param name="texturePool"></param> /// <param name="gameParent"></param> /// <param name="portalInstance"></param> /// <param name="device"></param> /// <param name="usedProps"></param> /// <returns></returns> public static PortalItem CreatePortalFromProperty(TexturePool texturePool, WzSubProperty gameParent, PortalInstance portalInstance, GraphicsDevice device, ref List <WzObject> usedProps) { PortalInfo portalInfo = (PortalInfo)portalInstance.BaseInfo; if (portalInstance.pt == PortalType.PORTALTYPE_STARTPOINT || portalInstance.pt == PortalType.PORTALTYPE_INVISIBLE || //portalInstance.pt == PortalType.PORTALTYPE_CHANGABLE_INVISIBLE || portalInstance.pt == PortalType.PORTALTYPE_SCRIPT_INVISIBLE || portalInstance.pt == PortalType.PORTALTYPE_SCRIPT || portalInstance.pt == PortalType.PORTALTYPE_COLLISION || portalInstance.pt == PortalType.PORTALTYPE_COLLISION_SCRIPT || portalInstance.pt == PortalType.PORTALTYPE_COLLISION_CUSTOM_IMPACT || // springs in Mechanical grave 350040240 portalInstance.pt == PortalType.PORTALTYPE_COLLISION_VERTICAL_JUMP) // vertical spring actually { return(null); } List <IDXObject> frames = new List <IDXObject>(); // All frames "stand", "speak" "blink" "hair", "angry", "wink" etc //string portalType = portalInstance.pt; //int portalId = Program.InfoManager.PortalIdByType[portalInstance.pt]; WzSubProperty portalTypeProperty = (WzSubProperty)gameParent[portalInstance.pt]; if (portalTypeProperty == null) { portalTypeProperty = (WzSubProperty)gameParent["pv"]; } else { // Support for older versions of MapleStory where 'pv' is a subproperty for the image frame than a collection of subproperty of frames if (portalTypeProperty["0"] is WzCanvasProperty) { frames.AddRange(LoadFrames(texturePool, portalTypeProperty, portalInstance.X, portalInstance.Y, device, ref usedProps)); portalTypeProperty = null; } } if (portalTypeProperty != null) { WzSubProperty portalImageProperty = (WzSubProperty)portalTypeProperty[portalInstance.image == null ? "default" : portalInstance.image]; if (portalImageProperty != null) { WzSubProperty framesPropertyParent; if (portalImageProperty["portalContinue"] != null) { framesPropertyParent = (WzSubProperty)portalImageProperty["portalContinue"]; } else { framesPropertyParent = (WzSubProperty)portalImageProperty; } if (framesPropertyParent != null) { frames.AddRange(LoadFrames(texturePool, framesPropertyParent, portalInstance.X, portalInstance.Y, device, ref usedProps)); } } } if (frames.Count == 0) { return(null); } return(new PortalItem(portalInstance, frames)); }
public PortalInstanceEditor(PortalInstance item) { InitializeComponent(); int portalTypes = Program.InfoManager.PortalTypeById.Count; ArrayList portals = new ArrayList(); for (int i = 0; i < portalTypes; i++) { try { portals.Add(Tables.PortalTypeNames[Program.InfoManager.PortalTypeById[i]]); }catch (KeyNotFoundException e) { continue; } } ptComboBox.Items.AddRange(portals.ToArray()); this.item = item; 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 = Program.InfoManager.PortalIdByType[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; } }
public PortalItem(PortalInstance portalInstance, IDXObject frame0) : base(frame0, false) { this.portalInstance = portalInstance; }
public PortalItem(PortalInstance portalInstance, List <IDXObject> frames) : base(frames, false) { this.portalInstance = portalInstance; }
public PortalInstanceEditor(PortalInstance item) { InitializeComponent(); int portalTypes = Program.InfoManager.PortalTypeById.Count; object[] portals = new object[portalTypes]; for (int i = 0; i < portalTypes; i++) { portals[i] = Tables.PortalTypeNames[Program.InfoManager.PortalTypeById[i]]; } ptComboBox.Items.AddRange(portals); this.item = item; 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 = Program.InfoManager.PortalIdByType[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; } }