internal void BaseDeserialize(XmlReader read) { try { read.ReadStartElement(); int count = read.ReadContentAsInt(); read.ReadEndElement(); int i = 0; while (i < count) { string name = read.LocalName; //SkillSettings.DoTell2("Current Name (win): " + name); int x = Int32.Parse(read.GetAttribute(0)); int y = Int32.Parse(read.GetAttribute(1)); int w = Int32.Parse(read.GetAttribute(2)); int h = Int32.Parse(read.GetAttribute(3)); int bg = Int32.Parse(read.GetAttribute(4)); WindowInfo inf = new WindowInfo(x, y, w, h, bg); ReplaceWindow(name, inf); read.Read(); i++; } read.ReadStartElement(); int count2 = read.ReadContentAsInt(); i = 0; read.ReadEndElement(); while (i < count2) { string name = read.LocalName; //SkillSettings.DoTell2("Current Name (btn): " + name); int x = Int32.Parse(read.GetAttribute(0)); int y = Int32.Parse(read.GetAttribute(1)); int w = Int32.Parse(read.GetAttribute(2)); int h = Int32.Parse(read.GetAttribute(3)); int bg = Int32.Parse(read.GetAttribute(4)); string txt = read.GetAttribute(5); int tx = Int32.Parse(read.GetAttribute(6) ); int ty = Int32.Parse(read.GetAttribute(7) ); int up = Int32.Parse(read.GetAttribute(8)); int dn = Int32.Parse(read.GetAttribute(9)); ButtonInfo inf = new ButtonInfo( x, y, w, h, bg, txt, tx, ty, up, dn ); ReplaceButton(name, inf); read.Read(); i++; } } catch (Exception e) { Console.WriteLine("Exception while reading in Button and Window info: " + e); } }
private void ReplaceWindow(string name, WindowInfo inf) { if (WindowInfo.ContainsKey(name)) WindowInfo.Remove(name); WindowInfo.Add(name, inf); }
public void GetGumpCode( ) { WindowInfo info = new WindowInfo(); try { info = skin.WindowInfo["SkillWindow"]; } catch { return; } this.X = info.X; this.Y = info.Y; this.AddButton( 170, 0, 2093, 2093, -100, GumpButtonType.Reply, 0 ); this.AddBackground(0, 15, info.W, info.H, info.bgID); this.AddImage( 145, 30, 2100 ); this.AddImage( 22, 355, 2102 ); this.AddImage(60, 54, 2091); this.AddImage(60, 333, 2091); Mobile m = Mobile; Skills s = m.Skills; this.AddLabel(270, 354, skin.BlueTextHue, "" + (checkdouble(s.Total / 10) ? " " + (s.Total / 10) + ".0" : " " + (s.Total / 10))); GumpList l = new GumpList(this, "details", skin); l.columns = 5; l.ShowDividers = false; l.ShowBackground = false; l.columnWidths[0] = 15; l.columnWidths[1] = 200; l.numperpage = 14; l.X = 20; l.Y = 51; ButtonInfo ecg = skin.ButtonInfo["ExpandContractGroup"]; GumpListEntry miscentry = new GumpListEntry(0, 0, l, info.W - 10, 20); miscentry.AddColumn(new GumpButton(0, 0, !showing.Contains(1) ? ecg.up : ecg.down, !showing.Contains(1) ? ecg.up : ecg.down, 1, GumpButtonType.Reply, 0)); miscentry.AddColumn("<basefont size=5 face = 1 color= #330066> Miscellaneous</basefont>"); GumpListEntry combentry = new GumpListEntry(0, 0, l, info.W - 10, 20); combentry.AddColumn(new GumpButton(0, 0, !showing.Contains(2) ? ecg.up : ecg.down, !showing.Contains(2) ? ecg.up : ecg.down, 2, GumpButtonType.Reply, 0)); combentry.AddColumn("<basefont size=5 face = 1 color= #330066> Combat Ratings</basefont>"); GumpListEntry actientry = new GumpListEntry(0, 0, l, info.W - 10, 20); actientry.AddColumn(new GumpButton(0, 0, !showing.Contains(3) ? ecg.up : ecg.down, !showing.Contains(3) ? ecg.up : ecg.down, 3, GumpButtonType.Reply, 0)); actientry.AddColumn("<basefont size=5 face = 1 color= #330066> Actions</basefont>"); GumpListEntry loreentry = new GumpListEntry(0, 0, l, info.W - 10, 20); loreentry.AddColumn(new GumpButton(0, 0, !showing.Contains(4) ? ecg.up : ecg.down, !showing.Contains(4) ? ecg.up : ecg.down, 4, GumpButtonType.Reply, 0)); loreentry.AddColumn("<basefont size=5 face = 1 color= #330066> Lore & Knowledge</basefont>"); GumpListEntry customentry = new GumpListEntry(0, 0, l, info.W - 10, 20); customentry.AddColumn(new GumpButton(0, 0, !showing.Contains(5) ? ecg.up : ecg.down, !showing.Contains(5) ? ecg.up : ecg.down, 5, GumpButtonType.Reply, 0)); customentry.AddColumn("<basefont size=5 face = 1 color= #330066> Custom Skills</basefont>"); ButtonInfo select = skin.ButtonInfo["UseButton"]; IEnumerator ie = null; int i = 1; for ( int k = 0; k < s.Length; k++ ) { if (ParallelSkills.actisearch.Contains(s[k].Name)) actiinfos.Add(s[k]); else if (ParallelSkills.combsearch.Contains(s[k].Name)) combinfos.Add(s[k]); else if (ParallelSkills.miscsearch.Contains(s[k].Name)) miscinfos.Add(s[k]); else if (ParallelSkills.loresearch.Contains(s[k].Name)) loreinfos.Add(s[k]); else custom.Add(s[k]); } actiinfos.Sort(CompareSkillNames); combinfos.Sort(CompareSkillNames); miscinfos.Sort(CompareSkillNames); loreinfos.Sort(CompareSkillNames); custom.Sort(CompareSkillNames); l.Add(miscentry); if (showing.Contains(1)) { ie = miscinfos.GetEnumerator(); while (ie.MoveNext()) { SkillSettings.DoTell2("Misc i: " + i + " Skill: " + ((Skill)ie.Current).ToString()); addEntry(l, (Skill)ie.Current, i, 1); i++; } } else i += miscinfos.Count; l.Add( combentry ); if (showing.Contains(2)) { //i = 1; ie = combinfos.GetEnumerator(); while (ie.MoveNext()) { SkillSettings.DoTell2("Co i: " + i + " Skill: " + ((Skill)ie.Current).ToString()); addEntry(l, (Skill)ie.Current, i, 2); i++; } } else i += combinfos.Count; l.Add(actientry); if (showing.Contains(3)) { //i = 1; ie = actiinfos.GetEnumerator(); while (ie.MoveNext()) { SkillSettings.DoTell2("A i: " + i + " Skill: " + ((Skill)ie.Current).ToString()); addEntry(l, (Skill)ie.Current, i, 3); i++; } } else i += actiinfos.Count; l.Add(loreentry); if (showing.Contains(4)) { //i = 1; ie = loreinfos.GetEnumerator(); while (ie.MoveNext()) { SkillSettings.DoTell2("L i: " + i + " Skill: " + ((Skill)ie.Current).ToString()); addEntry(l, (Skill)ie.Current, i, 4); i++; } } else i += loreinfos.Count; l.Add(customentry); if (showing.Contains(5)) { //i = 1; ie = custom.GetEnumerator(); while (ie.MoveNext()) { SkillSettings.DoTell2("Cu i: " + i + " Skill: " + ((Skill)ie.Current).ToString()); addEntry(l, (Skill)ie.Current, i, 5); i++; } } l.CommitList(); }