public void AddTooltip(string title, string text, Color titleColor, Color textColor) { title = title ?? String.Empty; text = text ?? String.Empty; if (titleColor.IsEmpty || titleColor == Color.Transparent) { titleColor = Color.Yellow; } if (textColor.IsEmpty || textColor == Color.Transparent) { textColor = Color.White; } Spoof spoof; if (!_TextTooltips.TryGetValue(text, out spoof) || spoof == null || spoof.Deleted) { spoof = Spoof.Acquire(); } if (!String.IsNullOrWhiteSpace(title)) { spoof.Text = String.Concat(title.WrapUOHtmlColor(titleColor, false), '\n', text.WrapUOHtmlColor(textColor, false)); } else { spoof.Text = text.WrapUOHtmlColor(textColor, false); } AddProperties(spoof); }
public static Spoof Acquire() { if (_SpoofPool.Count == 0) { return new Spoof(); } else { Spoof spoof = _SpoofPool[0]; _SpoofPool.Remove(spoof); return spoof; } }
private void AddProperties(Spoof spoof) { if (spoof == null || spoof.Deleted) { return; } if (User.IsOnline() && GetEntries <GumpOPL>().All(o => o.Serial != spoof.Serial.Value)) { User.Send(spoof.PropertyList); } AddProperties(spoof.Serial); }
public void AddTooltip(int[] clilocs, string[] args) { Dictionary<int, string> dictionary = new Dictionary<int, string>(); int emptyIndex = 0; for (int i = 0; i < clilocs.Length; i++) { string str = String.Empty; if (i < args.Length) { str = args[i] ?? String.Empty; } int cliloc = clilocs[i]; if (cliloc <= 0) { if (emptyIndex <= Spoof.EmptyClilocs.Length) { cliloc = Spoof.EmptyClilocs[emptyIndex]; emptyIndex++; } } if (cliloc > 0) { dictionary[cliloc] = str; } } Spoof spoof; if (!_ClilocTooltips.TryGetValue(dictionary, out spoof) || spoof == null || spoof.Deleted) { spoof = Spoof.Acquire(); } spoof.ClilocTable = dictionary; _ClilocTooltips[dictionary] = spoof; AddProperties(spoof); }
public void AddTooltip(string title, string text, System.Drawing.Color titleColor, System.Drawing.Color textColor) { title = title ?? String.Empty; text = text ?? String.Empty; if (titleColor.IsEmpty || titleColor == System.Drawing.Color.Transparent) { titleColor = System.Drawing.Color.White; } if (textColor.IsEmpty || textColor == System.Drawing.Color.Transparent) { textColor = System.Drawing.Color.White; } Spoof spoof; if (!_TextTooltips.TryGetValue(text, out spoof) || spoof == null || spoof.Deleted) { spoof = Spoof.Acquire(); } if (!String.IsNullOrWhiteSpace(title)) { spoof.Text = String.Concat(String.Format("<basefont color=#{0:X}>{1}", titleColor.ToArgb(), title), '\n', String.Format("<basefont color=#{0:X}>{1}", textColor.ToArgb(), text)); } else { spoof.Text = String.Format("<basefont color=#{0:X}>{1}", textColor.ToArgb(), text); // text.WrapUOHtmlColor(textColor, false); } _TextTooltips[text] = spoof; AddProperties(spoof); }
public void AddProperties(Spoof spoof) { User.Send(spoof.PropertyList); base.AddItemProperty(spoof.Serial.Value); }
public static void Free(ref Spoof spoof) { _Pool.Free(ref spoof); }
public static void Free(Spoof spoof) { _Pool.Free(spoof); }