|
|
@ -28,6 +28,7 @@ namespace MWGui
|
|
|
|
, mStamina(NULL)
|
|
|
|
, mStamina(NULL)
|
|
|
|
, mDrowning(NULL)
|
|
|
|
, mDrowning(NULL)
|
|
|
|
, mDrowningFrame(NULL)
|
|
|
|
, mDrowningFrame(NULL)
|
|
|
|
|
|
|
|
, mDrowningFlash(NULL)
|
|
|
|
, mWeapImage(NULL)
|
|
|
|
, mWeapImage(NULL)
|
|
|
|
, mSpellImage(NULL)
|
|
|
|
, mSpellImage(NULL)
|
|
|
|
, mWeapStatus(NULL)
|
|
|
|
, mWeapStatus(NULL)
|
|
|
@ -53,6 +54,7 @@ namespace MWGui
|
|
|
|
, mSpellVisible(true)
|
|
|
|
, mSpellVisible(true)
|
|
|
|
, mWorldMouseOver(false)
|
|
|
|
, mWorldMouseOver(false)
|
|
|
|
, mEnemyHealthTimer(0)
|
|
|
|
, mEnemyHealthTimer(0)
|
|
|
|
|
|
|
|
, mIsDrowning(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
setCoord(0,0, width, height);
|
|
|
|
setCoord(0,0, width, height);
|
|
|
|
|
|
|
|
|
|
|
@ -75,6 +77,7 @@ namespace MWGui
|
|
|
|
//Drowning bar
|
|
|
|
//Drowning bar
|
|
|
|
getWidget(mDrowningFrame, "DrowningFrame");
|
|
|
|
getWidget(mDrowningFrame, "DrowningFrame");
|
|
|
|
getWidget(mDrowning, "Drowning");
|
|
|
|
getWidget(mDrowning, "Drowning");
|
|
|
|
|
|
|
|
getWidget(mDrowningFlash, "Flash");
|
|
|
|
mDrowning->setProgressRange(200);
|
|
|
|
mDrowning->setProgressRange(200);
|
|
|
|
|
|
|
|
|
|
|
|
const MyGUI::IntSize& viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
|
|
|
const MyGUI::IntSize& viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
|
|
@ -207,7 +210,15 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
|
|
void HUD::setDrowningTimeLeft(float time)
|
|
|
|
void HUD::setDrowningTimeLeft(float time)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mDrowning->setProgressPosition(time/20.0*200.0);
|
|
|
|
size_t progress = time/20.0*200.0;
|
|
|
|
|
|
|
|
mDrowning->setProgressPosition(progress);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isDrowning = (progress == 0);
|
|
|
|
|
|
|
|
if (isDrowning && !mIsDrowning) // Just started drowning
|
|
|
|
|
|
|
|
mDrowningFlashTheta = 0.0f; // Start out on bright red every time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mDrowningFlash->setVisible(isDrowning);
|
|
|
|
|
|
|
|
mIsDrowning = isDrowning;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HUD::setDrowningBarVisible(bool visible)
|
|
|
|
void HUD::setDrowningBarVisible(bool visible)
|
|
|
@ -367,6 +378,9 @@ namespace MWGui
|
|
|
|
mEnemyHealth->setVisible(false);
|
|
|
|
mEnemyHealth->setVisible(false);
|
|
|
|
mWeaponSpellBox->setPosition(mWeaponSpellBox->getPosition() + MyGUI::IntPoint(0,20));
|
|
|
|
mWeaponSpellBox->setPosition(mWeaponSpellBox->getPosition() + MyGUI::IntPoint(0,20));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mIsDrowning)
|
|
|
|
|
|
|
|
mDrowningFlashTheta += dt * Ogre::Math::TWO_PI;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HUD::onResChange(int width, int height)
|
|
|
|
void HUD::onResChange(int width, int height)
|
|
|
@ -609,6 +623,12 @@ namespace MWGui
|
|
|
|
mEnemyHealth->setProgressRange(100);
|
|
|
|
mEnemyHealth->setProgressRange(100);
|
|
|
|
mEnemyHealth->setProgressPosition(stats.getHealth().getCurrent() / stats.getHealth().getModified() * 100);
|
|
|
|
mEnemyHealth->setProgressPosition(stats.getHealth().getCurrent() / stats.getHealth().getModified() * 100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mIsDrowning)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
float intensity = (cos(mDrowningFlashTheta) + 1.0f) / 2.0f;
|
|
|
|
|
|
|
|
mDrowningFlash->setColour(MyGUI::Colour(intensity, intensity, intensity));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HUD::setEnemy(const MWWorld::Ptr &enemy)
|
|
|
|
void HUD::setEnemy(const MWWorld::Ptr &enemy)
|
|
|
|