1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 04:09:42 +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);
}
const std::string MessageBox::getMessage()
{
return mMessage;
}
int MessageBox::getHeight ()
{
return mMainWidget->getHeight()+mNextBoxPadding;

View file

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

View file

@ -42,7 +42,6 @@ namespace MWInput
, mSneaking(false)
, mAttemptJump(false)
, mTimeIdle(0.f)
, mOverencumberedMessage("#{sNotifyMessage59}")
{
}
@ -100,16 +99,16 @@ namespace MWInput
{
player.setAutoMove (false);
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 (it != msgboxs.end())
(*it)->mCurrentTime = 0;
else
MWBase::Environment::get().getWindowManager()->messageBox(mOverencumberedMessage);
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage59}");
}
}

View file

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