summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-13 18:24:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-13 18:24:14 +0300
commita3b7888017c387d14e33a2021ed85927b78b776b (patch)
tree46eb14be3bb9f361d48188b886b1e98d4d32b519 /src
parentddd4c187d5b11abe9f94f0d32cda0a43fe83eba9 (diff)
downloadmv-a3b7888017c387d14e33a2021ed85927b78b776b.tar.gz
mv-a3b7888017c387d14e33a2021ed85927b78b776b.tar.bz2
mv-a3b7888017c387d14e33a2021ed85927b78b776b.tar.xz
mv-a3b7888017c387d14e33a2021ed85927b78b776b.zip
Add variable for storage window.
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/inventorywindow.cpp1
-rw-r--r--src/gui/windows/inventorywindow.h1
-rw-r--r--src/net/ea/inventoryhandler.cpp33
-rw-r--r--src/net/ea/inventoryhandler.h1
4 files changed, 18 insertions, 18 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index ea3cc5ad3..7cf268b0f 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -67,6 +67,7 @@
#include "debug.h"
InventoryWindow *inventoryWindow = nullptr;
+InventoryWindow *storageWindow = nullptr;
InventoryWindow::WindowList InventoryWindow::invInstances;
InventoryWindow::InventoryWindow(Inventory *const inventory) :
diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h
index f2952c2f5..ffa650418 100644
--- a/src/gui/windows/inventorywindow.h
+++ b/src/gui/windows/inventorywindow.h
@@ -200,5 +200,6 @@ class InventoryWindow final : public Window,
};
extern InventoryWindow *inventoryWindow;
+extern InventoryWindow *storageWindow;
#endif // GUI_WINDOWS_INVENTORYWINDOW_H
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 1f6d0e2a2..c3ddc6c0c 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -71,7 +71,6 @@ namespace Ea
EquipBackend InventoryHandler::mEquips;
InventoryItems InventoryHandler::mInventoryItems;
Inventory *InventoryHandler::mStorage = nullptr;
-InventoryWindow *InventoryHandler::mStorageWindow = nullptr;
PickupQueue InventoryHandler::mSentPickups;
bool InventoryHandler::mDebugInventory = true;
@@ -80,7 +79,7 @@ InventoryHandler::InventoryHandler()
mEquips.clear();
mInventoryItems.clear();
mStorage = nullptr;
- mStorageWindow = nullptr;
+ storageWindow = nullptr;
while (!mSentPickups.empty())
mSentPickups.pop();
mDebugInventory = true;
@@ -88,10 +87,10 @@ InventoryHandler::InventoryHandler()
InventoryHandler::~InventoryHandler()
{
- if (mStorageWindow)
+ if (storageWindow)
{
- mStorageWindow->close();
- mStorageWindow = nullptr;
+ storageWindow->close();
+ storageWindow = nullptr;
}
delete2(mStorage);
@@ -263,10 +262,10 @@ void InventoryHandler::processPlayerStorageStatus(Net::MessageIn &msg)
}
mInventoryItems.clear();
- if (!mStorageWindow)
+ if (!storageWindow)
{
- mStorageWindow = new InventoryWindow(mStorage);
- mStorageWindow->postInit();
+ storageWindow = new InventoryWindow(mStorage);
+ storageWindow->postInit();
}
BLOCK_END("InventoryHandler::processPlayerStorageStatus")
}
@@ -294,12 +293,12 @@ void InventoryHandler::processPlayerStorageClose(Net::MessageIn &msg A_UNUSED)
BLOCK_START("InventoryHandler::processPlayerStorageClose")
// Storage access has been closed
// Storage window deletes itself
- if (mStorageWindow)
+ if (storageWindow)
{
- mStorageWindow->unsetInventory();
- mStorageWindow->close();
+ storageWindow->unsetInventory();
+ storageWindow->close();
}
- mStorageWindow = nullptr;
+ storageWindow = nullptr;
if (mStorage)
mStorage->clear();
@@ -335,18 +334,18 @@ void InventoryHandler::processPlayerArrowEquip(Net::MessageIn &msg)
void InventoryHandler::closeStorage()
{
BLOCK_START("InventoryHandler::closeStorage")
- if (mStorageWindow)
+ if (storageWindow)
{
- mStorageWindow->unsetInventory();
- mStorageWindow->close();
- mStorageWindow = nullptr;
+ storageWindow->unsetInventory();
+ storageWindow->close();
+ storageWindow = nullptr;
}
BLOCK_END("InventoryHandler::closeStorage")
}
void InventoryHandler::forgotStorage()
{
- mStorageWindow = nullptr;
+ storageWindow = nullptr;
}
} // namespace Ea
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index 734e894f0..3e393a98c 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -107,7 +107,6 @@ class InventoryHandler notfinal : public Net::InventoryHandler
static EquipBackend mEquips;
static InventoryItems mInventoryItems;
static Inventory *mStorage;
- static InventoryWindow *mStorageWindow;
static PickupQueue mSentPickups;
static bool mDebugInventory;
};