1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:29:55 +00:00

Bug #5434: Pinned windows shouldn't cover breath progress bar

This commit is contained in:
andrew-app 2021-12-02 17:01:40 +00:00 committed by Evil Eye
parent 693880cc40
commit 13400b2c5f
7 changed files with 34 additions and 24 deletions

View file

@ -31,6 +31,7 @@ Programmers
Allofich Allofich
Andreas Stöckel Andreas Stöckel
Andrei Kortunov (akortunov) Andrei Kortunov (akortunov)
Andrew Appuhamy (andrew-app)
AnyOldName3 AnyOldName3
Ardekantur Ardekantur
Armin Preiml Armin Preiml
@ -230,7 +231,7 @@ Programmers
Yuri Krupenin Yuri Krupenin
zelurker zelurker
Noah Gooder Noah Gooder
Andrew Appuhamy (andrew-app)
Documentation Documentation
------------- -------------

View file

@ -23,6 +23,7 @@
Bug #5377: console does not appear after using menutest in inventory Bug #5377: console does not appear after using menutest in inventory
Bug #5379: Wandering NPCs falling through cantons Bug #5379: Wandering NPCs falling through cantons
Bug #5394: Windows snapping no longer works Bug #5394: Windows snapping no longer works
Bug #5434: Pinned windows shouldn't cover breath progress bar
Bug #5453: Magic effect VFX are offset for creatures Bug #5453: Magic effect VFX are offset for creatures
Bug #5483: AutoCalc flag is not used to calculate spells cost Bug #5483: AutoCalc flag is not used to calculate spells cost
Bug #5508: Engine binary links to Qt without using it Bug #5508: Engine binary links to Qt without using it

View file

@ -81,7 +81,7 @@ namespace MWGui
, mMinimap(nullptr) , mMinimap(nullptr)
, mCrosshair(nullptr) , mCrosshair(nullptr)
, mCellNameBox(nullptr) , mCellNameBox(nullptr)
, mDrowningFrame(nullptr) , mDrowningBar(nullptr)
, mDrowningFlash(nullptr) , mDrowningFlash(nullptr)
, mHealthManaStaminaBaseLeft(0) , mHealthManaStaminaBaseLeft(0)
, mWeapBoxBaseLeft(0) , mWeapBoxBaseLeft(0)
@ -119,6 +119,7 @@ namespace MWGui
fatigueFrame->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onHMSClicked); fatigueFrame->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onHMSClicked);
//Drowning bar //Drowning bar
getWidget(mDrowningBar, "DrowningBar");
getWidget(mDrowningFrame, "DrowningFrame"); getWidget(mDrowningFrame, "DrowningFrame");
getWidget(mDrowning, "Drowning"); getWidget(mDrowning, "Drowning");
getWidget(mDrowningFlash, "Flash"); getWidget(mDrowningFlash, "Flash");
@ -224,7 +225,7 @@ namespace MWGui
void HUD::setDrowningBarVisible(bool visible) void HUD::setDrowningBarVisible(bool visible)
{ {
mDrowningFrame->setVisible(visible); mDrowningBar->setVisible(visible);
} }
void HUD::onWorldClicked(MyGUI::Widget* _sender) void HUD::onWorldClicked(MyGUI::Widget* _sender)
@ -368,9 +369,6 @@ namespace MWGui
mWeaponSpellBox->setPosition(mWeaponSpellBox->getPosition() + MyGUI::IntPoint(0,20)); mWeaponSpellBox->setPosition(mWeaponSpellBox->getPosition() + MyGUI::IntPoint(0,20));
} }
if (mIsDrowning)
mDrowningFlashTheta += dt * osg::PI*2;
mSpellIcons->updateWidgets(mEffectBox, true); mSpellIcons->updateWidgets(mEffectBox, true);
if (mEnemyActorId != -1 && mEnemyHealth->getVisible()) if (mEnemyActorId != -1 && mEnemyHealth->getVisible())
@ -378,8 +376,13 @@ namespace MWGui
updateEnemyHealthBar(); updateEnemyHealthBar();
} }
if (mDrowningBar->getVisible())
mDrowningBar->setPosition(mMainWidget->getWidth()/2 - mDrowningFrame->getWidth()/2, mMainWidget->getTop());
if (mIsDrowning) if (mIsDrowning)
{ {
mDrowningFlashTheta += dt * osg::PI*2;
float intensity = (cos(mDrowningFlashTheta) + 2.0f) / 3.0f; float intensity = (cos(mDrowningFlashTheta) + 2.0f) / 3.0f;
mDrowningFlash->setAlpha(intensity); mDrowningFlash->setAlpha(intensity);

View file

@ -73,7 +73,7 @@ namespace MWGui
MyGUI::ImageBox* mCrosshair; MyGUI::ImageBox* mCrosshair;
MyGUI::TextBox* mCellNameBox; MyGUI::TextBox* mCellNameBox;
MyGUI::TextBox* mWeaponSpellBox; MyGUI::TextBox* mWeaponSpellBox;
MyGUI::Widget *mDrowningFrame, *mDrowningFlash; MyGUI::Widget *mDrowningBar, *mDrowningFrame, *mDrowningFlash;
// bottom left elements // bottom left elements
int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft; int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft;

View file

@ -638,6 +638,7 @@ namespace MWGui
mMap->setVisible(false); mMap->setVisible(false);
mStatsWindow->setVisible(false); mStatsWindow->setVisible(false);
mSpellWindow->setVisible(false); mSpellWindow->setVisible(false);
mHud->setDrowningBarVisible(false);
mInventoryWindow->setVisible(getMode() == GM_Container || getMode() == GM_Barter || getMode() == GM_Companion); mInventoryWindow->setVisible(getMode() == GM_Container || getMode() == GM_Barter || getMode() == GM_Companion);
} }

View file

@ -31,22 +31,6 @@
</Widget> </Widget>
</Widget> </Widget>
<!-- Drowning bar -->
<Widget type="Window" skin="MW_Dialog" position="0 36 230 58" align="Center Top" name="DrowningFrame">
<Property key="Visible" value="false"/>
<Widget type="TextBox" skin="SandText" position="0 3 222 24" name="DrowningTitle" align="Center Top HStretch">
<Property key="Caption" value="#{sBreath}"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextShadow" value="true"/>
<Property key="TextShadowColour" value="0 0 0"/>
</Widget>
<Widget type="Widget" skin="MW_Box" position="11 29 200 10" align="Stretch" name="BoundingBox"/>
<Widget type="ProgressBar" skin="MW_Progress_Drowning_Full" position="13 31 196 6" align="Center Top" name="Drowning">
<Property key="NeedMouse" value="false"/>
</Widget>
<Widget type="Widget" skin="MW_Progress_Drowning_Small" position="15 33 192 2" align="Center Top" name="Flash"/>
</Widget>
<!-- Equipped weapon/selected spell name display for a few seconds after it changes --> <!-- Equipped weapon/selected spell name display for a few seconds after it changes -->
<Widget type="TextBox" skin="SandText" position="13 118 270 24" name="WeaponSpellName" align="Left Bottom HStretch"> <Widget type="TextBox" skin="SandText" position="13 118 270 24" name="WeaponSpellName" align="Left Bottom HStretch">
<Property key="Visible" value="false"/> <Property key="Visible" value="false"/>
@ -128,4 +112,23 @@
</Widget> </Widget>
</Widget> </Widget>
</MyGUI>
<!-- Drowning bar -->
<Widget type="Widget" layer="DrowningBar" position="0 0 300 200" name="DrowningBar" align="Center Top">
<Property key="Visible" value="false"/>
<Widget type="Window" skin="MW_Dialog" position="0 36 230 58" align="Center Top" name="DrowningFrame">
<Widget type="TextBox" skin="SandText" position="0 3 222 24" name="DrowningTitle" align="Center Top HStretch">
<Property key="Caption" value="#{sBreath}"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextShadow" value="true"/>
<Property key="TextShadowColour" value="0 0 0"/>
</Widget>
<Widget type="Widget" skin="MW_Box" position="11 29 200 10" align="Stretch" name="BoundingBox"/>
<Widget type="ProgressBar" skin="MW_Progress_Drowning_Full" position="13 31 196 6" align="Center Top" name="Drowning">
<Property key="NeedMouse" value="false"/>
</Widget>
<Widget type="Widget" skin="MW_Progress_Drowning_Small" position="15 33 192 2" align="Center Top" name="Flash"/>
</Widget>
</Widget>
</MyGUI>

View file

@ -15,6 +15,7 @@
<Layer name="Popup" overlapped="true" pick="true"/> <Layer name="Popup" overlapped="true" pick="true"/>
<Layer name="Notification" overlapped="false" pick="false"/> <Layer name="Notification" overlapped="false" pick="false"/>
<Layer name="DragAndDrop" overlapped="false" pick="false"/> <Layer name="DragAndDrop" overlapped="false" pick="false"/>
<Layer name="DrowningBar" overlapped="false" pick="false"/>
<Layer name="LoadingScreen" overlapped="false" pick="true"/> <Layer name="LoadingScreen" overlapped="false" pick="true"/>
<Layer name="MessageBox" overlapped="false" pick="true"/> <Layer name="MessageBox" overlapped="false" pick="true"/>
<Layer name="InputBlocker" overlapped="false" pick="true"/> <Layer name="InputBlocker" overlapped="false" pick="true"/>