]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/HUD.hpp
centralize entity controllers
[blank.git] / src / ui / HUD.hpp
index d15643f4d4476090fc98138e10bcdaeffc2cbd14..2302fd2991d2ec954b54a77e41929f00bb5a0d5e 100644 (file)
@@ -3,8 +3,8 @@
 
 #include "FixedText.hpp"
 #include "MessageBox.hpp"
-#include "../model/EntityModel.hpp"
-#include "../model/OutlineModel.hpp"
+#include "../graphics/EntityMesh.hpp"
+#include "../graphics/PrimitiveMesh.hpp"
 
 #include <glm/glm.hpp>
 
@@ -47,6 +47,8 @@ public:
        void PostMessage(const std::string &msg) {
                PostMessage(msg.c_str());
        }
+       // whether to always render message box regardless of last post
+       void KeepMessages(bool k) { msg_keep = k; }
 
        void Update(int dt);
        void Render(Viewport &) noexcept;
@@ -57,13 +59,13 @@ private:
        const Player &player;
 
        // block focus
-       OutlineModel outline;
+       PrimitiveMesh outline;
        glm::mat4 outline_transform;
        bool outline_visible;
 
        // "inventory"
-       EntityModel block;
-       EntityModel::Buffer block_buf;
+       EntityMesh block;
+       EntityMesh::Buffer block_buf;
        glm::mat4 block_transform;
        FixedText block_label;
        bool block_visible;
@@ -79,10 +81,11 @@ private:
 
        // message box
        MessageBox messages;
-       IntervalTimer msg_timer;
+       CoarseTimer msg_timer;
+       bool msg_keep;
 
        // crosshair
-       OutlineModel crosshair;
+       PrimitiveMesh crosshair;
 
 };