summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/minimap.cpp2
-rw-r--r--src/gui/npcdialog.cpp2
-rw-r--r--src/gui/setup.cpp3
-rw-r--r--src/gui/setup_colors.cpp1
-rw-r--r--src/gui/socialwindow.cpp27
-rw-r--r--src/gui/statuswindow.cpp2
-rw-r--r--src/gui/viewport.cpp2
-rw-r--r--src/gui/widgets/dropshortcutcontainer.h3
-rw-r--r--src/gui/widgets/itemshortcutcontainer.h3
-rw-r--r--src/gui/widgets/spellshortcutcontainer.h3
-rw-r--r--src/gui/widgets/whispertab.h3
-rw-r--r--src/gui/windowmenu.h4
12 files changed, 30 insertions, 25 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index c834bed64..8cbeebad8 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -278,7 +278,7 @@ void Minimap::draw(gcn::Graphics *graphics)
{
type = UserPalette::GUILD;
}
- else if (being)
+ else
{
switch (being->getType())
{
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index b47e78626..166cef5b1 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -695,7 +695,7 @@ void NpcDialog::showAvatar(int avatarId)
delete mAvatarBeing;
mAvatarBeing = new Being(0, ActorSprite::NPC, avatarId, nullptr);
mPlayerBox->setPlayer(mAvatarBeing);
- if (mAvatarBeing && !mAvatarBeing->empty())
+ if (!mAvatarBeing->empty())
{
mAvatarBeing->logic();
Sprite *sprite = mAvatarBeing->getSprite(0);
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 8c76d89d0..b849823d9 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -50,7 +50,8 @@
extern Window *statusWindow;
Setup::Setup():
- Window(_("Setup"), false, nullptr, "setup.xml")
+ Window(_("Setup"), false, nullptr, "setup.xml"),
+ mResetWindows(nullptr)
{
setCloseButton(true);
setResizable(true);
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index f2412b3ff..09468a4a9 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -292,6 +292,7 @@ void Setup_Colors::valueChanged(const gcn::SelectionEvent &event A_UNUSED)
case UserPalette::ATTACK_RANGE:
case UserPalette::MONSTER_ATTACK_RANGE:
mTextPreview->setShadow(false);
+ break;
default:
break;
}
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 2c4f1316d..0f32f34a8 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -81,6 +81,20 @@ class SortFriendsFunctor
class SocialTab : public Tab
{
+public:
+ virtual void invite() = 0;
+
+ virtual void leave() = 0;
+
+ virtual void updateList() = 0;
+
+ virtual void updateAvatar(std::string name) = 0;
+
+ virtual void resetDamage(std::string name) = 0;
+
+ virtual void selectIndex(unsigned num A_UNUSED)
+ { }
+
protected:
friend class SocialWindow;
@@ -109,19 +123,6 @@ protected:
}
}
- virtual void invite() = 0;
-
- virtual void leave() = 0;
-
- virtual void updateList() = 0;
-
- virtual void updateAvatar(std::string name) = 0;
-
- virtual void resetDamage(std::string name) = 0;
-
- virtual void selectIndex(unsigned num A_UNUSED)
- { }
-
TextDialog *mInviteDialog;
ConfirmDialog *mConfirmDialog;
ScrollArea *mScroll;
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index 88b48a472..6354fe42e 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -108,9 +108,9 @@ class ChangeDisplay : public AttrDisplay, gcn::ActionListener
void setPointsNeeded(int needed);
- private:
void action(const gcn::ActionEvent &event);
+ private:
int mNeeded;
Label *mPoints;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 358974707..459f66052 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -281,7 +281,7 @@ void Viewport::_followMouse()
{
uint8_t button = SDL_GetMouseState(&mMouseX, &mMouseY);
// If the left button is dragged
- if (mPlayerFollowMouse && button & SDL_BUTTON(1))
+ if (mPlayerFollowMouse && (button & SDL_BUTTON(1)))
{
// We create a mouse event and send it to mouseDragged.
uint8_t *keys = SDL_GetKeyState(nullptr);
diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h
index 91e436836..99ff8bd2e 100644
--- a/src/gui/widgets/dropshortcutcontainer.h
+++ b/src/gui/widgets/dropshortcutcontainer.h
@@ -71,10 +71,11 @@ class DropShortcutContainer : public ShortcutContainer
void widgetHidden(const gcn::Event &event);
- private:
void mouseExited(gcn::MouseEvent &event);
+
void mouseMoved(gcn::MouseEvent &event);
+ private:
bool mItemClicked;
Item *mItemMoved;
diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h
index 255a8090e..1ed0bf627 100644
--- a/src/gui/widgets/itemshortcutcontainer.h
+++ b/src/gui/widgets/itemshortcutcontainer.h
@@ -72,10 +72,11 @@ class ItemShortcutContainer : public ShortcutContainer
void widgetHidden(const gcn::Event &event);
- private:
void mouseExited(gcn::MouseEvent &event);
+
void mouseMoved(gcn::MouseEvent &event);
+ private:
bool mItemClicked;
Item *mItemMoved;
unsigned mNumber;
diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h
index 72fec758f..e8f4cc2dc 100644
--- a/src/gui/widgets/spellshortcutcontainer.h
+++ b/src/gui/widgets/spellshortcutcontainer.h
@@ -71,10 +71,11 @@ class SpellShortcutContainer : public ShortcutContainer
void widgetHidden(const gcn::Event &event);
- private:
void mouseExited(gcn::MouseEvent &event);
+
void mouseMoved(gcn::MouseEvent &event);
+ private:
bool mSpellClicked;
TextCommand *mSpellMoved;
SpellPopup *mSpellPopup;
diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h
index 226ebaf40..85c670db1 100644
--- a/src/gui/widgets/whispertab.h
+++ b/src/gui/widgets/whispertab.h
@@ -46,11 +46,10 @@ class WhisperTab : public ChatTab
void saveToLogFile(std::string &msg);
- void getAutoCompleteList(StringVect &names) const;
-
protected:
friend class ChatWindow;
+ void getAutoCompleteList(StringVect &names) const;
/**
* Constructor.
*
diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h
index e1c78e5f8..3538a9b83 100644
--- a/src/gui/windowmenu.h
+++ b/src/gui/windowmenu.h
@@ -77,11 +77,11 @@ class WindowMenu : public Container,
void saveButtons();
- void drawChildren(gcn::Graphics* graphics);
-
void optionChanged(const std::string &name);
private:
+ void drawChildren(gcn::Graphics* graphics);
+
inline void addButton(const char* text, std::string description,
int &x, int &h, int key, bool visible = true);