You can sort the items by those names in Ascending or Descending, I did some (C&P)changes, but I did not test yet, so I do not know it works or not. shop_manager.cpp
New function for sorting:
bool CompareShopItemPos(const SShopItemTable& lhs, const SShopItemTable& rhs)
{
return (lhs.display_pos < rhs.display_pos);
}
Extended sorting statement:
std::string stSort;
if (!pNode->GetValue("sort", 0, stSort))
{
stSort = "None";
}
if (boost::iequals(stSort, "Asc"))
{
std::sort(shopItems.begin(), shopItems.end(), CompareShopItemName);
}
else if(boost::iequals(stSort, "Desc"))
{
std::sort(shopItems.rbegin(), shopItems.rend(), CompareShopItemName);
}
else if (boost::iequals(stSort, "Pos"))
{
std::sort(shopItems.begin(), shopItems.end(), CompareShopItemPos);
}
Group B02
{
Vnum 51
Name Costumes
CoinType SecondaryCoin
Sort Pos
Group Items
{
#--# Vnum Count Price
1 41003 1 50
2 41004 1 50
3 45003 1 30
4 45004 1 30
}
}