protected void Init(uint serial, uint gumpId, uint x, uint y, string layout, string[] text) { m_Serial = serial; m_GumpId = gumpId; m_X = x; m_Y = y; m_Text = text; layout = layout.Replace("}", ""); string[] splt = layout.Substring(1).Split('{'); ArrayList layoutList = new ArrayList(); foreach (string s in splt) { try { string[] commands = SplitCommands(s); ArrayList cmdList = new ArrayList(); foreach (string cmd in commands) { if (cmd != "") { cmdList.Add(cmd); } } GumpEntry entry = GumpEntry.Create((string[])cmdList.ToArray(typeof(string)), this); layoutList.Add(entry); } catch { } } m_Layout = (GumpEntry[])layoutList.ToArray(typeof(GumpEntry)); }
public void WriteRunUOClass(StreamWriter writer) { writer.WriteLine("using System;"); writer.WriteLine("using Server;"); writer.WriteLine("using Server.Gumps;"); writer.WriteLine("using Server.Network;"); writer.WriteLine(); writer.WriteLine("namespace Server.SpyUO"); writer.WriteLine("{"); writer.WriteLine("\tpublic class SpyUOGump : Gump"); writer.WriteLine("\t{"); writer.WriteLine("\t\tpublic SpyUOGump() : base( {0}, {1} )", m_X, m_Y); writer.WriteLine("\t\t{"); for (int i = 0; i < m_Layout.Length; i++) { GumpEntry entry = m_Layout[i]; bool space = entry is GumpPage; if (space && i != 0) { writer.WriteLine(); } writer.Write("\t\t\t{0}", entry.GetRunUOLine()); if (entry is GumpHtmlLocalized) { writer.WriteLine(" // " + LocalizedList.GetString(((GumpHtmlLocalized)entry).Number) as string); } else if (entry is GumpHtmlLocalizedColor) { writer.WriteLine(" // " + LocalizedList.GetString(((GumpHtmlLocalizedColor)entry).Number) as string); } else if (entry is GumpHtmlLocalizedArgs) { writer.WriteLine(" // " + LocalizedList.GetString(((GumpHtmlLocalizedArgs)entry).Number) as string); } else { writer.WriteLine(); } if (space && i < m_Layout.Length) { writer.WriteLine(); } } writer.WriteLine("\t\t}"); writer.WriteLine(); writer.WriteLine("\t\tpublic override void OnResponse( NetState sender, RelayInfo info )"); writer.WriteLine("\t\t{"); writer.WriteLine("\t\t}"); writer.WriteLine("\t}"); writer.Write("}"); }