diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-06 10:38:07 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-06 10:38:07 +0100 |
commit | 7cbdab589491e007adacd7597c769cdb9308a32c (patch) | |
tree | 0269c37cccbed49a1cb15db9de816f39ef549189 /src/gui/emoteshortcutcontainer.cpp | |
parent | 616afb27c23def5661b3466d6fc86fd1c65c0082 (diff) | |
parent | aa4229cbb9f2b264ca96c3beedc66b1c79ccc1f5 (diff) | |
download | mana-client-7cbdab589491e007adacd7597c769cdb9308a32c.tar.gz mana-client-7cbdab589491e007adacd7597c769cdb9308a32c.tar.bz2 mana-client-7cbdab589491e007adacd7597c769cdb9308a32c.tar.xz mana-client-7cbdab589491e007adacd7597c769cdb9308a32c.zip |
Merge branch 'aethyra/master'
Conflicts:
src/being.cpp
src/being.h
src/floor_item.cpp
src/floor_item.h
src/flooritemmanager.cpp
src/gui/inventorywindow.cpp
src/gui/inventorywindow.h
src/gui/itemcontainer.cpp
src/gui/popupmenu.cpp
src/net/beinghandler.cpp
src/npc.cpp
Diffstat (limited to 'src/gui/emoteshortcutcontainer.cpp')
-rw-r--r-- | src/gui/emoteshortcutcontainer.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/gui/emoteshortcutcontainer.cpp b/src/gui/emoteshortcutcontainer.cpp index a0739723..df1bf74c 100644 --- a/src/gui/emoteshortcutcontainer.cpp +++ b/src/gui/emoteshortcutcontainer.cpp @@ -75,6 +75,15 @@ EmoteShortcutContainer::~EmoteShortcutContainer() void EmoteShortcutContainer::draw(gcn::Graphics *graphics) { + if (!isVisible()) + return; + + if (config.getValue("guialpha", 0.8) != mAlpha) + { + mAlpha = config.getValue("guialpha", 0.8); + mBackgroundImg->setAlpha(mAlpha); + } + Graphics *g = static_cast<Graphics*>(graphics); graphics->setFont(getFont()); @@ -94,7 +103,8 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) if (emoteShortcut->getEmote(i)) { - mEmoteImg[emoteShortcut->getEmote(i) - 1]->draw(g, emoteX + 2, emoteY + 10); + mEmoteImg[emoteShortcut->getEmote(i) - 1]->draw(g, emoteX + 2, + emoteY + 10); } } @@ -111,12 +121,6 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) sprite->draw(g, tPosX, tPosY); } } - - if (config.getValue("guialpha", 0.8) != mAlpha) - { - mAlpha = config.getValue("guialpha", 0.8); - mBackgroundImg->setAlpha(mAlpha); - } } void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event) @@ -129,9 +133,7 @@ void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event) const int emoteId = emoteShortcut->getEmote(index); if (index == -1) - { return; - } if (emoteId) { @@ -152,19 +154,17 @@ void EmoteShortcutContainer::mousePressed(gcn::MouseEvent &event) const int index = getIndexFromGrid(event.getX(), event.getY()); if (index == -1) - { - return; - } + return; // Stores the selected emote if there is one. if (emoteShortcut->isEmoteSelected()) { - emoteShortcut->setEmote(index); - emoteShortcut->setEmoteSelected(0); + emoteShortcut->setEmote(index); + emoteShortcut->setEmoteSelected(0); } else if (emoteShortcut->getEmote(index)) { - mEmoteClicked = true; + mEmoteClicked = true; } } @@ -175,9 +175,7 @@ void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) const int index = getIndexFromGrid(event.getX(), event.getY()); if (emoteShortcut->isEmoteSelected()) - { emoteShortcut->setEmoteSelected(0); - } if (index == -1) { @@ -196,9 +194,7 @@ void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) } if (mEmoteClicked) - { mEmoteClicked = false; - } } } |