diff options
author | Forge <jgrimbert@free.fr> | 2009-01-04 20:18:25 +0100 |
---|---|---|
committer | Forge <jgrimbert@free.fr> | 2009-01-04 20:18:25 +0100 |
commit | fde40d91bceb1c7e7818d898f8731089ff87a9f4 (patch) | |
tree | 9f0f446664f2016e510da5983f548c176a330658 | |
parent | 0bfa55e0fe6e73bec360658eb8b0660178a60d55 (diff) | |
download | mana-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.
-rw-r--r-- | src/Makefile.am | 12 | ||||
-rw-r--r-- | src/game.cpp | 26 | ||||
-rw-r--r-- | src/gui/itemshortcutcontainer.h | 5 | ||||
-rw-r--r-- | src/keyboardconfig.cpp | 2 |
4 files changed, 36 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 658f3a10..382f33e0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,12 +49,20 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ gui/inttextbox.cpp \ gui/inventorywindow.cpp \ gui/inventorywindow.h \ + gui/smileywindow.cpp \ + gui/smileywindow.h \ + gui/smileycontainer.cpp \ + gui/smileycontainer.h \ gui/itemcontainer.cpp \ gui/itemcontainer.h \ gui/itemshortcutcontainer.cpp \ gui/itemshortcutcontainer.h \ - gui/itemshortcutwindow.cpp \ - gui/itemshortcutwindow.h \ + gui/shortcutwindow.cpp \ + gui/shortcutwindow.h \ + gui/smileyshortcutcontainer.cpp \ + gui/smileyshortcutcontainer.h \ + gui/shortcutcontainer.cpp \ + gui/shortcutcontainer.h \ gui/item_amount.cpp \ gui/item_amount.h \ gui/linkhandler.h \ 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; } } diff --git a/src/gui/itemshortcutcontainer.h b/src/gui/itemshortcutcontainer.h index a8daca0b..92b9b968 100644 --- a/src/gui/itemshortcutcontainer.h +++ b/src/gui/itemshortcutcontainer.h @@ -27,6 +27,7 @@ #include <guichan/widgetlistener.hpp> #include "../guichanfwd.h" +#include "shortcutcontainer.h" class Image; class Item; @@ -36,9 +37,7 @@ class Item; * * \ingroup GUI */ -class ItemShortcutContainer : public gcn::Widget, - public gcn::WidgetListener, - public gcn::MouseListener +class ItemShortcutContainer : public ShortcutContainer { public: /** diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 930d8944..0923f331 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -180,7 +180,7 @@ int KeyboardConfig::getKeySmilieOffset(int keyValue) const return 1+i-KEY_SMILEY_1; } } - return KEY_NO_VALUE; + return 0; } bool KeyboardConfig::isKeyActive(int index) |