public StringWriter GetSphereScript(bool bIsRevision) { StringWriter stringWriter1 = new StringWriter(); ArrayList arrayList1 = new ArrayList(); ArrayList arrayList2 = new ArrayList(); stringWriter1.WriteLine("// Created {0}, with Gump Studio.", (object)DateTime.Now); stringWriter1.WriteLine("// Exported with with {0} ver {1}.", (object)this.GetPluginInfo().PluginName, (object)this.GetPluginInfo().Version); stringWriter1.WriteLine("// Script for {0}", bIsRevision ? (object)"0.56/Revisions" : (object)"0.99/1.0"); stringWriter1.WriteLine(""); stringWriter1.WriteLine("[DIALOG {0}]", (object)this.frm_SphereExportForm.GumpName); StringWriter stringWriter2 = stringWriter1; string format = "{0}"; int num1 = bIsRevision ? 1 : 0; Point location = ((GumpProperties)this.m_Designer.GumpProperties).Location; int x = location.X; location = ((GumpProperties)this.m_Designer.GumpProperties).Location; int y = location.Y; string str = this.Gump_WriteLocation(num1 != 0, x, y); stringWriter2.WriteLine(format, (object)str); if (!((GumpProperties)this.m_Designer.GumpProperties).Closeable) { stringWriter1.WriteLine("{0}", bIsRevision ? (object)"NOCLOSE" : (object)"NoClose"); } if (!((GumpProperties)this.m_Designer.GumpProperties).Moveable) { stringWriter1.WriteLine("{0}", bIsRevision ? (object)"NOMOVE" : (object)"NoMove"); } if (!((GumpProperties)this.m_Designer.GumpProperties).Disposeable) { stringWriter1.WriteLine("{0}", bIsRevision ? (object)"NODISPOSE" : (object)"NoDispose"); } if (((ArrayList)this.m_Designer.Stacks).Count > 0) { int id1 = 0; int id2 = 0; int id3 = 0; int num2 = -1; for (int iPage = 0; iPage < ((ArrayList)this.m_Designer.Stacks).Count; ++iPage) { stringWriter1.WriteLine("{0}", (object)this.Gump_WritePage(bIsRevision, iPage)); GroupElement stack = ((ArrayList)this.m_Designer.Stacks)[iPage] as GroupElement; if (stack != null) { ArrayList elementsRecursive = stack.GetElementsRecursive(); if (elementsRecursive.Count > 0) { for (int index = 0; index < elementsRecursive.Count; ++index) { BaseElement baseElement = elementsRecursive[index] as BaseElement; if (baseElement != null) { HTMLElement htmlElement = baseElement as HTMLElement; if (htmlElement != null) { if (htmlElement.TextType == HTMLElementType.HTML) { if (bIsRevision) { string text = "HtmlGump id." + id1.ToString(); if (htmlElement.HTML != null) { arrayList2.Add((object)new SphereExporter.SphereElement(htmlElement.HTML.Length == 0 ? text : htmlElement.HTML, id1)); } else { arrayList2.Add((object)new SphereExporter.SphereElement(text, id1)); } } stringWriter1.WriteLine("{0}", (object)this.Gump_WriteHTML(bIsRevision, ((BaseElement)htmlElement).X, ((BaseElement)htmlElement).Y, ((ResizeableElement)htmlElement).Width, ((ResizeableElement)htmlElement).Height, htmlElement.ShowBackground, htmlElement.ShowScrollbar, ref id1, htmlElement.HTML)); } else { stringWriter1.WriteLine("{0}", (object)this.Gump_WriteXFHTML(bIsRevision, ((BaseElement)htmlElement).X, ((BaseElement)htmlElement).Y, ((ResizeableElement)htmlElement).Width, ((ResizeableElement)htmlElement).Height, htmlElement.ShowBackground, htmlElement.ShowScrollbar, htmlElement.CliLocID)); } } else { AlphaElement alphaElement = baseElement as AlphaElement; if (alphaElement != null) { stringWriter1.WriteLine("{0}", (object)this.Gump_WriteCheckerTrans(bIsRevision, ((BaseElement)alphaElement).X, ((BaseElement)alphaElement).Y, ((ResizeableElement)alphaElement).Width, ((ResizeableElement)alphaElement).Height)); } else { BackgroundElement backgroundElement = baseElement as BackgroundElement; if (backgroundElement != null) { stringWriter1.WriteLine("{0}", (object)this.Gump_WriteResizePic(bIsRevision, ((BaseElement)backgroundElement).X, ((BaseElement)backgroundElement).Y, ((ResizeableElement)backgroundElement).Width, ((ResizeableElement)backgroundElement).Height, backgroundElement.GumpID)); } else { ButtonElement buttonElement = baseElement as ButtonElement; if (buttonElement != null) { arrayList1.Add((object)new SphereExporter.SphereElement("// " + ((BaseElement)buttonElement).Name + "\n// " + buttonElement.Code, buttonElement.ButtonType == ButtonTypeEnum.Reply ? buttonElement.Param : id2)); stringWriter1.WriteLine("{0}", (object)this.Gump_WriteButton(bIsRevision, ((BaseElement)buttonElement).X, ((BaseElement)buttonElement).Y, buttonElement.NormalID, buttonElement.PressedID, buttonElement.ButtonType == ButtonTypeEnum.Page, buttonElement.Param, ref id2)); } else { ImageElement imageElement = baseElement as ImageElement; if (imageElement != null) { stringWriter1.WriteLine("{0}", (object)this.Gump_WriteGumpPic(bIsRevision, ((BaseElement)imageElement).X, ((BaseElement)imageElement).Y, imageElement.GumpID, imageElement.Hue.ToString())); } else { ItemElement itemElement = baseElement as ItemElement; if (itemElement != null) { stringWriter1.WriteLine("{0}", (object)this.Gump_WriteTilePic(bIsRevision, ((BaseElement)itemElement).X, ((BaseElement)itemElement).Y, itemElement.ItemID, itemElement.Hue.ToString())); } else { LabelElement labelElement = baseElement as LabelElement; if (labelElement != null) { if (bIsRevision) { string text = "Text id." + id1.ToString(); if (labelElement.Text != null) { arrayList2.Add((object)new SphereExporter.SphereElement(labelElement.Text.Length == 0 ? text : labelElement.Text, id1)); } else { arrayList2.Add((object)new SphereExporter.SphereElement(text, id1)); } } stringWriter1.WriteLine("{0}", (object)this.Gump_WriteText(bIsRevision, ((BaseElement)labelElement).X, ((BaseElement)labelElement).Y, labelElement.Hue.ToString(), labelElement.Text, ref id1)); } else { RadioElement radioElement = baseElement as RadioElement; if (radioElement != null) { if (radioElement.Group != num2) { stringWriter1.WriteLine("Group{0}", bIsRevision ? (object)(" " + radioElement.Group.ToString()) : (object)("(" + radioElement.Group.ToString() + ")")); num2 = radioElement.Group; } stringWriter1.WriteLine("{0}", (object)this.Gump_WriteRadioBox(bIsRevision, ((BaseElement)radioElement).X, ((BaseElement)radioElement).Y, ((CheckboxElement)radioElement).UnCheckedID, ((CheckboxElement)radioElement).CheckedID, radioElement.Checked, radioElement.Value)); } else { CheckboxElement checkboxElement = baseElement as CheckboxElement; if (checkboxElement != null) { stringWriter1.WriteLine("{0}", (object)this.Gump_WriteCheckBox(bIsRevision, ((BaseElement)checkboxElement).X, ((BaseElement)checkboxElement).Y, checkboxElement.UnCheckedID, checkboxElement.CheckedID, checkboxElement.Checked, ref id3)); } else { TextEntryElement textEntryElement = baseElement as TextEntryElement; if (textEntryElement != null) { if (bIsRevision) { string text = "Textentry id." + textEntryElement.ID.ToString(); if (textEntryElement.InitialText != null) { arrayList2.Add((object)new SphereExporter.SphereElement(textEntryElement.InitialText.Length == 0 ? text : textEntryElement.InitialText, id1)); } else { arrayList2.Add((object)new SphereExporter.SphereElement(text, id1)); } } stringWriter1.WriteLine("{0}", (object)this.Gump_WriteTextEntry(bIsRevision, ((BaseElement)textEntryElement).X, ((BaseElement)textEntryElement).Y, ((ResizeableElement)textEntryElement).Width, ((ResizeableElement)textEntryElement).Height, textEntryElement.Hue.ToString(), textEntryElement.InitialText, textEntryElement.ID, ref id1)); } else { TiledElement tiledElement = baseElement as TiledElement; if (tiledElement != null) { stringWriter1.WriteLine("{0}", (object)this.Gump_WriteGumpPicTiled(bIsRevision, ((BaseElement)tiledElement).X, ((BaseElement)tiledElement).Y, ((ResizeableElement)tiledElement).Width, ((ResizeableElement)tiledElement).Height, tiledElement.GumpID)); } } } } } } } } } } } } } } } } } stringWriter1.WriteLine(""); if (bIsRevision) { stringWriter1.WriteLine("[DIALOG {0} text]", (object)this.frm_SphereExportForm.GumpName); foreach (SphereExporter.SphereElement sphereElement in arrayList2) { stringWriter1.WriteLine("{0}", (object)sphereElement.sText); } stringWriter1.WriteLine(""); } stringWriter1.WriteLine("[DIALOG {0} button]", (object)this.frm_SphereExportForm.GumpName); foreach (SphereExporter.SphereElement sphereElement in arrayList1) { stringWriter1.WriteLine("ON={0}", (object)sphereElement.iId.ToString()); stringWriter1.WriteLine("{0}", (object)sphereElement.sText); stringWriter1.WriteLine(""); } stringWriter1.WriteLine("{0}", (object)this.Gump_WriteEOF()); return(stringWriter1); }