From b33429001cae9a85a3edb946e74788fb2929cad1 Mon Sep 17 00:00:00 2001 From: James Stephens Date: Mon, 2 Sep 2019 17:13:56 +0000 Subject: [PATCH] Fixes the offset question mark in the alchemy tooltip when the effect is not known --- CHANGELOG.md | 1 + apps/openmw/mwgui/widgets.cpp | 5 +++-- apps/openmw/mwgui/widgets.hpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3459733141..64af4b8497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,6 +129,7 @@ Bug #5106: Still can jump even when encumbered Bug #5110: ModRegion with a redundant numerical argument breaks script execution Bug #5112: Insufficient magicka for current spell not reflected on HUD icon + Bug #5113: Unknown alchemy question mark not centered Bug #5123: Script won't run on respawn Bug #5124: Arrow remains attached to actor if pulling animation was cancelled Bug #5126: Swimming creatures without RunForward animations are motionless during combat diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index 6e3e081a91..0568efeb45 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -375,7 +375,8 @@ namespace MWGui if (!mEffectParams.mKnown) { mTextWidget->setCaption ("?"); - mRequestedWidth = mTextWidget->getTextSize().width + 24; + mTextWidget->setCoord(sIconOffset / 2, mTextWidget->getCoord().top, mTextWidget->getCoord().width, mTextWidget->getCoord().height); // Compensates for the missing image when effect is not known + mRequestedWidth = mTextWidget->getTextSize().width + sIconOffset; mImageWidget->setImageTexture (""); return; } @@ -466,7 +467,7 @@ namespace MWGui } mTextWidget->setCaptionWithReplacing(spellLine); - mRequestedWidth = mTextWidget->getTextSize().width + 24; + mRequestedWidth = mTextWidget->getTextSize().width + sIconOffset; mImageWidget->setImageTexture(MWBase::Environment::get().getWindowManager()->correctIconPath(magicEffect->mIcon)); } diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index 6eab431d62..4b42b888a8 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -268,7 +268,8 @@ namespace MWGui virtual void initialiseOverride(); private: - + static const int sIconOffset = 24; + void updateWidgets(); SpellEffectParams mEffectParams;