summaryrefslogtreecommitdiff
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
parentca2f3bafe8815e5cba06426f24ef7acad6e699f4 (diff)
downloadplus-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.tar.gz
plus-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.tar.bz2
plus-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.tar.xz
plus-0e7b238a3794a9d2bb8dbf66adfe65bf6f1f4046.zip
Fix compilation without hercules support.
-rw-r--r--src/Makefile.am4
-rw-r--r--src/dragdrop.h4
-rw-r--r--src/gui/windows/itemamountwindow.cpp9
-rw-r--r--src/gui/windows/npcdialog.cpp20
-rw-r--r--src/gui/windows/npcdialog.h2
-rw-r--r--src/utils/gettexthelper.cpp4
6 files changed, 36 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 13aa6eb44..2a96c66bd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -717,8 +717,6 @@ manaplus_SOURCES += main.cpp \
client.h \
resources/sprite/imagesprite.cpp \
resources/sprite/imagesprite.h \
- resources/inventory/complexinventory.cpp \
- resources/inventory/complexinventory.h \
resources/inventory/inventory.cpp \
resources/inventory/inventory.h \
textcommand.cpp \
@@ -1494,6 +1492,8 @@ manaplus_SOURCES += gui/windows/bankwindow.cpp \
listeners/vendingmodelistener.h \
listeners/vendingslotslistener.cpp \
listeners/vendingslotslistener.h \
+ resources/inventory/complexinventory.cpp \
+ resources/inventory/complexinventory.h \
net/auctionhandler.h \
net/bankhandler.h \
net/battlegroundhandler.h \
diff --git a/src/dragdrop.h b/src/dragdrop.h
index 557e15d81..71656ba2f 100644
--- a/src/dragdrop.h
+++ b/src/dragdrop.h
@@ -236,12 +236,12 @@ class DragDrop final
|| mSource == DragDropSource::Storage
#ifdef EATHENA_SUPPORT
|| mSource == DragDropSource::Cart
+ || mSource == DragDropSource::Craft
#endif
|| mSource == DragDropSource::Trade
|| mSource == DragDropSource::Outfit
|| mSource == DragDropSource::Ground
- || mSource == DragDropSource::Drop
- || mSource == DragDropSource::Craft;
+ || mSource == DragDropSource::Drop;
}
private:
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;
diff --git a/src/utils/gettexthelper.cpp b/src/utils/gettexthelper.cpp
index 3d70ae3dd..2de5589dc 100644
--- a/src/utils/gettexthelper.cpp
+++ b/src/utils/gettexthelper.cpp
@@ -47,6 +47,7 @@ extern "C" char const *_nl_locale_name_default(void);
#include "debug.h"
+#if defined(ENABLE_NLS) || defined(ENABLE_CUSTOMNLS)
static std::string setLangEnv()
{
std::string lang = config.getStringValue("lang");
@@ -63,7 +64,6 @@ static std::string setLangEnv()
}
#endif // defined(ENABLE_NLS) && defined(WIN32)
-#if defined(ENABLE_NLS) || defined(ENABLE_CUSTOMNLS)
if (!lang.empty())
{
#ifdef WIN32
@@ -79,10 +79,10 @@ static std::string setLangEnv()
#endif // WIN32
}
-#endif // defined(ENABLE_NLS) || defined(ENABLE_CUSTOMNLS)
return lang;
}
+#endif // defined(ENABLE_NLS) || defined(ENABLE_CUSTOMNLS)
void GettextHelper::initLang()
{