Update pinned windows in-game (bug #4560)

pull/541/head
Andrei Kortunov 6 years ago
parent 327f36b081
commit 8fa6c6f726

@ -96,6 +96,7 @@
Bug #4553: Forcegreeting on non-actor opens a dialogue window which cannot be closed Bug #4553: Forcegreeting on non-actor opens a dialogue window which cannot be closed
Bug #4557: Topics with reserved names are handled differently from vanilla Bug #4557: Topics with reserved names are handled differently from vanilla
Bug #4558: Mesh optimizer: check for reserved node name is case-sensitive Bug #4558: Mesh optimizer: check for reserved node name is case-sensitive
Bug #4560: OpenMW does not update pinned windows properly
Bug #4563: Fast travel price logic checks destination cell instead of service actor cell Bug #4563: Fast travel price logic checks destination cell instead of service actor cell
Bug #4565: Underwater view distance should be limited Bug #4565: Underwater view distance should be limited
Bug #4573: Player uses headtracking in the 1st-person mode Bug #4573: Player uses headtracking in the 1st-person mode

@ -68,6 +68,7 @@ namespace MWGui
, mPreview(new MWRender::InventoryPreview(parent, resourceSystem, MWMechanics::getPlayer())) , mPreview(new MWRender::InventoryPreview(parent, resourceSystem, MWMechanics::getPlayer()))
, mTrading(false) , mTrading(false)
, mScaleFactor(1.0f) , mScaleFactor(1.0f)
, mUpdateTimer(0.f)
{ {
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI"); float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
if (uiScale > 1.0) if (uiScale > 1.0)
@ -631,6 +632,22 @@ namespace MWGui
void InventoryWindow::onFrame(float dt) void InventoryWindow::onFrame(float dt)
{ {
updateEncumbranceBar(); updateEncumbranceBar();
if (mPinned)
{
mUpdateTimer += dt;
if (0.1f < mUpdateTimer)
{
mUpdateTimer = 0;
// Update pinned inventory in-game
if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
{
mItemView->update();
notifyContentChanged();
}
}
}
} }
void InventoryWindow::setTrading(bool trading) void InventoryWindow::setTrading(bool trading)

@ -102,6 +102,7 @@ namespace MWGui
bool mTrading; bool mTrading;
float mScaleFactor; float mScaleFactor;
float mUpdateTimer;
void onItemSelected(int index); void onItemSelected(int index);
void onItemSelectedFromSourceModel(int index); void onItemSelectedFromSourceModel(int index);

@ -86,6 +86,10 @@ namespace MWGui
mUpdateTimer = 0; mUpdateTimer = 0;
mSpellView->incrementalUpdate(); mSpellView->incrementalUpdate();
} }
// Update effects in-game too if the window is pinned
if (mPinned && !MWBase::Environment::get().getWindowManager()->isGuiMode())
mSpellIcons->updateWidgets(mEffectBox, false);
} }
void SpellWindow::updateSpells() void SpellWindow::updateSpells()

Loading…
Cancel
Save