1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-23 06:41:08 +00:00
This commit is contained in:
kuyondo 2021-12-14 22:40:05 +08:00
parent 6e43206d69
commit 2fce89e64f
4 changed files with 5 additions and 13 deletions

View File

@ -206,11 +206,6 @@ namespace MWGui
mMainWidget->setPosition(pos); mMainWidget->setPosition(pos);
} }
const std::string MessageBox::getMessage()
{
return mMessage;
}
int MessageBox::getHeight () int MessageBox::getHeight ()
{ {
return mMainWidget->getHeight()+mNextBoxPadding; return mMainWidget->getHeight()+mNextBoxPadding;

View File

@ -65,7 +65,7 @@ namespace MWGui
public: public:
MessageBox (MessageBoxManager& parMessageBoxManager, const std::string& message); MessageBox (MessageBoxManager& parMessageBoxManager, const std::string& message);
void setMessage (const std::string& message); void setMessage (const std::string& message);
const std::string getMessage(); const std::string& getMessage() { return mMessage; };
int getHeight (); int getHeight ();
void update (int height); void update (int height);
void setVisible(bool value); void setVisible(bool value);
@ -75,7 +75,7 @@ namespace MWGui
protected: protected:
MessageBoxManager& mMessageBoxManager; MessageBoxManager& mMessageBoxManager;
const std::string mMessage; std::string mMessage;
MyGUI::EditBox* mMessageWidget; MyGUI::EditBox* mMessageWidget;
int mBottomPadding; int mBottomPadding;
int mNextBoxPadding; int mNextBoxPadding;

View File

@ -42,7 +42,6 @@ namespace MWInput
, mSneaking(false) , mSneaking(false)
, mAttemptJump(false) , mAttemptJump(false)
, mTimeIdle(0.f) , mTimeIdle(0.f)
, mOverencumberedMessage("#{sNotifyMessage59}")
{ {
} }
@ -100,16 +99,16 @@ namespace MWInput
{ {
player.setAutoMove (false); player.setAutoMove (false);
std::vector<MWGui::MessageBox*> msgboxs = MWBase::Environment::get().getWindowManager()->getActiveMessageBoxes(); std::vector<MWGui::MessageBox*> msgboxs = MWBase::Environment::get().getWindowManager()->getActiveMessageBoxes();
const std::vector<MWGui::MessageBox*>::iterator it = std::find_if(msgboxs.begin(), msgboxs.end(), [=](MWGui::MessageBox*& msgbox) const std::vector<MWGui::MessageBox*>::iterator it = std::find_if(msgboxs.begin(), msgboxs.end(), [](MWGui::MessageBox*& msgbox)
{ {
return (msgbox->getMessage() == mOverencumberedMessage); return (msgbox->getMessage() == "#{sNotifyMessage59}");
}); });
// if an overencumbered messagebox is already present, reset its expiry timer, otherwise create new one. // if an overencumbered messagebox is already present, reset its expiry timer, otherwise create new one.
if (it != msgboxs.end()) if (it != msgboxs.end())
(*it)->mCurrentTime = 0; (*it)->mCurrentTime = 0;
else else
MWBase::Environment::get().getWindowManager()->messageBox(mOverencumberedMessage); MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage59}");
} }
} }

View File

@ -67,8 +67,6 @@ namespace MWInput
bool mSneaking; bool mSneaking;
bool mAttemptJump; bool mAttemptJump;
const std::string mOverencumberedMessage;
float mTimeIdle; float mTimeIdle;
}; };
} }