forked from teamnwah/openmw-tes3coop
journal close sound
This commit is contained in:
parent
9dd53b32b8
commit
3c69d26571
2 changed files with 13 additions and 0 deletions
|
@ -82,6 +82,7 @@ book formatText(std::string text,book mBook,int maxLine, int lineSize)
|
|||
MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
|
||||
: WindowBase("openmw_journal_layout.xml", parWindowManager)
|
||||
, lastPos(0)
|
||||
, mVisible(false)
|
||||
{
|
||||
//setCoord(0,0,498, 342);
|
||||
center();
|
||||
|
@ -111,6 +112,15 @@ MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
|
|||
//displayLeftText(list.front());
|
||||
}
|
||||
|
||||
void MWGui::JournalWindow::setVisible(bool visible)
|
||||
{
|
||||
if (mVisible && !visible)
|
||||
MWBase::Environment::get().getSoundManager()->playSound ("book close", 1.0, 1.0);
|
||||
mVisible = visible;
|
||||
|
||||
mMainWidget->setVisible(visible);
|
||||
}
|
||||
|
||||
void MWGui::JournalWindow::open()
|
||||
{
|
||||
mPageNumber = 0;
|
||||
|
|
|
@ -18,6 +18,8 @@ namespace MWGui
|
|||
JournalWindow(WindowManager& parWindowManager);
|
||||
void open();
|
||||
|
||||
virtual void setVisible(bool visible); // only used to play close sound
|
||||
|
||||
private:
|
||||
void displayLeftText(std::string text);
|
||||
void displayRightText(std::string text);
|
||||
|
@ -41,6 +43,7 @@ namespace MWGui
|
|||
std::vector<std::string> leftPages;
|
||||
std::vector<std::string> rightPages;
|
||||
int mPageNumber; //store the number of the current left page
|
||||
bool mVisible;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue