summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorForge <jgrimbert@free.fr>2009-01-04 20:18:25 +0100
committerForge <jgrimbert@free.fr>2009-01-04 20:18:25 +0100
commitfde40d91bceb1c7e7818d898f8731089ff87a9f4 (patch)
tree9f0f446664f2016e510da5983f548c176a330658 /src/game.cpp
parent0bfa55e0fe6e73bec360658eb8b0660178a60d55 (diff)
downloadmana-fde40d91bceb1c7e7818d898f8731089ff87a9f4.tar.gz
mana-fde40d91bceb1c7e7818d898f8731089ff87a9f4.tar.bz2
mana-fde40d91bceb1c7e7818d898f8731089ff87a9f4.tar.xz
mana-fde40d91bceb1c7e7818d898f8731089ff87a9f4.zip
Smiley step 1.91, the little part to make it work
TODO list of 1.9 still intact.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index f886f859..666820f5 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -53,7 +53,11 @@
#include "gui/gui.h"
#include "gui/help.h"
#include "gui/inventorywindow.h"
-#include "gui/itemshortcutwindow.h"
+#include "gui/smileywindow.h"
+#include "gui/shortcutwindow.h"
+#include "gui/shortcutcontainer.h"
+#include "gui/itemshortcutcontainer.h"
+#include "gui/smileyshortcutcontainer.h"
#include "gui/menuwindow.h"
#include "gui/minimap.h"
#include "gui/ministatus.h"
@@ -112,6 +116,7 @@ BuyDialog *buyDialog;
SellDialog *sellDialog;
BuySellDialog *buySellDialog;
InventoryWindow *inventoryWindow;
+SmileyWindow *smileyWindow;
NpcListDialog *npcListDialog;
NpcTextDialog *npcTextDialog;
SkillDialog *skillDialog;
@@ -122,7 +127,8 @@ TradeWindow *tradeWindow;
//BuddyWindow *buddyWindow;
HelpWindow *helpWindow;
DebugWindow *debugWindow;
-ItemShortcutWindow *itemShortcutWindow;
+ShortcutWindow *itemShortcutWindow;
+ShortcutWindow *smileyShortcutWindow;
BeingManager *beingManager = NULL;
FloorItemManager *floorItemManager = NULL;
@@ -195,6 +201,7 @@ void createGuiWindows(Network *network)
sellDialog = new SellDialog(network);
buySellDialog = new BuySellDialog();
inventoryWindow = new InventoryWindow();
+ smileyWindow = new SmileyWindow();
npcTextDialog = new NpcTextDialog();
npcListDialog = new NpcListDialog();
skillDialog = new SkillDialog();
@@ -205,7 +212,8 @@ void createGuiWindows(Network *network)
//buddyWindow = new BuddyWindow();
helpWindow = new HelpWindow();
debugWindow = new DebugWindow();
- itemShortcutWindow = new ItemShortcutWindow();
+ itemShortcutWindow = new ShortcutWindow("ItemShortcut",new ItemShortcutContainer);
+ smileyShortcutWindow = new ShortcutWindow("SmileyShortcut",new SmileyShortcutContainer);
// Initialize window positions
//buddyWindow->setPosition(10, minimap->getHeight() + 30);
@@ -224,6 +232,8 @@ void createGuiWindows(Network *network)
menuWindow->getWindowName() + "Visible", true));
itemShortcutWindow->setVisible((bool) config.getValue(
itemShortcutWindow->getWindowName() + "Visible", true));
+ smileyShortcutWindow->setVisible((bool) config.getValue(
+ smileyShortcutWindow->getWindowName() + "Visible", true));
if (config.getValue("logToChat", 0))
{
@@ -244,6 +254,7 @@ void destroyGuiWindows()
delete sellDialog;
delete buySellDialog;
delete inventoryWindow;
+ delete smileyWindow;
delete npcListDialog;
delete npcTextDialog;
delete skillDialog;
@@ -255,6 +266,7 @@ void destroyGuiWindows()
delete helpWindow;
delete debugWindow;
delete itemShortcutWindow;
+ delete smileyShortcutWindow;
}
Game::Game(Network *network):
@@ -553,6 +565,7 @@ void Game::handleInput()
{
player_node->emote(emotion);
used = true;
+ return;
}
}
switch (event.key.keysym.sym)
@@ -706,6 +719,7 @@ void Game::handleInput()
{
statusWindow->setVisible(false);
inventoryWindow->setVisible(false);
+ smileyWindow->setVisible(false);
skillDialog->setVisible(false);
setupWindow->setVisible(false);
equipmentWindow->setVisible(false);
@@ -741,6 +755,12 @@ void Game::handleInput()
case KeyboardConfig::KEY_WINDOW_DEBUG:
requestedWindow = debugWindow;
break;
+ case KeyboardConfig::KEY_WINDOW_ALLSMILEY:
+ requestedWindow = smileyWindow;
+ break;
+ case KeyboardConfig::KEY_WINDOW_SMILEY_SHORTCUT:
+ requestedWindow = smileyShortcutWindow;
+ break;
}
}