summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-10 18:19:25 -0700
committerIra Rice <irarice@gmail.com>2009-01-10 18:19:25 -0700
commit4018856d2d30532ad2404de4462ff3e473938a22 (patch)
tree75330ae36ef00304a23981d445d75cc0af78a04e /src
parente1b29d03d1fa9f1e6716fdd03f4baa62a02240dd (diff)
downloadmana-client-4018856d2d30532ad2404de4462ff3e473938a22.tar.gz
mana-client-4018856d2d30532ad2404de4462ff3e473938a22.tar.bz2
mana-client-4018856d2d30532ad2404de4462ff3e473938a22.tar.xz
mana-client-4018856d2d30532ad2404de4462ff3e473938a22.zip
Changed a few emote variable names to be more sensible, as well as
removing emotions.png from the client data files (should have never been there to begin with, IMO). TODO: Simplify the emote code so that there is a lot less redundant code, as well as make filling out the possible emotes more flexible. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am20
-rw-r--r--src/being.cpp5
-rw-r--r--src/gui/smileycontainer.cpp26
-rw-r--r--src/gui/smileycontainer.h8
-rw-r--r--src/gui/smileyshortcutcontainer.cpp6
-rw-r--r--src/gui/smileywindow.cpp14
-rw-r--r--src/gui/smileywindow.h2
7 files changed, 41 insertions, 40 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index d267022b..e189b793 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,20 +47,10 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \
gui/inttextbox.cpp \
gui/inventorywindow.cpp \
gui/inventorywindow.h \
- gui/smileywindow.cpp \
- gui/smileywindow.h \
- gui/smileycontainer.cpp \
- gui/smileycontainer.h \
gui/itemcontainer.cpp \
gui/itemcontainer.h \
gui/itemshortcutcontainer.cpp \
gui/itemshortcutcontainer.h \
- gui/shortcutwindow.cpp \
- gui/shortcutwindow.h \
- gui/smileyshortcutcontainer.cpp \
- gui/smileyshortcutcontainer.h \
- gui/shortcutcontainer.cpp \
- gui/shortcutcontainer.h \
gui/item_amount.cpp \
gui/item_amount.h \
gui/linkhandler.h \
@@ -119,10 +109,20 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \
gui/shop.h \
gui/shoplistbox.cpp \
gui/shoplistbox.h \
+ gui/shortcutwindow.cpp \
+ gui/shortcutwindow.h \
+ gui/shortcutcontainer.cpp \
+ gui/shortcutcontainer.h \
gui/skill.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 \
diff --git a/src/being.cpp b/src/being.cpp
index ba3107db..5eb62b2d 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -44,6 +44,7 @@
#include "gui/speechbubble.h"
#include "utils/dtor.h"
+#include "utils/gettext.h"
#include "utils/tostring.h"
#include "utils/xml.h"
@@ -91,8 +92,8 @@ Being::Being(int id, int job, Map *map):
{
// Load the emotion set
ResourceManager *rm = ResourceManager::getInstance();
- emotionSet = rm->getImageSet("graphics/gui/emotions.png", 30, 32);
- if (!emotionSet) logger->error("Unable to load emotions!");
+ emotionSet = rm->getImageSet("graphics/sprites/emotions.png", 30, 32);
+ if (!emotionSet) logger->error(_("Unable to load emotions"));
// Hairstyles are encoded as negative numbers. Count how far negative we can go.
int hairstyles = 1;
diff --git a/src/gui/smileycontainer.cpp b/src/gui/smileycontainer.cpp
index d221f55c..f8f57c45 100644
--- a/src/gui/smileycontainer.cpp
+++ b/src/gui/smileycontainer.cpp
@@ -36,17 +36,17 @@
#include "../utils/gettext.h"
#include "../utils/tostring.h"
-const int SmileyContainer::gridWidth = 34; // item icon width + 4
-const int SmileyContainer::gridHeight = 36; // item icon height + 4
+const int SmileyContainer::gridWidth = 34; // emote icon width + 4
+const int SmileyContainer::gridHeight = 36; // emote icon height + 4
-static const int NO_ITEM = -1;
+static const int NO_EMOTE = -1;
SmileyContainer::SmileyContainer():
- mSelectedItemIndex(NO_ITEM)
+ mSelectedEmoteIndex(NO_EMOTE)
{
ResourceManager *resman = ResourceManager::getInstance();
- mSmileyImg = resman->getImageSet("graphics/gui/emotions.png",30,32);
+ mSmileyImg = resman->getImageSet("graphics/sprites/emotions.png", 30, 32);
if (!mSmileyImg) logger->error(_("Unable to load emotions"));
mSelImg = resman->getImage("graphics/gui/selection.png");
@@ -95,7 +95,7 @@ void SmileyContainer::draw(gcn::Graphics *graphics)
mSmileyImg->get(i), itemX, itemY);
// Draw selection image below selected item
- if (mSelectedItemIndex == i)
+ if (mSelectedEmoteIndex == i)
{
static_cast<Graphics*>(graphics)->drawImage(
mSelImg, itemX, itemY);
@@ -123,23 +123,23 @@ void SmileyContainer::recalculateHeight()
int SmileyContainer::getSelectedSmiley()
{
- if (mSelectedItemIndex == NO_ITEM)
+ if (mSelectedEmoteIndex == NO_EMOTE)
return 0;
- return 1+mSelectedItemIndex;
+ return 1+mSelectedEmoteIndex;
}
void SmileyContainer::selectNone()
{
- setSelectedItemIndex(NO_ITEM);
+ setSelectedEmoteIndex(NO_EMOTE);
}
-void SmileyContainer::setSelectedItemIndex(int index)
+void SmileyContainer::setSelectedEmoteIndex(int index)
{
if (index < 0 || index >= mMaxSmiley )
- mSelectedItemIndex = NO_ITEM;
+ mSelectedEmoteIndex = NO_EMOTE;
else
- mSelectedItemIndex = index;
+ mSelectedEmoteIndex = index;
}
void SmileyContainer::distributeValueChangedEvent()
@@ -165,7 +165,7 @@ void SmileyContainer::mousePressed(gcn::MouseEvent &event)
int index = mx / gridWidth + ((my / gridHeight) * columns);
if (index <mMaxSmiley)
{
- setSelectedItemIndex(index);
+ setSelectedEmoteIndex(index);
smileyShortcut->setSmileySelected(index+1);
}
}
diff --git a/src/gui/smileycontainer.h b/src/gui/smileycontainer.h
index ddfe9ec5..88ca0b48 100644
--- a/src/gui/smileycontainer.h
+++ b/src/gui/smileycontainer.h
@@ -33,7 +33,7 @@
class Image;
class Inventory;
-class Item;
+class Emote;
namespace gcn {
class SelectionListener;
@@ -107,12 +107,12 @@ class SmileyContainer : public gcn::Widget,
* Sets the currently selected item. Invalid (e.g., negative) indices set `no item'.
*/
- void setSelectedItemIndex(int index);
+ void setSelectedEmoteIndex(int index);
/**
* Find the current item index by the most recently used item ID
*/
- void refindSelectedItem(void);
+ void refindSelectedEmote(void);
/**
* Determine and set the height of the container.
@@ -126,7 +126,7 @@ class SmileyContainer : public gcn::Widget,
ImageSet *mSmileyImg;
Image *mSelImg;
- int mSelectedItemIndex;
+ int mSelectedEmoteIndex;
int mMaxSmiley;
diff --git a/src/gui/smileyshortcutcontainer.cpp b/src/gui/smileyshortcutcontainer.cpp
index 6028939f..c3cd056d 100644
--- a/src/gui/smileyshortcutcontainer.cpp
+++ b/src/gui/smileyshortcutcontainer.cpp
@@ -41,15 +41,15 @@ SmileyShortcutContainer::SmileyShortcutContainer():
mSmileyClicked(false),
mSmileyMoved(0)
{
- mGridWidth=1,
- mGridHeight=1,
+ 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/gui/emotions.png",30,32);
+ mSmileyImg = resman->getImageSet("graphics/sprites/emotions.png", 30, 32);
if (!mSmileyImg) logger->error(_("Unable to load emotions"));
mMaxItems = smileyShortcut->getSmileyCount();
diff --git a/src/gui/smileywindow.cpp b/src/gui/smileywindow.cpp
index 570eb45c..e3e821ff 100644
--- a/src/gui/smileywindow.cpp
+++ b/src/gui/smileywindow.cpp
@@ -45,10 +45,10 @@ SmileyWindow::SmileyWindow():
mUseButton = new Button(_("Use"), "use", this);
- mItems = new SmileyContainer();
- mItems->addSelectionListener(this);
+ mEmotes = new SmileyContainer();
+ mEmotes->addSelectionListener(this);
- mInvenScroll = new ScrollArea(mItems);
+ mInvenScroll = new ScrollArea(mEmotes);
mInvenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
draw();
@@ -63,12 +63,12 @@ SmileyWindow::SmileyWindow():
void SmileyWindow::action(const gcn::ActionEvent &event)
{
- int item = mItems->getSelectedSmiley();
+ int emote = mEmotes->getSelectedSmiley();
- if (!item)
+ if (!emote)
return;
- player_node->emote(item);
+ player_node->emote(emote);
}
@@ -95,5 +95,5 @@ void SmileyWindow::widgetResized(const gcn::Event &event)
int SmileyWindow::getSelectedSmiley() const
{
- return mItems->getSelectedSmiley();
+ return mEmotes->getSelectedSmiley();
}
diff --git a/src/gui/smileywindow.h b/src/gui/smileywindow.h
index 81ec6663..db27fcbd 100644
--- a/src/gui/smileywindow.h
+++ b/src/gui/smileywindow.h
@@ -69,7 +69,7 @@ class SmileyWindow : public Window, gcn::ActionListener,
private:
- SmileyContainer *mItems;
+ SmileyContainer *mEmotes;
gcn::Button *mUseButton;
gcn::ScrollArea *mInvenScroll;