Quote:
Originally Posted by DasSchwarzeT
Mit nem Eintrag
(absteigen)
und
(aufsteigend)
lassen sich die Items übrigens nach dem Itemnamen sortieren.
|
Näää...Dann doch lieber nach Vnum oder ->
Such nach & Kommentiert es aus.
Code =
PHP Code:
bool CompareShopItemName(const SShopItemTable& lhs, const SShopItemTable& rhs)
Bild =
Jetzt fügt ihr darunter folgendes ein.
Code =
PHP Code:
bool CompareShopItemPos(const SShopItemTable& lhs, const SShopItemTable& rhs)
{
return (lhs.vnum < rhs.vnum);
}
Bild =
Als nächstes sucht ihr nach und Kommentiert es aus
Code =
PHP Code:
if (boost::iequals(stSort, "Asc"))
bzw könnt auch
PHP Code:
CompareShopItemName
Bild =
Zu Schluss fügt ihr folgendes darunter ein
Code =
PHP Code:
if (boost::iequals(stSort, "Pos"))
{
std::sort(shopItems.begin(), shopItems.end(), CompareShopItemPos);
}
Bild =
Die shop_table_ex Erweiterung sieht dann so aus ->
Bild =
Sprich bei dem Punkt wo Sort steht fügt ihr halt dahinter die Entsprechen Option ein.
Bei mir ist es in diesem fall "Pos" um die neue Funktion aufzurufen die wir gerade eingefügt haben.
Gut und Ja... man müsse die anderen Optionen nicht aus Kommentieren.. Wer es mag soll es tun :P
Für die ID Sort Funktion müsst ihr selber nachdenken =)
Gruß, Nyor