X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FHUD.hpp;h=cab8f93e0bf13c26cccb69a6a3a4d48b6ac28fa9;hb=75172fd735e34082c34b47ae7c194445b53038d9;hp=8978c91e23510d7d332b7015dc3bf1729086e4fa;hpb=376fc1fca87fcdd22dabadf6d01d245ef8c3cedd;p=blank.git diff --git a/src/ui/HUD.hpp b/src/ui/HUD.hpp index 8978c91..cab8f93 100644 --- a/src/ui/HUD.hpp +++ b/src/ui/HUD.hpp @@ -2,8 +2,9 @@ #define BLANK_UI_HUD_H_ #include "FixedText.hpp" -#include "../model/EntityModel.hpp" -#include "../model/OutlineModel.hpp" +#include "MessageBox.hpp" +#include "../graphics/EntityMesh.hpp" +#include "../graphics/PrimitiveMesh.hpp" #include @@ -12,34 +13,76 @@ namespace blank { class Block; class BlockTypeRegistry; +class Config; +class Environment; class Font; +class Player; class Viewport; class HUD { public: - HUD(const BlockTypeRegistry &, const Font &); + explicit HUD(Environment &, Config &, const Player &); HUD(const HUD &) = delete; HUD &operator =(const HUD &) = delete; - void Display(const Block &); + // focus + void FocusBlock(const Chunk &, int); + void FocusEntity(const Entity &); + void FocusNone(); + // "inventory" + void DisplayNone(); + void Display(const BlockType &); + + // debug overlay + void UpdateDebug(); + void UpdateCounter(); + void UpdatePosition(); + void UpdateOrientation(); + + // message box + void PostMessage(const char *); + void PostMessage(const std::string &msg) { + PostMessage(msg.c_str()); + } + + void Update(int dt); void Render(Viewport &) noexcept; private: - const BlockTypeRegistry &types; - const Font &font; - - EntityModel block; - EntityModel::Buffer block_buf; + Environment &env; + Config &config; + const Player &player; + + // block focus + PrimitiveMesh outline; + glm::mat4 outline_transform; + bool outline_visible; + + // "inventory" + EntityMesh block; + EntityMesh::Buffer block_buf; glm::mat4 block_transform; - FixedText block_label; - bool block_visible; - OutlineModel crosshair; + // debug overlay + FixedText counter_text; + FixedText position_text; + FixedText orientation_text; + FixedText block_text; + FixedText entity_text; + bool show_block; + bool show_entity; + + // message box + MessageBox messages; + IntervalTimer msg_timer; + + // crosshair + PrimitiveMesh crosshair; };