|
You last visited: Today at 11:59
Advertisement
[MINI] Button for sort of Inventory
Discussion on [MINI] Button for sort of Inventory within the Metin2 PServer Designs, Websites & Scripts forum part of the Metin2 Private Server category.
05/25/2017, 00:13
|
#1
|
elite*gold: 50
Join Date: May 2011
Posts: 269
Received Thanks: 990
|
[MINI] Button for sort of Inventory
Hello,
I saw a new custome "system" by name Sort, which is resorting the whole inventory, and I made a little button for it from the standard metin2 interface files. I think I saw this on Rubinum and Shiro3 with an ugly icon
I think no need to explain how to implement it.
|
|
|
05/25/2017, 06:16
|
#2
|
elite*gold: 0
Join Date: Jun 2013
Posts: 196
Received Thanks: 50
|
nice
you can make the code? the part which is sorting your inventory with /sort_inventory command
|
|
|
05/25/2017, 12:05
|
#3
|
elite*gold: 105
Join Date: Jun 2015
Posts: 453
Received Thanks: 294
|
Nice work dude...
|
|
|
05/25/2017, 12:55
|
#4
|
elite*gold: 0
Join Date: Dec 2014
Posts: 1,015
Received Thanks: 498
|
Nettes release, wird der Source Part nicht releast?
|
|
|
05/26/2017, 23:40
|
#5
|
elite*gold: 50
Join Date: May 2011
Posts: 269
Received Thanks: 990
|
The sorting function is on my TODO list only, I didn't start to code yet.
|
|
|
05/28/2017, 12:01
|
#6
|
elite*gold: 0
Join Date: Dec 2014
Posts: 1,015
Received Thanks: 498
|
Quote:
Originally Posted by xP3NG3Rx
The sorting function is on my TODO list only, I didn't start to code yet.
|
'd be amazing if you code & release it.
|
|
|
05/31/2017, 08:41
|
#7
|
elite*gold: 0
Join Date: Jun 2013
Posts: 196
Received Thanks: 50
|
You can coding the sorting function are you sure?
|
|
|
06/04/2017, 01:37
|
#8
|
elite*gold: 0
Join Date: Jul 2009
Posts: 2,471
Received Thanks: 5,622
|
Code:
ACMD(do_sort_inventory)
{
std::vector<CItem*> collectItems;
std::vector<WORD> oldCells;
int totalSize = 0;
for (auto i = 0; i < INVENTORY_MAX_COUNT; ++i) {
auto item = ch->GetInventoryItem(i);
if (item) {
totalSize += item->GetSize();
oldCells.push_back(item->GetCell());
collectItems.push_back(item);
}
}
if (totalSize - 3 >= INVENTORY_MAX_COUNT) {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("INVENTORY_FULL_CANNOT_SORT"));
return;
}
for (auto& item : collectItems) {
item->RemoveFromCharacter();
}
std::sort(collectItems.begin(), collectItems.end(),
[]( CItem* a, CItem* b) {
return a->GetVnum() < b->GetVnum();
});
for (auto& sortedItem : collectItems) {
auto cell = ch->GetEmptyInventory(sortedItem->GetSize());
sortedItem->AddToCharacter(ch, TItemPos(INVENTORY, cell), false);
}
}
Not the best but should work, could not work possibly im pretty drunk right now
|
|
|
06/04/2017, 02:41
|
#9
|
elite*gold: 399
Join Date: Sep 2011
Posts: 5,323
Received Thanks: 3,938
|
Quote:
Originally Posted by .Alpha.
im pretty drunk right now
|
+1
|
|
|
06/07/2017, 02:04
|
#10
|
elite*gold: 0
Join Date: Jun 2012
Posts: 58
Received Thanks: 14
|
Quote:
Originally Posted by .Alpha.
Code:
ACMD(do_sort_inventory)
{
std::vector<CItem*> collectItems;
std::vector<WORD> oldCells;
int totalSize = 0;
for (auto i = 0; i < INVENTORY_MAX_COUNT; ++i) {
auto item = ch->GetInventoryItem(i);
if (item) {
totalSize += item->GetSize();
oldCells.push_back(item->GetCell());
collectItems.push_back(item);
}
}
if (totalSize - 3 >= INVENTORY_MAX_COUNT) {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("INVENTORY_FULL_CANNOT_SORT"));
return;
}
for (auto& item : collectItems) {
item->RemoveFromCharacter();
}
std::sort(collectItems.begin(), collectItems.end(),
[]( CItem* a, CItem* b) {
return a->GetVnum() < b->GetVnum();
});
for (auto& sortedItem : collectItems) {
auto cell = ch->GetEmptyInventory(sortedItem->GetSize());
sortedItem->AddToCharacter(ch, TItemPos(INVENTORY, cell), false);
}
}
Not the best but should work, could not work possibly im pretty drunk right now
|
Works pretty well. Thanks. And thanks to penger too.
|
|
|
06/08/2017, 19:56
|
#11
|
elite*gold: 0
Join Date: Jun 2013
Posts: 196
Received Thanks: 50
|
can you do also a autostack function?
|
|
|
03/02/2024, 16:46
|
#12
|
elite*gold: 0
Join Date: Sep 2023
Posts: 1
Received Thanks: 0
|
Hi, could anyone help me implement this function within my metin please?
|
|
|
|
Similar Threads
|
Moving event weapon through storage w/o sort button
08/31/2014 - 9Dragons - 33 Replies
In the last update GC disabled the Sort button so moving the event weapon through storage using the Sort button doesn't work any more. I saw some people that moved the event weapons using another method. They said they have another more complicated method, does anyone know that method?
|
Can you move untradeble items on Gc 9d without Sort button anymore?
08/27/2014 - 9Dragons - 7 Replies
Hey guys i ws wondering if some1 found another method to move untradeble items in storage , after 9dragons GC updated the game and removed the Sort Button . Thanks.
|
[B] Push Button [S] 10 e*gold/Button; 25 e*g/psd+Button
09/20/2013 - elite*gold Trading - 4 Replies
Moin,
Hier könnt ihr folgenden Push Button kaufen:
http://i.epvpimg.com/YlrYe.jpg
Pro Button wären das 10e*g, pro Button mit .psd dazu 25e*g.
Wenn ihr einen Button kaufen wollt, schreibt mir eine PN, damit ich den Namen ändern kann, alles hochladen kann und euch dann per Treasure schicken kann. ;)
Schrift kann auch geändert werden. Dazu einfach in der PN schreiben, welche Schrift ihr haben wollt^^
|
All times are GMT +1. The time now is 11:59.
|
|