diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-22 19:48:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-22 19:48:04 +0300 |
commit | de4548a50ecb4d4700c9899044f50070f7d9a95a (patch) | |
tree | d54bc1bdf010b2a08cdf067fcaf64d92d42685b1 /src/net/eathena/pethandler.cpp | |
parent | bf3c7384ad1b1fce8beac97f8715eb054158f72e (diff) | |
download | plus-de4548a50ecb4d4700c9899044f50070f7d9a95a.tar.gz plus-de4548a50ecb4d4700c9899044f50070f7d9a95a.tar.bz2 plus-de4548a50ecb4d4700c9899044f50070f7d9a95a.tar.xz plus-de4548a50ecb4d4700c9899044f50070f7d9a95a.zip |
Add egg selection dialog.
Diffstat (limited to 'src/net/eathena/pethandler.cpp')
-rw-r--r-- | src/net/eathena/pethandler.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index bb513b6ac..9b2f3b22b 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -20,13 +20,20 @@ #include "net/eathena/pethandler.h" +#include "inventory.h" #include "notifymanager.h" +#include "being/playerinfo.h" + #include "gui/chatconsts.h" +#include "gui/windows/eggselectiondialog.h" + #include "net/chathandler.h" #include "net/net.h" +#include "net/ea/eaprotocol.h" + #include "net/eathena/menu.h" #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -149,9 +156,18 @@ void PetHandler::processEggsList(Net::MessageIn &msg) { const int count = (msg.readInt16("len") - 4) / 2; menu = MenuType::Eggs; + + SellDialog *const dialog = new EggSelectionDialog; + dialog->postInit(); + Inventory *const inv = PlayerInfo::getInventory(); + for (int f = 0; f < count; f ++) { - msg.readInt16("egg index"); + const int index = msg.readInt16("index") - INVENTORY_OFFSET; + const Item *const item = inv->getItem(index); + + if (item) + dialog->addItem(item, 0); } } |