summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-15 18:44:29 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-15 18:44:29 +0300
commit0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046 (patch)
tree47839023fd9bc4b24db413a462c39fea3d0911de /src/gui
parentca2f3bafe8815e5cba06426f24ef7acad6e699f4 (diff)
downloadmv-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.tar.gz
mv-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.tar.bz2
mv-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.tar.xz
mv-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.zip
Fix compilation without hercules support.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/itemamountwindow.cpp9
-rw-r--r--src/gui/windows/npcdialog.cpp20
-rw-r--r--src/gui/windows/npcdialog.h2
3 files changed, 30 insertions, 1 deletions
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index 103fb619b..5bd7da12e 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -356,6 +356,7 @@ void ItemAmountWindow::action(const ActionEvent &event)
}
else
{
+#ifdef EATHENA_SUPPORT
if (mUsage == CraftAdd)
{
finish(mItem,
@@ -364,6 +365,7 @@ void ItemAmountWindow::action(const ActionEvent &event)
mUsage);
}
else
+#endif
{
finish(mItem,
mItemAmountTextField->getValue(),
@@ -472,16 +474,23 @@ void ItemAmountWindow::showWindow(const Usage usage,
if (usage != ShopBuyAdd && usage != ShopSellAdd && maxRange <= 1)
{
+#ifdef EATHENA_SUPPORT
if (usage == CraftAdd)
finish(item, maxRange, tag, usage);
else
+#endif
finish(item, maxRange, 0, usage);
}
else
{
+#ifdef EATHENA_SUPPORT
ItemAmountWindow *const window = CREATEWIDGETR(ItemAmountWindow,
usage, parent, item, maxRange);
if (usage == CraftAdd)
window->mPrice = tag;
+#else
+ CREATEWIDGET(ItemAmountWindow,
+ usage, parent, item, maxRange);
+#endif
}
}
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 2fcb53468..862c6bfcd 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -128,8 +128,10 @@ NpcDialog::NpcDialog(const BeingId npcId) :
mButton3(new Button(this, _("Add"), "add", this)),
// TRANSLATORS: npc dialog button
mResetButton(new Button(this, _("Reset"), "reset", this)),
- mInventory(new Inventory(InventoryType::Craft, 1)),
+ mInventory(new Inventory(InventoryType::Npc, 1)),
+#ifdef EATHENA_SUPPORT
mComplexInventory(new ComplexInventory(InventoryType::Craft, 1)),
+#endif
mItemContainer(new ItemContainer(this, mInventory,
10000, ShowEmptyRows_true)),
mItemScrollArea(new ScrollArea(this, mItemContainer,
@@ -261,7 +263,9 @@ NpcDialog::~NpcDialog()
delete2(mItemLinkHandler);
delete2(mItemContainer);
delete2(mInventory);
+#ifdef EATHENA_SUPPORT
delete2(mComplexInventory);
+#endif
delete2(mItemScrollArea);
delete2(mListScrollArea);
delete2(mSkinScrollArea);
@@ -465,6 +469,7 @@ void NpcDialog::action(const ActionEvent &event)
}
case NPC_INPUT_ITEM_CRAFT:
{
+#ifdef EATHENA_SUPPORT
restoreVirtuals();
if (!PacketLimiter::limitPackets(
PacketType::PACKET_NPC_INPUT))
@@ -495,6 +500,7 @@ void NpcDialog::action(const ActionEvent &event)
// need send selected item
npcHandler->stringInput(mNpcId, str);
mInventory->clear();
+#endif
break;
}
@@ -530,7 +536,9 @@ void NpcDialog::action(const ActionEvent &event)
mInventory->clear();
break;
case NPC_INPUT_ITEM_CRAFT:
+#ifdef EATHENA_SUPPORT
mComplexInventory->clear();
+#endif
break;
case NPC_INPUT_NONE:
case NPC_INPUT_LIST:
@@ -555,7 +563,9 @@ void NpcDialog::action(const ActionEvent &event)
mInventory->clear();
break;
case NPC_INPUT_ITEM_CRAFT:
+#ifdef EATHENA_SUPPORT
mComplexInventory->clear();
+#endif
break;
case NPC_INPUT_STRING:
case NPC_INPUT_INTEGER:
@@ -601,12 +611,14 @@ void NpcDialog::action(const ActionEvent &event)
Inventory *const inventory = PlayerInfo::getInventory();
if (inventory)
{
+#ifdef EATHENA_SUPPORT
if (mInputState == NPC_INPUT_ITEM_CRAFT)
{
if (mComplexInventory->addVirtualItem(item, 0, 1))
inventory->virtualRemove(item, 1);
}
else
+#endif
{
if (mInventory->addVirtualItem(item, 0, 1))
inventory->virtualRemove(item, 1);
@@ -789,10 +801,12 @@ void NpcDialog::itemIndexRequest(const int size)
void NpcDialog::itemCraftRequest(const int size)
{
+#ifdef EATHENA_SUPPORT
mActionState = NPC_ACTION_INPUT;
mInputState = NPC_INPUT_ITEM_CRAFT;
mComplexInventory->resize(size);
buildLayout();
+#endif
}
void NpcDialog::move(const int amount)
@@ -987,9 +1001,11 @@ void NpcDialog::placeItemInputControls()
mItemContainer->setMaxColumns(10000);
}
+#ifdef EATHENA_SUPPORT
if (mInputState == NPC_INPUT_ITEM_CRAFT)
mItemContainer->setInventory(mComplexInventory);
else
+#endif
mItemContainer->setInventory(mInventory);
if (mDialogInfo && mDialogInfo->hideText)
@@ -1383,6 +1399,7 @@ void NpcDialog::addCraftItem(Item *const item,
if (!inventory)
return;
+#ifdef EATHENA_SUPPORT
if (mComplexInventory->addVirtualItem(
item,
slot,
@@ -1390,4 +1407,5 @@ void NpcDialog::addCraftItem(Item *const item,
{
inventory->virtualRemove(item, amount);
}
+#endif
}
diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h
index bc8cc284c..29f728c91 100644
--- a/src/gui/windows/npcdialog.h
+++ b/src/gui/windows/npcdialog.h
@@ -297,7 +297,9 @@ class NpcDialog final : public Window,
Button *mResetButton A_NONNULLPOINTER;
Inventory *mInventory A_NONNULLPOINTER;
+#ifdef EATHENA_SUPPORT
ComplexInventory *mComplexInventory A_NONNULLPOINTER;
+#endif
ItemContainer *mItemContainer A_NONNULLPOINTER;
ScrollArea *mItemScrollArea A_NONNULLPOINTER;