1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

125 lines
3.8 KiB
C++
Raw Normal View History

#ifndef OPENMW_GAME_MWGUI_HUD_H
#define OPENMW_GAME_MWGUI_HUD_H
#include "mapwindow.hpp"
#include "../mwmechanics/stat.hpp"
2015-01-10 03:56:06 +01:00
namespace MWWorld
{
class Ptr;
}
namespace MWGui
{
class DragAndDrop;
2013-03-03 12:01:19 +01:00
class SpellIcons;
class ItemWidget;
2015-05-01 02:09:57 +02:00
class HUD : public Layout, public LocalMapBase
{
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
/// Set time left for the player to start drowning
/// @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);
void setDrowningBarVisible(bool visible);
2012-08-27 19:18:55 +02:00
void setHmsVisible(bool visible);
void setWeapVisible(bool visible);
void setSpellVisible(bool visible);
void setSneakVisible(bool visible);
2012-08-27 19:18:55 +02:00
void setEffectVisible(bool visible);
void setMinimapVisible(bool visible);
void setSelectedSpell(const std::string& spellId, int successChancePercent);
void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent);
const MWWorld::Ptr& getSelectedEnchantItem();
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
void onFrame(float dt);
void setCellName(const std::string& cellName);
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:
MyGUI::ProgressBar *mHealth, *mMagicka, *mStamina, *mEnemyHealth, *mDrowning;
2012-05-29 15:36:48 +02:00
MyGUI::Widget* mHealthFrame;
MyGUI::Widget *mWeapBox, *mSpellBox, *mSneakBox;
ItemWidget *mWeapImage, *mSpellImage;
2013-07-30 06:00:20 +02:00
MyGUI::ProgressBar *mWeapStatus, *mSpellStatus;
MyGUI::Widget *mEffectBox, *mMinimapBox;
2012-08-28 17:30:34 +02:00
MyGUI::Button* mMinimapButton;
MyGUI::ScrollView* mMinimap;
MyGUI::ImageBox* mCompass;
MyGUI::ImageBox* mCrosshair;
MyGUI::TextBox* mCellNameBox;
MyGUI::TextBox* mWeaponSpellBox;
2013-10-27 04:05:01 -04:00
MyGUI::Widget *mDrowningFrame, *mDrowningFlash;
// bottom left elements
int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft;
// bottom right elements
int mMinimapBoxBaseRight, mEffectBoxBaseRight;
DragAndDrop* mDragAndDrop;
std::string mCellName;
float mCellNameTimer;
std::string mWeaponName;
std::string mSpellName;
float mWeaponSpellTimer;
2012-05-28 12:34:29 +02:00
bool mMapVisible;
bool mWeaponVisible;
bool mSpellVisible;
2012-05-28 12:34:29 +02:00
bool mWorldMouseOver;
2013-03-03 12:01:19 +01:00
SpellIcons* mSpellIcons;
int mEnemyActorId;
2013-07-30 06:00:20 +02:00
float mEnemyHealthTimer;
2013-10-27 04:05:01 -04:00
bool mIsDrowning;
float mDrowningFlashTheta;
void onWorldClicked(MyGUI::Widget* _sender);
void onWorldMouseOver(MyGUI::Widget* _sender, int x, int y);
void onWorldMouseLostFocus(MyGUI::Widget* _sender, MyGUI::Widget* _new);
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
// LocalMapBase
virtual void customMarkerCreated(MyGUI::Widget* marker);
virtual void doorMarkerCreated(MyGUI::Widget* marker);
void updateEnemyHealthBar();
2012-08-27 19:18:55 +02:00
void updatePositions();
};
}
#endif