private string ReadProperties(uint serial, out string htmltext) { bool hasStartColor = false; string result = null; htmltext = string.Empty; if (SerialHelper.IsValid(serial) && World.OPL.TryGetNameAndData(serial, out string name, out string data)) { ValueStringBuilder sbHTML = new ValueStringBuilder(); { ValueStringBuilder sb = new ValueStringBuilder(); { if (!string.IsNullOrEmpty(name)) { if (SerialHelper.IsItem(serial)) { sbHTML.Append("<basefont color=\"yellow\">"); hasStartColor = true; } else { Mobile mob = World.Mobiles.Get(serial); if (mob != null) { sbHTML.Append(Notoriety.GetHTMLHue(mob.NotorietyFlag)); hasStartColor = true; } } sb.Append(name); sbHTML.Append(name); if (hasStartColor) { sbHTML.Append("<basefont color=\"#FFFFFFFF\">"); } } if (!string.IsNullOrEmpty(data)) { sb.Append('\n'); sb.Append(data); sbHTML.Append('\n'); sbHTML.Append(data); } htmltext = sbHTML.ToString(); result = sb.ToString(); sb.Dispose(); sbHTML.Dispose(); } } } return(string.IsNullOrEmpty(result) ? null : result); }
private string ReadProperties(Entity obj, out string htmltext) { _sb.Clear(); _sbHTML.Clear(); bool hasStartColor = false; for (int i = 0; i < obj.Properties.Count; i++) { Property property = obj.Properties[i]; if (property.Cliloc <= 0) { continue; } if (i == 0 /*&& !string.IsNullOrEmpty(obj.Name)*/) { if (obj.Serial.IsMobile) { Mobile mobile = (Mobile)obj; //ushort hue = Notoriety.GetHue(mobile.NotorietyFlag); _sbHTML.Append(Notoriety.GetHTMLHue(mobile.NotorietyFlag)); } else { _sbHTML.Append("<basefont color=\"yellow\">"); } hasStartColor = true; } string text = FormatTitle(FileManager.Cliloc.Translate((int)property.Cliloc, property.Args, true)); if (string.IsNullOrEmpty(text)) { continue; } _sb.Append(text); _sbHTML.Append(text); if (hasStartColor) { _sbHTML.Append("<basefont color=\"#FFFFFFFF\">"); hasStartColor = false; } if (i < obj.Properties.Count - 1) { _sb.Append("\n"); _sbHTML.Append("\n"); } } htmltext = _sbHTML.ToString(); string result = _sb.ToString(); return(string.IsNullOrEmpty(result) ? null : result); }
private string ReadProperties(uint serial, out string htmltext) { _sb.Clear(); _sbHTML.Clear(); bool hasStartColor = false; if (SerialHelper.IsValid(serial) && World.OPL.TryGetNameAndData(serial, out string name, out string data)) { if (!string.IsNullOrEmpty(name)) { if (SerialHelper.IsItem(serial)) { _sbHTML.Append("<basefont color=\"yellow\">"); hasStartColor = true; } else { Mobile mob = World.Mobiles.Get(serial); if (mob != null) { _sbHTML.Append(Notoriety.GetHTMLHue(mob.NotorietyFlag)); hasStartColor = true; } } _sb.Append(name); _sbHTML.Append(name); if (hasStartColor) { _sbHTML.Append("<basefont color=\"#FFFFFFFF\">"); } } if (!string.IsNullOrEmpty(data)) { string s = $"\n{data}"; _sb.Append(s); _sbHTML.Append(s); } } htmltext = _sbHTML.ToString(); string result = _sb.ToString(); return(string.IsNullOrEmpty(result) ? null : result); }
private string ReadProperties(Entity obj, out string htmltext) { _sb.Clear(); _sbHTML.Clear(); bool hasStartColor = false; if (obj != null && World.OPL.TryGetNameAndData(obj, out string name, out string data)) { if (!string.IsNullOrEmpty(name)) { if (obj is Item) { _sbHTML.Append("<basefont color=\"yellow\">"); hasStartColor = true; } else if (obj is Mobile mob) { _sbHTML.Append(Notoriety.GetHTMLHue(mob.NotorietyFlag)); hasStartColor = true; } _sb.Append(name); _sbHTML.Append(name); if (hasStartColor) { _sbHTML.Append("<basefont color=\"#FFFFFFFF\">"); } } if (!string.IsNullOrEmpty(data)) { string s = $"\n{data}"; _sb.Append(s); _sbHTML.Append(s); } } //for (int i = 0; i < obj.Properties.Count; i++) //{ // Property property = obj.Properties[i]; // if (property.Cliloc <= 0) // continue; // if (i == 0 /*&& !string.IsNullOrEmpty(obj.Name)*/) // { // if (obj is Mobile mobile) // { // //ushort hue = Notoriety.GetHue(mobile.NotorietyFlag); // _sbHTML.Append(Notoriety.GetHTMLHue(mobile.NotorietyFlag)); // } // else // _sbHTML.Append("<basefont color=\"yellow\">"); // hasStartColor = true; // } // string text = FormatTitle(FileManager.Cliloc.Translate((int) property.Cliloc, property.Args, true)); // if (string.IsNullOrEmpty(text)) continue; // _sb.Append(text); // _sbHTML.Append(text); // if (hasStartColor) // { // _sbHTML.Append("<basefont color=\"#FFFFFFFF\">"); // hasStartColor = false; // } // if (i < obj.Properties.Count - 1) // { // _sb.Append("\n"); // _sbHTML.Append("\n"); // } //} htmltext = _sbHTML.ToString(); string result = _sb.ToString(); return(string.IsNullOrEmpty(result) ? null : result); }