X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FHUD.hpp;h=32a167b865d2979209f763a1e12341280f3b2f28;hb=3542823a1af7f5063d7cc8da84efa248eb889b8a;hp=718e712485b30a727a14426dd50ead4ad8227d7a;hpb=3f35e70a6b66daf2ffd59590e98e2dd11e6eaabb;p=blank.git diff --git a/src/ui/HUD.hpp b/src/ui/HUD.hpp index 718e712..32a167b 100644 --- a/src/ui/HUD.hpp +++ b/src/ui/HUD.hpp @@ -1,9 +1,10 @@ #ifndef BLANK_UI_HUD_H_ #define BLANK_UI_HUD_H_ -#include "../graphics/FixedText.hpp" -#include "../model/Model.hpp" -#include "../model/OutlineModel.hpp" +#include "FixedText.hpp" +#include "MessageBox.hpp" +#include "../graphics/EntityMesh.hpp" +#include "../graphics/OutlineMesh.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; - - Model block; - Model::Buffer block_buf; + Environment &env; + Config &config; + const Player &player; + + // block focus + OutlineMesh 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 + OutlineMesh crosshair; };