summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-09 14:49:07 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-09 14:49:07 +0000
commitcd68076f45b1ae6332b5298f57240aa4b0ebf357 (patch)
tree1736ba4bf56cf5d9ac32a50a036b996954d651ee /src
parentaca696b5c784bfbb426c50ac58e93e3d61944b39 (diff)
downloadmana-client-cd68076f45b1ae6332b5298f57240aa4b0ebf357.tar.gz
mana-client-cd68076f45b1ae6332b5298f57240aa4b0ebf357.tar.bz2
mana-client-cd68076f45b1ae6332b5298f57240aa4b0ebf357.tar.xz
mana-client-cd68076f45b1ae6332b5298f57240aa4b0ebf357.zip
Re-enabled non-functional item shortcut window, planned to be fixed for 0.0.25
(reverted change 3811). Somehow seems it's not drawing anything, not sure why.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/Makefile.am6
-rw-r--r--src/game.cpp14
-rw-r--r--src/gui/itemcontainer.cpp12
-rw-r--r--src/gui/menuwindow.cpp12
-rw-r--r--src/main.cpp6
-rw-r--r--src/net/inventoryhandler.cpp4
7 files changed, 35 insertions, 25 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 793d135f..aff01cb1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -99,6 +99,10 @@ SET(SRCS
gui/inventorywindow.h
gui/itemcontainer.cpp
gui/itemcontainer.h
+ gui/itemshortcutcontainer.cpp
+ gui/itemshortcutcontainer.h
+ gui/itemshortcutwindow.cpp
+ gui/itemshortcutwindow.h
gui/item_amount.cpp
gui/item_amount.h
gui/linkhandler.h
@@ -290,6 +294,8 @@ SET(SRCS
inventory.h
item.cpp
item.h
+ itemshortcut.cpp
+ itemshortcut.h
joystick.cpp
joystick.h
keyboardconfig.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 329dbd78..dab89e54 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,6 +49,10 @@ tmw_SOURCES = gui/widgets/resizegrip.cpp \
gui/inventorywindow.h \
gui/itemcontainer.cpp \
gui/itemcontainer.h \
+ gui/itemshortcutcontainer.cpp \
+ gui/itemshortcutcontainer.h \
+ gui/itemshortcutwindow.cpp \
+ gui/itemshortcutwindow.h \
gui/item_amount.cpp \
gui/item_amount.h \
gui/linkhandler.h \
@@ -240,6 +244,8 @@ tmw_SOURCES = gui/widgets/resizegrip.cpp \
inventory.h \
item.cpp \
item.h \
+ itemshortcut.cpp \
+ itemshortcut.h \
joystick.cpp \
joystick.h \
keyboardconfig.cpp \
diff --git a/src/game.cpp b/src/game.cpp
index 0d8cfa6c..9eadeba0 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -36,7 +36,7 @@
#include "engine.h"
#include "flooritemmanager.h"
#include "graphics.h"
-//#include "itemshortcut.h"
+#include "itemshortcut.h"
#include "joystick.h"
#include "keyboardconfig.h"
#include "localplayer.h"
@@ -54,7 +54,7 @@
#include "gui/gui.h"
#include "gui/help.h"
#include "gui/inventorywindow.h"
-//#include "gui/itemshortcutwindow.h"
+#include "gui/itemshortcutwindow.h"
#include "gui/menuwindow.h"
#include "gui/minimap.h"
#include "gui/ministatus.h"
@@ -120,7 +120,7 @@ TradeWindow *tradeWindow;
//BuddyWindow *buddyWindow;
HelpWindow *helpWindow;
DebugWindow *debugWindow;
-//ItemShortcutWindow *itemShortcutWindow;
+ItemShortcutWindow *itemShortcutWindow;
BeingManager *beingManager = NULL;
FloorItemManager *floorItemManager = NULL;
@@ -201,7 +201,7 @@ void createGuiWindows(Network *network)
//buddyWindow = new BuddyWindow();
helpWindow = new HelpWindow();
debugWindow = new DebugWindow();
- //itemShortcutWindow = new ItemShortcutWindow();
+ itemShortcutWindow = new ItemShortcutWindow();
// Initialize window positions
//chargeDialog->setPosition(
@@ -214,7 +214,7 @@ void createGuiWindows(Network *network)
chatWindow->setVisible(true);
miniStatusWindow->setVisible(true);
menuWindow->setVisible(true);
- //itemShortcutWindow->setVisible(true);
+ itemShortcutWindow->setVisible(true);
if (config.getValue("logToChat", 0))
{
@@ -247,7 +247,7 @@ void destroyGuiWindows()
//delete buddyWindow;
delete helpWindow;
delete debugWindow;
- //delete itemShortcutWindow;
+ delete itemShortcutWindow;
}
Game::Game(Network *network):
@@ -541,7 +541,6 @@ void Game::handleInput()
{
const int tKey = keyboard.getKeyIndex(event.key.keysym.sym);
// Checks if any item shortcut is pressed.
- /*
for (int i = KeyboardConfig::KEY_SHORTCUT_0;
i <= KeyboardConfig::KEY_SHORTCUT_9;
i++)
@@ -552,7 +551,6 @@ void Game::handleInput()
break;
}
}
- */
switch (tKey) {
case KeyboardConfig::KEY_PICKUP:
{
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index c73d25f3..ad0674f4 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -29,7 +29,7 @@
#include "../graphics.h"
#include "../inventory.h"
#include "../item.h"
-//#include "../itemshortcut.h"
+#include "../itemshortcut.h"
#include "../log.h"
#include "../resources/image.h"
@@ -197,7 +197,7 @@ ItemContainer::mousePressed(gcn::MouseEvent &event)
int my = event.getY();
int index = mx / gridWidth + ((my / gridHeight) * columns) + 2;
- //itemShortcut->setItemSelected(NULL);
+ itemShortcut->setItemSelected(NULL);
// Fix for old server, it should be: if (index >= mMaxItems)
if (index > mMaxItems + 1)
{
@@ -206,9 +206,9 @@ ItemContainer::mousePressed(gcn::MouseEvent &event)
}
Item *item = mInventory->getItem(index);
setSelectedItem(item);
- //if (!item->isEquipment())
- //{
- // itemShortcut->setItemSelected(item);
- //}
+ if (!item->isEquipment())
+ {
+ itemShortcut->setItemSelected(item);
+ }
}
}
diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp
index e4d101c8..2043b7d1 100644
--- a/src/gui/menuwindow.cpp
+++ b/src/gui/menuwindow.cpp
@@ -35,7 +35,7 @@ extern Window *inventoryWindow;
extern Window *equipmentWindow;
extern Window *skillDialog;
extern Window *statusWindow;
-//extern Window *itemShortcutWindow;
+extern Window *itemShortcutWindow;
namespace {
struct MenuWindowListener : public gcn::ActionListener
@@ -62,7 +62,7 @@ MenuWindow::MenuWindow():
"Equipment",
"Inventory",
"Skills",
-// "Shortcut",
+ "Shortcut",
"Setup",
0
};
@@ -107,10 +107,10 @@ void MenuWindowListener::action(const gcn::ActionEvent &event)
{
window = skillDialog;
}
- //else if (event.getId() == "Shortcut")
- //{
- // window = itemShortcutWindow;
- //}
+ else if (event.getId() == "Shortcut")
+ {
+ window = itemShortcutWindow;
+ }
else if (event.getId() == "Setup")
{
window = setupWindow;
diff --git a/src/main.cpp b/src/main.cpp
index 4e9936e9..9e75090c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -48,7 +48,7 @@
#include "keyboardconfig.h"
#include "game.h"
#include "graphics.h"
-//#include "itemshortcut.h"
+#include "itemshortcut.h"
#include "lockedarray.h"
#include "localplayer.h"
#include "log.h"
@@ -308,7 +308,7 @@ void init_engine(const Options &options)
graphics->_beginDraw();
// Initialize the item shortcuts.
- //itemShortcut = new ItemShortcut();
+ itemShortcut = new ItemShortcut();
gui = new Gui(graphics);
state = UPDATE_STATE; /**< Initial game state */
@@ -337,7 +337,7 @@ void init_engine(const Options &options)
void exit_engine()
{
// Before config.write() since it writes the shortcuts to the config
- //delete itemShortcut;
+ delete itemShortcut;
config.write();
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp
index 9e18f23c..7ed7e38d 100644
--- a/src/net/inventoryhandler.cpp
+++ b/src/net/inventoryhandler.cpp
@@ -30,7 +30,7 @@
#include "../resources/iteminfo.h"
#include "../item.h"
-//#include "../itemshortcut.h"
+#include "../itemshortcut.h"
#include "../localplayer.h"
#include "../gui/chat.h"
@@ -80,7 +80,7 @@ void InventoryHandler::handleMessage(MessageIn *msg)
player_node->getInvItem(index)->setEquipment(true);
}
}
- //itemShortcut->load();
+ itemShortcut->load();
break;
case SMSG_PLAYER_INVENTORY_ADD: