ST33LDI9ITAL

Initiate
Alright, So it's been awhile and getting back into things after many years. Was messing with corpse names and decided to set the corpse OPL name as grey in color so easier to tell what corpses are grey on mouseover.
Code:
list.Add(1046414, String.Format("<basefont color=#642EFE>{0}</basefont>", Name)); // the remains of ~1_NAME~

However, when you do that it displays the actual html tags in the all names and cntrl shift gump.

I realize this has been talked about before and searched around...but what I want to know is, why?

Why when you set OPL name to color the same value is used for displaying item name? Is there no way to separate the opl name from the item name to avoid this? I've been trying to track it down and figure it out but would appreciate anyone shedding some light on this.
 
Code:
public override void AddNameProperty(ObjectPropertyList list)
{
   if (ItemID == 0x2006) // Corpse form
   {
      if (m_CorpseName != null)
      {
         list.Add(m_CorpseName);
      }
      else
      {
         list.Add(1046414, String.Format("<basefont color=#642EFE>{0}</basefont>", Name)); // the remains of ~1_NAME~
      }
   }
   else // Bone form
   {
      list.Add(1046414, String.Format("<basefont color=#848484>{0}</basefont>", Name)); // the remains of ~1_NAME~ // the remains of ~1_NAME~
   }
}

AddNameProperty (OPL) should be able to be separated from what's being used and displayed as the actual name shouldn't it? I realize there is the Utility.FixHTML() for stripping these tags out of strings as well..but what I'm trying to figure out is where or how AddNameProperty() is connected to and used for displaying the item names with all names or cntrl shift gump..
[doublepost=1550726551][/doublepost]I think I get it.. so, AddNameProperty() is actually changing the Name property of the item. So.... need to make a second property like NameOPL or NameFormatted or something and use that for displaying OPL Name of items since it might contain html formatting.

Now trying to figure out best way to go about it...

Any thoughts? Advice?

Should I make another utility function like FixHTML and check if Name has formatting... if so then dupe it to NameOPL and strip all formatting and return unformatted name?
 

Active Shards

Donations

Total amount
$0.00
Goal
$500.00
Back