public static void HuePicker_OnHueSelect(int Hue, Gump Sender) { if ((Sender.HasTag("Dialog") && Sender.HasTag("Item Art")) && Sender.HasTag("ItemID")) { GItemArt art; Gump tag = (Gump) Sender.GetTag("Dialog"); Gump g = (Gump) Sender.GetTag("Item Art"); Gumps.Destroy(g); art = new GItemArt(0xb7, 3, (int) Sender.GetTag("ItemID"), Hues.GetItemHue((int) Sender.GetTag("ItemID"), Hue)) { X = art.X + (((0x3a - (art.Image.xMax - art.Image.xMin)) / 2) - art.Image.xMin), Y = art.Y + (((0x52 - (art.Image.yMax - art.Image.yMin)) / 2) - art.Image.yMin) }; tag.Children.Add(art); Sender.SetTag("Item Art", art); } }
private static bool Parse_Tag(XmlTextReader xml, Gump Parent) { string name = ""; string str2 = ""; object @int = ""; bool isEmptyElement = xml.IsEmptyElement; while (xml.MoveToNextAttribute()) { switch (xml.Name) { case "Name": { name = GetString(xml.Value); continue; } case "Names": { name = xml.Value; continue; } case "Type": { str2 = GetString(xml.Value); continue; } case "Types": { str2 = xml.Value; continue; } case "Value": switch (str2) { case "String": { @int = GetString(xml.Value); continue; } case "Integer": { @int = GetInt(xml.Value); continue; } case "Boolean": { @int = GetBool(xml.Value); continue; } case "Font": { @int = GetFont(xml.Value); continue; } case "Hue": { @int = GetHue(xml.Value); continue; } case "Gump": { @int = GetGump(xml.Value); continue; } } return false; } return false; } if (!isEmptyElement) { Skip(xml); } Parent.SetTag(name, @int); return true; }