summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/setup_other.cpp15
-rw-r--r--src/gui/setup_other.h3
-rw-r--r--src/gui/viewport.cpp9
-rw-r--r--src/gui/viewport.h1
4 files changed, 25 insertions, 3 deletions
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp
index e7ddfcef0..5e7895c23 100644
--- a/src/gui/setup_other.cpp
+++ b/src/gui/setup_other.cpp
@@ -64,6 +64,7 @@
#define ACTION_SHOW_MOB_HP "show mob hp"
#define ACTION_SHOW_OWN_HP "show own hp"
#define ACTION_SHOW_JOB_EXP "show job exp"
+#define ACTION_SHOW_BEING_POPUP "show being popup"
Setup_Other::Setup_Other():
mShowMonstersTakedDamage(config.getBoolValue("showMonstersTakedDamage")),
@@ -90,6 +91,7 @@ Setup_Other::Setup_Other():
mShowMobHP(config.getBoolValue("showMobHP")),
mShowOwnHP(config.getBoolValue("showOwnHP")),
mShowJobExp(config.getBoolValue("showJobExp")),
+ mShowBeingPopup(config.getBoolValue("showBeingPopup")),
mEditDialog(0)
{
setName(_("Misc"));
@@ -189,6 +191,10 @@ Setup_Other::Setup_Other():
mShowJobExp,
this, ACTION_SHOW_JOB_EXP);
+ mShowBeingPopupCheckBox = new CheckBox(_("Show players popups"),
+ mShowBeingPopup,
+ this, ACTION_SHOW_BEING_POPUP);
+
// Do the layout
LayoutHelper h(this);
ContainerPlacer place = h.getPlacer(0, 0);
@@ -205,6 +211,7 @@ Setup_Other::Setup_Other():
place(12, 6, mShowMobHPCheckBox, 10);
place(12, 7, mShowOwnHPCheckBox, 10);
place(12, 8, mShowJobExpCheckBox, 10);
+ place(12, 9, mShowBeingPopupCheckBox, 10);
place(0, 3, mFloorItemsHighlightCheckBox, 12);
place(0, 4, mHighlightAttackRangeCheckBox, 12);
place(0, 5, mHighlightMonsterAttackRangeCheckBox, 12);
@@ -341,6 +348,10 @@ void Setup_Other::action(const gcn::ActionEvent &event)
{
mShowJobExp = mShowJobExpCheckBox->isSelected();
}
+ else if (event.getId() == ACTION_SHOW_BEING_POPUP)
+ {
+ mShowBeingPopup = mShowBeingPopupCheckBox->isSelected();
+ }
}
void Setup_Other::cancel()
@@ -416,6 +427,9 @@ void Setup_Other::cancel()
mShowJobExp = config.getBoolValue("showJobExp");
mShowJobExpCheckBox->setSelected(mShowJobExp);
+
+ mShowBeingPopup = config.getBoolValue("showBeingPopup");
+ mShowBeingPopupCheckBox->setSelected(mShowBeingPopup);
}
void Setup_Other::apply()
@@ -444,6 +458,7 @@ void Setup_Other::apply()
config.setValue("showMobHP", mShowMobHP);
config.setValue("showOwnHP", mShowOwnHP);
config.setValue("showJobExp", mShowJobExp);
+ config.setValue("showBeingPopup", mShowBeingPopup);
logger->setDebugLog(mDebugLog);
}
diff --git a/src/gui/setup_other.h b/src/gui/setup_other.h
index d73e679b8..041aad9f3 100644
--- a/src/gui/setup_other.h
+++ b/src/gui/setup_other.h
@@ -116,6 +116,9 @@ class Setup_Other : public SetupTab, public gcn::ActionListener
gcn::CheckBox *mShowJobExpCheckBox;
bool mShowJobExp;
+ gcn::CheckBox *mShowBeingPopupCheckBox;
+ bool mShowBeingPopup;
+
EditDialog *mEditDialog;
};
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 9458ea911..11918f0b7 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -57,8 +57,6 @@ Viewport::Viewport():
mMouseY(0),
mPixelViewX(0.0f),
mPixelViewY(0.0f),
-// mTileViewX(0),
-// mTileViewY(0),
mShowDebugPath(false),
mCameraMode(0),
mPlayerFollowMouse(false),
@@ -76,9 +74,11 @@ Viewport::Viewport():
mScrollRadius = config.getIntValue("ScrollRadius");
mScrollCenterOffsetX = config.getIntValue("ScrollCenterOffsetX");
mScrollCenterOffsetY = config.getIntValue("ScrollCenterOffsetY");
+ mShowBeingPopup = config.getBoolValue("showBeingPopup");
config.addListener("ScrollLaziness", this);
config.addListener("ScrollRadius", this);
+ config.addListener("showBeingPopup", this);
mPopupMenu = new PopupMenu;
mBeingPopup = new BeingPopup;
@@ -91,6 +91,7 @@ Viewport::~Viewport()
{
config.removeListener("ScrollLaziness", this);
config.removeListener("ScrollRadius", this);
+ config.removeListener("showBeingPopup", this);
delete mPopupMenu;
mPopupMenu = 0;
@@ -620,6 +621,7 @@ void Viewport::optionChanged(const std::string &name _UNUSED_)
{
mScrollLaziness = config.getIntValue("ScrollLaziness");
mScrollRadius = config.getIntValue("ScrollRadius");
+ mShowBeingPopup = config.getBoolValue("showBeingPopup");
}
void Viewport::mouseMoved(gcn::MouseEvent &event _UNUSED_)
@@ -635,7 +637,8 @@ void Viewport::mouseMoved(gcn::MouseEvent &event _UNUSED_)
if (mHoverBeing && mHoverBeing->getType() == Being::PLAYER)
{
mTextPopup->setVisible(false);
- mBeingPopup->show(getMouseX(), getMouseY(), mHoverBeing);
+ if (mShowBeingPopup)
+ mBeingPopup->show(getMouseX(), getMouseY(), mHoverBeing);
}
else
{
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index cf5e53c4d..0ed9bee78 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -269,6 +269,7 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
int mScrollRadius;
int mScrollLaziness;
+ bool mShowBeingPopup;
int mScrollCenterOffsetX;
int mScrollCenterOffsetY;
int mMouseX; /**< Current mouse position in pixels. */