Call clear() for every window

pull/303/head
scrawl 7 years ago
parent c6c01870ec
commit e7d2a8a4dc

@ -24,6 +24,7 @@ namespace MWGui
void setPtr(const MWWorld::Ptr& npc);
void onFrame (float dt);
void clear() { resetReference(); }
private:
ItemView* mItemView;

@ -47,6 +47,7 @@ namespace MWGui
void setFont(const std::string &fntName);
void onResChange(int width, int height);
void clear() { resetReference(); }
// Print a message to the console, in specified color.
void print(const std::string &msg, const std::string& color = "#FFFFFF");

@ -35,6 +35,7 @@ namespace MWGui
void setPtr(const MWWorld::Ptr& container);
virtual void onClose();
void clear() { resetReference(); }
void onFrame(float dt) { checkReferenceAvailable(); }

@ -118,6 +118,7 @@ namespace MWGui
void goodbye();
void onFrame(float dt);
void clear() { resetReference(); }
// make sure to call these before setKeywords()
void setServices(int services) { mServices = services; }

@ -22,6 +22,7 @@ namespace MWGui
virtual void onOpen();
void onFrame(float dt) { checkReferenceAvailable(); }
void clear() { resetReference(); }
void setSoulGem (const MWWorld::Ptr& gem);
void setItem (const MWWorld::Ptr& item);

@ -60,6 +60,8 @@ namespace MWGui
void setEnemy(const MWWorld::Ptr& enemy);
void resetEnemy();
void clear() { resetEnemy(); }
private:
MyGUI::ProgressBar *mHealth, *mMagicka, *mStamina, *mEnemyHealth, *mDrowning;
MyGUI::Widget* mHealthFrame;

@ -29,6 +29,7 @@ namespace MWGui
void setPtr(const MWWorld::Ptr& actor, int startOffset);
void onFrame(float dt) { checkReferenceAvailable(); }
void clear() { resetReference(); }
void onResChange(int, int) { center(); }

@ -151,6 +151,7 @@ namespace MWGui
SpellCreationDialog();
virtual void onOpen();
void clear() { resetReference(); }
void onFrame(float dt) { checkReferenceAvailable(); }

@ -30,6 +30,7 @@ namespace MWGui
void setPtr(const MWWorld::Ptr& actor);
void onFrame(float dt);
void clear() { resetReference(); }
void borrowItem (int index, size_t count);
void returnItem (int index, size_t count);

@ -20,6 +20,8 @@ namespace MWGui
void onFrame(float dt);
void clear() { resetReference(); }
protected:
virtual void onReferenceUnavailable ();

@ -262,6 +262,11 @@ namespace MWGui
}
}
void WaitDialog::clear()
{
mProgressBar.setVisible(false);
}
void WaitDialog::stopWaiting ()
{
MWBase::Environment::get().getWindowManager()->fadeScreenIn(0.2f);

@ -34,6 +34,7 @@ namespace MWGui
virtual bool exit();
void onFrame(float dt);
void clear();
bool getSleeping() { return mTimeAdvancer.isRunning() && mSleeping; }
void wakeUp();

@ -45,6 +45,9 @@ namespace MWGui
void center();
/// Clear any state specific to the running game
virtual void clear() {}
/// Called when GUI viewport changes size
virtual void onResChange(int width, int height) {}
};

@ -514,10 +514,6 @@ namespace MWGui
void WindowManager::setNewGame(bool newgame)
{
// This method will always be called after loading a savegame or starting a new game
// Reset enemy, it could be a dangling pointer from a previous game
mHud->resetEnemy();
if (newgame)
{
disallowAll();
@ -1596,36 +1592,26 @@ namespace MWGui
void WindowManager::clear()
{
for (WindowBase* window : mWindows)
window->clear();
if (mLocalMapRender)
mLocalMapRender->clear();
mMap->clear();
mQuickKeysMenu->clear();
mMessageBoxManager->clear();
mTrainingWindow->resetReference();
mDialogueWindow->resetReference();
mTradeWindow->resetReference();
mSpellBuyingWindow->resetReference();
mSpellCreationDialog->resetReference();
mEnchantingDialog->resetReference();
mContainerWindow->resetReference();
mCompanionWindow->resetReference();
mConsole->resetReference();
mToolTips->setFocusObject(MWWorld::ConstPtr());
mInventoryWindow->clear();
mSelectedSpell.clear();
mCustomMarkers.clear();
mForceHidden = GW_None;
setWerewolfOverlay(false);
mGuiModes.clear();
while (!mGuiModes.empty())
popGuiMode();
MWBase::Environment::get().getInputManager()->changeInputMode(false);
updateVisible();
}

Loading…
Cancel
Save