summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-10-04 20:56:08 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-10-04 20:58:48 +0200
commite115390f18734d9e3e0e2fc5e1ed05f44c9fdb60 (patch)
treec271b3afa2a01140b7243fa7e8fbad2a785a3a14
parent0510ae7b8e979d7dcb831e1249cc22770ae7fc7c (diff)
downloadmana-e115390f18734d9e3e0e2fc5e1ed05f44c9fdb60.tar.gz
mana-e115390f18734d9e3e0e2fc5e1ed05f44c9fdb60.tar.bz2
mana-e115390f18734d9e3e0e2fc5e1ed05f44c9fdb60.tar.xz
mana-e115390f18734d9e3e0e2fc5e1ed05f44c9fdb60.zip
Removed useless LocalPlayer::mUpdateName
Maybe it once had a use, but a change in the "Show own name" setting is already handled by LocalPlayer::event.
-rw-r--r--src/gui/setup_interface.cpp7
-rw-r--r--src/gui/setup_video.cpp4
-rw-r--r--src/gui/setup_video.h5
-rw-r--r--src/gui/viewport.cpp8
-rw-r--r--src/localplayer.cpp3
-rw-r--r--src/localplayer.h15
6 files changed, 3 insertions, 39 deletions
diff --git a/src/gui/setup_interface.cpp b/src/gui/setup_interface.cpp
index e30a85de..ffb7b897 100644
--- a/src/gui/setup_interface.cpp
+++ b/src/gui/setup_interface.cpp
@@ -22,7 +22,6 @@
#include "gui/setup_interface.h"
#include "configuration.h"
-#include "localplayer.h"
#include "gui/widgets/checkbox.h"
#include "gui/widgets/label.h"
@@ -209,8 +208,6 @@ void Setup_Interface::cancel()
config.setValue("visiblenames", mVisibleNamesEnabled);
config.setValue("speech", mSpeechMode);
config.setValue("showownname", mNameEnabled);
- if (local_player)
- local_player->setCheckNameSetting(true);
config.setValue("logNpcInGui", mNPCLogEnabled);
config.setValue("guialpha", mOpacity);
config.setValue("showpickupchat", mPickupChatEnabled);
@@ -251,10 +248,6 @@ void Setup_Interface::action(const gcn::ActionEvent &event)
}
else if (id == "showownname")
{
- // Notify the local player that settings have changed for the name
- // and requires an update
- if (local_player)
- local_player->setCheckNameSetting(true);
config.setValue("showownname", mNameCheckBox->isSelected());
}
else if (id == "lognpc")
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 21f1935a..0d6c9cce 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -243,8 +243,8 @@ Setup_Video::Setup_Video():
{
setName(_("Video"));
- overlayDetailLabel = new Label(_("Ambient FX:"));
- particleDetailLabel = new Label(_("Particle detail:"));
+ auto overlayDetailLabel = new Label(_("Ambient FX:"));
+ auto particleDetailLabel = new Label(_("Particle detail:"));
#ifndef USE_OPENGL
mOpenGLCheckBox->setEnabled(false);
diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h
index 0914f6b1..6d4fbe77 100644
--- a/src/gui/setup_video.h
+++ b/src/gui/setup_video.h
@@ -58,11 +58,6 @@ class Setup_Video : public SetupTab, public gcn::ActionListener,
std::unique_ptr<ResolutionListModel> mResolutionListModel;
std::unique_ptr<ScaleListModel> mScaleListModel;
- //gcn::Label *scrollRadiusLabel;
- //gcn::Label *scrollLazinessLabel;
- gcn::Label *overlayDetailLabel;
- gcn::Label *particleDetailLabel;
-
gcn::DropDown *mWindowModeDropDown;
gcn::DropDown *mResolutionDropDown;
gcn::DropDown *mScaleDropDown;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 0d4af6f8..cdc4076e 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -209,12 +209,6 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
_drawDebugPath(graphics);
}
- if (local_player->getCheckNameSetting())
- {
- local_player->setCheckNameSetting(false);
- local_player->setName(local_player->getName());
- }
-
// Draw text
if (textManager)
{
@@ -632,7 +626,7 @@ void Viewport::event(Event::Channel channel, const Event &event)
else if (channel == Event::ConfigChannel &&
event.getType() == Event::ConfigOptionChanged)
{
- const std::string option = event.getString("option");
+ const std::string &option = event.getString("option");
if (option == "ScrollLaziness" || option == "ScrollRadius")
{
mScrollLaziness = config.getIntValue("ScrollLaziness");
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 02ec4f14..c6031e49 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -61,8 +61,6 @@ LocalPlayer::LocalPlayer(int id, int subtype):
mAwayListener = new AwayListener();
- mUpdateName = true;
-
setShowName(config.getValue("showownname", 1));
listen(Event::ConfigChannel);
@@ -1033,7 +1031,6 @@ void LocalPlayer::event(Event::Channel channel, const Event &event)
{
setShowName(config.getValue("showownname", 1));
}
-
}
Being::event(channel, event);
diff --git a/src/localplayer.h b/src/localplayer.h
index aa89b3fb..4e3bbc88 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -195,22 +195,7 @@ class LocalPlayer final : public Being
void event(Event::Channel channel, const Event &event) override;
- /**
- * Tells the engine wether to check
- * if the Player Name is to be displayed.
- */
- void setCheckNameSetting(bool checked) { mUpdateName = checked; }
-
- /**
- * Gets if the engine has to check
- * if the Player Name is to be displayed.
- */
- bool getCheckNameSetting() const { return mUpdateName; }
-
protected:
- /** Whether or not the name settings have changed */
- bool mUpdateName;
-
/** Make the character starts to walk. */
void startWalking(unsigned char dir);