mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-23 18:53:08 +00:00
initialize constants
This commit is contained in:
parent
1f2311538d
commit
df9f601ed7
7 changed files with 13 additions and 10 deletions
|
|
@ -146,7 +146,7 @@ namespace MWBase
|
||||||
virtual MWGui::CountDialog* getCountDialog() = 0;
|
virtual MWGui::CountDialog* getCountDialog() = 0;
|
||||||
virtual MWGui::ConfirmationDialog* getConfirmationDialog() = 0;
|
virtual MWGui::ConfirmationDialog* getConfirmationDialog() = 0;
|
||||||
virtual MWGui::TradeWindow* getTradeWindow() = 0;
|
virtual MWGui::TradeWindow* getTradeWindow() = 0;
|
||||||
virtual std::vector<MWGui::MessageBox*> getActiveMessageBoxes() = 0;
|
virtual const std::vector<MWGui::MessageBox*> getActiveMessageBoxes() = 0;
|
||||||
|
|
||||||
/// Make the player use an item, while updating GUI state accordingly
|
/// Make the player use an item, while updating GUI state accordingly
|
||||||
virtual void useItem(const MWWorld::Ptr& item, bool force=false) = 0;
|
virtual void useItem(const MWWorld::Ptr& item, bool force=false) = 0;
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ namespace MWGui
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<MessageBox*> MessageBoxManager::getActiveMessageBoxes()
|
const std::vector<MessageBox*> MessageBoxManager::getActiveMessageBoxes()
|
||||||
{
|
{
|
||||||
return mMessageBoxes;
|
return mMessageBoxes;
|
||||||
}
|
}
|
||||||
|
|
@ -208,7 +208,7 @@ namespace MWGui
|
||||||
mMainWidget->setPosition(pos);
|
mMainWidget->setPosition(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MessageBox::getMessage()
|
const std::string MessageBox::getMessage()
|
||||||
{
|
{
|
||||||
return mMessage;
|
return mMessage;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace MWGui
|
||||||
|
|
||||||
void setVisible(bool value);
|
void setVisible(bool value);
|
||||||
|
|
||||||
std::vector<MessageBox*> getActiveMessageBoxes();
|
const std::vector<MessageBox*> getActiveMessageBoxes();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<MessageBox*> mMessageBoxes;
|
std::vector<MessageBox*> mMessageBoxes;
|
||||||
|
|
@ -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);
|
||||||
std::string getMessage();
|
const std::string getMessage();
|
||||||
int getHeight ();
|
int getHeight ();
|
||||||
void update (int height);
|
void update (int height);
|
||||||
void setVisible(bool value);
|
void setVisible(bool value);
|
||||||
|
|
|
||||||
|
|
@ -771,7 +771,7 @@ namespace MWGui
|
||||||
mMessageBoxManager->removeStaticMessageBox();
|
mMessageBoxManager->removeStaticMessageBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<MWGui::MessageBox*> WindowManager::getActiveMessageBoxes()
|
const std::vector<MWGui::MessageBox*> WindowManager::getActiveMessageBoxes()
|
||||||
{
|
{
|
||||||
return mMessageBoxManager->getActiveMessageBoxes();
|
return mMessageBoxManager->getActiveMessageBoxes();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ namespace MWGui
|
||||||
MWGui::CountDialog* getCountDialog() override;
|
MWGui::CountDialog* getCountDialog() override;
|
||||||
MWGui::ConfirmationDialog* getConfirmationDialog() override;
|
MWGui::ConfirmationDialog* getConfirmationDialog() override;
|
||||||
MWGui::TradeWindow* getTradeWindow() override;
|
MWGui::TradeWindow* getTradeWindow() override;
|
||||||
std::vector<MWGui::MessageBox*> getActiveMessageBoxes() override;
|
const std::vector<MWGui::MessageBox*> getActiveMessageBoxes() override;
|
||||||
|
|
||||||
/// Make the player use an item, while updating GUI state accordingly
|
/// Make the player use an item, while updating GUI state accordingly
|
||||||
void useItem(const MWWorld::Ptr& item, bool bypassBeastRestrictions=false) override;
|
void useItem(const MWWorld::Ptr& item, bool bypassBeastRestrictions=false) override;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ namespace MWInput
|
||||||
, mSneaking(false)
|
, mSneaking(false)
|
||||||
, mAttemptJump(false)
|
, mAttemptJump(false)
|
||||||
, mTimeIdle(0.f)
|
, mTimeIdle(0.f)
|
||||||
|
, mOverencumberedMessage("#{sNotifyMessage59}")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,16 +100,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();
|
||||||
std::vector<MWGui::MessageBox*>::iterator it = std::find_if(msgboxs.begin(), msgboxs.end(), [](MWGui::MessageBox*& msg)
|
const std::vector<MWGui::MessageBox*>::iterator it = std::find_if(msgboxs.begin(), msgboxs.end(), [=](MWGui::MessageBox*& msgbox)
|
||||||
{
|
{
|
||||||
return (msg->getMessage() == "#{sNotifyMessage59}");
|
return (msgbox->getMessage() == mOverencumberedMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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("#{sNotifyMessage59}");
|
MWBase::Environment::get().getWindowManager()->messageBox(mOverencumberedMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ namespace MWInput
|
||||||
bool mSneaking;
|
bool mSneaking;
|
||||||
bool mAttemptJump;
|
bool mAttemptJump;
|
||||||
|
|
||||||
|
const std::string mOverencumberedMessage;
|
||||||
|
|
||||||
float mTimeIdle;
|
float mTimeIdle;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue