]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/HUD.hpp
split input handling
[blank.git] / src / ui / HUD.hpp
index 1917b130c926772b5518806c1fc04af157447271..d15643f4d4476090fc98138e10bcdaeffc2cbd14 100644 (file)
@@ -2,6 +2,7 @@
 #define BLANK_UI_HUD_H_
 
 #include "FixedText.hpp"
+#include "MessageBox.hpp"
 #include "../model/EntityModel.hpp"
 #include "../model/OutlineModel.hpp"
 
@@ -12,34 +13,75 @@ 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;
 
+       // focus
+       void FocusBlock(const Chunk &, int);
+       void FocusEntity(const Entity &);
+       void FocusNone();
+
+       // "inventory"
        void DisplayNone();
-       void Display(const Block &);
+       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;
+       Environment &env;
+       Config &config;
+       const Player &player;
+
+       // block focus
+       OutlineModel outline;
+       glm::mat4 outline_transform;
+       bool outline_visible;
 
+       // "inventory"
        EntityModel block;
        EntityModel::Buffer block_buf;
        glm::mat4 block_transform;
-
        FixedText block_label;
-
        bool block_visible;
 
+       // 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
        OutlineModel crosshair;
 
 };