mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Merge remote-tracking branch 'potatoesmaster/sneak'
This commit is contained in:
commit
8f330e7e3c
7 changed files with 42 additions and 4 deletions
|
@ -188,6 +188,7 @@ namespace MWBase
|
|||
virtual void setMinimapVisibility(bool visible) = 0;
|
||||
virtual void setWeaponVisibility(bool visible) = 0;
|
||||
virtual void setSpellVisibility(bool visible) = 0;
|
||||
virtual void setSneakVisibility(bool visible) = 0;
|
||||
|
||||
virtual void activateQuickKey (int index) = 0;
|
||||
|
||||
|
|
|
@ -84,6 +84,9 @@ namespace MWGui
|
|||
mSpellBoxBaseLeft = mSpellBox->getLeft();
|
||||
mSpellBox->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onMagicClicked);
|
||||
|
||||
getWidget(mSneakBox, "SneakBox");
|
||||
mSneakBoxBaseLeft = mSneakBox->getLeft();
|
||||
|
||||
getWidget(mEffectBox, "EffectBox");
|
||||
mEffectBoxBaseRight = viewSize.width - mEffectBox->getRight();
|
||||
|
||||
|
@ -503,6 +506,12 @@ namespace MWGui
|
|||
updatePositions();
|
||||
}
|
||||
|
||||
void HUD::setSneakVisible(bool visible)
|
||||
{
|
||||
mSneakBox->setVisible(visible);
|
||||
updatePositions();
|
||||
}
|
||||
|
||||
void HUD::setEffectVisible(bool visible)
|
||||
{
|
||||
mEffectBox->setVisible (visible);
|
||||
|
@ -517,12 +526,18 @@ namespace MWGui
|
|||
|
||||
void HUD::updatePositions()
|
||||
{
|
||||
int weapDx = 0, spellDx = 0;
|
||||
int weapDx = 0, spellDx = 0, sneakDx = 0;
|
||||
if (!mHealth->getVisible())
|
||||
spellDx = weapDx = mWeapBoxBaseLeft - mHealthManaStaminaBaseLeft;
|
||||
sneakDx = spellDx = weapDx = mWeapBoxBaseLeft - mHealthManaStaminaBaseLeft;
|
||||
|
||||
if (!mWeapBox->getVisible())
|
||||
{
|
||||
spellDx += mSpellBoxBaseLeft - mWeapBoxBaseLeft;
|
||||
sneakDx = spellDx;
|
||||
}
|
||||
|
||||
if (!mSpellBox->getVisible())
|
||||
sneakDx += mSneakBoxBaseLeft - mSpellBoxBaseLeft;
|
||||
|
||||
mWeaponVisible = mWeapBox->getVisible();
|
||||
mSpellVisible = mSpellBox->getVisible();
|
||||
|
@ -531,6 +546,7 @@ namespace MWGui
|
|||
|
||||
mWeapBox->setPosition(mWeapBoxBaseLeft - weapDx, mWeapBox->getTop());
|
||||
mSpellBox->setPosition(mSpellBoxBaseLeft - spellDx, mSpellBox->getTop());
|
||||
mSneakBox->setPosition(mSneakBoxBaseLeft - sneakDx, mSneakBox->getTop());
|
||||
|
||||
const MyGUI::IntSize& viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ namespace MWGui
|
|||
void setHmsVisible(bool visible);
|
||||
void setWeapVisible(bool visible);
|
||||
void setSpellVisible(bool visible);
|
||||
void setSneakVisible(bool visible);
|
||||
|
||||
void setEffectVisible(bool visible);
|
||||
void setMinimapVisible(bool visible);
|
||||
|
@ -51,7 +52,7 @@ namespace MWGui
|
|||
private:
|
||||
MyGUI::ProgressBar *mHealth, *mMagicka, *mStamina, *mEnemyHealth;
|
||||
MyGUI::Widget* mHealthFrame;
|
||||
MyGUI::Widget *mWeapBox, *mSpellBox;
|
||||
MyGUI::Widget *mWeapBox, *mSpellBox, *mSneakBox;
|
||||
MyGUI::ImageBox *mWeapImage, *mSpellImage;
|
||||
MyGUI::ProgressBar *mWeapStatus, *mSpellStatus;
|
||||
MyGUI::Widget *mEffectBox, *mMinimapBox;
|
||||
|
@ -70,7 +71,7 @@ namespace MWGui
|
|||
MyGUI::TextBox* mBatchCounter;
|
||||
|
||||
// bottom left elements
|
||||
int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft;
|
||||
int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft;
|
||||
// bottom right elements
|
||||
int mMinimapBoxBaseRight, mEffectBoxBaseRight;
|
||||
|
||||
|
|
|
@ -834,6 +834,11 @@ namespace MWGui
|
|||
mHud->setEffectVisible (visible);
|
||||
}
|
||||
|
||||
void WindowManager::setSneakVisibility(bool visible)
|
||||
{
|
||||
mHud->setSneakVisible(visible);
|
||||
}
|
||||
|
||||
void WindowManager::setDragDrop(bool dragDrop)
|
||||
{
|
||||
mToolTips->setEnabled(!dragDrop);
|
||||
|
|
|
@ -179,6 +179,7 @@ namespace MWGui
|
|||
virtual void setMinimapVisibility(bool visible);
|
||||
virtual void setWeaponVisibility(bool visible);
|
||||
virtual void setSpellVisibility(bool visible);
|
||||
virtual void setSneakVisibility(bool visible);
|
||||
|
||||
virtual void activateQuickKey (int index);
|
||||
|
||||
|
|
|
@ -123,6 +123,9 @@ namespace MWWorld
|
|||
MWWorld::Ptr ptr = getPlayer();
|
||||
|
||||
MWWorld::Class::get (ptr).setStance (ptr, MWWorld::Class::Sneak, sneak);
|
||||
|
||||
// TODO show sneak indicator only when the player is not detected by any actor
|
||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(sneak);
|
||||
}
|
||||
|
||||
void Player::yaw(float yaw)
|
||||
|
|
|
@ -65,6 +65,17 @@
|
|||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<!-- Sneak indicator box -->
|
||||
<Widget type="Button" skin="" position="162 146 36 36" align="Left Bottom" name="SneakBox">
|
||||
<Widget type="Widget" skin="HUD_Box" position="0 0 36 36">
|
||||
<Property key="NeedMouse" value="false"/>
|
||||
<Widget type="ImageBox" skin="ImageBox" position="2 2 32 32" align="Left Top" name="SneakImage">
|
||||
<Property key="NeedMouse" value="false"/>
|
||||
<Property key="ImageTexture" value="icons\k\stealth_sneak.dds"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<!-- Spell effects box -->
|
||||
<Widget type="Widget" skin="HUD_Box_Transparent" position="199 168 20 20" align="Right Bottom" name="EffectBox">
|
||||
</Widget>
|
||||
|
|
Loading…
Reference in a new issue