Item Link

Updated the item link to not include the count in the link but to keep it outside.

Thank you @kjack9 for this great improvement!

I'm sorry I renamed the itemLink variable but my OCD forced me to when I merged it with name.
This commit is contained in:
Revision
2023-05-18 14:42:35 +02:00
parent 26490adbab
commit 46d5f1eb43

View File

@@ -23,11 +23,11 @@ private:
std::string name;
if (count > 1)
{
name = Acore::StringFormat("[%s]x%i", item->GetTemplate()->Name1, count);
name = Acore::StringFormat("|cff9d9d9d|Hitem:%i::::::::80:::::|h[%s]|h|rx%i", item->GetTemplate()->ItemId, item->GetTemplate()->Name1, count);
}
else
{
name = Acore::StringFormat("[%s]", item->GetTemplate()->Name1);
name = Acore::StringFormat("|cff9d9d9d|Hitem:%i::::::::80:::::|h[%s]|h|r", item->GetTemplate()->ItemId, item->GetTemplate()->Name1);
}
uint32 money = item->GetTemplate()->SellPrice * count;
@@ -35,41 +35,39 @@ private:
uint32 silver = (money % GOLD) / SILVER;
uint32 copper = (money % GOLD) % SILVER;
std::string itemLink = Acore::StringFormat("|cff9d9d9d|Hitem:%i::::::::80:::::|h%s|h|r", item->GetTemplate()->ItemId, name);
std::string info;
if (money < SILVER)
{
info = Acore::StringFormat("%s sold for %i copper.", itemLink, copper);
info = Acore::StringFormat("%s sold for %i copper.", name, copper);
}
else if (money < GOLD)
{
if (copper > 0)
{
info = Acore::StringFormat("%s sold for %i silver and %i copper.", itemLink, silver, copper);
info = Acore::StringFormat("%s sold for %i silver and %i copper.", name, silver, copper);
}
else
{
info = Acore::StringFormat("%s sold for %i silver.", itemLink, silver);
info = Acore::StringFormat("%s sold for %i silver.", name, silver);
}
}
else
{
if (copper > 0 && silver > 0)
{
info = Acore::StringFormat("%s sold for %i gold, %i silver and %i copper.", itemLink, gold, silver, copper);
info = Acore::StringFormat("%s sold for %i gold, %i silver and %i copper.", name, gold, silver, copper);
}
else if (copper > 0)
{
info = Acore::StringFormat("%s sold for %i gold and %i copper.", itemLink, gold, copper);
info = Acore::StringFormat("%s sold for %i gold and %i copper.", name, gold, copper);
}
else if (silver > 0)
{
info = Acore::StringFormat("%s sold for %i gold and %i silver.", itemLink, gold, silver);
info = Acore::StringFormat("%s sold for %i gold and %i silver.", name, gold, silver);
}
else
{
info = Acore::StringFormat("%s sold for %i gold.", itemLink, gold);
info = Acore::StringFormat("%s sold for %i gold.", name, gold);
}
}