summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/npcdialog.cpp14
-rw-r--r--src/gui/windows/npcdialog.h2
-rw-r--r--src/gui/windows/statuswindow.cpp4
3 files changed, 8 insertions, 12 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index fac7714ed..0ccae687b 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -26,6 +26,7 @@
#include "configuration.h"
#include "inventory.h"
#include "item.h"
+#include "settings.h"
#include "soundconsts.h"
#include "soundmanager.h"
@@ -823,7 +824,7 @@ void NpcDialog::saveCamera()
if (!viewport || mCameraMode >= 0)
return;
- mCameraMode = viewport->getCameraMode();
+ mCameraMode = settings.cameraMode;
mCameraX = viewport->getCameraRelativeX();
mCameraY = viewport->getCameraRelativeY();
}
@@ -833,15 +834,10 @@ void NpcDialog::restoreCamera()
if (!viewport || mCameraMode == -1)
return;
- if (!mCameraMode)
+ if (settings.cameraMode != mCameraMode)
+ viewport->toggleCameraMode();
+ if (mCameraMode)
{
- if (viewport->getCameraMode() != mCameraMode)
- viewport->toggleCameraMode();
- }
- else
- {
- if (viewport->getCameraMode() != mCameraMode)
- viewport->toggleCameraMode();
viewport->setCameraRelativeX(mCameraX);
viewport->setCameraRelativeY(mCameraY);
}
diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h
index bd9c21678..7c72550c9 100644
--- a/src/gui/windows/npcdialog.h
+++ b/src/gui/windows/npcdialog.h
@@ -296,7 +296,7 @@ class NpcDialog final : public Window,
PlayerBox *mPlayerBox;
Being *mAvatarBeing;
int mLastNextTime;
- int mCameraMode;
+ unsigned int mCameraMode;
int mCameraX;
int mCameraY;
bool mShowAvatar;
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index c4b645424..cdbf33fe8 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -640,7 +640,7 @@ std::string StatusWindow::translateLetter2(const std::string &letters)
void StatusWindow::updateStatusBar(ProgressBar *const bar,
const bool percent A_UNUSED) const
{
- if (!player_node || !viewport || !modifiers)
+ if (!modifiers)
return;
bar->setText(translateLetter2(modifiers->getMoveTypeString())
@@ -659,7 +659,7 @@ void StatusWindow::updateStatusBar(ProgressBar *const bar,
modifiers->getMapDrawTypeString()))
.append(" ").append(translateLetter2(
modifiers->getImitationModeString()))
- .append(translateLetter2(LocalPlayer::getCameraModeString()))
+ .append(translateLetter2(modifiers->getCameraModeString()))
.append(translateLetter2(modifiers->getAwayModeString())));
bar->setProgress(50);