2014-03-16 23:38:51 +01:00
|
|
|
#ifndef OPENMW_GAME_MWGUI_HUD_H
|
|
|
|
#define OPENMW_GAME_MWGUI_HUD_H
|
|
|
|
|
2013-04-10 00:32:05 -04:00
|
|
|
#include "mapwindow.hpp"
|
2012-05-13 18:14:03 +02:00
|
|
|
|
|
|
|
#include "../mwmechanics/stat.hpp"
|
2015-01-10 03:56:06 +01:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
}
|
2012-05-13 18:14:03 +02:00
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2012-05-13 18:35:56 +02:00
|
|
|
class DragAndDrop;
|
2013-03-03 12:01:19 +01:00
|
|
|
class SpellIcons;
|
2014-06-05 22:13:18 +02:00
|
|
|
class ItemWidget;
|
2012-05-13 18:35:56 +02:00
|
|
|
|
2015-05-01 02:09:57 +02:00
|
|
|
class HUD : public Layout, public LocalMapBase
|
2012-05-13 18:14:03 +02:00
|
|
|
{
|
|
|
|
public:
|
2015-11-07 00:13:13 +01:00
|
|
|
HUD(CustomMarkerCollection& customMarkers, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender);
|
2013-03-03 12:01:19 +01:00
|
|
|
virtual ~HUD();
|
2012-09-15 17:12:42 +02:00
|
|
|
void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value);
|
2012-08-27 19:18:55 +02:00
|
|
|
|
2013-08-07 15:34:11 +02:00
|
|
|
/// Set time left for the player to start drowning
|
2014-04-27 04:27:26 +02:00
|
|
|
/// @param time time left to start drowning
|
|
|
|
/// @param maxTime how long we can be underwater (in total) until drowning starts
|
|
|
|
void setDrowningTimeLeft(float time, float maxTime);
|
2013-08-07 15:34:11 +02:00
|
|
|
void setDrowningBarVisible(bool visible);
|
|
|
|
|
2012-08-27 19:18:55 +02:00
|
|
|
void setHmsVisible(bool visible);
|
|
|
|
void setWeapVisible(bool visible);
|
|
|
|
void setSpellVisible(bool visible);
|
2013-08-03 02:43:56 +02:00
|
|
|
void setSneakVisible(bool visible);
|
2012-08-27 19:18:55 +02:00
|
|
|
|
|
|
|
void setEffectVisible(bool visible);
|
|
|
|
void setMinimapVisible(bool visible);
|
|
|
|
|
2012-05-29 18:33:01 +02:00
|
|
|
void setSelectedSpell(const std::string& spellId, int successChancePercent);
|
|
|
|
void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent);
|
2017-02-15 00:55:35 +01:00
|
|
|
const MWWorld::Ptr& getSelectedEnchantItem();
|
2012-05-29 18:33:01 +02:00
|
|
|
void setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent);
|
|
|
|
void unsetSelectedSpell();
|
|
|
|
void unsetSelectedWeapon();
|
|
|
|
|
2012-08-27 19:18:55 +02:00
|
|
|
void setCrosshairVisible(bool visible);
|
2015-07-17 17:29:00 +02:00
|
|
|
void setCrosshairOwned(bool owned);
|
2012-08-27 19:18:55 +02:00
|
|
|
|
2012-05-26 23:06:15 +02:00
|
|
|
void onFrame(float dt);
|
|
|
|
|
|
|
|
void setCellName(const std::string& cellName);
|
|
|
|
|
2012-06-02 12:25:24 +02:00
|
|
|
bool getWorldMouseOver() { return mWorldMouseOver; }
|
|
|
|
|
2013-03-03 12:01:19 +01:00
|
|
|
MyGUI::Widget* getEffectBox() { return mEffectBox; }
|
|
|
|
|
|
|
|
void update();
|
|
|
|
|
2013-07-30 06:00:20 +02:00
|
|
|
void setEnemy(const MWWorld::Ptr& enemy);
|
2014-04-23 19:49:09 +02:00
|
|
|
void resetEnemy();
|
2013-07-30 06:00:20 +02:00
|
|
|
|
2012-08-27 19:18:55 +02:00
|
|
|
private:
|
2013-08-07 15:34:11 +02:00
|
|
|
MyGUI::ProgressBar *mHealth, *mMagicka, *mStamina, *mEnemyHealth, *mDrowning;
|
2012-05-29 15:36:48 +02:00
|
|
|
MyGUI::Widget* mHealthFrame;
|
2013-08-03 02:43:56 +02:00
|
|
|
MyGUI::Widget *mWeapBox, *mSpellBox, *mSneakBox;
|
2014-06-05 22:13:18 +02:00
|
|
|
ItemWidget *mWeapImage, *mSpellImage;
|
2013-07-30 06:00:20 +02:00
|
|
|
MyGUI::ProgressBar *mWeapStatus, *mSpellStatus;
|
2012-07-13 03:51:58 -07:00
|
|
|
MyGUI::Widget *mEffectBox, *mMinimapBox;
|
2012-08-28 17:30:34 +02:00
|
|
|
MyGUI::Button* mMinimapButton;
|
2012-07-13 03:51:58 -07:00
|
|
|
MyGUI::ScrollView* mMinimap;
|
|
|
|
MyGUI::ImageBox* mCompass;
|
|
|
|
MyGUI::ImageBox* mCrosshair;
|
2012-05-26 23:06:15 +02:00
|
|
|
MyGUI::TextBox* mCellNameBox;
|
2012-05-29 18:33:01 +02:00
|
|
|
MyGUI::TextBox* mWeaponSpellBox;
|
2013-10-27 04:05:01 -04:00
|
|
|
MyGUI::Widget *mDrowningFrame, *mDrowningFlash;
|
2012-05-13 18:14:03 +02:00
|
|
|
|
|
|
|
// bottom left elements
|
2013-08-03 02:43:56 +02:00
|
|
|
int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft;
|
2012-05-13 18:14:03 +02:00
|
|
|
// bottom right elements
|
2012-07-13 03:51:58 -07:00
|
|
|
int mMinimapBoxBaseRight, mEffectBoxBaseRight;
|
2012-05-13 18:35:56 +02:00
|
|
|
|
|
|
|
DragAndDrop* mDragAndDrop;
|
|
|
|
|
2012-05-26 23:06:15 +02:00
|
|
|
std::string mCellName;
|
|
|
|
float mCellNameTimer;
|
|
|
|
|
2012-05-29 18:33:01 +02:00
|
|
|
std::string mWeaponName;
|
|
|
|
std::string mSpellName;
|
|
|
|
float mWeaponSpellTimer;
|
|
|
|
|
2012-05-28 12:34:29 +02:00
|
|
|
bool mMapVisible;
|
2012-05-29 18:59:11 +02:00
|
|
|
bool mWeaponVisible;
|
|
|
|
bool mSpellVisible;
|
2012-05-28 12:34:29 +02:00
|
|
|
|
2012-06-02 12:25:24 +02:00
|
|
|
bool mWorldMouseOver;
|
|
|
|
|
2013-03-03 12:01:19 +01:00
|
|
|
SpellIcons* mSpellIcons;
|
|
|
|
|
2014-07-23 22:04:18 +02:00
|
|
|
int mEnemyActorId;
|
2013-07-30 06:00:20 +02:00
|
|
|
float mEnemyHealthTimer;
|
|
|
|
|
2013-10-27 04:05:01 -04:00
|
|
|
bool mIsDrowning;
|
|
|
|
float mDrowningFlashTheta;
|
|
|
|
|
2012-05-13 18:35:56 +02:00
|
|
|
void onWorldClicked(MyGUI::Widget* _sender);
|
2012-05-15 16:47:23 +02:00
|
|
|
void onWorldMouseOver(MyGUI::Widget* _sender, int x, int y);
|
2012-05-17 14:13:35 +02:00
|
|
|
void onWorldMouseLostFocus(MyGUI::Widget* _sender, MyGUI::Widget* _new);
|
2012-05-26 21:09:21 +02:00
|
|
|
void onHMSClicked(MyGUI::Widget* _sender);
|
|
|
|
void onWeaponClicked(MyGUI::Widget* _sender);
|
|
|
|
void onMagicClicked(MyGUI::Widget* _sender);
|
|
|
|
void onMapClicked(MyGUI::Widget* _sender);
|
2012-08-27 19:18:55 +02:00
|
|
|
|
2015-02-20 00:00:13 +01:00
|
|
|
// LocalMapBase
|
|
|
|
virtual void customMarkerCreated(MyGUI::Widget* marker);
|
|
|
|
virtual void doorMarkerCreated(MyGUI::Widget* marker);
|
|
|
|
|
2014-03-15 20:48:54 +01:00
|
|
|
void updateEnemyHealthBar();
|
|
|
|
|
2012-08-27 19:18:55 +02:00
|
|
|
void updatePositions();
|
2012-05-13 18:14:03 +02:00
|
|
|
};
|
|
|
|
}
|
2014-03-16 23:38:51 +01:00
|
|
|
|
|
|
|
#endif
|