2012-05-13 16:14:03 +00:00
|
|
|
#include "map_window.hpp"
|
|
|
|
|
|
|
|
#include <openengine/gui/layout.hpp>
|
|
|
|
|
|
|
|
#include "../mwmechanics/stat.hpp"
|
2012-05-29 16:33:01 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
2012-05-13 16:14:03 +00:00
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2012-05-13 16:35:56 +00:00
|
|
|
class DragAndDrop;
|
|
|
|
|
2012-05-13 16:14:03 +00:00
|
|
|
class HUD : public OEngine::GUI::Layout, public LocalMapBase
|
|
|
|
{
|
|
|
|
public:
|
2012-05-13 16:35:56 +00:00
|
|
|
HUD(int width, int height, int fpsLevel, DragAndDrop* dragAndDrop);
|
2012-05-13 16:14:03 +00:00
|
|
|
void setEffect(const char *img);
|
|
|
|
void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value);
|
|
|
|
void setFPS(float fps);
|
|
|
|
void setTriangleCount(size_t count);
|
|
|
|
void setBatchCount(size_t count);
|
|
|
|
void setBottomLeftVisibility(bool hmsVisible, bool weapVisible, bool spellVisible);
|
|
|
|
void setBottomRightVisibility(bool effectBoxVisible, bool minimapVisible);
|
|
|
|
void setFpsLevel(const int level);
|
|
|
|
|
2012-05-29 16:33:01 +00:00
|
|
|
void setSelectedSpell(const std::string& spellId, int successChancePercent);
|
|
|
|
void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent);
|
|
|
|
void setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent);
|
|
|
|
void unsetSelectedSpell();
|
|
|
|
void unsetSelectedWeapon();
|
|
|
|
|
2012-05-26 21:06:15 +00:00
|
|
|
void onFrame(float dt);
|
2012-05-28 07:19:25 +00:00
|
|
|
void onResChange(int width, int height);
|
2012-05-26 21:06:15 +00:00
|
|
|
|
|
|
|
void setCellName(const std::string& cellName);
|
|
|
|
|
2012-06-02 10:25:24 +00:00
|
|
|
bool getWorldMouseOver() { return mWorldMouseOver; }
|
|
|
|
|
2012-05-13 16:14:03 +00:00
|
|
|
MyGUI::ProgressPtr health, magicka, stamina;
|
2012-05-29 13:36:48 +00:00
|
|
|
MyGUI::Widget* mHealthFrame;
|
2012-05-13 16:14:03 +00:00
|
|
|
MyGUI::Widget *weapBox, *spellBox;
|
|
|
|
MyGUI::ImageBox *weapImage, *spellImage;
|
|
|
|
MyGUI::ProgressPtr weapStatus, spellStatus;
|
|
|
|
MyGUI::Widget *effectBox, *minimapBox;
|
|
|
|
MyGUI::ImageBox* effect1;
|
|
|
|
MyGUI::ScrollView* minimap;
|
|
|
|
MyGUI::ImageBox* compass;
|
|
|
|
MyGUI::ImageBox* crosshair;
|
2012-05-26 21:06:15 +00:00
|
|
|
MyGUI::TextBox* mCellNameBox;
|
2012-05-29 16:33:01 +00:00
|
|
|
MyGUI::TextBox* mWeaponSpellBox;
|
2012-05-13 16:14:03 +00:00
|
|
|
|
|
|
|
MyGUI::WidgetPtr fpsbox;
|
|
|
|
MyGUI::TextBox* fpscounter;
|
|
|
|
MyGUI::TextBox* trianglecounter;
|
|
|
|
MyGUI::TextBox* batchcounter;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// bottom left elements
|
|
|
|
int hmsBaseLeft, weapBoxBaseLeft, spellBoxBaseLeft;
|
|
|
|
// bottom right elements
|
|
|
|
int minimapBoxBaseRight, effectBoxBaseRight;
|
2012-05-13 16:35:56 +00:00
|
|
|
|
|
|
|
DragAndDrop* mDragAndDrop;
|
|
|
|
|
2012-05-26 21:06:15 +00:00
|
|
|
std::string mCellName;
|
|
|
|
float mCellNameTimer;
|
|
|
|
|
2012-05-29 16:33:01 +00:00
|
|
|
std::string mWeaponName;
|
|
|
|
std::string mSpellName;
|
|
|
|
float mWeaponSpellTimer;
|
|
|
|
|
2012-05-28 10:34:29 +00:00
|
|
|
bool mMapVisible;
|
2012-05-29 16:59:11 +00:00
|
|
|
bool mWeaponVisible;
|
|
|
|
bool mSpellVisible;
|
2012-05-28 10:34:29 +00:00
|
|
|
|
2012-06-02 10:25:24 +00:00
|
|
|
bool mWorldMouseOver;
|
|
|
|
|
2012-05-13 16:35:56 +00:00
|
|
|
void onWorldClicked(MyGUI::Widget* _sender);
|
2012-05-15 14:47:23 +00:00
|
|
|
void onWorldMouseOver(MyGUI::Widget* _sender, int x, int y);
|
2012-05-17 12:13:35 +00:00
|
|
|
void onWorldMouseLostFocus(MyGUI::Widget* _sender, MyGUI::Widget* _new);
|
2012-05-26 19:09:21 +00:00
|
|
|
void onHMSClicked(MyGUI::Widget* _sender);
|
|
|
|
void onWeaponClicked(MyGUI::Widget* _sender);
|
|
|
|
void onMagicClicked(MyGUI::Widget* _sender);
|
|
|
|
void onMapClicked(MyGUI::Widget* _sender);
|
2012-05-13 16:14:03 +00:00
|
|
|
};
|
|
|
|
}
|