X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FHUD.hpp;h=b6ae7d7656cba0298f013ee24833ec0aeab0a0dc;hb=225a7e66ed3f3f03ab458ab39c914ed55cd69600;hp=cab8f93e0bf13c26cccb69a6a3a4d48b6ac28fa9;hpb=75172fd735e34082c34b47ae7c194445b53038d9;p=blank.git diff --git a/src/ui/HUD.hpp b/src/ui/HUD.hpp index cab8f93..b6ae7d7 100644 --- a/src/ui/HUD.hpp +++ b/src/ui/HUD.hpp @@ -14,6 +14,7 @@ namespace blank { class Block; class BlockTypeRegistry; class Config; +class ConnectionHandler; class Environment; class Font; class Player; @@ -42,11 +43,16 @@ public: void UpdatePosition(); void UpdateOrientation(); + // net stats + void UpdateNetStats(const ConnectionHandler &); + // message box void PostMessage(const char *); 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; @@ -77,9 +83,16 @@ private: bool show_block; bool show_entity; + // net stats + FixedText bandwidth_text; + FixedText rtt_text; + FixedText packet_loss_text; + bool show_net; + // message box MessageBox messages; - IntervalTimer msg_timer; + CoarseTimer msg_timer; + bool msg_keep; // crosshair PrimitiveMesh crosshair;