From 0bfa55e0fe6e73bec360658eb8b0660178a60d55 Mon Sep 17 00:00:00 2001 From: Forge Date: Sun, 4 Jan 2009 20:07:14 +0100 Subject: Smiley track: step 1.9 The window listing the smiley is ok (F11). The window for shortcut of smiley is in progress (F12) So far, you can use any available smiley directly (mouse interface) and can get a reminder of the keybinding in the shortcut window. Yet to be done (for final step 2.0): * Transform the keybinding into the actual mapping of the shortcut seen in F12 * Drag & Drop from F11 to F12 windows and from F12 to F12 * Code factorisation for class ShortcutContainer and derivatives Item & Smiley (so far, most code is shared, but actually in 3 places, should keep only specific code in leaf-class, and main code in parent) Revision of copyright message (so far, only a cut-paste of inspiring previous files) * Save shortcut-smiley mapping on exit (and reload on start) (with protection against changing smiley-list) --- src/gui/shortcutcontainer.h | 115 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/gui/shortcutcontainer.h (limited to 'src/gui/shortcutcontainer.h') diff --git a/src/gui/shortcutcontainer.h b/src/gui/shortcutcontainer.h new file mode 100644 index 00000000..5ca56899 --- /dev/null +++ b/src/gui/shortcutcontainer.h @@ -0,0 +1,115 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _TMW_SHORTCUTCONTAINER_H__ +#define _TMW_SHORTCUTCONTAINER_H__ + +#include +#include +#include + +#include "../guichanfwd.h" + +class Image; +class Item; + +/** + * An item shortcut container. Used to quickly use items. + * + * \ingroup GUI + */ +class ShortcutContainer : public gcn::Widget, + public gcn::WidgetListener, + public gcn::MouseListener +{ + public: + /** + * Constructor. Initializes the graphic. + */ + ShortcutContainer(); + + /** + * Destructor. + */ + virtual ~ShortcutContainer(); + + /** + * Handles the logic of the ItemContainer + */ + virtual void logic(); + + /** + * Draws the items. + */ + virtual void draw(gcn::Graphics *graphics); + + /** + * Invoked when a widget changes its size. This is used to determine + * the new height of the container. + */ + virtual void widgetResized(const gcn::Event &event); + + /** + * Handles mouse when dragged. + */ + virtual void mouseDragged(gcn::MouseEvent &event); + + /** + * Handles mouse when pressed. + */ + virtual void mousePressed(gcn::MouseEvent &event); + + /** + * Handles mouse release. + */ + virtual void mouseReleased(gcn::MouseEvent &event); + + virtual int getMaxItems() + { return mMaxItems; } + + virtual int getBoxWidth() + { return mBoxWidth; } + + virtual int getBoxHeight() + { return mBoxHeight; } + + protected: + /** + * Gets the index from the grid provided the point is in an item box. + * + * @param pointX X coordinate of the point. + * @param pointY Y coordinate of the point. + * @return index on success, -1 on failure. + */ + int getIndexFromGrid(int pointX, int pointY) const; + + Image *mBackgroundImg; + + int mMaxItems; + int mBoxWidth; + int mBoxHeight; + int mCursorPosX, mCursorPosY; + int mGridWidth, mGridHeight; + bool mItemClicked; + Item *mItemMoved; +}; + +#endif -- cgit v1.2.3-70-g09d2 From 611210b1e0fd9cbaed38b229462e109d8f4be385 Mon Sep 17 00:00:00 2001 From: Forge Date: Fri, 9 Jan 2009 00:03:53 +0100 Subject: Now, the real stage 2.0 of smiley window. All is done, and all files are now in the tree. (ok, copyright of new files is still opened... do as you want, if you care) Signed-off-by: Forge --- src/Makefile.am | 2 + src/game.cpp | 10 +- src/gui/itemshortcutcontainer.cpp | 36 +------ src/gui/itemshortcutcontainer.h | 31 ------ src/gui/shortcutcontainer.cpp | 165 +----------------------------- src/gui/shortcutcontainer.h | 17 +--- src/gui/smileycontainer.cpp | 9 +- src/gui/smileyshortcutcontainer.cpp | 195 ++++++++++++------------------------ src/gui/smileyshortcutcontainer.h | 34 +------ src/main.cpp | 6 ++ src/smileyshortcut.h | 2 +- 11 files changed, 94 insertions(+), 413 deletions(-) (limited to 'src/gui/shortcutcontainer.h') diff --git a/src/Makefile.am b/src/Makefile.am index 1d325a84..d3a9571b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -278,6 +278,8 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ inventory.h \ item.cpp \ item.h \ + smileyshortcut.cpp \ + smileyshortcut.h \ itemshortcut.cpp \ itemshortcut.h \ joystick.cpp \ diff --git a/src/game.cpp b/src/game.cpp index 76eb6b82..da733fe3 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -36,6 +36,7 @@ #include "flooritemmanager.h" #include "graphics.h" #include "itemshortcut.h" +#include "smileyshortcut.h" #include "joystick.h" #include "keyboardconfig.h" #include "localplayer.h" @@ -556,15 +557,10 @@ void Game::handleInput() if (keyboard.isKeyActive(keyboard.KEY_SMILIE)) { // Emotions - Uint8 emotion=keyboard.getKeySmilieOffset(event.key.keysym.sym); - /** - * Later here: increase the size of emotion, - * and get the entry from the smiley - * shortcut object - */ + int emotion=keyboard.getKeySmilieOffset(event.key.keysym.sym); if (emotion) { - player_node->emote(emotion); + smileyShortcut->useSmiley(emotion); used = true; return; } diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 77657169..f0ab8274 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -34,11 +34,11 @@ #include "../utils/tostring.h" ItemShortcutContainer::ItemShortcutContainer(): - mGridWidth(1), - mGridHeight(1), mItemClicked(false), mItemMoved(NULL) { + mGridWidth=1; + mGridHeight=1; addMouseListener(this); addWidgetListener(this); @@ -131,22 +131,6 @@ ItemShortcutContainer::draw(gcn::Graphics *graphics) } } -void ItemShortcutContainer::widgetResized(const gcn::Event &event) -{ - mGridWidth = getWidth() / mBoxWidth; - if (mGridWidth < 1) { - mGridWidth = 1; - } - - setHeight((mMaxItems / mGridWidth + - (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight); - - mGridHeight = getHeight() / mBoxHeight; - if (mGridHeight < 1) { - mGridHeight = 1; - } -} - void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event) { @@ -219,19 +203,3 @@ ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event) } } -int -ItemShortcutContainer::getIndexFromGrid(int pointX, int pointY) const -{ - const gcn::Rectangle tRect = gcn::Rectangle( - 0, 0, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); - if (!tRect.isPointInRect(pointX, pointY)) { - return -1; - } - const int index = ((pointY / mBoxHeight) * mGridWidth) + - pointX / mBoxWidth; - if (index >= mMaxItems) - { - return -1; - } - return index; -} diff --git a/src/gui/itemshortcutcontainer.h b/src/gui/itemshortcutcontainer.h index 92b9b968..37c61e07 100644 --- a/src/gui/itemshortcutcontainer.h +++ b/src/gui/itemshortcutcontainer.h @@ -60,12 +60,6 @@ class ItemShortcutContainer : public ShortcutContainer */ void draw(gcn::Graphics *graphics); - /** - * Invoked when a widget changes its size. This is used to determine - * the new height of the container. - */ - void widgetResized(const gcn::Event &event); - /** * Handles mouse when dragged. */ @@ -81,32 +75,7 @@ class ItemShortcutContainer : public ShortcutContainer */ void mouseReleased(gcn::MouseEvent &event); - int getMaxItems() - { return mMaxItems; } - - int getBoxWidth() - { return mBoxWidth; } - - int getBoxHeight() - { return mBoxHeight; } - private: - /** - * Gets the index from the grid provided the point is in an item box. - * - * @param pointX X coordinate of the point. - * @param pointY Y coordinate of the point. - * @return index on success, -1 on failure. - */ - int getIndexFromGrid(int pointX, int pointY) const; - - Image *mBackgroundImg; - - int mMaxItems; - int mBoxWidth; - int mBoxHeight; - int mCursorPosX, mCursorPosY; - int mGridWidth, mGridHeight; bool mItemClicked; Item *mItemMoved; }; diff --git a/src/gui/shortcutcontainer.cpp b/src/gui/shortcutcontainer.cpp index f1a60189..32d7c6af 100644 --- a/src/gui/shortcutcontainer.cpp +++ b/src/gui/shortcutcontainer.cpp @@ -35,101 +35,10 @@ ShortcutContainer::ShortcutContainer(): mGridWidth(1), - mGridHeight(1), - mItemClicked(false), - mItemMoved(NULL) + mGridHeight(1) { - addMouseListener(this); - addWidgetListener(this); - - ResourceManager *resman = ResourceManager::getInstance(); - - mBackgroundImg = resman->getImage("graphics/gui/item_shortcut_bgr.png"); - mMaxItems = itemShortcut->getItemCount(); - - mBoxHeight = 42; - mBoxWidth = 36; -} - -ShortcutContainer::~ShortcutContainer() -{ - mBackgroundImg->decRef(); } -void -ShortcutContainer::logic() -{ - gcn::Widget::logic(); - - int i = itemShortcut->getItemCount(); - - if (i != mMaxItems) - { - mMaxItems = i; - setWidth(getWidth()); - } -} - -void -ShortcutContainer::draw(gcn::Graphics *graphics) -{ - Graphics *g = static_cast(graphics); - - graphics->setFont(getFont()); - - for (int i = 0; i < mMaxItems; i++) - { - const int itemX = (i % mGridWidth) * mBoxWidth; - const int itemY = (i / mGridWidth) * mBoxHeight; - - g->drawImage(mBackgroundImg, itemX, itemY); - - // Draw item keyboard shortcut. - const char *key = SDL_GetKeyName( - (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_0 + i)); - graphics->setColor(0x000000); - g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); - - if (itemShortcut->getItem(i) < 0) - continue; - - Item *item = - player_node->getInventory()->findItem(itemShortcut->getItem(i)); - if (item) { - // Draw item icon. - const std::string label = - item->isEquipped() ? "Eq." : toString(item->getQuantity()); - Image* image = item->getImage(); - if (image) { - const std::string label = - item->isEquipped() ? "Eq." : toString(item->getQuantity()); - g->drawImage(image, itemX, itemY); - g->drawText( - label, - itemX + mBoxWidth / 2, - itemY + mBoxHeight - 14, - gcn::Graphics::CENTER); - } - } - } - if (mItemMoved) - { - // Draw the item image being dragged by the cursor. - Image* image = mItemMoved->getImage(); - if (image) - { - const int tPosX = mCursorPosX - (image->getWidth() / 2); - const int tPosY = mCursorPosY - (image->getHeight() / 2); - - g->drawImage(image, tPosX, tPosY); - g->drawText( - toString(mItemMoved->getQuantity()), - tPosX + mBoxWidth / 2, - tPosY + mBoxHeight - 14, - gcn::Graphics::CENTER); - } - } -} void ShortcutContainer::widgetResized(const gcn::Event &event) { @@ -147,78 +56,6 @@ void ShortcutContainer::widgetResized(const gcn::Event &event) } } -void -ShortcutContainer::mouseDragged(gcn::MouseEvent &event) -{ - if (event.getButton() == gcn::MouseEvent::LEFT) { - if (!mItemMoved && mItemClicked) { - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - return; - } - const int itemId = itemShortcut->getItem(index); - if (itemId < 0) - return; - Item *item = player_node->getInventory()->findItem(itemId); - if (item) - { - mItemMoved = item; - itemShortcut->removeItem(index); - } - } - if (mItemMoved) { - mCursorPosX = event.getX(); - mCursorPosY = event.getY(); - } - } -} - -void -ShortcutContainer::mousePressed(gcn::MouseEvent &event) -{ - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - return; - } - - // Stores the selected item if theirs one. - if (itemShortcut->isItemSelected()) { - itemShortcut->setItem(index); - itemShortcut->setItemSelected(-1); - } - else if (itemShortcut->getItem(index)) { - mItemClicked = true; - } -} - -void -ShortcutContainer::mouseReleased(gcn::MouseEvent &event) -{ - if (event.getButton() == gcn::MouseEvent::LEFT) - { - if (itemShortcut->isItemSelected()) - { - itemShortcut->setItemSelected(-1); - } - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - mItemMoved = NULL; - return; - } - if (mItemMoved) { - itemShortcut->setItems(index, mItemMoved->getId()); - mItemMoved = NULL; - } - else if (itemShortcut->getItem(index) && mItemClicked) - { - itemShortcut->useItem(index); - } - if (mItemClicked) { - mItemClicked = false; - } - } -} - int ShortcutContainer::getIndexFromGrid(int pointX, int pointY) const { diff --git a/src/gui/shortcutcontainer.h b/src/gui/shortcutcontainer.h index 5ca56899..ebc0a9fc 100644 --- a/src/gui/shortcutcontainer.h +++ b/src/gui/shortcutcontainer.h @@ -49,17 +49,12 @@ class ShortcutContainer : public gcn::Widget, /** * Destructor. */ - virtual ~ShortcutContainer(); - - /** - * Handles the logic of the ItemContainer - */ - virtual void logic(); + ~ShortcutContainer(){} /** * Draws the items. */ - virtual void draw(gcn::Graphics *graphics); + virtual void draw(gcn::Graphics *graphics)=0; /** * Invoked when a widget changes its size. This is used to determine @@ -70,17 +65,17 @@ class ShortcutContainer : public gcn::Widget, /** * Handles mouse when dragged. */ - virtual void mouseDragged(gcn::MouseEvent &event); + virtual void mouseDragged(gcn::MouseEvent &event)=0; /** * Handles mouse when pressed. */ - virtual void mousePressed(gcn::MouseEvent &event); + virtual void mousePressed(gcn::MouseEvent &event)=0; /** * Handles mouse release. */ - virtual void mouseReleased(gcn::MouseEvent &event); + virtual void mouseReleased(gcn::MouseEvent &event)=0; virtual int getMaxItems() { return mMaxItems; } @@ -108,8 +103,6 @@ class ShortcutContainer : public gcn::Widget, int mBoxHeight; int mCursorPosX, mCursorPosY; int mGridWidth, mGridHeight; - bool mItemClicked; - Item *mItemMoved; }; #endif diff --git a/src/gui/smileycontainer.cpp b/src/gui/smileycontainer.cpp index 5eb99723..55f8f11b 100644 --- a/src/gui/smileycontainer.cpp +++ b/src/gui/smileycontainer.cpp @@ -31,6 +31,8 @@ #include "../resources/iteminfo.h" #include "../resources/resourcemanager.h" +#include "../smileyshortcut.h" + #include "../utils/tostring.h" const int SmileyContainer::gridWidth = 34; // item icon width + 4 @@ -158,7 +160,10 @@ void SmileyContainer::mousePressed(gcn::MouseEvent &event) int mx = event.getX(); int my = event.getY(); int index = mx / gridWidth + ((my / gridHeight) * columns); - - setSelectedItemIndex(index); + if (index setSmileySelected(index+1); + } } } diff --git a/src/gui/smileyshortcutcontainer.cpp b/src/gui/smileyshortcutcontainer.cpp index 5a9c3036..03b343e4 100644 --- a/src/gui/smileyshortcutcontainer.cpp +++ b/src/gui/smileyshortcutcontainer.cpp @@ -25,6 +25,7 @@ #include "../inventory.h" #include "../item.h" #include "../itemshortcut.h" +#include "../smileyshortcut.h" #include "../keyboardconfig.h" #include "../localplayer.h" #include "../log.h" @@ -36,11 +37,11 @@ #include "../utils/tostring.h" SmileyShortcutContainer::SmileyShortcutContainer(): - mGridWidth(1), - mGridHeight(1), - mItemClicked(false), - mItemMoved(NULL) + mSmileyClicked(false), + mSmileyMoved(0) { + mGridWidth=1, + mGridHeight=1, addMouseListener(this); addWidgetListener(this); @@ -50,7 +51,7 @@ SmileyShortcutContainer::SmileyShortcutContainer(): mSmileyImg = resman->getImageSet("graphics/gui/emotions.png",30,32); if (!mSmileyImg) logger->error("Unable to load emotions"); - mMaxItems = 12; + mMaxItems = smileyShortcut->getSmileyCount(); mBoxHeight = 42; mBoxWidth = 36; @@ -86,158 +87,92 @@ SmileyShortcutContainer::draw(gcn::Graphics *graphics) (SDLKey) keyboard.getKeyValue(keyboard.KEY_SMILEY_1 + i)); graphics->setColor(0x000000); g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); + if (smileyShortcut->getSmiley(i)) + { static_cast(graphics)->drawImage( - mSmileyImg->get(i), itemX+2, itemY+10); - -#if 0 - if (itemShortcut->getItem(i) < 0) - continue; - - Item *item = - player_node->getInventory()->findItem(itemShortcut->getItem(i)); - if (item) { - // Draw item icon. - const std::string label = - item->isEquipped() ? "Eq." : toString(item->getQuantity()); - Image* image = item->getImage(); - if (image) { - const std::string label = - item->isEquipped() ? "Eq." : toString(item->getQuantity()); - g->drawImage(image, itemX, itemY); - g->drawText( - label, - itemX + mBoxWidth / 2, - itemY + mBoxHeight - 14, - gcn::Graphics::CENTER); - } + mSmileyImg->get(smileyShortcut->getSmiley(i)-1), itemX+2, itemY+10); } -#endif + } - if (mItemMoved) + if (mSmileyMoved) { // Draw the item image being dragged by the cursor. - Image* image = mItemMoved->getImage(); + Image* image = mSmileyImg->get(mSmileyMoved-1); if (image) { const int tPosX = mCursorPosX - (image->getWidth() / 2); const int tPosY = mCursorPosY - (image->getHeight() / 2); g->drawImage(image, tPosX, tPosY); - g->drawText( - toString(mItemMoved->getQuantity()), - tPosX + mBoxWidth / 2, - tPosY + mBoxHeight - 14, - gcn::Graphics::CENTER); } } } -void SmileyShortcutContainer::widgetResized(const gcn::Event &event) -{ - mGridWidth = getWidth() / mBoxWidth; - if (mGridWidth < 1) { - mGridWidth = 1; - } - - setHeight((mMaxItems / mGridWidth + - (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight); - - mGridHeight = getHeight() / mBoxHeight; - if (mGridHeight < 1) { - mGridHeight = 1; - } -} - void SmileyShortcutContainer::mouseDragged(gcn::MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) { - if (!mItemMoved && mItemClicked) { - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - return; - } -#if 0 - const int itemId = itemShortcut->getItem(index); - if (itemId < 0) - return; - Item *item = player_node->getInventory()->findItem(itemId); - if (item) - { - mItemMoved = item; - itemShortcut->removeItem(index); - } -#endif - } - if (mItemMoved) { - mCursorPosX = event.getX(); - mCursorPosY = event.getY(); - } - } + if (event.getButton() == gcn::MouseEvent::LEFT) { + if (!mSmileyMoved && mSmileyClicked) { + const int index = getIndexFromGrid(event.getX(), event.getY()); + if (index == -1) { + return; + } + const int smileyId = smileyShortcut->getSmiley(index); + if (smileyId) + { + mSmileyMoved = smileyId; + smileyShortcut->removeSmiley(index); + } + } + if (mSmileyMoved) { + mCursorPosX = event.getX(); + mCursorPosY = event.getY(); + } + } } void SmileyShortcutContainer::mousePressed(gcn::MouseEvent &event) { - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - return; - } -#if 0 - // Stores the selected item if theirs one. - if (itemShortcut->isItemSelected()) { - itemShortcut->setItem(index); - itemShortcut->setItemSelected(-1); - } - else if (itemShortcut->getItem(index)) { - mItemClicked = true; - } -#endif + const int index = getIndexFromGrid(event.getX(), event.getY()); + if (index == -1) { + return; + } + // Stores the selected item if theirs one. + if (smileyShortcut->isSmileySelected()) { + smileyShortcut->setSmiley(index); + smileyShortcut->setSmileySelected(0); + } + else if (smileyShortcut->getSmiley(index)) { + mSmileyClicked = true; + } } void SmileyShortcutContainer::mouseReleased(gcn::MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) - { -#if 0 - if (itemShortcut->isItemSelected()) - { - itemShortcut->setItemSelected(-1); - } - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - mItemMoved = NULL; - return; - } - if (mItemMoved) { - itemShortcut->setItems(index, mItemMoved->getId()); - mItemMoved = NULL; - } - else if (itemShortcut->getItem(index) && mItemClicked) - { - itemShortcut->useItem(index); - } - if (mItemClicked) { - mItemClicked = false; - } -#endif - } + if (event.getButton() == gcn::MouseEvent::LEFT) + { + if (smileyShortcut->isSmileySelected()) + { + smileyShortcut->setSmileySelected(0); + } + const int index = getIndexFromGrid(event.getX(), event.getY()); + if (index == -1) { + mSmileyMoved = 0; + return; + } + if (mSmileyMoved) { + smileyShortcut->setSmileys(index, mSmileyMoved); + mSmileyMoved = 0; + } + else if (smileyShortcut->getSmiley(index) && mSmileyClicked) + { + smileyShortcut->useSmiley(index+1); + } + if (mSmileyClicked) { + mSmileyClicked = false; + } + } } -int -SmileyShortcutContainer::getIndexFromGrid(int pointX, int pointY) const -{ - const gcn::Rectangle tRect = gcn::Rectangle( - 0, 0, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); - if (!tRect.isPointInRect(pointX, pointY)) { - return -1; - } - const int index = ((pointY / mBoxHeight) * mGridWidth) + - pointX / mBoxWidth; - if (index >= mMaxItems) - { - return -1; - } - return index; -} diff --git a/src/gui/smileyshortcutcontainer.h b/src/gui/smileyshortcutcontainer.h index d6bbbc4f..55df6124 100644 --- a/src/gui/smileyshortcutcontainer.h +++ b/src/gui/smileyshortcutcontainer.h @@ -57,12 +57,6 @@ class SmileyShortcutContainer : public ShortcutContainer */ void draw(gcn::Graphics *graphics); - /** - * Invoked when a widget changes its size. This is used to determine - * the new height of the container. - */ - void widgetResized(const gcn::Event &event); - /** * Handles mouse when dragged. */ @@ -78,35 +72,11 @@ class SmileyShortcutContainer : public ShortcutContainer */ void mouseReleased(gcn::MouseEvent &event); - int getMaxItems() - { return mMaxItems; } - - int getBoxWidth() - { return mBoxWidth; } - - int getBoxHeight() - { return mBoxHeight; } - private: - /** - * Gets the index from the grid provided the point is in an item box. - * - * @param pointX X coordinate of the point. - * @param pointY Y coordinate of the point. - * @return index on success, -1 on failure. - */ - int getIndexFromGrid(int pointX, int pointY) const; - - Image *mBackgroundImg; ImageSet *mSmileyImg; - int mMaxItems; - int mBoxWidth; - int mBoxHeight; - int mCursorPosX, mCursorPosY; - int mGridWidth, mGridHeight; - bool mItemClicked; - Item *mItemMoved; + bool mSmileyClicked; + int mSmileyMoved; }; #endif diff --git a/src/main.cpp b/src/main.cpp index 4a3acce8..09004a50 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,6 +40,7 @@ #include "game.h" #include "graphics.h" #include "itemshortcut.h" +#include "smileyshortcut.h" #include "keyboardconfig.h" #include "localplayer.h" #include "lockedarray.h" @@ -401,6 +402,9 @@ void init_engine(const Options &options) // Initialize the item shortcuts. itemShortcut = new ItemShortcut(); + + // Initialize the smiley shortcuts. + smileyShortcut = new SmileyShortcut(); gui = new Gui(graphics); state = LOGIN_STATE; /**< Initial game state */ @@ -433,6 +437,8 @@ void exit_engine() { // Before config.write() since it writes the shortcuts to the config delete itemShortcut; + + delete smileyShortcut; config.write(); diff --git a/src/smileyshortcut.h b/src/smileyshortcut.h index 9960d8cf..c4fb9280 100644 --- a/src/smileyshortcut.h +++ b/src/smileyshortcut.h @@ -20,7 +20,7 @@ */ #ifndef _TMW_SMILEYSHORTCUT_H__ -#define _TMW_ITEMSHORTCUT_H__ +#define _TMW_SMILEYSHORTCUT_H__ #define SHORTCUT_SMILEYS 12 -- cgit v1.2.3-70-g09d2 From 7f8f7bcd329e62d240914686b01a9cd68624309c Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 12 Jan 2009 15:41:10 -0700 Subject: Some rather pedantic changes. Unified all naming for emoticons in the code so that only one term is used everywhere (to simplify maintainability), as well as corrected several variable names and comments where there was copy/pasted code, but it wasn't corrected. Also moved emote shortcuts back to where they were originally, to reduce player confusion when the next build comes around. Signed-off-by: Ira Rice --- aethyra.cbp | 14 +-- src/Makefile.am | 16 +-- src/emoteshortcut.cpp | 77 +++++++++++++++ src/emoteshortcut.h | 125 +++++++++++++++++++++++ src/game.cpp | 46 ++++----- src/gui/emotecontainer.cpp | 171 ++++++++++++++++++++++++++++++++ src/gui/emotecontainer.h | 140 ++++++++++++++++++++++++++ src/gui/emoteshortcutcontainer.cpp | 192 ++++++++++++++++++++++++++++++++++++ src/gui/emoteshortcutcontainer.h | 82 +++++++++++++++ src/gui/emotewindow.cpp | 99 +++++++++++++++++++ src/gui/emotewindow.h | 79 +++++++++++++++ src/gui/itemshortcutcontainer.cpp | 6 +- src/gui/menuwindow.cpp | 4 +- src/gui/setup.cpp | 8 +- src/gui/setup.h | 3 +- src/gui/shortcutcontainer.cpp | 9 +- src/gui/shortcutcontainer.h | 9 +- src/gui/shortcutwindow.h | 2 +- src/gui/smileycontainer.cpp | 172 -------------------------------- src/gui/smileycontainer.h | 139 -------------------------- src/gui/smileyshortcutcontainer.cpp | 179 --------------------------------- src/gui/smileyshortcutcontainer.h | 82 --------------- src/gui/smileywindow.cpp | 99 ------------------- src/gui/smileywindow.h | 80 --------------- src/itemshortcut.h | 2 +- src/keyboardconfig.cpp | 52 +++++----- src/keyboardconfig.h | 40 ++++---- src/main.cpp | 8 +- src/smileyshortcut.cpp | 76 -------------- src/smileyshortcut.h | 127 ------------------------ 30 files changed, 1075 insertions(+), 1063 deletions(-) create mode 100644 src/emoteshortcut.cpp create mode 100644 src/emoteshortcut.h create mode 100644 src/gui/emotecontainer.cpp create mode 100644 src/gui/emotecontainer.h create mode 100644 src/gui/emoteshortcutcontainer.cpp create mode 100644 src/gui/emoteshortcutcontainer.h create mode 100644 src/gui/emotewindow.cpp create mode 100644 src/gui/emotewindow.h delete mode 100644 src/gui/smileycontainer.cpp delete mode 100644 src/gui/smileycontainer.h delete mode 100644 src/gui/smileyshortcutcontainer.cpp delete mode 100644 src/gui/smileyshortcutcontainer.h delete mode 100644 src/gui/smileywindow.cpp delete mode 100644 src/gui/smileywindow.h delete mode 100644 src/smileyshortcut.cpp delete mode 100644 src/smileyshortcut.h (limited to 'src/gui/shortcutcontainer.h') diff --git a/aethyra.cbp b/aethyra.cbp index 0ede5d07..67d8d7d2 100644 --- a/aethyra.cbp +++ b/aethyra.cbp @@ -100,6 +100,8 @@ + + @@ -141,6 +143,12 @@ + + + + + + @@ -223,12 +231,6 @@ - - - - - - diff --git a/src/Makefile.am b/src/Makefile.am index e189b793..96be8465 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,6 +33,12 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ gui/connection.h \ gui/debugwindow.cpp \ gui/debugwindow.h \ + gui/emotecontainer.cpp \ + gui/emotecontainer.h \ + gui/emoteshortcutcontainer.cpp \ + gui/emoteshortcutcontainer.h \ + gui/emotewindow.cpp \ + gui/emotewindow.h \ gui/equipmentwindow.cpp \ gui/equipmentwindow.h \ gui/focushandler.cpp \ @@ -117,12 +123,6 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ gui/skill.h \ gui/slider.cpp \ gui/slider.h \ - gui/smileycontainer.cpp \ - gui/smileycontainer.h \ - gui/smileyshortcutcontainer.cpp \ - gui/smileyshortcutcontainer.h \ - gui/smileywindow.cpp \ - gui/smileywindow.h \ gui/speechbubble.cpp \ gui/speechbubble.h \ gui/status.cpp \ @@ -252,6 +252,8 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ configuration.h \ effectmanager.cpp \ effectmanager.h \ + emoteshortcut.cpp \ + emoteshortcut.h \ engine.cpp \ engine.h \ equipment.cpp \ @@ -272,8 +274,6 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ inventory.h \ item.cpp \ item.h \ - smileyshortcut.cpp \ - smileyshortcut.h \ itemshortcut.cpp \ itemshortcut.h \ joystick.cpp \ diff --git a/src/emoteshortcut.cpp b/src/emoteshortcut.cpp new file mode 100644 index 00000000..66989d44 --- /dev/null +++ b/src/emoteshortcut.cpp @@ -0,0 +1,77 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "emoteshortcut.h" + +#include "configuration.h" +#include "localplayer.h" + +#include "utils/tostring.h" + +EmoteShortcut::EmoteShortcut *emoteShortcut; + +EmoteShortcut::EmoteShortcut(): + mEmoteSelected(0) +{ + for (int i = 0; i < SHORTCUT_EMOTES; i++) + { + mEmotes[i] = i + 1; + } + load(); +} + +EmoteShortcut::~EmoteShortcut() +{ + save(); +} + +void EmoteShortcut::load() +{ + for (int i = 0; i < SHORTCUT_EMOTES; i++) + { + int emoteId = (int) config.getValue("emoteshortcut" + toString(i), i + 1); + + if (emoteId) + { + mEmotes[i] = emoteId; + } + } +} + +void EmoteShortcut::save() +{ + for (int i = 0; i < SHORTCUT_EMOTES; i++) + { + const int emoteId = mEmotes[i] ? mEmotes[i] : 0; + config.setValue("emoteshortcut" + toString(i), emoteId); + } +} + +void EmoteShortcut::useEmote(int index) +{ + if ((index > 0) && (index <= SHORTCUT_EMOTES)) + { + if (mEmotes[index - 1] > 0) + { + player_node->emote(mEmotes[index - 1]); + } + } +} diff --git a/src/emoteshortcut.h b/src/emoteshortcut.h new file mode 100644 index 00000000..14162f73 --- /dev/null +++ b/src/emoteshortcut.h @@ -0,0 +1,125 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _AETHYRA_EMOTESHORTCUT_H__ +#define _AETHYRA_EMOTESHORTCUT_H__ + +#define SHORTCUT_EMOTES 12 + +/** + * The class which keeps track of the emote shortcuts. + */ +class EmoteShortcut +{ + public: + /** + * Constructor. + */ + EmoteShortcut(); + + /** + * Destructor. + */ + ~EmoteShortcut(); + + /** + * Load the configuration information. + */ + void load(); + + /** + * Returns the shortcut Emote ID specified by the index. + * + * @param index Index of the shortcut Emote. + */ + int getEmote(int index) const + { return mEmotes[index]; } + + /** + * Returns the amount of shortcut Emotes. + */ + int getEmoteCount() const + { return SHORTCUT_EMOTES; } + + /** + * Returns the emote ID that is currently selected. + */ + int getEmoteSelected() const + { return mEmoteSelected; } + + /** + * Adds the selected emote ID to the emotes specified by the index. + * + * @param index Index of the emotes. + */ + void setEmote(int index) + { mEmotes[index] = mEmoteSelected; } + + /** + * Adds a emoticon to the emotes store specified by the index. + * + * @param index Index of the emote. + * @param emoteId ID of the emote. + */ + void setEmotes(int index, int emoteId) + { mEmotes[index] = emoteId; } + + /** + * Set the Emote that is selected. + * + * @param emoteId The ID of the emote that is to be assigned. + */ + void setEmoteSelected(int emoteId) + { mEmoteSelected = emoteId; } + + /** + * A flag to check if the Emote is selected. + */ + bool isEmoteSelected() + { return mEmoteSelected; } + + /** + * Remove a Emote from the shortcut. + */ + void removeEmote(int index) + { mEmotes[index] = 0; } + + /** + * Try to use the Emote specified by the index. + * + * @param index Index of the emote shortcut. + */ + void useEmote(int index); + + private: + /** + * Save the configuration information. + */ + void save(); + + int mEmotes[SHORTCUT_EMOTES]; /**< The emote stored. */ + int mEmoteSelected; /**< The emote held by cursor. */ + +}; + +extern EmoteShortcut *emoteShortcut; + +#endif diff --git a/src/game.cpp b/src/game.cpp index 18169cd0..753d7afa 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -35,7 +35,6 @@ #include "flooritemmanager.h" #include "graphics.h" #include "itemshortcut.h" -#include "smileyshortcut.h" #include "joystick.h" #include "keyboardconfig.h" #include "localplayer.h" @@ -49,15 +48,16 @@ #include "gui/chat.h" #include "gui/confirm_dialog.h" #include "gui/debugwindow.h" +#include "gui/emoteshortcut.h" +#include "gui/emoteshortcutcontainer.h" +#include "gui/emotewindow.h" #include "gui/equipmentwindow.h" #include "gui/gui.h" #include "gui/help.h" #include "gui/inventorywindow.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" @@ -118,7 +118,7 @@ BuyDialog *buyDialog; SellDialog *sellDialog; BuySellDialog *buySellDialog; InventoryWindow *inventoryWindow; -SmileyWindow *smileyWindow; +EmoteWindow *emoteWindow; NpcListDialog *npcListDialog; NpcTextDialog *npcTextDialog; SkillDialog *skillDialog; @@ -129,7 +129,7 @@ TradeWindow *tradeWindow; HelpWindow *helpWindow; DebugWindow *debugWindow; ShortcutWindow *itemShortcutWindow; -ShortcutWindow *smileyShortcutWindow; +ShortcutWindow *emoteShortcutWindow; BeingManager *beingManager = NULL; FloorItemManager *floorItemManager = NULL; @@ -202,7 +202,7 @@ void createGuiWindows(Network *network) sellDialog = new SellDialog(network); buySellDialog = new BuySellDialog(); inventoryWindow = new InventoryWindow(); - smileyWindow = new SmileyWindow(); + emoteWindow = new EmoteWindow(); npcTextDialog = new NpcTextDialog(); npcListDialog = new NpcListDialog(); skillDialog = new SkillDialog(); @@ -213,7 +213,7 @@ void createGuiWindows(Network *network) helpWindow = new HelpWindow(); debugWindow = new DebugWindow(); itemShortcutWindow = new ShortcutWindow("ItemShortcut",new ItemShortcutContainer); - smileyShortcutWindow = new ShortcutWindow("SmileyShortcut",new SmileyShortcutContainer); + emoteShortcutWindow = new ShortcutWindow("emoteShortcut",new EmoteShortcutContainer); // Set initial window visibility chatWindow->setVisible((bool) config.getValue( @@ -227,8 +227,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)); + emoteShortcutWindow->setVisible((bool) config.getValue( + emoteShortcutWindow->getWindowName() + "Visible", true)); if (config.getValue("logToChat", 0)) { @@ -250,7 +250,7 @@ void destroyGuiWindows() delete sellDialog; delete buySellDialog; delete inventoryWindow; - delete smileyWindow; + delete emoteWindow; delete npcListDialog; delete npcTextDialog; delete skillDialog; @@ -261,7 +261,7 @@ void destroyGuiWindows() delete helpWindow; delete debugWindow; delete itemShortcutWindow; - delete smileyShortcutWindow; + delete emoteShortcutWindow; } Game::Game(Network *network): @@ -545,14 +545,14 @@ void Game::handleInput() } } - // Smilie - if (keyboard.isKeyActive(keyboard.KEY_SMILIE)) + // Mode switch to emotes + if (keyboard.isKeyActive(keyboard.KEY_EMOTE)) { // Emotions - int emotion = keyboard.getKeySmilieOffset(event.key.keysym.sym); + int emotion = keyboard.getKeyEmoteOffset(event.key.keysym.sym); if (emotion) { - smileyShortcut->useSmiley(emotion); + emoteShortcut->useEmote(emotion); used = true; return; } @@ -655,13 +655,13 @@ void Game::handleInput() if (!tradeWindow->isVisible()) { // Checks if any item shortcut is pressed. - for (int i = KeyboardConfig::KEY_SHORTCUT_0; - i <= KeyboardConfig::KEY_SHORTCUT_9; + for (int i = KeyboardConfig::KEY_SHORTCUT_1; + i <= KeyboardConfig::KEY_SHORTCUT_12; i++) { if (tKey == i && !used) { itemShortcut->useItem( - i - KeyboardConfig::KEY_SHORTCUT_0); + i - KeyboardConfig::KEY_SHORTCUT_1); break; } } @@ -708,7 +708,7 @@ void Game::handleInput() { statusWindow->setVisible(false); inventoryWindow->setVisible(false); - smileyWindow->setVisible(false); + emoteWindow->setVisible(false); skillDialog->setVisible(false); setupWindow->setVisible(false); equipmentWindow->setVisible(false); @@ -745,11 +745,11 @@ void Game::handleInput() case KeyboardConfig::KEY_WINDOW_DEBUG: requestedWindow = debugWindow; break; - case KeyboardConfig::KEY_WINDOW_ALLSMILEY: - requestedWindow = smileyWindow; + case KeyboardConfig::KEY_WINDOW_EMOTE: + requestedWindow = emoteWindow; break; - case KeyboardConfig::KEY_WINDOW_SMILEY_SHORTCUT: - requestedWindow = smileyShortcutWindow; + case KeyboardConfig::KEY_WINDOW_EMOTE_SHORTCUT: + requestedWindow = emoteShortcutWindow; break; } } diff --git a/src/gui/emotecontainer.cpp b/src/gui/emotecontainer.cpp new file mode 100644 index 00000000..c3e20c41 --- /dev/null +++ b/src/gui/emotecontainer.cpp @@ -0,0 +1,171 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include + +#include "emotecontainer.h" +#include "emoteshortcut.h" + +#include "../configuration.h" +#include "../graphics.h" +#include "../log.h" + +#include "../resources/image.h" +#include "../resources/iteminfo.h" +#include "../resources/resourcemanager.h" + +#include "../utils/gettext.h" +#include "../utils/tostring.h" + +const int EmoteContainer::gridWidth = 34; // emote icon width + 4 +const int EmoteContainer::gridHeight = 36; // emote icon height + 4 + +static const int NO_EMOTE = -1; + +EmoteContainer::EmoteContainer(): + mSelectedEmoteIndex(NO_EMOTE) +{ + ResourceManager *resman = ResourceManager::getInstance(); + + mEmoteImg = resman->getImageSet("graphics/sprites/emotions.png", 30, 32); + if (!mEmoteImg) logger->error(_("Unable to load emotions")); + + mSelImg = resman->getImage("graphics/gui/selection.png"); + if (!mSelImg) logger->error(_("Unable to load selection.png")); + + mSelImg->setAlpha(config.getValue("guialpha", 0.8)); + + mMaxEmote = mEmoteImg->size(); + + addMouseListener(this); + addWidgetListener(this); +} + +EmoteContainer::~EmoteContainer() +{ + if (mEmoteImg) + { + mEmoteImg->decRef(); + mEmoteImg = NULL; + } + if (!mSelImg) + { + mSelImg->decRef(); + mSelImg = NULL; + } +} + +void EmoteContainer::draw(gcn::Graphics *graphics) +{ + int columns = getWidth() / gridWidth; + + // Have at least 1 column + if (columns < 1) + { + columns = 1; + } + + for (int i = 0; i < mMaxEmote ; i++) + { + int emoteX = ((i) % columns) * gridWidth; + int emoteY = ((i) / columns) * gridHeight; + + // Draw emote icon + static_cast(graphics)->drawImage( + mEmoteImg->get(i), emoteX, emoteY); + + // Draw selection image below selected item + if (mSelectedEmoteIndex == i) + { + static_cast(graphics)->drawImage( + mSelImg, emoteX, emoteY); + } + } +} + +void EmoteContainer::widgetResized(const gcn::Event &event) +{ + recalculateHeight(); +} + +void EmoteContainer::recalculateHeight() +{ + int cols = getWidth() / gridWidth; + + if (cols < 1) + cols = 1; + + const int rows = (mMaxEmote / cols) + (mMaxEmote % cols > 0 ? 1 : 0); + const int height = rows * gridHeight + 8; + if (height != getHeight()) + setHeight(height); +} + +int EmoteContainer::getSelectedEmote() +{ + if (mSelectedEmoteIndex == NO_EMOTE) + return 0; + + return 1 + mSelectedEmoteIndex; +} + +void EmoteContainer::selectNone() +{ + setSelectedEmoteIndex(NO_EMOTE); +} + +void EmoteContainer::setSelectedEmoteIndex(int index) +{ + if (index < 0 || index >= mMaxEmote ) + mSelectedEmoteIndex = NO_EMOTE; + else + mSelectedEmoteIndex = index; +} + +void EmoteContainer::distributeValueChangedEvent() +{ + gcn::SelectionEvent event(this); + std::list::iterator i_end = mListeners.end(); + std::list::iterator i; + + for (i = mListeners.begin(); i != i_end; ++i) + { + (*i)->valueChanged(event); + } +} + +void EmoteContainer::mousePressed(gcn::MouseEvent &event) +{ + int button = event.getButton(); + if (button == gcn::MouseEvent::LEFT || button == gcn::MouseEvent::RIGHT) + { + int columns = getWidth() / gridWidth; + int mx = event.getX(); + int my = event.getY(); + int index = mx / gridWidth + ((my / gridHeight) * columns); + if (index < mMaxEmote) + { + setSelectedEmoteIndex(index); + emoteShortcut->setEmoteSelected(index + 1); + } + } +} diff --git a/src/gui/emotecontainer.h b/src/gui/emotecontainer.h new file mode 100644 index 00000000..f5922a9c --- /dev/null +++ b/src/gui/emotecontainer.h @@ -0,0 +1,140 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _AETHYRA_EMOTECONTAINER_H__ +#define _AETHYRA_EMOTECONTAINER_H__ + +#include + +#include +#include +#include + +#include "../guichanfwd.h" + +#include "../resources/imageset.h" + +class Image; +class Inventory; +class Emote; + +namespace gcn { + class SelectionListener; +} + +/** + * An item container. Used to show items in inventory and trade dialog. + * + * \ingroup GUI + */ +class EmoteContainer : public gcn::Widget, + public gcn::MouseListener, + public gcn::WidgetListener +{ + public: + /** + * Constructor. Initializes the graphic. + */ + EmoteContainer(); + + /** + * Destructor. + */ + virtual ~EmoteContainer(); + + /** + * Draws the items. + */ + void draw(gcn::Graphics *graphics); + + /** + * Called whenever the widget changes size. + */ + void widgetResized(const gcn::Event &event); + + /** + * Handles mouse click. + */ + void mousePressed(gcn::MouseEvent &event); + + /** + * Returns the selected item. + */ + int getSelectedEmote(); + + /** + * Sets selected item to NULL. + */ + void selectNone(); + + /** + * Adds a listener to the list that's notified each time a change to + * the selection occurs. + */ + void addSelectionListener(gcn::SelectionListener *listener) + { + mListeners.push_back(listener); + } + + /** + * Removes a listener from the list that's notified each time a change + * to the selection occurs. + */ + void removeSelectionListener(gcn::SelectionListener *listener) + { + mListeners.remove(listener); + } + + private: + /** + + * Sets the currently selected item. Invalid (e.g., negative) indices set `no item'. + */ + void setSelectedEmoteIndex(int index); + + /** + * Find the current item index by the most recently used item ID + */ + void refindSelectedEmote(void); + + /** + * Determine and set the height of the container. + */ + void recalculateHeight(void); + + /** + * Sends out selection events to the list of selection listeners. + */ + void distributeValueChangedEvent(void); + + ImageSet *mEmoteImg; + Image *mSelImg; + int mSelectedEmoteIndex; + + int mMaxEmote; + + std::list mListeners; + + static const int gridWidth; + static const int gridHeight; +}; + +#endif diff --git a/src/gui/emoteshortcutcontainer.cpp b/src/gui/emoteshortcutcontainer.cpp new file mode 100644 index 00000000..5e984dd5 --- /dev/null +++ b/src/gui/emoteshortcutcontainer.cpp @@ -0,0 +1,192 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "emoteshortcutcontainer.h" + +#include "../emoteshortcut.h" +#include "../graphics.h" +#include "../inventory.h" +#include "../item.h" +#include "../itemshortcut.h" +#include "../keyboardconfig.h" +#include "../localplayer.h" +#include "../log.h" + +#include "../resources/image.h" +#include "../resources/resourcemanager.h" + +#include "../utils/gettext.h" +#include "../utils/tostring.h" + +EmoteShortcutContainer::EmoteShortcutContainer(): + mEmoteClicked(false), + mEmoteMoved(0) +{ + mGridWidth = 1, + mGridHeight = 1, + addMouseListener(this); + addWidgetListener(this); + + ResourceManager *resman = ResourceManager::getInstance(); + + mBackgroundImg = resman->getImage("graphics/gui/item_shortcut_bgr.png"); + mEmoteImg = resman->getImageSet("graphics/sprites/emotions.png", 30, 32); + if (!mEmoteImg) logger->error(_("Unable to load emotions")); + + mMaxItems = emoteShortcut->getEmoteCount(); + + mBoxHeight = mBackgroundImg->getHeight(); + mBoxWidth = mBackgroundImg->getWidth(); +} + +EmoteShortcutContainer::~EmoteShortcutContainer() +{ + mBackgroundImg->decRef(); + if (mEmoteImg) + { + mEmoteImg->decRef(); + mEmoteImg=NULL; + } +} + +void EmoteShortcutContainer::draw(gcn::Graphics *graphics) +{ + Graphics *g = static_cast(graphics); + + //graphics->setFont(getFont()); + + for (int i = 0; i < mMaxItems; i++) + { + const int emoteX = (i % mGridWidth) * mBoxWidth; + const int emoteY = (i / mGridWidth) * mBoxHeight; + + g->drawImage(mBackgroundImg, emoteX, emoteY); + + // Draw emote keyboard shortcut. + const char *key = SDL_GetKeyName( + (SDLKey) keyboard.getKeyValue(keyboard.KEY_EMOTE_1 + i)); + graphics->setColor(0x000000); + g->drawText(key, emoteX + 2, emoteY + 2, gcn::Graphics::LEFT); + + if (emoteShortcut->getEmote(i)) + { + static_cast(graphics)->drawImage( + mEmoteImg->get(emoteShortcut->getEmote(i) - 1), emoteX + 2, emoteY + 10); + } + + } + if (mEmoteMoved) + { + // Draw the emote image being dragged by the cursor. + Image* image = mEmoteImg->get(mEmoteMoved-1); + if (image) + { + const int tPosX = mCursorPosX - (image->getWidth() / 2); + const int tPosY = mCursorPosY - (image->getHeight() / 2); + + g->drawImage(image, tPosX, tPosY); + } + } +} + +void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event) +{ + if (event.getButton() == gcn::MouseEvent::LEFT) + { + if (!mEmoteMoved && mEmoteClicked) + { + const int index = getIndexFromGrid(event.getX(), event.getY()); + const int emoteId = emoteShortcut->getEmote(index); + + if (index == -1) + { + return; + } + + if (emoteId) + { + mEmoteMoved = emoteId; + emoteShortcut->removeEmote(index); + } + } + if (mEmoteMoved) + { + mCursorPosX = event.getX(); + mCursorPosY = event.getY(); + } + } +} + +void EmoteShortcutContainer::mousePressed(gcn::MouseEvent &event) +{ + const int index = getIndexFromGrid(event.getX(), event.getY()); + + if (index == -1) + { + return; + } + + // Stores the selected emote if there is one. + if (emoteShortcut->isEmoteSelected()) + { + emoteShortcut->setEmote(index); + emoteShortcut->setEmoteSelected(0); + } + else if (emoteShortcut->getEmote(index)) + { + mEmoteClicked = true; + } +} + +void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) +{ + if (event.getButton() == gcn::MouseEvent::LEFT) + { + const int index = getIndexFromGrid(event.getX(), event.getY()); + + if (emoteShortcut->isEmoteSelected()) + { + emoteShortcut->setEmoteSelected(0); + } + + if (index == -1) + { + mEmoteMoved = 0; + return; + } + + if (mEmoteMoved) + { + emoteShortcut->setEmotes(index, mEmoteMoved); + mEmoteMoved = 0; + } + else if (emoteShortcut->getEmote(index) && mEmoteClicked) + { + emoteShortcut->useEmote(index + 1); + } + + if (mEmoteClicked) + { + mEmoteClicked = false; + } + } +} + diff --git a/src/gui/emoteshortcutcontainer.h b/src/gui/emoteshortcutcontainer.h new file mode 100644 index 00000000..5b3f61cd --- /dev/null +++ b/src/gui/emoteshortcutcontainer.h @@ -0,0 +1,82 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _AETHYRA_EMOTESHORTCUTCONTAINER_H__ +#define _AETHYRA_EMOTESHORTCUTCONTAINER_H__ + +#include +#include +#include + +#include "shortcutcontainer.h" + +#include "../guichanfwd.h" + +#include "../resources/imageset.h" + +class Image; + +/** + * An emote shortcut container. Used to quickly use emoticons. + * + * \ingroup GUI + */ +class EmoteShortcutContainer : public ShortcutContainer +{ + public: + /** + * Constructor. Initializes the graphic. + */ + EmoteShortcutContainer(); + + /** + * Destructor. + */ + virtual ~EmoteShortcutContainer(); + + /** + * Draws the items. + */ + void draw(gcn::Graphics *graphics); + + /** + * Handles mouse when dragged. + */ + void mouseDragged(gcn::MouseEvent &event); + + /** + * Handles mouse when pressed. + */ + void mousePressed(gcn::MouseEvent &event); + + /** + * Handles mouse release. + */ + void mouseReleased(gcn::MouseEvent &event); + + private: + ImageSet *mEmoteImg; + + bool mEmoteClicked; + int mEmoteMoved; +}; + +#endif diff --git a/src/gui/emotewindow.cpp b/src/gui/emotewindow.cpp new file mode 100644 index 00000000..af9648ef --- /dev/null +++ b/src/gui/emotewindow.cpp @@ -0,0 +1,99 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include + +#include "button.h" +#include "gui.h" +#include "emotewindow.h" +#include "emotecontainer.h" +#include "scrollarea.h" + +#include "../localplayer.h" + +#include "../utils/gettext.h" +#include "../utils/tostring.h" + +EmoteWindow::EmoteWindow(): + Window(_("Emote")) +{ + setWindowName(_("Emote")); + setResizable(true); + setCloseButton(true); + setMinWidth(80); + setDefaultSize(115, 25, 322, 200); + + mUseButton = new Button(_("Use"), "use", this); + + mEmotes = new EmoteContainer(); + mEmotes->addSelectionListener(this); + + mInvenScroll = new ScrollArea(mEmotes); + mInvenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); + + draw(); + + add(mUseButton); + add(mInvenScroll); + + mUseButton->setSize(60, mUseButton->getHeight()); + + loadWindowState(); +} + +void EmoteWindow::action(const gcn::ActionEvent &event) +{ + int emote = mEmotes->getSelectedEmote(); + + if (!emote) + return; + + player_node->emote(emote); +} + + +void EmoteWindow::draw() +{ + const gcn::Rectangle &area = getChildrenArea(); + const int width = area.width; + const int height = area.height; + + mUseButton->setPosition(8, height - 8 - mUseButton->getHeight()); + + mInvenScroll->setSize(width - 16, mUseButton->getY() - 18); + mInvenScroll->setPosition(8, 10); + + setMinHeight(130); +} + +void EmoteWindow::widgetResized(const gcn::Event &event) +{ + Window::widgetResized(event); + draw(); +} + + +int EmoteWindow::getSelectedEmote() const +{ + return mEmotes->getSelectedEmote(); +} diff --git a/src/gui/emotewindow.h b/src/gui/emotewindow.h new file mode 100644 index 00000000..a382e37d --- /dev/null +++ b/src/gui/emotewindow.h @@ -0,0 +1,79 @@ +/* + * Aethyra + * Copyright 2009 Aethyra Development Team + * + * This file is part of Aethyra. + * + * Aethyra is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * Aethyra is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Aethyra; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _AETHYRA_EMOTEWINDOW_H +#define _AETHYRA_EMOTEWINDOW_H + +#include +#include + +#include "textbox.h" +#include "window.h" + +#include "../guichanfwd.h" + +class EmoteContainer; + +/** + * Emote dialog. + * + * \ingroup Interface + */ +class EmoteWindow : public Window, gcn::ActionListener, + gcn::SelectionListener +{ + public: + /** + * Constructor. + */ + EmoteWindow(); + + /** + * Called when receiving actions from the widgets. + */ + void action(const gcn::ActionEvent &event); + + /** + * Returns the selected item. + */ + int getSelectedEmote() const; + + /** + * Updates window drawing. + */ + void draw(); + + /** + * Called whenever the widget changes size. + */ + void widgetResized(const gcn::Event &event); + + private: + + EmoteContainer *mEmotes; + + gcn::Button *mUseButton; + gcn::ScrollArea *mInvenScroll; +}; + +extern EmoteWindow *emoteWindow; + +#endif diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index b576e843..7e2eeac0 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -50,8 +50,8 @@ ItemShortcutContainer::ItemShortcutContainer(): mBackgroundImg->setAlpha(config.getValue("guialpha", 0.8)); - mBoxHeight = 42; - mBoxWidth = 36; + mBoxHeight = mBackgroundImg->getHeight(); + mBoxWidth = mBackgroundImg->getWidth(); } ItemShortcutContainer::~ItemShortcutContainer() @@ -89,7 +89,7 @@ ItemShortcutContainer::draw(gcn::Graphics *graphics) // Draw item keyboard shortcut. const char *key = SDL_GetKeyName( - (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_0 + i)); + (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_1 + i)); graphics->setColor(0x000000); g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp index 99eaca34..2a175a61 100644 --- a/src/gui/menuwindow.cpp +++ b/src/gui/menuwindow.cpp @@ -33,7 +33,7 @@ extern Window *chatWindow; extern Window *equipmentWindow; extern Window *inventoryWindow; extern Window *itemShortcutWindow; -extern Window *smileyWindow; +extern Window *emoteWindow; extern Window *setupWindow; extern Window *skillDialog; extern Window *statusWindow; @@ -120,7 +120,7 @@ void MenuWindowListener::action(const gcn::ActionEvent &event) } else if (event.getId() == _("Emote")) { - window = smileyWindow; + window = emoteWindow; } else if (event.getId() == _("Setup")) { diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index bcffbae0..66f15f03 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -43,8 +43,8 @@ extern Window *minimap; extern Window *skillDialog; extern Window *statusWindow; extern Window *itemShortcutWindow; -extern Window *smileyShortcutWindow; -extern Window *smileyWindow; +extern Window *emoteShortcutWindow; +extern Window *emoteWindow; extern Window *tradeWindow; Setup::Setup(): @@ -138,8 +138,8 @@ void Setup::action(const gcn::ActionEvent &event) helpWindow->resetToDefaultSize(); skillDialog->resetToDefaultSize(); itemShortcutWindow->resetToDefaultSize(); - smileyShortcutWindow->resetToDefaultSize(); - smileyWindow->resetToDefaultSize(); + emoteShortcutWindow->resetToDefaultSize(); + emoteWindow->resetToDefaultSize(); tradeWindow->resetToDefaultSize(); } } diff --git a/src/gui/setup.h b/src/gui/setup.h index fd200f4c..1ad93cac 100644 --- a/src/gui/setup.h +++ b/src/gui/setup.h @@ -53,8 +53,7 @@ class Setup : public Window, public gcn::ActionListener /** * Event handling method. */ - void - action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event); private: std::list mTabs; diff --git a/src/gui/shortcutcontainer.cpp b/src/gui/shortcutcontainer.cpp index 32d7c6af..88d9bb22 100644 --- a/src/gui/shortcutcontainer.cpp +++ b/src/gui/shortcutcontainer.cpp @@ -43,7 +43,8 @@ ShortcutContainer::ShortcutContainer(): void ShortcutContainer::widgetResized(const gcn::Event &event) { mGridWidth = getWidth() / mBoxWidth; - if (mGridWidth < 1) { + if (mGridWidth < 1) + { mGridWidth = 1; } @@ -51,7 +52,8 @@ void ShortcutContainer::widgetResized(const gcn::Event &event) (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight); mGridHeight = getHeight() / mBoxHeight; - if (mGridHeight < 1) { + if (mGridHeight < 1) + { mGridHeight = 1; } } @@ -61,7 +63,8 @@ ShortcutContainer::getIndexFromGrid(int pointX, int pointY) const { const gcn::Rectangle tRect = gcn::Rectangle( 0, 0, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); - if (!tRect.isPointInRect(pointX, pointY)) { + if (!tRect.isPointInRect(pointX, pointY)) + { return -1; } const int index = ((pointY / mBoxHeight) * mGridWidth) + diff --git a/src/gui/shortcutcontainer.h b/src/gui/shortcutcontainer.h index ebc0a9fc..9d0584d3 100644 --- a/src/gui/shortcutcontainer.h +++ b/src/gui/shortcutcontainer.h @@ -29,7 +29,6 @@ #include "../guichanfwd.h" class Image; -class Item; /** * An item shortcut container. Used to quickly use items. @@ -54,7 +53,7 @@ class ShortcutContainer : public gcn::Widget, /** * Draws the items. */ - virtual void draw(gcn::Graphics *graphics)=0; + virtual void draw(gcn::Graphics *graphics) = 0; /** * Invoked when a widget changes its size. This is used to determine @@ -65,17 +64,17 @@ class ShortcutContainer : public gcn::Widget, /** * Handles mouse when dragged. */ - virtual void mouseDragged(gcn::MouseEvent &event)=0; + virtual void mouseDragged(gcn::MouseEvent &event) = 0; /** * Handles mouse when pressed. */ - virtual void mousePressed(gcn::MouseEvent &event)=0; + virtual void mousePressed(gcn::MouseEvent &event) = 0; /** * Handles mouse release. */ - virtual void mouseReleased(gcn::MouseEvent &event)=0; + virtual void mouseReleased(gcn::MouseEvent &event) = 0; virtual int getMaxItems() { return mMaxItems; } diff --git a/src/gui/shortcutwindow.h b/src/gui/shortcutwindow.h index b5a23c2c..9ac1a52a 100644 --- a/src/gui/shortcutwindow.h +++ b/src/gui/shortcutwindow.h @@ -60,6 +60,6 @@ class ShortcutWindow : public Window }; extern ShortcutWindow *itemShortcutWindow; -extern ShortcutWindow *smileyShortcutWindow; +extern ShortcutWindow *emoteShortcutWindow; #endif diff --git a/src/gui/smileycontainer.cpp b/src/gui/smileycontainer.cpp deleted file mode 100644 index f8f57c45..00000000 --- a/src/gui/smileycontainer.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "smileycontainer.h" - -#include -#include - -#include "../configuration.h" -#include "../graphics.h" -#include "../log.h" -#include "../smileyshortcut.h" - -#include "../resources/image.h" -#include "../resources/iteminfo.h" -#include "../resources/resourcemanager.h" - -#include "../utils/gettext.h" -#include "../utils/tostring.h" - -const int SmileyContainer::gridWidth = 34; // emote icon width + 4 -const int SmileyContainer::gridHeight = 36; // emote icon height + 4 - -static const int NO_EMOTE = -1; - -SmileyContainer::SmileyContainer(): - mSelectedEmoteIndex(NO_EMOTE) -{ - ResourceManager *resman = ResourceManager::getInstance(); - - mSmileyImg = resman->getImageSet("graphics/sprites/emotions.png", 30, 32); - if (!mSmileyImg) logger->error(_("Unable to load emotions")); - - mSelImg = resman->getImage("graphics/gui/selection.png"); - if (!mSelImg) logger->error(_("Unable to load selection.png")); - - mSelImg->setAlpha(config.getValue("guialpha", 0.8)); - - mMaxSmiley = mSmileyImg->size(); - - addMouseListener(this); - addWidgetListener(this); -} - -SmileyContainer::~SmileyContainer() -{ - if (mSmileyImg) - { - mSmileyImg->decRef(); - mSmileyImg=NULL; - } - if (!mSelImg) - { - mSelImg->decRef(); - mSelImg=NULL; - } -} - -void SmileyContainer::draw(gcn::Graphics *graphics) -{ - int columns = getWidth() / gridWidth; - - // Have at least 1 column - if (columns < 1) - { - columns = 1; - } - - for (int i = 0; i < mMaxSmiley ; i++) - { - int itemX = ((i) % columns) * gridWidth; - int itemY = ((i) / columns) * gridHeight; - - - // Draw item icon - static_cast(graphics)->drawImage( - mSmileyImg->get(i), itemX, itemY); - - // Draw selection image below selected item - if (mSelectedEmoteIndex == i) - { - static_cast(graphics)->drawImage( - mSelImg, itemX, itemY); - } - } -} - -void SmileyContainer::widgetResized(const gcn::Event &event) -{ - recalculateHeight(); -} - -void SmileyContainer::recalculateHeight() -{ - int cols = getWidth() / gridWidth; - - if (cols < 1) - cols = 1; - - const int rows = (mMaxSmiley / cols) + (mMaxSmiley % cols > 0 ? 1 : 0); - const int height = rows * gridHeight + 8; - if (height != getHeight()) - setHeight(height); -} - -int SmileyContainer::getSelectedSmiley() -{ - if (mSelectedEmoteIndex == NO_EMOTE) - return 0; - - return 1+mSelectedEmoteIndex; -} - -void SmileyContainer::selectNone() -{ - setSelectedEmoteIndex(NO_EMOTE); -} - -void SmileyContainer::setSelectedEmoteIndex(int index) -{ - if (index < 0 || index >= mMaxSmiley ) - mSelectedEmoteIndex = NO_EMOTE; - else - mSelectedEmoteIndex = index; -} - -void SmileyContainer::distributeValueChangedEvent() -{ - gcn::SelectionEvent event(this); - std::list::iterator i_end = mListeners.end(); - std::list::iterator i; - - for (i = mListeners.begin(); i != i_end; ++i) - { - (*i)->valueChanged(event); - } -} - -void SmileyContainer::mousePressed(gcn::MouseEvent &event) -{ - int button = event.getButton(); - if (button == gcn::MouseEvent::LEFT || button == gcn::MouseEvent::RIGHT) - { - int columns = getWidth() / gridWidth; - int mx = event.getX(); - int my = event.getY(); - int index = mx / gridWidth + ((my / gridHeight) * columns); - if (index setSmileySelected(index+1); - } - } -} diff --git a/src/gui/smileycontainer.h b/src/gui/smileycontainer.h deleted file mode 100644 index 88ca0b48..00000000 --- a/src/gui/smileycontainer.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _TMW_SMILEYCONTAINER_H__ -#define _TMW_SMILEYCONTAINER_H__ - -#include - -#include -#include -#include - -#include "../resources/imageset.h" -#include "../guichanfwd.h" - -class Image; -class Inventory; -class Emote; - -namespace gcn { - class SelectionListener; -} - -/** - * An item container. Used to show items in inventory and trade dialog. - * - * \ingroup GUI - */ -class SmileyContainer : public gcn::Widget, - public gcn::MouseListener, - public gcn::WidgetListener -{ - public: - /** - * Constructor. Initializes the graphic. - */ - SmileyContainer(); - - /** - * Destructor. - */ - virtual ~SmileyContainer(); - - /** - * Draws the items. - */ - void draw(gcn::Graphics *graphics); - - /** - * Called whenever the widget changes size. - */ - void widgetResized(const gcn::Event &event); - - /** - * Handles mouse click. - */ - void mousePressed(gcn::MouseEvent &event); - - /** - * Returns the selected item. - */ - int getSelectedSmiley(); - - /** - * Sets selected item to NULL. - */ - void selectNone(); - - /** - * Adds a listener to the list that's notified each time a change to - * the selection occurs. - */ - void addSelectionListener(gcn::SelectionListener *listener) - { - mListeners.push_back(listener); - } - - /** - * Removes a listener from the list that's notified each time a change - * to the selection occurs. - */ - void removeSelectionListener(gcn::SelectionListener *listener) - { - mListeners.remove(listener); - } - - private: - /** - - * Sets the currently selected item. Invalid (e.g., negative) indices set `no item'. - */ - void setSelectedEmoteIndex(int index); - - /** - * Find the current item index by the most recently used item ID - */ - void refindSelectedEmote(void); - - /** - * Determine and set the height of the container. - */ - void recalculateHeight(void); - - /** - * Sends out selection events to the list of selection listeners. - */ - void distributeValueChangedEvent(void); - - ImageSet *mSmileyImg; - Image *mSelImg; - int mSelectedEmoteIndex; - - int mMaxSmiley; - - std::list mListeners; - - static const int gridWidth; - static const int gridHeight; -}; - -#endif diff --git a/src/gui/smileyshortcutcontainer.cpp b/src/gui/smileyshortcutcontainer.cpp deleted file mode 100644 index c3cd056d..00000000 --- a/src/gui/smileyshortcutcontainer.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - * The Mana World - * Copyright 2007 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "smileyshortcutcontainer.h" - -#include "../graphics.h" -#include "../inventory.h" -#include "../item.h" -#include "../itemshortcut.h" -#include "../smileyshortcut.h" -#include "../keyboardconfig.h" -#include "../localplayer.h" -#include "../log.h" - - -#include "../resources/image.h" -#include "../resources/resourcemanager.h" - -#include "../utils/gettext.h" -#include "../utils/tostring.h" - -SmileyShortcutContainer::SmileyShortcutContainer(): - mSmileyClicked(false), - mSmileyMoved(0) -{ - mGridWidth = 1, - mGridHeight = 1, - addMouseListener(this); - addWidgetListener(this); - - ResourceManager *resman = ResourceManager::getInstance(); - - mBackgroundImg = resman->getImage("graphics/gui/item_shortcut_bgr.png"); - mSmileyImg = resman->getImageSet("graphics/sprites/emotions.png", 30, 32); - if (!mSmileyImg) logger->error(_("Unable to load emotions")); - - mMaxItems = smileyShortcut->getSmileyCount(); - - mBoxHeight = 42; - mBoxWidth = 36; -} - -SmileyShortcutContainer::~SmileyShortcutContainer() -{ - mBackgroundImg->decRef(); - if (mSmileyImg) - { - mSmileyImg->decRef(); - mSmileyImg=NULL; - } - -} - -void -SmileyShortcutContainer::draw(gcn::Graphics *graphics) -{ - Graphics *g = static_cast(graphics); - - graphics->setFont(getFont()); - - for (int i = 0; i < mMaxItems; i++) - { - const int itemX = (i % mGridWidth) * mBoxWidth; - const int itemY = (i / mGridWidth) * mBoxHeight; - - g->drawImage(mBackgroundImg, itemX, itemY); - - // Draw item keyboard shortcut. - const char *key = SDL_GetKeyName( - (SDLKey) keyboard.getKeyValue(keyboard.KEY_SMILEY_1 + i)); - graphics->setColor(0x000000); - g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); - if (smileyShortcut->getSmiley(i)) - { - static_cast(graphics)->drawImage( - mSmileyImg->get(smileyShortcut->getSmiley(i)-1), itemX+2, itemY+10); - } - - } - if (mSmileyMoved) - { - // Draw the item image being dragged by the cursor. - Image* image = mSmileyImg->get(mSmileyMoved-1); - if (image) - { - const int tPosX = mCursorPosX - (image->getWidth() / 2); - const int tPosY = mCursorPosY - (image->getHeight() / 2); - - g->drawImage(image, tPosX, tPosY); - } - } -} - -void -SmileyShortcutContainer::mouseDragged(gcn::MouseEvent &event) -{ - if (event.getButton() == gcn::MouseEvent::LEFT) { - if (!mSmileyMoved && mSmileyClicked) { - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - return; - } - const int smileyId = smileyShortcut->getSmiley(index); - if (smileyId) - { - mSmileyMoved = smileyId; - smileyShortcut->removeSmiley(index); - } - } - if (mSmileyMoved) { - mCursorPosX = event.getX(); - mCursorPosY = event.getY(); - } - } -} - -void -SmileyShortcutContainer::mousePressed(gcn::MouseEvent &event) -{ - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - return; - } - // Stores the selected item if theirs one. - if (smileyShortcut->isSmileySelected()) { - smileyShortcut->setSmiley(index); - smileyShortcut->setSmileySelected(0); - } - else if (smileyShortcut->getSmiley(index)) { - mSmileyClicked = true; - } -} - -void -SmileyShortcutContainer::mouseReleased(gcn::MouseEvent &event) -{ - if (event.getButton() == gcn::MouseEvent::LEFT) - { - if (smileyShortcut->isSmileySelected()) - { - smileyShortcut->setSmileySelected(0); - } - const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) { - mSmileyMoved = 0; - return; - } - if (mSmileyMoved) { - smileyShortcut->setSmileys(index, mSmileyMoved); - mSmileyMoved = 0; - } - else if (smileyShortcut->getSmiley(index) && mSmileyClicked) - { - smileyShortcut->useSmiley(index+1); - } - if (mSmileyClicked) { - mSmileyClicked = false; - } - } -} - diff --git a/src/gui/smileyshortcutcontainer.h b/src/gui/smileyshortcutcontainer.h deleted file mode 100644 index 55df6124..00000000 --- a/src/gui/smileyshortcutcontainer.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The Mana World - * Copyright 2007 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _TMW_SMILEYSHORTCUTCONTAINER_H__ -#define _TMW_SMILEYSHORTCUTCONTAINER_H__ - -#include -#include -#include - -#include "../resources/imageset.h" -#include "../guichanfwd.h" - -#include "shortcutcontainer.h" - -class Image; -class Item; - -/** - * A smiley shortcut container. Used to quickly use items. - * - * \ingroup GUI - */ -class SmileyShortcutContainer : public ShortcutContainer -{ - public: - /** - * Constructor. Initializes the graphic. - */ - SmileyShortcutContainer(); - - /** - * Destructor. - */ - virtual ~SmileyShortcutContainer(); - - /** - * Draws the items. - */ - void draw(gcn::Graphics *graphics); - - /** - * Handles mouse when dragged. - */ - void mouseDragged(gcn::MouseEvent &event); - - /** - * Handles mouse when pressed. - */ - void mousePressed(gcn::MouseEvent &event); - - /** - * Handles mouse release. - */ - void mouseReleased(gcn::MouseEvent &event); - - private: - ImageSet *mSmileyImg; - - bool mSmileyClicked; - int mSmileyMoved; -}; - -#endif diff --git a/src/gui/smileywindow.cpp b/src/gui/smileywindow.cpp deleted file mode 100644 index e3e821ff..00000000 --- a/src/gui/smileywindow.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include - -#include "button.h" -#include "gui.h" -#include "smileywindow.h" -#include "smileycontainer.h" -#include "scrollarea.h" - -#include "../localplayer.h" - -#include "../utils/gettext.h" -#include "../utils/tostring.h" - -SmileyWindow::SmileyWindow(): - Window(_("Emote")) -{ - setWindowName(_("Emote")); - setResizable(true); - setCloseButton(true); - setMinWidth(80); - setDefaultSize(115, 25, 322, 200); - - mUseButton = new Button(_("Use"), "use", this); - - mEmotes = new SmileyContainer(); - mEmotes->addSelectionListener(this); - - mInvenScroll = new ScrollArea(mEmotes); - mInvenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - - draw(); - - add(mUseButton); - add(mInvenScroll); - - mUseButton->setSize(60, mUseButton->getHeight()); - - loadWindowState(); -} - -void SmileyWindow::action(const gcn::ActionEvent &event) -{ - int emote = mEmotes->getSelectedSmiley(); - - if (!emote) - return; - - player_node->emote(emote); -} - - -void SmileyWindow::draw() -{ - const gcn::Rectangle &area = getChildrenArea(); - const int width = area.width; - const int height = area.height; - - mUseButton->setPosition(8, height - 8 - mUseButton->getHeight()); - - mInvenScroll->setSize(width - 16, mUseButton->getY() - 18); - mInvenScroll->setPosition(8, 10); - - setMinHeight(130); -} - -void SmileyWindow::widgetResized(const gcn::Event &event) -{ - Window::widgetResized(event); - draw(); -} - - -int SmileyWindow::getSelectedSmiley() const -{ - return mEmotes->getSelectedSmiley(); -} diff --git a/src/gui/smileywindow.h b/src/gui/smileywindow.h deleted file mode 100644 index db27fcbd..00000000 --- a/src/gui/smileywindow.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _TMW_SMILEYWINDOW_H -#define _TMW_SMILEYWINDOW_H - -#include -#include - -#include "textbox.h" -#include "window.h" - -#include "../guichanfwd.h" - -class Item; -class SmileyContainer; - -/** - * smiley dialog. - * - * \ingroup Interface - */ -class SmileyWindow : public Window, gcn::ActionListener, - gcn::SelectionListener -{ - public: - /** - * Constructor. - */ - SmileyWindow(); - - /** - * Called when receiving actions from the widgets. - */ - void action(const gcn::ActionEvent &event); - - /** - * Returns the selected item. - */ - int getSelectedSmiley() const; - - /** - * Updates window drawing. - */ - void draw(); - - /** - * Called whenever the widget changes size. - */ - void widgetResized(const gcn::Event &event); - - private: - - SmileyContainer *mEmotes; - - gcn::Button *mUseButton; - gcn::ScrollArea *mInvenScroll; -}; - -extern SmileyWindow *smileyWindow; - -#endif diff --git a/src/itemshortcut.h b/src/itemshortcut.h index a0c52468..57800d96 100644 --- a/src/itemshortcut.h +++ b/src/itemshortcut.h @@ -22,7 +22,7 @@ #ifndef _TMW_ITEMSHORTCUT_H__ #define _TMW_ITEMSHORTCUT_H__ -#define SHORTCUT_ITEMS 10 +#define SHORTCUT_ITEMS 12 class Item; diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 0923f331..932f6ad2 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -50,7 +50,6 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { {"keyPickup", SDLK_z, "Pickup"}, {"keyHideWindows", SDLK_h, "Hide Windows"}, {"keyBeingSit", SDLK_s, "Sit"}, - {"keyShortcut0", SDLK_0, "Item Shortcut 0"}, {"keyShortcut1", SDLK_1, "Item Shortcut 1"}, {"keyShortcut2", SDLK_2, "Item Shortcut 2"}, {"keyShortcut3", SDLK_3, "Item Shortcut 3"}, @@ -60,6 +59,9 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { {"keyShortcut7", SDLK_7, "Item Shortcut 7"}, {"keyShortcut8", SDLK_8, "Item Shortcut 8"}, {"keyShortcut9", SDLK_9, "Item Shortcut 9"}, + {"keyShortcut10", SDLK_0, "Item Shortcut 10"}, + {"keyShortcut11", SDLK_MINUS, "Item Shortcut 11"}, + {"keyShortcut12", SDLK_EQUALS, "Item Shortcut 12"}, {"keyWindowStatus", SDLK_F2, "Status Window"}, {"keyWindowInventory", SDLK_F3, "Inventory Window"}, {"keyWindowEquipment", SDLK_F4, "Equipment WIndow"}, @@ -69,20 +71,20 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { {"keyWindowShortcut", SDLK_F8, "Item Shortcut Window"}, {"keyWindowSetup", SDLK_F9, "Setup Window"}, {"keyWindowDebug", SDLK_F10, "Debug Window"}, - {"keyWindowSmileyList", SDLK_F11, "Smiley List Window"}, - {"keyWindowSmileyBar", SDLK_F12, "Smiley Shortcut Window"}, - {"keySmileyShortcut1", SDLK_KP1, "Smiley Shortcut 1"}, - {"keySmileyShortcut2", SDLK_KP2, "Smiley Shortcut 2"}, - {"keySmileyShortcut3", SDLK_KP3, "Smiley Shortcut 3"}, - {"keySmileyShortcut4", SDLK_KP4, "Smiley Shortcut 4"}, - {"keySmileyShortcut5", SDLK_KP5, "Smiley Shortcut 5"}, - {"keySmileyShortcut6", SDLK_KP6, "Smiley Shortcut 6"}, - {"keySmileyShortcut7", SDLK_KP7, "Smiley Shortcut 7"}, - {"keySmileyShortcut8", SDLK_KP8, "Smiley Shortcut 8"}, - {"keySmileyShortcut9", SDLK_KP9, "Smiley Shortcut 9"}, - {"keySmileyShortcut10", SDLK_KP0, "Smiley Shortcut 10"}, - {"keySmileyShortcut11", SDLK_KP_DIVIDE, "Smiley Shortcut 11"}, - {"keySmileyShortcut12", SDLK_KP_MULTIPLY, "Smiley Shortcut 12"} + {"keyWindowEmote", SDLK_F11, "Emote Window"}, + {"keyWindowEmoteBar", SDLK_F12, "Emote Shortcut Window"}, + {"keyEmoteShortcut1", SDLK_1, "Emote Shortcut 1"}, + {"keyEmoteShortcut2", SDLK_2, "Emote Shortcut 2"}, + {"keyEmoteShortcut3", SDLK_3, "Emote Shortcut 3"}, + {"keyEmoteShortcut4", SDLK_4, "Emote Shortcut 4"}, + {"keyEmoteShortcut5", SDLK_5, "Emote Shortcut 5"}, + {"keyEmoteShortcut6", SDLK_6, "Emote Shortcut 6"}, + {"keyEmoteShortcut7", SDLK_7, "Emote Shortcut 7"}, + {"keyEmoteShortcut8", SDLK_8, "Emote Shortcut 8"}, + {"keyEmoteShortcut9", SDLK_9, "Emote Shortcut 9"}, + {"keyEmoteShortcut10", SDLK_0, "Emote Shortcut 10"}, + {"keyEmoteShortcut11", SDLK_MINUS, "Emote Shortcut 11"}, + {"keyEmoteShortcut12", SDLK_EQUALS, "Emote Shortcut 12"} }; void KeyboardConfig::init() @@ -134,16 +136,11 @@ bool KeyboardConfig::hasConflicts() */ for (i = 0; i < KEY_TOTAL; i++) { - for (j = i,j++; j < KEY_TOTAL; j++) + for (j = i, j++; j < KEY_TOTAL; j++) { -/** - * KEY_SMILEY_* are separated from other keys, duplicate in different - * area is allowed, but not in same area (of course) - * (i.e.: not two identical key for smiley, not two identical for other; - * but same key for a smiley and a not-smiley is ok) - * - */ - if (!((i=KEY_SMILEY_1)) + // Allow for item shortcut and emote keys to overlap, but no other keys + if (!(((i >= KEY_SHORTCUT_1) && (i <= KEY_SHORTCUT_12)) && + ((j >= KEY_EMOTE_1) && (j <= KEY_EMOTE_12))) && mKey[i].value == mKey[j].value ) { @@ -171,13 +168,14 @@ int KeyboardConfig::getKeyIndex(int keyValue) const return KEY_NO_VALUE; } -int KeyboardConfig::getKeySmilieOffset(int keyValue) const + +int KeyboardConfig::getKeyEmoteOffset(int keyValue) const { - for (int i = KEY_SMILEY_1; i <= KEY_SMILEY_12; i++) + for (int i = KEY_EMOTE_1; i <= KEY_EMOTE_12; i++) { if(keyValue == mKey[i].value) { - return 1+i-KEY_SMILEY_1; + return 1 + i - KEY_EMOTE_1; } } return 0; diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index f6439795..716f9a17 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -103,9 +103,9 @@ class KeyboardConfig int getKeyIndex(int keyValue) const; /** - * Get the key function index for smiley by providing the offset value. + * Get the key function index for an emote by providing the offset value. */ - int getKeySmilieOffset(int keyValue) const; + int getKeyEmoteOffset(int keyValue) const; /** * Set the enable flag, which will stop the user from doing actions. @@ -147,8 +147,6 @@ class KeyboardConfig * KEY_TOTAL should always be last (used as a conditional in loops). * The key assignment view gets arranged according to the order of * these values. - * - * KEY_SMILEY_* must be also at the end (just before KEY_TOTAL) */ enum KeyAction { KEY_NO_VALUE = -1, @@ -157,7 +155,7 @@ class KeyboardConfig KEY_MOVE_LEFT, KEY_MOVE_RIGHT, KEY_ATTACK, - KEY_SMILIE, + KEY_EMOTE, KEY_TALK, KEY_TARGET, KEY_TARGET_CLOSEST, @@ -166,7 +164,6 @@ class KeyboardConfig KEY_PICKUP, KEY_HIDE_WINDOWS, KEY_SIT, - KEY_SHORTCUT_0, KEY_SHORTCUT_1, KEY_SHORTCUT_2, KEY_SHORTCUT_3, @@ -176,6 +173,9 @@ class KeyboardConfig KEY_SHORTCUT_7, KEY_SHORTCUT_8, KEY_SHORTCUT_9, + KEY_SHORTCUT_10, + KEY_SHORTCUT_11, + KEY_SHORTCUT_12, KEY_WINDOW_STATUS, KEY_WINDOW_INVENTORY, KEY_WINDOW_EQUIPMENT, @@ -185,20 +185,20 @@ class KeyboardConfig KEY_WINDOW_SHORTCUT, KEY_WINDOW_SETUP, KEY_WINDOW_DEBUG, - KEY_WINDOW_ALLSMILEY, - KEY_WINDOW_SMILEY_SHORTCUT, - KEY_SMILEY_1, - KEY_SMILEY_2, - KEY_SMILEY_3, - KEY_SMILEY_4, - KEY_SMILEY_5, - KEY_SMILEY_6, - KEY_SMILEY_7, - KEY_SMILEY_8, - KEY_SMILEY_9, - KEY_SMILEY_10, - KEY_SMILEY_11, - KEY_SMILEY_12, + KEY_WINDOW_EMOTE, + KEY_WINDOW_EMOTE_SHORTCUT, + KEY_EMOTE_1, + KEY_EMOTE_2, + KEY_EMOTE_3, + KEY_EMOTE_4, + KEY_EMOTE_5, + KEY_EMOTE_6, + KEY_EMOTE_7, + KEY_EMOTE_8, + KEY_EMOTE_9, + KEY_EMOTE_10, + KEY_EMOTE_11, + KEY_EMOTE_12, KEY_TOTAL }; diff --git a/src/main.cpp b/src/main.cpp index d9ebaefa..3cf8611d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,7 +40,6 @@ #include "game.h" #include "graphics.h" #include "itemshortcut.h" -#include "smileyshortcut.h" #include "keyboardconfig.h" #include "localplayer.h" #include "lockedarray.h" @@ -57,6 +56,7 @@ #include "gui/char_server.h" #include "gui/char_select.h" #include "gui/colour.h" +#include "gui/emoteshortcut.h" #include "gui/gui.h" #include "gui/login.h" #include "gui/ok_dialog.h" @@ -403,8 +403,8 @@ void init_engine(const Options &options) // Initialize the item shortcuts. itemShortcut = new ItemShortcut(); - // Initialize the smiley shortcuts. - smileyShortcut = new SmileyShortcut(); + // Initialize the emote shortcuts. + emoteShortcut = new EmoteShortcut(); gui = new Gui(graphics); state = LOGIN_STATE; /**< Initial game state */ @@ -438,7 +438,7 @@ void exit_engine() // Before config.write() since it writes the shortcuts to the config delete itemShortcut; - delete smileyShortcut; + delete emoteShortcut; config.write(); diff --git a/src/smileyshortcut.cpp b/src/smileyshortcut.cpp deleted file mode 100644 index adc7d9c3..00000000 --- a/src/smileyshortcut.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * The Mana World - * Copyright 2007 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "configuration.h" -#include "smileyshortcut.h" -#include "localplayer.h" - -#include "utils/tostring.h" - -SmileyShortcut::SmileyShortcut *smileyShortcut; - -SmileyShortcut::SmileyShortcut(): - mSmileySelected(0) -{ - for (int i = 0; i < SHORTCUT_SMILEYS; i++) - { - mSmileys[i] = i+1; - } - load(); -} - -SmileyShortcut::~SmileyShortcut() -{ - save(); -} - -void SmileyShortcut::load() -{ - for (int i = 0; i < SHORTCUT_SMILEYS; i++) - { - int smileyId = (int) config.getValue("Smileyshortcut" + toString(i), i+1); - - if (smileyId) - { - mSmileys[i] = smileyId; - } - } -} - -void SmileyShortcut::save() -{ - for (int i = 0; i < SHORTCUT_SMILEYS; i++) - { - const int smileyId = mSmileys[i] ? mSmileys[i] : 0; - config.setValue("Smileyshortcut" + toString(i), smileyId); - } -} - -void SmileyShortcut::useSmiley(int index) -{ - if ((index>0)&&(index<=SHORTCUT_SMILEYS)) - { - if (mSmileys[index-1]>0) - { - player_node->emote(mSmileys[index-1]); - } - } -} diff --git a/src/smileyshortcut.h b/src/smileyshortcut.h deleted file mode 100644 index c4fb9280..00000000 --- a/src/smileyshortcut.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * The Mana World - * Copyright 2007 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _TMW_SMILEYSHORTCUT_H__ -#define _TMW_SMILEYSHORTCUT_H__ - -#define SHORTCUT_SMILEYS 12 - -class Item; - -/** - * The class which keeps track of the item shortcuts. - */ -class SmileyShortcut -{ - public: - /** - * Constructor. - */ - SmileyShortcut(); - - /** - * Destructor. - */ - ~SmileyShortcut(); - - /** - * Load the configuration information. - */ - void load(); - - /** - * Returns the shortcut smiley ID specified by the index. - * - * @param index Index of the shortcut smiley. - */ - int getSmiley(int index) const - { return mSmileys[index]; } - - /** - * Returns the amount of shortcut smileys. - */ - int getSmileyCount() const - { return SHORTCUT_SMILEYS; } - - /** - * Returns the item ID that is currently selected. - */ - int getSmileySelected() const - { return mSmileySelected; } - - /** - * Adds the selected item ID to the items specified by the index. - * - * @param index Index of the items. - */ - void setSmiley(int index) - { mSmileys[index] = mSmileySelected; } - - /** - * Adds a smiley to the smileys store specified by the index. - * - * @param index Index of the smiley. - * @param smileyId ID of the smiley. - */ - void setSmileys(int index, int smileyId) - { mSmileys[index] = smileyId; } - - /** - * Set the smiley that is selected. - * - * @param smileyId The ID of the smiley that is to be assigned. - */ - void setSmileySelected(int smileyId) - { mSmileySelected = smileyId; } - - /** - * A flag to check if the smiley is selected. - */ - bool isSmileySelected() - { return mSmileySelected; } - - /** - * Remove a smiley from the shortcut. - */ - void removeSmiley(int index) - { mSmileys[index] = 0; } - - /** - * Try to use the smiley specified by the index. - * - * @param index Index of the smiley shortcut. - */ - void useSmiley(int index); - - private: - /** - * Save the configuration information. - */ - void save(); - - int mSmileys[SHORTCUT_SMILEYS]; /**< The smiley stored. */ - int mSmileySelected; /**< The smiley held by cursor. */ - -}; - -extern SmileyShortcut *smileyShortcut; - -#endif -- cgit v1.2.3-70-g09d2 From 50eae6ebe793295986071e748f3698154158d6cd Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 25 Jan 2009 22:00:00 +0100 Subject: Removed the TMW branding from header guards --- src/animatedsprite.h | 4 ++-- src/being.h | 4 ++-- src/beingmanager.h | 4 ++-- src/configlistener.h | 4 ++-- src/configuration.h | 4 ++-- src/emoteshortcut.h | 4 ++-- src/equipment.h | 4 ++-- src/floor_item.h | 4 ++-- src/flooritemmanager.h | 4 ++-- src/game.h | 4 ++-- src/gui/browserbox.h | 4 ++-- src/gui/button.h | 4 ++-- src/gui/buttonbox.h | 4 ++-- src/gui/buy.h | 4 ++-- src/gui/buysell.h | 4 ++-- src/gui/chat.h | 4 ++-- src/gui/chatinput.h | 4 ++-- src/gui/checkbox.h | 4 ++-- src/gui/confirm_dialog.h | 4 ++-- src/gui/connection.h | 4 ++-- src/gui/debugwindow.h | 4 ++-- src/gui/emotecontainer.h | 4 ++-- src/gui/emoteshortcutcontainer.h | 4 ++-- src/gui/emotewindow.h | 4 ++-- src/gui/equipmentwindow.h | 4 ++-- src/gui/focushandler.h | 4 ++-- src/gui/gccontainer.h | 4 ++-- src/gui/gui.h | 4 ++-- src/gui/help.h | 4 ++-- src/gui/inventorywindow.cpp | 2 +- src/gui/inventorywindow.h | 4 ++-- src/gui/item_amount.h | 6 +++--- src/gui/itemcontainer.h | 4 ++-- src/gui/itemlinkhandler.h | 4 ++-- src/gui/itempopup.h | 6 +++--- src/gui/itemshortcutcontainer.h | 4 ++-- src/gui/linkhandler.h | 4 ++-- src/gui/listbox.h | 4 ++-- src/gui/login.h | 4 ++-- src/gui/menuwindow.h | 4 ++-- src/gui/minimap.h | 4 ++-- src/gui/npc_text.h | 6 +++--- src/gui/npcintegerdialog.h | 6 +++--- src/gui/npclistdialog.h | 6 +++--- src/gui/npcstringdialog.h | 6 +++--- src/gui/passwordfield.h | 4 ++-- src/gui/playerbox.h | 4 ++-- src/gui/popupmenu.h | 4 ++-- src/gui/progressbar.h | 4 ++-- src/gui/radiobutton.h | 6 +++--- src/gui/register.h | 4 ++-- src/gui/scrollarea.h | 4 ++-- src/gui/sdlinput.h | 4 ++-- src/gui/sell.h | 4 ++-- src/gui/setup.h | 4 ++-- src/gui/setup_audio.h | 4 ++-- src/gui/setup_joystick.h | 4 ++-- src/gui/setup_keyboard.h | 4 ++-- src/gui/setup_players.h | 4 ++-- src/gui/setup_video.h | 4 ++-- src/gui/setuptab.h | 4 ++-- src/gui/shoplistbox.h | 4 ++-- src/gui/shortcutcontainer.h | 4 ++-- src/gui/shortcutwindow.h | 4 ++-- src/gui/skill.h | 4 ++-- src/gui/slider.h | 4 ++-- src/gui/status.h | 4 ++-- src/gui/table.h | 6 +++--- src/gui/table_model.h | 6 +++--- src/gui/textbox.h | 4 ++-- src/gui/textfield.h | 4 ++-- src/gui/trade.h | 4 ++-- src/gui/truetypefont.h | 4 ++-- src/gui/viewport.h | 4 ++-- src/gui/widgets/layout.h | 6 +++--- src/gui/widgets/resizegrip.h | 4 ++-- src/gui/widgets/tab.h | 4 ++-- src/gui/widgets/tabbedarea.h | 4 ++-- src/gui/window.h | 4 ++-- src/gui/windowcontainer.h | 4 ++-- src/guichanfwd.h | 4 ++-- src/item.h | 4 ++-- src/itemshortcut.h | 4 ++-- src/joystick.h | 6 +++--- src/keyboardconfig.h | 4 ++-- src/localplayer.h | 4 ++-- src/lockedarray.h | 4 ++-- src/logindata.h | 4 ++-- src/main.cpp | 2 +- src/main.h | 4 ++-- src/map.h | 4 ++-- src/monster.h | 4 ++-- src/net/beinghandler.h | 4 ++-- src/net/buysellhandler.h | 4 ++-- src/net/charserverhandler.h | 4 ++-- src/net/chathandler.h | 4 ++-- src/net/equipmenthandler.h | 4 ++-- src/net/inventoryhandler.h | 4 ++-- src/net/itemhandler.h | 4 ++-- src/net/loginhandler.h | 4 ++-- src/net/maploginhandler.h | 4 ++-- src/net/messagehandler.h | 4 ++-- src/net/messagein.h | 4 ++-- src/net/messageout.h | 4 ++-- src/net/network.h | 12 +++++++----- src/net/npchandler.h | 4 ++-- src/net/partyhandler.h | 4 ++-- src/net/playerhandler.h | 4 ++-- src/net/protocol.h | 4 ++-- src/net/skillhandler.h | 4 ++-- src/net/tradehandler.h | 4 ++-- src/npc.h | 4 ++-- src/openglgraphics.h | 4 ++-- src/party.h | 4 ++-- src/player.h | 4 ++-- src/player_relations.h | 6 +++--- src/position.h | 6 +++--- src/properties.h | 4 ++-- src/recorder.h | 10 +++++----- src/resources/action.h | 4 ++-- src/resources/ambientoverlay.h | 4 ++-- src/resources/animation.h | 4 ++-- src/resources/buddylist.h | 6 +++--- src/resources/colordb.h | 4 ++-- src/resources/dye.h | 4 ++-- src/resources/emotedb.h | 4 ++-- src/resources/image.h | 4 ++-- src/resources/imageloader.h | 4 ++-- src/resources/imageset.h | 4 ++-- src/resources/itemdb.h | 4 ++-- src/resources/iteminfo.h | 4 ++-- src/resources/mapreader.h | 4 ++-- src/resources/monsterdb.h | 4 ++-- src/resources/monsterinfo.h | 4 ++-- src/resources/music.h | 4 ++-- src/resources/npcdb.h | 4 ++-- src/resources/resource.h | 4 ++-- src/resources/resourcemanager.h | 4 ++-- src/resources/soundeffect.h | 4 ++-- src/resources/spritedef.h | 4 ++-- src/serverinfo.h | 4 ++-- src/shopitem.h | 4 ++-- src/simpleanimation.h | 4 ++-- src/sound.h | 4 ++-- src/sprite.h | 4 ++-- src/text.h | 7 ++++--- src/textmanager.h | 7 ++++--- src/tileset.h | 4 ++-- src/utils/base64.h | 6 +++--- src/utils/dtor.h | 4 ++-- src/utils/gettext.h | 4 ++-- src/utils/mutex.h | 6 +++--- src/utils/strprintf.h | 4 ++-- src/utils/tostring.h | 4 ++-- src/utils/trim.h | 4 ++-- src/utils/xml.h | 4 ++-- src/vector.h | 6 +++--- 157 files changed, 341 insertions(+), 337 deletions(-) (limited to 'src/gui/shortcutcontainer.h') diff --git a/src/animatedsprite.h b/src/animatedsprite.h index c8a2b3c5..b196b990 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ANIMATEDSPRITE_H -#define _TMW_ANIMATEDSPRITE_H +#ifndef ANIMATEDSPRITE_H +#define ANIMATEDSPRITE_H #include "resources/spritedef.h" diff --git a/src/being.h b/src/being.h index c47864e8..80295db8 100644 --- a/src/being.h +++ b/src/being.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_BEING_H -#define _TMW_BEING_H +#ifndef BEING_H +#define BEING_H #include #include diff --git a/src/beingmanager.h b/src/beingmanager.h index 267b4655..11721709 100644 --- a/src/beingmanager.h +++ b/src/beingmanager.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_BEINGMANAGER_H -#define _TMW_BEINGMANAGER_H +#ifndef BEINGMANAGER_H +#define BEINGMANAGER_H #include "being.h" diff --git a/src/configlistener.h b/src/configlistener.h index e62d41ea..51d58144 100644 --- a/src/configlistener.h +++ b/src/configlistener.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_CONFIGLISTENER_H -#define _TMW_CONFIGLISTENER_H +#ifndef CONFIGLISTENER_H +#define CONFIGLISTENER_H #include diff --git a/src/configuration.h b/src/configuration.h index f7a44410..0cc4e29f 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_CONFIGURATION_H -#define _TMW_CONFIGURATION_H +#ifndef CONFIGURATION_H +#define CONFIGURATION_H #include #include diff --git a/src/emoteshortcut.h b/src/emoteshortcut.h index 14162f73..3f907e1b 100644 --- a/src/emoteshortcut.h +++ b/src/emoteshortcut.h @@ -19,8 +19,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _AETHYRA_EMOTESHORTCUT_H__ -#define _AETHYRA_EMOTESHORTCUT_H__ +#ifndef EMOTESHORTCUT_H__ +#define EMOTESHORTCUT_H__ #define SHORTCUT_EMOTES 12 diff --git a/src/equipment.h b/src/equipment.h index 50fcbb32..ace76e63 100644 --- a/src/equipment.h +++ b/src/equipment.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_EQUIPMENT_H_ -#define _TMW_EQUIPMENT_H_ +#ifndef EQUIPMENT_H +#define EQUIPMENT_H class Item; diff --git a/src/floor_item.h b/src/floor_item.h index 589835b4..a7299bfb 100644 --- a/src/floor_item.h +++ b/src/floor_item.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_FLOORITEM_H_ -#define _TMW_FLOORITEM_H_ +#ifndef FLOORITEM_H +#define FLOORITEM_H #include "graphics.h" #include "item.h" diff --git a/src/flooritemmanager.h b/src/flooritemmanager.h index b527bbd2..3f96b587 100644 --- a/src/flooritemmanager.h +++ b/src/flooritemmanager.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_FLOORITEMMANAGER_H -#define _TMW_FLOORITEMMANAGER_H +#ifndef FLOORITEMMANAGER_H +#define FLOORITEMMANAGER_H #include diff --git a/src/game.h b/src/game.h index f674dbf0..4f512d97 100644 --- a/src/game.h +++ b/src/game.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GAME_ -#define _TMW_GAME_ +#ifndef GAME_ +#define GAME_ #include #include diff --git a/src/gui/browserbox.h b/src/gui/browserbox.h index c2c427f4..4290f0a2 100644 --- a/src/gui/browserbox.h +++ b/src/gui/browserbox.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __TMW_BROWSERBOX_H__ -#define __TMW_BROWSERBOX_H__ +#ifndef BROWSERBOX_H +#define BROWSERBOX_H #include #include diff --git a/src/gui/button.h b/src/gui/button.h index 51f6cffc..d8ed9fa7 100644 --- a/src/gui/button.h +++ b/src/gui/button.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_BUTTON_H -#define _TMW_BUTTON_H +#ifndef BUTTON_H +#define BUTTON_H #include diff --git a/src/gui/buttonbox.h b/src/gui/buttonbox.h index 1741f7ba..6d0e46b6 100644 --- a/src/gui/buttonbox.h +++ b/src/gui/buttonbox.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_BUTTONBOX_H -#define _TMW_BUTTONBOX_H +#ifndef BUTTONBOX_H +#define BUTTONBOX_H #include diff --git a/src/gui/buy.h b/src/gui/buy.h index 1b7ebe43..423918ce 100644 --- a/src/gui/buy.h +++ b/src/gui/buy.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_BUY_H -#define _TMW_BUY_H +#ifndef BUY_H +#define BUY_H #include #include diff --git a/src/gui/buysell.h b/src/gui/buysell.h index 0f41e9ed..60a6398d 100644 --- a/src/gui/buysell.h +++ b/src/gui/buysell.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_BUYSELL_H -#define _TMW_BUYSELL_H +#ifndef BUYSELL_H +#define BUYSELL_H #include diff --git a/src/gui/chat.h b/src/gui/chat.h index e5d0a4a9..176fccb7 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_CHAT_H -#define _TMW_CHAT_H +#ifndef CHAT_H +#define CHAT_H #include #include diff --git a/src/gui/chatinput.h b/src/gui/chatinput.h index fc5c18a3..d98e120b 100644 --- a/src/gui/chatinput.h +++ b/src/gui/chatinput.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_CHATINPUT_H -#define _TMW_CHATINPUT_H +#ifndef CHATINPUT_H +#define CHATINPUT_H #include diff --git a/src/gui/checkbox.h b/src/gui/checkbox.h index ea67ec02..d92fc822 100644 --- a/src/gui/checkbox.h +++ b/src/gui/checkbox.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_CHECKBOX_H -#define _TMW_CHECKBOX_H +#ifndef CHECKBOX_H +#define CHECKBOX_H #include diff --git a/src/gui/confirm_dialog.h b/src/gui/confirm_dialog.h index 63a867da..fb8290c8 100644 --- a/src/gui/confirm_dialog.h +++ b/src/gui/confirm_dialog.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_OPTION_DIALOG_H -#define _TMW_OPTION_DIALOG_H +#ifndef OPTION_DIALOG_H +#define OPTION_DIALOG_H #include diff --git a/src/gui/connection.h b/src/gui/connection.h index 0cbb8768..3caa611f 100644 --- a/src/gui/connection.h +++ b/src/gui/connection.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_CONNECTION_H -#define _TMW_CONNECTION_H +#ifndef CONNECTION_H +#define CONNECTION_H #include "window.h" diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h index 185915a2..00119d15 100644 --- a/src/gui/debugwindow.h +++ b/src/gui/debugwindow.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_DEBUGWINDOW_H -#define _TMW_DEBUGWINDOW_H +#ifndef DEBUGWINDOW_H +#define DEBUGWINDOW_H #include diff --git a/src/gui/emotecontainer.h b/src/gui/emotecontainer.h index 2231e01a..8e52a206 100644 --- a/src/gui/emotecontainer.h +++ b/src/gui/emotecontainer.h @@ -19,8 +19,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _AETHYRA_EMOTECONTAINER_H__ -#define _AETHYRA_EMOTECONTAINER_H__ +#ifndef EMOTECONTAINER_H__ +#define EMOTECONTAINER_H__ #include #include diff --git a/src/gui/emoteshortcutcontainer.h b/src/gui/emoteshortcutcontainer.h index f8a07dcc..71485259 100644 --- a/src/gui/emoteshortcutcontainer.h +++ b/src/gui/emoteshortcutcontainer.h @@ -19,8 +19,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _AETHYRA_EMOTESHORTCUTCONTAINER_H__ -#define _AETHYRA_EMOTESHORTCUTCONTAINER_H__ +#ifndef EMOTESHORTCUTCONTAINER_H__ +#define EMOTESHORTCUTCONTAINER_H__ #include diff --git a/src/gui/emotewindow.h b/src/gui/emotewindow.h index e92808dc..eaea1f7c 100644 --- a/src/gui/emotewindow.h +++ b/src/gui/emotewindow.h @@ -19,8 +19,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _AETHYRA_EMOTEWINDOW_H -#define _AETHYRA_EMOTEWINDOW_H +#ifndef EMOTEWINDOW_H +#define EMOTEWINDOW_H #include #include diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index c50e154e..3a3f37f4 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_EQUIPMENT_H -#define _TMW_EQUIPMENT_H +#ifndef EQUIPMENTWINDOW_H +#define EQUIPMENTWINDOW_H #include "window.h" #include "../inventory.h" diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h index a183a1c8..124b5472 100644 --- a/src/gui/focushandler.h +++ b/src/gui/focushandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_FOCUSHANDLER_H -#define _TMW_FOCUSHANDLER_H +#ifndef FOCUSHANDLER_H +#define FOCUSHANDLER_H #include diff --git a/src/gui/gccontainer.h b/src/gui/gccontainer.h index 03dcb785..0a573645 100644 --- a/src/gui/gccontainer.h +++ b/src/gui/gccontainer.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_GCCONTAINER_H -#define _TMW_GUI_GCCONTAINER_H +#ifndef GUI_GCCONTAINER_H +#define GUI_GCCONTAINER_H #include diff --git a/src/gui/gui.h b/src/gui/gui.h index 9f45a3f3..9681d44a 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI -#define _TMW_GUI +#ifndef GUI +#define GUI #include diff --git a/src/gui/help.h b/src/gui/help.h index b4627389..2ba74c0a 100644 --- a/src/gui/help.h +++ b/src/gui/help.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_HELP_H -#define _TMW_HELP_H +#ifndef HELP_H +#define HELP_H #include diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index da549841..64227c2d 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -109,7 +109,7 @@ void InventoryWindow::logic() // Adjust widgets mWeight = _("Weight: ") + mTotalWeight + " g / " + - mMaxWeight + _(" g Slots: ") + + mMaxWeight + _(" g Slots: ") + toString(player_node->getInventory()->getNumberOfSlotsUsed()) + "/" + toString(player_node->getInventory()->getInventorySize()); diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index e14994df..000112e8 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_INVENTORYWINDOW_H -#define _TMW_INVENTORYWINDOW_H +#ifndef INVENTORYWINDOW_H +#define INVENTORYWINDOW_H #include #include diff --git a/src/gui/item_amount.h b/src/gui/item_amount.h index e6086f82..d8eedadb 100644 --- a/src/gui/item_amount.h +++ b/src/gui/item_amount.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEM_AMOUNT_WINDOW_H -#define _TMW_ITEM_AMOUNT_WINDOW_H +#ifndef ITEM_AMOUNT_WINDOW_H +#define ITEM_AMOUNT_WINDOW_H #include @@ -69,4 +69,4 @@ class ItemAmountWindow : public Window, public gcn::ActionListener gcn::Slider *mItemAmountSlide; }; -#endif /* _TMW_ITEM_AMOUNT_WINDOW_H */ +#endif /* ITEM_AMOUNT_WINDOW_H */ diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h index 0eb940f5..aac06bae 100644 --- a/src/gui/itemcontainer.h +++ b/src/gui/itemcontainer.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEMCONTAINER_H__ -#define _TMW_ITEMCONTAINER_H__ +#ifndef ITEMCONTAINER_H +#define ITEMCONTAINER_H #include diff --git a/src/gui/itemlinkhandler.h b/src/gui/itemlinkhandler.h index 973aab75..cd6fd900 100644 --- a/src/gui/itemlinkhandler.h +++ b/src/gui/itemlinkhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEM_LINK_HANDLER_H_ -#define _TMW_ITEM_LINK_HANDLER_H_ +#ifndef ITEM_LINK_HANDLER_H_ +#define ITEM_LINK_HANDLER_H_ #include "linkhandler.h" diff --git a/src/gui/itempopup.h b/src/gui/itempopup.h index 4206671e..8ae2c98f 100644 --- a/src/gui/itempopup.h +++ b/src/gui/itempopup.h @@ -20,8 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEMPOPUP_H__ -#define _TMW_ITEMPOPUP_H__ +#ifndef ITEMPOPUP_H__ +#define ITEMPOPUP_H__ #include "scrollarea.h" #include "textbox.h" @@ -46,4 +46,4 @@ class ItemPopup : public Window ScrollArea *mItemEffectScroll; }; -#endif // _TMW_ITEMPOPUP_H__ +#endif // ITEMPOPUP_H__ diff --git a/src/gui/itemshortcutcontainer.h b/src/gui/itemshortcutcontainer.h index d8ddf110..9b61ca86 100644 --- a/src/gui/itemshortcutcontainer.h +++ b/src/gui/itemshortcutcontainer.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEMSHORTCUTCONTAINER_H__ -#define _TMW_ITEMSHORTCUTCONTAINER_H__ +#ifndef ITEMSHORTCUTCONTAINER_H +#define ITEMSHORTCUTCONTAINER_H #include #include diff --git a/src/gui/linkhandler.h b/src/gui/linkhandler.h index b238f38b..ecc05b13 100644 --- a/src/gui/linkhandler.h +++ b/src/gui/linkhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_LINK_HANDLER_H_ -#define _TMW_LINK_HANDLER_H_ +#ifndef LINK_HANDLER_H +#define LINK_HANDLER_H #include diff --git a/src/gui/listbox.h b/src/gui/listbox.h index 69ba45f4..3d0062bc 100644 --- a/src/gui/listbox.h +++ b/src/gui/listbox.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_LISTBOX_H -#define _TMW_LISTBOX_H +#ifndef LISTBOX_H +#define LISTBOX_H #include diff --git a/src/gui/login.h b/src/gui/login.h index c8fcc267..b85e5ae1 100644 --- a/src/gui/login.h +++ b/src/gui/login.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_LOGIN_H -#define _TMW_LOGIN_H +#ifndef LOGIN_H +#define LOGIN_H #include #include diff --git a/src/gui/menuwindow.h b/src/gui/menuwindow.h index 539cdc24..9b784c35 100644 --- a/src/gui/menuwindow.h +++ b/src/gui/menuwindow.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MENU_H -#define _TMW_MENU_H +#ifndef MENU_H +#define MENU_H #include "window.h" diff --git a/src/gui/minimap.h b/src/gui/minimap.h index 6b2b7f52..b4574ad5 100644 --- a/src/gui/minimap.h +++ b/src/gui/minimap.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MINIMAP_H -#define _TMW_MINIMAP_H +#ifndef MINIMAP_H +#define MINIMAP_H #include "window.h" diff --git a/src/gui/npc_text.h b/src/gui/npc_text.h index f6b059ea..b4b6f1af 100644 --- a/src/gui/npc_text.h +++ b/src/gui/npc_text.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NPC_TEXT_H -#define _TMW_NPC_TEXT_H +#ifndef NPC_TEXT_H +#define NPC_TEXT_H #include @@ -77,4 +77,4 @@ class NpcTextDialog : public Window, public gcn::ActionListener BrowserBox *mBrowserBox; }; -#endif // _TMW_NPC_TEXT_H +#endif // NPC_TEXT_H diff --git a/src/gui/npcintegerdialog.h b/src/gui/npcintegerdialog.h index d2c5f058..983c46fe 100644 --- a/src/gui/npcintegerdialog.h +++ b/src/gui/npcintegerdialog.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_NPCINTEGERDIALOG_H -#define _TMW_GUI_NPCINTEGERDIALOG_H +#ifndef GUI_NPCINTEGERDIALOG_H +#define GUI_NPCINTEGERDIALOG_H #include #include @@ -77,4 +77,4 @@ class NpcIntegerDialog : public Window, public gcn::ActionListener, gcn::Button *resetButton; }; -#endif // _TMW_GUI_NPCINTEGERDIALOG_H +#endif // GUI_NPCINTEGERDIALOG_H diff --git a/src/gui/npclistdialog.h b/src/gui/npclistdialog.h index 242e3a95..ffeced3d 100644 --- a/src/gui/npclistdialog.h +++ b/src/gui/npclistdialog.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_NPCLISTDIALOG_H -#define _TMW_GUI_NPCLISTDIALOG_H +#ifndef GUI_NPCLISTDIALOG_H +#define GUI_NPCLISTDIALOG_H #include #include @@ -86,4 +86,4 @@ class NpcListDialog : public Window, public gcn::ActionListener, std::vector mItems; }; -#endif // _TMW_GUI_NPCLISTDIALOG_H +#endif // GUI_NPCLISTDIALOG_H diff --git a/src/gui/npcstringdialog.h b/src/gui/npcstringdialog.h index e57003e9..5aea2de0 100644 --- a/src/gui/npcstringdialog.h +++ b/src/gui/npcstringdialog.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_NPCSTRINGDIALOG_H -#define _TMW_GUI_NPCSTRINGDIALOG_H +#ifndef GUI_NPCSTRINGDIALOG_H +#define GUI_NPCSTRINGDIALOG_H #include #include @@ -75,4 +75,4 @@ class NpcStringDialog : public Window, public gcn::ActionListener gcn::Button *cancelButton; }; -#endif // _TMW_GUI_NPCSTRINGDIALOG_H +#endif // GUI_NPCSTRINGDIALOG_H diff --git a/src/gui/passwordfield.h b/src/gui/passwordfield.h index 033c4bf9..e01bedbd 100644 --- a/src/gui/passwordfield.h +++ b/src/gui/passwordfield.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_PASSWORDFIELD_H_ -#define _TMW_PASSWORDFIELD_H_ +#ifndef PASSWORDFIELD_H +#define PASSWORDFIELD_H #include "textfield.h" diff --git a/src/gui/playerbox.h b/src/gui/playerbox.h index 75dfe14c..5aacd26f 100644 --- a/src/gui/playerbox.h +++ b/src/gui/playerbox.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __TMW_PLAYERBOX_H__ -#define __TMW_PLAYERBOX_H__ +#ifndef PLAYERBOX_H +#define PLAYERBOX_H #include diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h index 734b826f..715a9bb5 100644 --- a/src/gui/popupmenu.h +++ b/src/gui/popupmenu.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_POPUP_MENU_H -#define _TMW_POPUP_MENU_H +#ifndef POPUP_MENU_H +#define POPUP_MENU_H #include "linkhandler.h" #include "window.h" diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h index e874b56d..ee0a5f81 100644 --- a/src/gui/progressbar.h +++ b/src/gui/progressbar.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_PROGRESSBAR_H -#define _TMW_PROGRESSBAR_H +#ifndef PROGRESSBAR_H +#define PROGRESSBAR_H #include diff --git a/src/gui/radiobutton.h b/src/gui/radiobutton.h index 84c552b9..dcd62802 100644 --- a/src/gui/radiobutton.h +++ b/src/gui/radiobutton.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_RADIOBUTTON_H -#define _TMW_RADIOBUTTON_H +#ifndef RADIOBUTTON_H +#define RADIOBUTTON_H #include @@ -63,4 +63,4 @@ class RadioButton : public gcn::RadioButton { static Image *radioDisabledChecked; }; -#endif /* _TMW_RADIOBUTTON_H */ +#endif /* RADIOBUTTON_H */ diff --git a/src/gui/register.h b/src/gui/register.h index 58106a41..4b95a07b 100644 --- a/src/gui/register.h +++ b/src/gui/register.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_REGISTER_H -#define _TMW_REGISTER_H +#ifndef REGISTER_H +#define REGISTER_H #include diff --git a/src/gui/scrollarea.h b/src/gui/scrollarea.h index 26cba4a6..4fababfa 100644 --- a/src/gui/scrollarea.h +++ b/src/gui/scrollarea.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __TMW_SCROLLAREA_H__ -#define __TMW_SCROLLAREA_H__ +#ifndef SCROLLAREA_H +#define SCROLLAREA_H #include diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h index 67eb13a8..3901589a 100644 --- a/src/gui/sdlinput.h +++ b/src/gui/sdlinput.h @@ -55,8 +55,8 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _TMW_SDLINPUT_ -#define _TMW_SDLINPUT_ +#ifndef SDLINPUT_ +#define SDLINPUT_ #include diff --git a/src/gui/sell.h b/src/gui/sell.h index 0aba2909..8e639a3d 100644 --- a/src/gui/sell.h +++ b/src/gui/sell.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SELL_H -#define _TMW_SELL_H +#ifndef SELL_H +#define SELL_H #include #include diff --git a/src/gui/setup.h b/src/gui/setup.h index 1e0359aa..e4eb0902 100644 --- a/src/gui/setup.h +++ b/src/gui/setup.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SETUP_H -#define _TMW_SETUP_H +#ifndef SETUP_H +#define SETUP_H #include diff --git a/src/gui/setup_audio.h b/src/gui/setup_audio.h index a91cb6cb..2f5cd736 100644 --- a/src/gui/setup_audio.h +++ b/src/gui/setup_audio.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_SETUP_AUDIO_H -#define _TMW_GUI_SETUP_AUDIO_H +#ifndef GUI_SETUP_AUDIO_H +#define GUI_SETUP_AUDIO_H #include diff --git a/src/gui/setup_joystick.h b/src/gui/setup_joystick.h index fec38353..2dc56439 100644 --- a/src/gui/setup_joystick.h +++ b/src/gui/setup_joystick.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_SETUP_JOYSTICK_H -#define _TMW_GUI_SETUP_JOYSTICK_H +#ifndef GUI_SETUP_JOYSTICK_H +#define GUI_SETUP_JOYSTICK_H #include diff --git a/src/gui/setup_keyboard.h b/src/gui/setup_keyboard.h index 86dd920b..d4966053 100644 --- a/src/gui/setup_keyboard.h +++ b/src/gui/setup_keyboard.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_SETUP_KEYBOARD_H -#define _TMW_GUI_SETUP_KEYBOARD_H +#ifndef GUI_SETUP_KEYBOARD_H +#define GUI_SETUP_KEYBOARD_H #include diff --git a/src/gui/setup_players.h b/src/gui/setup_players.h index a1f1e8aa..22c8a9b6 100644 --- a/src/gui/setup_players.h +++ b/src/gui/setup_players.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_SETUP_PLAYERS_H -#define _TMW_GUI_SETUP_PLAYERS_H +#ifndef GUI_SETUP_PLAYERS_H +#define GUI_SETUP_PLAYERS_H #include diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h index e9cfb36e..d863fb64 100644 --- a/src/gui/setup_video.h +++ b/src/gui/setup_video.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_SETUP_VIDEO_H -#define _TMW_GUI_SETUP_VIDEO_H +#ifndef GUI_SETUP_VIDEO_H +#define GUI_SETUP_VIDEO_H #include #include diff --git a/src/gui/setuptab.h b/src/gui/setuptab.h index c1171fdb..3e0c51e2 100644 --- a/src/gui/setuptab.h +++ b/src/gui/setuptab.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUI_SETUPTAB_H -#define _TMW_GUI_SETUPTAB_H +#ifndef GUI_SETUPTAB_H +#define GUI_SETUPTAB_H #include "gccontainer.h" diff --git a/src/gui/shoplistbox.h b/src/gui/shoplistbox.h index c55db889..733af4eb 100644 --- a/src/gui/shoplistbox.h +++ b/src/gui/shoplistbox.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SHOPLISTBOX_H -#define _TMW_SHOPLISTBOX_H +#ifndef SHOPLISTBOX_H +#define SHOPLISTBOX_H #include "listbox.h" #include "shop.h" diff --git a/src/gui/shortcutcontainer.h b/src/gui/shortcutcontainer.h index 9d0584d3..d841f4d8 100644 --- a/src/gui/shortcutcontainer.h +++ b/src/gui/shortcutcontainer.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SHORTCUTCONTAINER_H__ -#define _TMW_SHORTCUTCONTAINER_H__ +#ifndef SHORTCUTCONTAINER_H__ +#define SHORTCUTCONTAINER_H__ #include #include diff --git a/src/gui/shortcutwindow.h b/src/gui/shortcutwindow.h index 3c9bfbea..0168669e 100644 --- a/src/gui/shortcutwindow.h +++ b/src/gui/shortcutwindow.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SHORTCUTWINDOW_H -#define _TMW_SHORTCUTWINDOW_H +#ifndef SHORTCUTWINDOW_H +#define SHORTCUTWINDOW_H #include "window.h" diff --git a/src/gui/skill.h b/src/gui/skill.h index 33298e96..955666d9 100644 --- a/src/gui/skill.h +++ b/src/gui/skill.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SKILL_H -#define _TMW_SKILL_H +#ifndef SKILL_H +#define SKILL_H #include diff --git a/src/gui/slider.h b/src/gui/slider.h index c2add662..c14c5be9 100644 --- a/src/gui/slider.h +++ b/src/gui/slider.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SLIDER_H -#define _TMW_SLIDER_H +#ifndef SLIDER_H +#define SLIDER_H #include diff --git a/src/gui/status.h b/src/gui/status.h index 795ed533..14a7617e 100644 --- a/src/gui/status.h +++ b/src/gui/status.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_STATUS_H -#define _TMW_STATUS_H +#ifndef STATUS_H +#define STATUS_H #include diff --git a/src/gui/table.h b/src/gui/table.h index 39a48dd5..e3fd8cf6 100644 --- a/src/gui/table.h +++ b/src/gui/table.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TMW_TABLE_H_ -#define TMW_TABLE_H_ +#ifndef TABLE_H +#define TABLE_H #include @@ -148,4 +148,4 @@ private: }; -#endif /* !defined(TMW_TABLE_H_) */ +#endif /* !defined(TABLE_H) */ diff --git a/src/gui/table_model.h b/src/gui/table_model.h index cd4bc6db..1c36ca46 100644 --- a/src/gui/table_model.h +++ b/src/gui/table_model.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TMW_TABLE_MODEL_H_ -#define TMW_TABLE_MODEL_H_ +#ifndef TABLE_MODEL_H +#define TABLE_MODEL_H #include #include @@ -176,4 +176,4 @@ protected: virtual void drawBackground(gcn::Graphics *graphics); }; -#endif /* !defined(TMW_TABLE_MODEL_H_) */ +#endif /* !defined(TABLE_MODEL_H) */ diff --git a/src/gui/textbox.h b/src/gui/textbox.h index 62385b1e..98b60402 100644 --- a/src/gui/textbox.h +++ b/src/gui/textbox.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __TMW_TEXTBOX_H__ -#define __TMW_TEXTBOX_H__ +#ifndef TEXTBOX_H +#define TEXTBOX_H #include diff --git a/src/gui/textfield.h b/src/gui/textfield.h index 4c887546..a2432175 100644 --- a/src/gui/textfield.h +++ b/src/gui/textfield.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __TMW_TEXTFIELD_H__ -#define __TMW_TEXTFIELD_H__ +#ifndef TEXTFIELD_H +#define TEXTFIELD_H #include diff --git a/src/gui/trade.h b/src/gui/trade.h index 910a5183..df724038 100644 --- a/src/gui/trade.h +++ b/src/gui/trade.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_TRADE_H -#define _TMW_TRADE_H +#ifndef TRADE_H +#define TRADE_H #include diff --git a/src/gui/truetypefont.h b/src/gui/truetypefont.h index bb3663cd..288be49a 100644 --- a/src/gui/truetypefont.h +++ b/src/gui/truetypefont.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_TRUETYPEFONT_H -#define _TMW_TRUETYPEFONT_H +#ifndef TRUETYPEFONT_H +#define TRUETYPEFONT_H #include diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 0a140ff9..5ed40166 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_VIEWPORT_H_ -#define _TMW_VIEWPORT_H_ +#ifndef VIEWPORT_H +#define VIEWPORT_H #include diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h index b9b8b0f8..20a4222d 100644 --- a/src/gui/widgets/layout.h +++ b/src/gui/widgets/layout.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_WIDGET_LAYOUT_H__ -#define _TMW_WIDGET_LAYOUT_H__ +#ifndef WIDGET_LAYOUT_H +#define WIDGET_LAYOUT_H #include @@ -317,4 +317,4 @@ class Layout: public LayoutCell bool mComputed; }; -#endif // _TMW_WIDGET_LAYOUT_H__ +#endif // WIDGET_LAYOUT_H diff --git a/src/gui/widgets/resizegrip.h b/src/gui/widgets/resizegrip.h index 6c517de8..7f1329a2 100644 --- a/src/gui/widgets/resizegrip.h +++ b/src/gui/widgets/resizegrip.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_RESIZEGRIP_H -#define _TMW_RESIZEGRIP_H +#ifndef RESIZEGRIP_H +#define RESIZEGRIP_H #include diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h index 6b6e06af..8382df83 100644 --- a/src/gui/widgets/tab.h +++ b/src/gui/widgets/tab.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_TAB_H -#define _TMW_TAB_H +#ifndef TAB_H +#define TAB_H #include diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 8d60409a..01d70380 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_TABBEDAREA_H -#define _TMW_TABBEDAREA_H +#ifndef TABBEDAREA_H +#define TABBEDAREA_H #include #include diff --git a/src/gui/window.h b/src/gui/window.h index fc808cf4..51b5186d 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_WINDOW_H__ -#define _TMW_WINDOW_H__ +#ifndef WINDOW_H +#define WINDOW_H #include diff --git a/src/gui/windowcontainer.h b/src/gui/windowcontainer.h index f087db2c..a3e80223 100644 --- a/src/gui/windowcontainer.h +++ b/src/gui/windowcontainer.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_WINDOWCONTAINER_H_ -#define _TMW_WINDOWCONTAINER_H_ +#ifndef WINDOWCONTAINER_H +#define WINDOWCONTAINER_H #include diff --git a/src/guichanfwd.h b/src/guichanfwd.h index 5fd05dbc..2e97db68 100644 --- a/src/guichanfwd.h +++ b/src/guichanfwd.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_GUICHANFWD_H -#define _TMW_GUICHANFWD_H +#ifndef GUICHANFWD_H +#define GUICHANFWD_H namespace gcn { class ActionListener; diff --git a/src/item.h b/src/item.h index 2543b594..3ea4a905 100644 --- a/src/item.h +++ b/src/item.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _ITEM_H_ -#define _ITEM_H_ +#ifndef ITEM_H +#define ITEM_H #include "resources/itemdb.h" diff --git a/src/itemshortcut.h b/src/itemshortcut.h index 5e448010..95e17f44 100644 --- a/src/itemshortcut.h +++ b/src/itemshortcut.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEMSHORTCUT_H__ -#define _TMW_ITEMSHORTCUT_H__ +#ifndef ITEMSHORTCUT_H +#define ITEMSHORTCUT_H #define SHORTCUT_ITEMS 12 diff --git a/src/joystick.h b/src/joystick.h index 867bf96a..a7090293 100644 --- a/src/joystick.h +++ b/src/joystick.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_JOYSTICK_H -#define _TMW_JOYSTICK_H +#ifndef JOYSTICK_H +#define JOYSTICK_H #include @@ -98,4 +98,4 @@ class Joystick void doCalibration(); }; -#endif // _TMW_JOYSTICK_H +#endif // JOYSTICK_H diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index 038a33af..2077126d 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_KEYBOARDCONFIG_H -#define _TMW_KEYBOARDCONFIG_H +#ifndef KEYBOARDCONFIG_H +#define KEYBOARDCONFIG_H #include diff --git a/src/localplayer.h b/src/localplayer.h index 236d63dc..4e0b205f 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_LOCALPLAYER_H -#define _TMW_LOCALPLAYER_H +#ifndef LOCALPLAYER_H +#define LOCALPLAYER_H #include "player.h" #include "simpleanimation.h" diff --git a/src/lockedarray.h b/src/lockedarray.h index e32f6305..2b4b099d 100644 --- a/src/lockedarray.h +++ b/src/lockedarray.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_LOCKEDARRAY_H -#define _TMW_LOCKEDARRAY_H +#ifndef LOCKEDARRAY_H +#define LOCKEDARRAY_H #include diff --git a/src/logindata.h b/src/logindata.h index ea494e15..410d2e73 100644 --- a/src/logindata.h +++ b/src/logindata.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_LOGINDATA_H -#define _TMW_LOGINDATA_H +#ifndef LOGINDATA_H +#define LOGINDATA_H #include diff --git a/src/main.cpp b/src/main.cpp index 8490ec94..b933742a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -680,7 +680,7 @@ void charLogin(Network *network, LoginData *loginData) outMsg.writeInt32(loginData->session_ID1); outMsg.writeInt32(loginData->session_ID2); // [Fate] The next word is unused by the old char server, so we squeeze in tmw client version information - outMsg.writeInt16(TMW_CLIENT_PROTOCOL_VERSION); + outMsg.writeInt16(CLIENT_PROTOCOL_VERSION); outMsg.writeInt8(loginData->sex); // We get 4 useless bytes before the real answer comes in diff --git a/src/main.h b/src/main.h index 0fe2b296..df2c4397 100644 --- a/src/main.h +++ b/src/main.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MAIN_H -#define _TMW_MAIN_H +#ifndef MAIN_H +#define MAIN_H #include diff --git a/src/map.h b/src/map.h index 73be3dd2..bd4cb122 100644 --- a/src/map.h +++ b/src/map.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MAP_H_ -#define _TMW_MAP_H_ +#ifndef MAP_H +#define MAP_H #include #include diff --git a/src/monster.h b/src/monster.h index ecd90766..8d7f8ae7 100644 --- a/src/monster.h +++ b/src/monster.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MONSTER_H -#define _TMW_MONSTER_H +#ifndef MONSTER_H +#define MONSTER_H #include "being.h" diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h index cb5941fd..54b82075 100644 --- a/src/net/beinghandler.h +++ b/src/net/beinghandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_BEINGHANDLER_H -#define _TMW_NET_BEINGHANDLER_H +#ifndef NET_BEINGHANDLER_H +#define NET_BEINGHANDLER_H #include "messagehandler.h" diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h index eb1f5853..0ede7b48 100644 --- a/src/net/buysellhandler.h +++ b/src/net/buysellhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_BUYSELLHANDLER_H -#define _TMW_NET_BUYSELLHANDLER_H +#ifndef NET_BUYSELLHANDLER_H +#define NET_BUYSELLHANDLER_H #include "messagehandler.h" diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h index 7e711fd9..37b378f2 100644 --- a/src/net/charserverhandler.h +++ b/src/net/charserverhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_CHARSERVERHANDLER_H -#define _TMW_NET_CHARSERVERHANDLER_H +#ifndef NET_CHARSERVERHANDLER_H +#define NET_CHARSERVERHANDLER_H #include "messagehandler.h" diff --git a/src/net/chathandler.h b/src/net/chathandler.h index 6393e401..ff649205 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_CHATHANDLER_H -#define _TMW_NET_CHATHANDLER_H +#ifndef NET_CHATHANDLER_H +#define NET_CHATHANDLER_H #include "messagehandler.h" diff --git a/src/net/equipmenthandler.h b/src/net/equipmenthandler.h index d477885d..c66d7932 100644 --- a/src/net/equipmenthandler.h +++ b/src/net/equipmenthandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_EQUIPMENTHANDLER_H -#define _TMW_NET_EQUIPMENTHANDLER_H +#ifndef NET_EQUIPMENTHANDLER_H +#define NET_EQUIPMENTHANDLER_H #include "messagehandler.h" diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index d18e428a..336b2e98 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_INVENTORYHANDLER_H -#define _TMW_NET_INVENTORYHANDLER_H +#ifndef NET_INVENTORYHANDLER_H +#define NET_INVENTORYHANDLER_H #include "messagehandler.h" diff --git a/src/net/itemhandler.h b/src/net/itemhandler.h index 621b7097..0cb3b42a 100644 --- a/src/net/itemhandler.h +++ b/src/net/itemhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_ITEMHANDLER_H -#define _TMW_NET_ITEMHANDLER_H +#ifndef NET_ITEMHANDLER_H +#define NET_ITEMHANDLER_H #include "messagehandler.h" diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 9024136f..c847b4c1 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_LOGINHANDLER_H -#define _TMW_NET_LOGINHANDLER_H +#ifndef NET_LOGINHANDLER_H +#define NET_LOGINHANDLER_H #include diff --git a/src/net/maploginhandler.h b/src/net/maploginhandler.h index a7267372..c7fee70c 100644 --- a/src/net/maploginhandler.h +++ b/src/net/maploginhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_MAPLOGINHANDLER_H -#define _TMW_NET_MAPLOGINHANDLER_H +#ifndef NET_MAPLOGINHANDLER_H +#define NET_MAPLOGINHANDLER_H #include "messagehandler.h" diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h index f46da788..45cdf8cd 100644 --- a/src/net/messagehandler.h +++ b/src/net/messagehandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_MESSAGEHANDLER_H -#define _TMW_NET_MESSAGEHANDLER_H +#ifndef NET_MESSAGEHANDLER_H +#define NET_MESSAGEHANDLER_H #include diff --git a/src/net/messagein.h b/src/net/messagein.h index 5cf7cbb5..0ff6e78a 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MESSAGEIN_ -#define _TMW_MESSAGEIN_ +#ifndef MESSAGEIN_ +#define MESSAGEIN_ #include #include diff --git a/src/net/messageout.h b/src/net/messageout.h index d377229a..b3a4ef68 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MESSAGEOUT_ -#define _TMW_MESSAGEOUT_ +#ifndef MESSAGEOUT_ +#define MESSAGEOUT_ #include #include diff --git a/src/net/network.h b/src/net/network.h index db4d7f07..c035f55c 100644 --- a/src/net/network.h +++ b/src/net/network.h @@ -19,17 +19,19 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NETWORK_ -#define _TMW_NETWORK_ +#ifndef NETWORK_ +#define NETWORK_ #include #include #include #include -#define TMW_CLIENT_PROTOCOL_VERSION 1 - /**< Protocol version, reported to the eAthena char and mapserver who - can adjust the protocol accordingly */ +/** + * Protocol version, reported to the eAthena char and mapserver who can adjust + * the protocol accordingly. + */ +#define CLIENT_PROTOCOL_VERSION 1 class MessageHandler; class MessageIn; diff --git a/src/net/npchandler.h b/src/net/npchandler.h index f47af523..7ac962eb 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_NPCHANDLER_H -#define _TMW_NET_NPCHANDLER_H +#ifndef NET_NPCHANDLER_H +#define NET_NPCHANDLER_H #include "messagehandler.h" diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index daabc52f..08d85ad0 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_PARTYHANDLER_H -#define _TMW_NET_PARTYHANDLER_H +#ifndef PARTYHANDLER_H +#define PARTYHANDLER_H #include "messagehandler.h" diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index ceefadf6..1a7c8da3 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_PLAYERHANDLER_H -#define _TMW_NET_PLAYERHANDLER_H +#ifndef NET_PLAYERHANDLER_H +#define NET_PLAYERHANDLER_H #include "messagehandler.h" diff --git a/src/net/protocol.h b/src/net/protocol.h index 8f2a2392..fd08c45d 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_PROTOCOL_ -#define _TMW_PROTOCOL_ +#ifndef PROTOCOL_ +#define PROTOCOL_ /********************************* * Packets from server to client * diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h index 44a0f894..2b55605d 100644 --- a/src/net/skillhandler.h +++ b/src/net/skillhandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_SKILLHANDLER_H -#define _TMW_NET_SKILLHANDLER_H +#ifndef NET_SKILLHANDLER_H +#define NET_SKILLHANDLER_H #include "messagehandler.h" diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h index 730c6971..d479e43f 100644 --- a/src/net/tradehandler.h +++ b/src/net/tradehandler.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NET_TRADEHANDLER_H -#define _TMW_NET_TRADEHANDLER_H +#ifndef NET_TRADEHANDLER_H +#define NET_TRADEHANDLER_H #include "messagehandler.h" diff --git a/src/npc.h b/src/npc.h index 00494060..dd8d7f5d 100644 --- a/src/npc.h +++ b/src/npc.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NPC_H -#define _TMW_NPC_H +#ifndef NPC_H +#define NPC_H #include "player.h" diff --git a/src/openglgraphics.h b/src/openglgraphics.h index 6ff80bcc..566d6252 100644 --- a/src/openglgraphics.h +++ b/src/openglgraphics.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_OPENGLGRAPHICS_H -#define _TMW_OPENGLGRAPHICS_H +#ifndef OPENGLGRAPHICS_H +#define OPENGLGRAPHICS_H #include "graphics.h" diff --git a/src/party.h b/src/party.h index 0e1afc3c..8d6dce47 100644 --- a/src/party.h +++ b/src/party.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_PARTY_H -#define _TMW_PARTY_H +#ifndef PARTY_H +#define PARTY_H #include diff --git a/src/player.h b/src/player.h index 11cccd04..5fe9963a 100644 --- a/src/player.h +++ b/src/player.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_PLAYER_H -#define _TMW_PLAYER_H +#ifndef PLAYER_H +#define PLAYER_H #include "being.h" #include "text.h" diff --git a/src/player_relations.h b/src/player_relations.h index 07ec7fcb..0f8bb4e3 100644 --- a/src/player_relations.h +++ b/src/player_relations.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TMW_PLAYER_RELATIONS_H_ -#define TMW_PLAYER_RELATIONS_H_ +#ifndef PLAYER_RELATIONS_H +#define PLAYER_RELATIONS_H #include #include @@ -239,4 +239,4 @@ private: extern PlayerRelationsManager player_relations; // singleton representation of player relations -#endif /* !defined(TMW_PLAYER_RELATIONS_H_) */ +#endif /* !defined(PLAYER_RELATIONS_H) */ diff --git a/src/position.h b/src/position.h index 7ef01466..cbcf8c99 100644 --- a/src/position.h +++ b/src/position.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TMW_POSITION_H -#define TMW_POSITION_H +#ifndef POSITION_H +#define POSITION_H #include #include @@ -55,4 +55,4 @@ std::ostream& operator <<(std::ostream &os, const Position &p); */ std::ostream& operator <<(std::ostream &os, const Path &path); -#endif // TMW_POSITION_H +#endif // POSITION_H diff --git a/src/properties.h b/src/properties.h index 81714dde..91367552 100644 --- a/src/properties.h +++ b/src/properties.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_PROPERTIES_H_ -#define _TMW_PROPERTIES_H_ +#ifndef PROPERTIES_H +#define PROPERTIES_H #include #include diff --git a/src/recorder.h b/src/recorder.h index c9955fd9..4a220166 100644 --- a/src/recorder.h +++ b/src/recorder.h @@ -1,8 +1,8 @@ /* - * The Mana World - * Copyright (C) 2004 The Mana World Development Team + * Aethyra + * Copyright (C) 2008 Aethyra Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_RECORD_H -#define _TMW_RECORD_H +#ifndef RECORD_H +#define RECORD_H #include #include diff --git a/src/resources/action.h b/src/resources/action.h index 1b5f1fc8..649d3828 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ACTION_H -#define _TMW_ACTION_H +#ifndef ACTION_H +#define ACTION_H #include diff --git a/src/resources/ambientoverlay.h b/src/resources/ambientoverlay.h index 1b03a19c..65f9891d 100644 --- a/src/resources/ambientoverlay.h +++ b/src/resources/ambientoverlay.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_RESOURCES_AMBIENTOVERLAY_H_ -#define _TMW_RESOURCES_AMBIENTOVERLAY_H_ +#ifndef RESOURCES_AMBIENTOVERLAY_H +#define RESOURCES_AMBIENTOVERLAY_H class Graphics; class Image; diff --git a/src/resources/animation.h b/src/resources/animation.h index 8ebebc6f..0c461ebe 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ANIMATION_H -#define _TMW_ANIMATION_H +#ifndef ANIMATION_H +#define ANIMATION_H #include diff --git a/src/resources/buddylist.h b/src/resources/buddylist.h index 40dd125d..d769b2b8 100644 --- a/src/resources/buddylist.h +++ b/src/resources/buddylist.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_BUDDYLIST_H -#define _TMW_BUDDYLIST_H +#ifndef BUDDYLIST_H +#define BUDDYLIST_H #include #include @@ -76,4 +76,4 @@ class BuddyList : public gcn::ListModel { std::string mFilename; /* File to work with */ }; -#endif /* _TMW_BUDDYLIST_H */ +#endif /* BUDDYLIST_H */ diff --git a/src/resources/colordb.h b/src/resources/colordb.h index 2b750fa3..da36048a 100644 --- a/src/resources/colordb.h +++ b/src/resources/colordb.h @@ -19,8 +19,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _AETHYRA_COLOR_MANAGER_H -#define _AETHYRA_COLOR_MANAGER_H +#ifndef COLOR_MANAGER_H +#define COLOR_MANAGER_H #include #include diff --git a/src/resources/dye.h b/src/resources/dye.h index 6bec8eb1..1db16c6a 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_DYE_H -#define _TMW_DYE_H +#ifndef DYE_H +#define DYE_H #include #include diff --git a/src/resources/emotedb.h b/src/resources/emotedb.h index 73354ec0..0962edad 100644 --- a/src/resources/emotedb.h +++ b/src/resources/emotedb.h @@ -19,8 +19,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _AETHYRA_EMOTE_DB_H -#define _AETHYRA_EMOTE_DB_H +#ifndef EMOTE_DB_H +#define EMOTE_DB_H #include #include diff --git a/src/resources/image.h b/src/resources/image.h index 0974b18b..a4048803 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_IMAGE_H -#define _TMW_IMAGE_H +#ifndef IMAGE_H +#define IMAGE_H #include diff --git a/src/resources/imageloader.h b/src/resources/imageloader.h index 05d7a838..0ac7c899 100644 --- a/src/resources/imageloader.h +++ b/src/resources/imageloader.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_IMAGELOADER_H -#define _TMW_IMAGELOADER_H +#ifndef IMAGELOADER_H +#define IMAGELOADER_H #include diff --git a/src/resources/imageset.h b/src/resources/imageset.h index f8939263..f59c76bb 100644 --- a/src/resources/imageset.h +++ b/src/resources/imageset.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_IMAGESET_H -#define _TMW_IMAGESET_H +#ifndef IMAGESET_H +#define IMAGESET_H #include diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h index 78279f4d..e7c23ca2 100644 --- a/src/resources/itemdb.h +++ b/src/resources/itemdb.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEM_MANAGER_H -#define _TMW_ITEM_MANAGER_H +#ifndef ITEM_MANAGER_H +#define ITEM_MANAGER_H #include diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 5e98d040..86725ca2 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_ITEMINFO_H_ -#define _TMW_ITEMINFO_H_ +#ifndef ITEMINFO_H +#define ITEMINFO_H #include #include diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h index bf797690..ef945c3f 100644 --- a/src/resources/mapreader.h +++ b/src/resources/mapreader.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MAPREADER_H_ -#define _TMW_MAPREADER_H_ +#ifndef MAPREADER_H +#define MAPREADER_H #include diff --git a/src/resources/monsterdb.h b/src/resources/monsterdb.h index cee1390b..6fbde55f 100644 --- a/src/resources/monsterdb.h +++ b/src/resources/monsterdb.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MONSTER_DB_H -#define _TMW_MONSTER_DB_H +#ifndef MONSTER_DB_H +#define MONSTER_DB_H #include diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index 77130be0..75464035 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MONSTERINFO_H_ -#define _TMW_MONSTERINFO_H_ +#ifndef MONSTERINFO_H +#define MONSTERINFO_H #include #include diff --git a/src/resources/music.h b/src/resources/music.h index 4d2ffd29..65f1ee88 100644 --- a/src/resources/music.h +++ b/src/resources/music.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_MUSIC_H -#define _TMW_MUSIC_H +#ifndef MUSIC_H +#define MUSIC_H #include diff --git a/src/resources/npcdb.h b/src/resources/npcdb.h index c2bd04e4..af6764bf 100644 --- a/src/resources/npcdb.h +++ b/src/resources/npcdb.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_NPC_DB_H -#define _TMW_NPC_DB_H +#ifndef NPC_DB_H +#define NPC_DB_H #include #include diff --git a/src/resources/resource.h b/src/resources/resource.h index 855d09b8..303b82c8 100644 --- a/src/resources/resource.h +++ b/src/resources/resource.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_RESOURCE_H -#define _TMW_RESOURCE_H +#ifndef RESOURCE_H +#define RESOURCE_H #include #include diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 4372195d..7996e816 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_RESOURCE_MANAGER_H -#define _TMW_RESOURCE_MANAGER_H +#ifndef RESOURCE_MANAGER_H +#define RESOURCE_MANAGER_H #include #include diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h index b19142b3..05ec9e54 100644 --- a/src/resources/soundeffect.h +++ b/src/resources/soundeffect.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SOUND_EFFECT_H -#define _TMW_SOUND_EFFECT_H +#ifndef SOUND_EFFECT_H +#define SOUND_EFFECT_H #include diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 4759ef4e..99d570f1 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SPRITEDEF_H -#define _TMW_SPRITEDEF_H +#ifndef SPRITEDEF_H +#define SPRITEDEF_H #include #include diff --git a/src/serverinfo.h b/src/serverinfo.h index d3be62fa..c38d13c7 100644 --- a/src/serverinfo.h +++ b/src/serverinfo.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SERVERINFO_ -#define _TMW_SERVERINFO_ +#ifndef SERVERINFO_ +#define SERVERINFO_ #include diff --git a/src/shopitem.h b/src/shopitem.h index 7da77cdf..3353ebe7 100644 --- a/src/shopitem.h +++ b/src/shopitem.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _SHOPITEM_H_ -#define _SHOPITEM_H_ +#ifndef _SHOPITEM_H +#define _SHOPITEM_H #include "item.h" diff --git a/src/simpleanimation.h b/src/simpleanimation.h index ce8832c3..a7178145 100644 --- a/src/simpleanimation.h +++ b/src/simpleanimation.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SIMPLEANIMAION_H -#define _TMW_SIMPLEANIMAION_H +#ifndef SIMPLEANIMAION_H +#define SIMPLEANIMAION_H #include "resources/animation.h" diff --git a/src/sound.h b/src/sound.h index 1b47e4c7..05b2def3 100644 --- a/src/sound.h +++ b/src/sound.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SOUND_H -#define _TMW_SOUND_H +#ifndef SOUND_H +#define SOUND_H #include #include diff --git a/src/sprite.h b/src/sprite.h index 321d6abe..a6384e94 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_SPRITE_H_ -#define _TMW_SPRITE_H_ +#ifndef SPRITE_H +#define SPRITE_H class Graphics; diff --git a/src/text.h b/src/text.h index 03f2dcbc..43d6b5ea 100644 --- a/src/text.h +++ b/src/text.h @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _AETHYRA_TEXT_H -#define _AETHYRA_TEXT_H +#ifndef TEXT_H +#define TEXT_H #include "graphics.h" #include "guichanfwd.h" @@ -89,4 +89,5 @@ class FlashText : public Text private: int mTime; /**< Time left for flashing */ }; -#endif + +#endif // TEXT_H diff --git a/src/textmanager.h b/src/textmanager.h index 6497c335..a08660d5 100644 --- a/src/textmanager.h +++ b/src/textmanager.h @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _AETHYRA_TEXTMANAGER_H -#define _AETHYRA_TEXTMANAGER_H +#ifndef TEXTMANAGER_H +#define TEXTMANAGER_H #include @@ -71,4 +71,5 @@ class TextManager }; extern TextManager *textManager; -#endif + +#endif // TEXTMANAGER_H diff --git a/src/tileset.h b/src/tileset.h index 040f7ef8..d4de7ba5 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_TILESET_H_ -#define _TMW_TILESET_H_ +#ifndef TILESET_H +#define TILESET_H #include "resources/imageset.h" diff --git a/src/utils/base64.h b/src/utils/base64.h index c802207b..92c23016 100644 --- a/src/utils/base64.h +++ b/src/utils/base64.h @@ -27,10 +27,10 @@ +----------------------------------------------------------------------+ */ -#ifndef _TMW_BASE64_H -#define _TMW_BASE64_H +#ifndef BASE64_H +#define BASE64_H extern unsigned char *php3_base64_encode(const unsigned char *, int, int *); extern unsigned char *php3_base64_decode(const unsigned char *, int, int *); -#endif /* _TMW_BASE64_H */ +#endif /* BASE64_H */ diff --git a/src/utils/dtor.h b/src/utils/dtor.h index 399cb8c2..0b71fa50 100644 --- a/src/utils/dtor.h +++ b/src/utils/dtor.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_UTILS_DTOR_H -#define _TMW_UTILS_DTOR_H +#ifndef UTILS_DTOR_H +#define UTILS_DTOR_H #include #include diff --git a/src/utils/gettext.h b/src/utils/gettext.h index 74502bb0..5281d491 100644 --- a/src/utils/gettext.h +++ b/src/utils/gettext.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_UTILS_GETTEXT_H -#define _TMW_UTILS_GETTEXT_H +#ifndef UTILS_GETTEXT_H +#define UTILS_GETTEXT_H #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/utils/mutex.h b/src/utils/mutex.h index 31e43e33..5e5df8f8 100644 --- a/src/utils/mutex.h +++ b/src/utils/mutex.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TMW_MUTEX_H -#define TMW_MUTEX_H +#ifndef MUTEX_H +#define MUTEX_H #include @@ -94,4 +94,4 @@ inline MutexLocker::~MutexLocker() mMutex->unlock(); } -#endif // TMW_MUTEX_H +#endif // MUTEX_H diff --git a/src/utils/strprintf.h b/src/utils/strprintf.h index 98ef5065..78e7a04c 100644 --- a/src/utils/strprintf.h +++ b/src/utils/strprintf.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_UTILS_STRPRINTF_H -#define _TMW_UTILS_STRPRINTF_H +#ifndef UTILS_STRPRINTF_H +#define UTILS_STRPRINTF_H #include diff --git a/src/utils/tostring.h b/src/utils/tostring.h index 0c3b600f..5ac1d3aa 100644 --- a/src/utils/tostring.h +++ b/src/utils/tostring.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_UTILS_TOSTRING_H -#define _TMW_UTILS_TOSTRING_H +#ifndef UTILS_TOSTRING_H +#define UTILS_TOSTRING_H #include diff --git a/src/utils/trim.h b/src/utils/trim.h index 9d0d5600..b7474ac7 100644 --- a/src/utils/trim.h +++ b/src/utils/trim.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_UTILS_TRIM_H_ -#define _TMW_UTILS_TRIM_H_ +#ifndef UTILS_TRIM_H +#define UTILS_TRIM_H #include diff --git a/src/utils/xml.h b/src/utils/xml.h index 6af5f1ca..2e08dd50 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_XML_H -#define _TMW_XML_H +#ifndef XML_H +#define XML_H #include diff --git a/src/vector.h b/src/vector.h index cd477301..6dd461ac 100644 --- a/src/vector.h +++ b/src/vector.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_VECTOR_H_ -#define _TMW_VECTOR_H_ +#ifndef VECTOR_H +#define VECTOR_H #include @@ -187,4 +187,4 @@ class Vector */ std::ostream& operator <<(std::ostream &os, const Vector &v); -#endif // _TMW_VECTOR_H_ +#endif // VECTOR_H -- cgit v1.2.3-70-g09d2 From ebc287a74689cfd283bd3a87d8969f3e689b6aa6 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 26 Jan 2009 20:37:01 -0700 Subject: Little bit of include cleanups. Signed-off-by: Ira Rice --- src/gui/emoteshortcutcontainer.h | 2 -- src/gui/emotewindow.cpp | 1 + src/gui/emotewindow.h | 4 ++-- src/gui/equipmentwindow.cpp | 11 ++++++----- src/gui/equipmentwindow.h | 3 +-- src/gui/itemcontainer.cpp | 1 + src/gui/itemcontainer.h | 3 +-- src/gui/itemshortcutcontainer.cpp | 1 + src/gui/itemshortcutcontainer.h | 6 ++---- src/gui/shortcutcontainer.h | 4 ++-- 10 files changed, 17 insertions(+), 19 deletions(-) (limited to 'src/gui/shortcutcontainer.h') diff --git a/src/gui/emoteshortcutcontainer.h b/src/gui/emoteshortcutcontainer.h index 71485259..cffaee6f 100644 --- a/src/gui/emoteshortcutcontainer.h +++ b/src/gui/emoteshortcutcontainer.h @@ -25,8 +25,6 @@ #include #include -#include -#include #include "shortcutcontainer.h" diff --git a/src/gui/emotewindow.cpp b/src/gui/emotewindow.cpp index 3653cb68..b4e9c735 100644 --- a/src/gui/emotewindow.cpp +++ b/src/gui/emotewindow.cpp @@ -28,6 +28,7 @@ #include "emotewindow.h" #include "emotecontainer.h" #include "scrollarea.h" +#include "textbox.h" #include "widgets/layout.h" diff --git a/src/gui/emotewindow.h b/src/gui/emotewindow.h index eaea1f7c..8e36e5ce 100644 --- a/src/gui/emotewindow.h +++ b/src/gui/emotewindow.h @@ -25,12 +25,12 @@ #include #include -#include "textbox.h" #include "window.h" #include "../guichanfwd.h" class EmoteContainer; +class TextBox; /** * Emote dialog. @@ -38,7 +38,7 @@ class EmoteContainer; * \ingroup Interface */ class EmoteWindow : public Window, gcn::ActionListener, - gcn::SelectionListener + gcn::SelectionListener { public: /** diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index b532d621..b37dfc3a 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -28,6 +28,7 @@ #include "equipmentwindow.h" #include "playerbox.h" +#include "../equipment.h" #include "../graphics.h" #include "../inventory.h" #include "../item.h" @@ -42,15 +43,15 @@ // Positions of the boxes, 2nd dimension is X and Y respectively. static const int boxPosition[][2] = { {50, 208}, // EQUIP_LEGS_SLOT - {8, 123}, // EQUIP_FIGHT1_SLOT - {8, 78}, // EQUIP_GLOVES_SLOT + {8, 123}, // EQUIP_FIGHT1_SLOT + {8, 78}, // EQUIP_GLOVES_SLOT {129, 168}, // EQUIP_RING2_SLOT - {8, 168}, // EQUIP_RING1_SLOT + {8, 168}, // EQUIP_RING1_SLOT {129, 123}, // EQUIP_FIGHT2_SLOT - {90, 208}, // EQUIP_FEET_SLOT + {90, 208}, // EQUIP_FEET_SLOT {50, 40}, // EQUIP_CAPE_SLOT {70, 0}, // EQUIP_HEAD_SLOT - {90, 40}, // EQUIP_TORSO_SLOT + {90, 40}, // EQUIP_TORSO_SLOT {129, 78} // EQUIP_AMMO_SLOT }; diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index d8018644..8e9b22eb 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -26,8 +26,7 @@ #include "window.h" -#include "../equipment.h" - +class Equipment; class Inventory; class PlayerBox; diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index e07a997c..ab3da9f6 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -25,6 +25,7 @@ #include #include "itemcontainer.h" +#include "itempopup.h" #include "../graphics.h" #include "../inventory.h" diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h index aac06bae..5513faa7 100644 --- a/src/gui/itemcontainer.h +++ b/src/gui/itemcontainer.h @@ -28,13 +28,12 @@ #include #include -#include "itempopup.h" - #include "../guichanfwd.h" class Image; class Inventory; class Item; +class ItemPopup; namespace gcn { class SelectionListener; diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 5179ceb8..8803ab15 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -21,6 +21,7 @@ #include #include "itemshortcutcontainer.h" +#include "itempopup.h" #include "../configuration.h" #include "../graphics.h" diff --git a/src/gui/itemshortcutcontainer.h b/src/gui/itemshortcutcontainer.h index 9b61ca86..d6a04d7b 100644 --- a/src/gui/itemshortcutcontainer.h +++ b/src/gui/itemshortcutcontainer.h @@ -23,16 +23,14 @@ #define ITEMSHORTCUTCONTAINER_H #include -#include -#include -#include "../guichanfwd.h" #include "shortcutcontainer.h" -#include "itempopup.h" +#include "../guichanfwd.h" class Image; class Item; +class ItemPopup; /** * An item shortcut container. Used to quickly use items. diff --git a/src/gui/shortcutcontainer.h b/src/gui/shortcutcontainer.h index d841f4d8..66aca6c3 100644 --- a/src/gui/shortcutcontainer.h +++ b/src/gui/shortcutcontainer.h @@ -36,8 +36,8 @@ class Image; * \ingroup GUI */ class ShortcutContainer : public gcn::Widget, - public gcn::WidgetListener, - public gcn::MouseListener + public gcn::WidgetListener, + public gcn::MouseListener { public: /** -- cgit v1.2.3-70-g09d2