From 46d5f1eb437594a1e0fe9e9d6d196d35b1319ef6 Mon Sep 17 00:00:00 2001 From: Revision Date: Thu, 18 May 2023 14:42:35 +0200 Subject: [PATCH] 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. --- src/mod_junk_to_gold.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/mod_junk_to_gold.cpp b/src/mod_junk_to_gold.cpp index 8bd5fbe..b369a68 100644 --- a/src/mod_junk_to_gold.cpp +++ b/src/mod_junk_to_gold.cpp @@ -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); } }