Call WindowBase::onFrame() for every active window

pull/303/head
scrawl 7 years ago
parent ba7ae2663f
commit 2b03bc0c56

@ -116,8 +116,9 @@ void CompanionWindow::setPtr(const MWWorld::Ptr& npc)
setTitle(npc.getClass().getName(npc));
}
void CompanionWindow::onFrame()
void CompanionWindow::onFrame(float dt)
{
checkReferenceAvailable();
updateEncumbranceBar();
}

@ -23,7 +23,7 @@ namespace MWGui
virtual void resetReference();
void setPtr(const MWWorld::Ptr& npc);
void onFrame ();
void onFrame (float dt);
private:
ItemView* mItemView;

@ -42,6 +42,8 @@ namespace MWGui
virtual void onOpen();
virtual void onClose();
void onFrame(float dt) { checkReferenceAvailable(); }
void setFont(const std::string &fntName);
void onResChange(int width, int height);

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

@ -630,9 +630,10 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
}
void DialogueWindow::onFrame()
void DialogueWindow::onFrame(float dt)
{
if(mMainWidget->getVisible() && mPtr.getTypeName() == typeid(ESM::NPC).name())
checkReferenceAvailable();
if(mPtr.getTypeName() == typeid(ESM::NPC).name())
{
int disp = MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr);
mDispositionBar->setProgressRange(100);

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

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

@ -589,11 +589,8 @@ namespace MWGui
mEncumbranceBar->setValue(static_cast<int>(encumbrance), static_cast<int>(capacity));
}
void InventoryWindow::onFrame()
void InventoryWindow::onFrame(float dt)
{
if (!mMainWidget->getVisible())
return;
updateEncumbranceBar();
}

@ -40,7 +40,7 @@ namespace MWGui
/// start trading, disables item drag&drop
void setTrading(bool trading);
void onFrame();
void onFrame(float dt);
void pickUpObject (MWWorld::Ptr object);

@ -197,7 +197,7 @@ namespace MWGui
}
}
void MainMenu::update(float dt)
void MainMenu::onFrame(float dt)
{
if (mVideo)
{

@ -36,7 +36,7 @@ namespace MWGui
virtual void setVisible (bool visible);
void update(float dt);
void onFrame(float dt);
private:
const VFS::Manager* mVFS;

@ -28,6 +28,8 @@ namespace MWGui
void setPtr(const MWWorld::Ptr& actor);
void setPtr(const MWWorld::Ptr& actor, int startOffset);
void onFrame(float dt) { checkReferenceAvailable(); }
protected:
MyGUI::Button* mCancelButton;
MyGUI::TextBox* mPlayerGold;

@ -152,6 +152,8 @@ namespace MWGui
virtual void onOpen();
void onFrame(float dt) { checkReferenceAvailable(); }
void setPtr(const MWWorld::Ptr& actor);
protected:

@ -68,16 +68,13 @@ namespace MWGui
}
void SpellWindow::onFrame(float dt)
{
if (mMainWidget->getVisible())
{
NoDrop::onFrame(dt);
mUpdateTimer += dt;
if (0.5f < mUpdateTimer)
{
NoDrop::onFrame(dt);
mUpdateTimer += dt;
if (0.5f < mUpdateTimer)
{
mUpdateTimer = 0;
mSpellView->incrementalUpdate();
}
mUpdateTimer = 0;
mSpellView->incrementalUpdate();
}
}

@ -297,9 +297,6 @@ namespace MWGui
void StatsWindow::onFrame (float dt)
{
if (!mMainWidget->getVisible())
return;
NoDrop::onFrame(dt);
MWWorld::Ptr player = MWMechanics::getPlayer();

@ -142,6 +142,11 @@ namespace MWGui
onFilterChanged(mFilterAll);
}
void TradeWindow::onFrame(float dt)
{
checkReferenceAvailable();
}
void TradeWindow::onFilterChanged(MyGUI::Widget* _sender)
{
if (_sender == mFilterAll)

@ -29,6 +29,8 @@ namespace MWGui
void setPtr(const MWWorld::Ptr& actor);
void onFrame(float dt);
void borrowItem (int index, size_t count);
void returnItem (int index, size_t count);

@ -195,6 +195,7 @@ namespace MWGui
void TrainingWindow::onFrame(float dt)
{
checkReferenceAvailable();
mTimeAdvancer.onFrame(dt);
if (mFadeTimeRemaining <= 0)

@ -29,6 +29,9 @@ namespace MWGui
/// Open this object in the GUI, for windows that support it
virtual void setPtr(const MWWorld::Ptr& ptr) {}
/// Called every frame if the window is in an active GUI mode
virtual void onFrame(float duration) {}
/// Notify that window has been made visible
virtual void onOpen() {}
/// Notify that window has been hidden

@ -890,12 +890,19 @@ namespace MWGui
void WindowManager::onFrame (float frameDuration)
{
if (!mGuiModes.empty())
{
GuiModeState& state = mGuiModeStates[mGuiModes.back()];
for (WindowBase* window : state.mWindows)
window->onFrame(frameDuration);
}
if (!mCurrentModals.empty())
mCurrentModals.top()->onFrame(frameDuration);
mMessageBoxManager->onFrame(frameDuration);
mToolTips->onFrame(frameDuration);
mMenu->update(frameDuration);
if (mLocalMapRender)
mLocalMapRender->cleanupCameras();
@ -909,34 +916,10 @@ namespace MWGui
mDragAndDrop->mDraggedWidget->setPosition(MyGUI::InputManager::getInstance().getMousePosition());
}
mDialogueWindow->onFrame();
mInventoryWindow->onFrame();
updateMap();
mStatsWindow->onFrame(frameDuration);
mMap->onFrame(frameDuration);
mSpellWindow->onFrame(frameDuration);
mWaitDialog->onFrame(frameDuration);
mHud->onFrame(frameDuration);
mTrainingWindow->onFrame (frameDuration);
mTrainingWindow->checkReferenceAvailable();
mDialogueWindow->checkReferenceAvailable();
mTradeWindow->checkReferenceAvailable();
mSpellBuyingWindow->checkReferenceAvailable();
mSpellCreationDialog->checkReferenceAvailable();
mEnchantingDialog->checkReferenceAvailable();
mContainerWindow->checkReferenceAvailable();
mCompanionWindow->checkReferenceAvailable();
mConsole->checkReferenceAvailable();
mCompanionWindow->onFrame();
mJailScreen->onFrame(frameDuration);
if (mWerewolfFader)
mWerewolfFader->update(frameDuration);
mBlindnessFader->update(frameDuration);

Loading…
Cancel
Save