X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2FInterface.hpp;h=d045cc900b2e5215fea3c3dcc00eb443e7ee02fa;hb=5e8eee742138f2578e83e710ffc41408abd3073f;hp=d01fe254a665ed0011c214a97fae7af4b9dbb030;hpb=37a1465a83e4ac4363ed0d8e0fa1ce5055dd2db4;p=blank.git diff --git a/src/ui/Interface.hpp b/src/ui/Interface.hpp index d01fe25..d045cc9 100644 --- a/src/ui/Interface.hpp +++ b/src/ui/Interface.hpp @@ -1,25 +1,26 @@ #ifndef BLANK_UI_INTERFACE_HPP_ #define BLANK_UI_INTERFACE_HPP_ +#include "FixedText.hpp" #include "HUD.hpp" +#include "MessageBox.hpp" #include "../app/FPSController.hpp" #include "../app/IntervalTimer.hpp" -#include "../graphics/Font.hpp" +#include "../audio/Sound.hpp" #include "../model/geometry.hpp" #include "../model/OutlineModel.hpp" #include "../world/Block.hpp" -#include +#include #include +#include namespace blank { -class Assets; class Chunk; -class BlendedSprite; -class DirectionalLighting; -class FrameCounter; +class Environment; +class Viewport; class World; class Interface { @@ -32,10 +33,11 @@ public: bool keyboard_disabled = false; bool mouse_disabled = false; + bool audio_disabled = false; bool visual_disabled = false; }; - Interface(const Config &, const Assets &, const FrameCounter &, World &); + Interface(const Config &, Environment &, World &); void HandlePress(const SDL_KeyboardEvent &); void HandleRelease(const SDL_KeyboardEvent &); @@ -43,7 +45,6 @@ public: void HandlePress(const SDL_MouseButtonEvent &); void HandleRelease(const SDL_MouseButtonEvent &); void Handle(const SDL_MouseWheelEvent &); - void Handle(const SDL_WindowEvent &) noexcept; void FaceBlock(); void TurnBlock(); @@ -63,21 +64,30 @@ public: void SelectNext(); void SelectPrevious(); - void ToggleCounter(); + void ToggleAudio(); + void ToggleVisual(); + + void ToggleDebug(); void UpdateCounter(); + void UpdatePosition(); + void UpdateOrientation(); + + void PostMessage(const char *); + void PostMessage(const std::string &msg) { + PostMessage(msg.c_str()); + } void Update(int dt); - void Render(DirectionalLighting &, BlendedSprite &) noexcept; + void Render(Viewport &) noexcept; private: void CheckAim(); private: - const FrameCounter &counter; + Environment &env; World &world; FPSController ctrl; - Font font; HUD hud; Ray aim; @@ -88,11 +98,11 @@ private: OutlineModel outline; glm::mat4 outline_transform; - bool show_counter; - Texture counter_tex; - SpriteModel counter_sprite; - glm::mat4 counter_transform; - SDL_Color counter_color; + FixedText counter_text; + FixedText position_text; + FixedText orientation_text; + MessageBox messages; + IntervalTimer msg_timer; Config config; @@ -102,7 +112,12 @@ private: Block remove; Block selection; - glm::tvec3 fwd, rev; + Sound place_sound; + Sound remove_sound; + + glm::ivec3 fwd, rev; + + bool debug; };