1 #ifndef BLANK_UI_INTERFACE_HPP_
2 #define BLANK_UI_INTERFACE_HPP_
4 #include "FixedText.hpp"
6 #include "MessageBox.hpp"
7 #include "../app/FPSController.hpp"
8 #include "../app/IntervalTimer.hpp"
9 #include "../audio/Sound.hpp"
10 #include "../model/geometry.hpp"
11 #include "../model/OutlineModel.hpp"
12 #include "../world/Block.hpp"
13 #include "../world/EntityCollision.hpp"
14 #include "../world/WorldCollision.hpp"
17 #include <glm/glm.hpp>
31 std::string player_name = "default";
33 float move_velocity = 0.005f;
34 float pitch_sensitivity = -0.0025f;
35 float yaw_sensitivity = -0.001f;
37 bool keyboard_disabled = false;
38 bool mouse_disabled = false;
39 bool audio_disabled = false;
40 bool visual_disabled = false;
43 Interface(const Config &, Environment &, World &);
45 Entity &Player() noexcept { return ctrl.Controlled(); }
46 const Entity &Player() const noexcept { return ctrl.Controlled(); }
48 void HandlePress(const SDL_KeyboardEvent &);
49 void HandleRelease(const SDL_KeyboardEvent &);
50 void Handle(const SDL_MouseMotionEvent &);
51 void HandlePress(const SDL_MouseButtonEvent &);
52 void HandleRelease(const SDL_MouseButtonEvent &);
53 void Handle(const SDL_MouseWheelEvent &);
58 void ToggleCollision();
62 void RemoveBlock() noexcept;
65 void SelectPrevious();
72 void UpdatePosition();
73 void UpdateOrientation();
74 void UpdateBlockInfo();
75 void UpdateEntityInfo();
77 void PostMessage(const char *);
78 void PostMessage(const std::string &msg) {
79 PostMessage(msg.c_str());
84 void Render(Viewport &) noexcept;
97 WorldCollision aim_world;
98 EntityCollision aim_entity;
100 OutlineModel outline;
101 glm::mat4 outline_transform;
103 FixedText counter_text;
104 FixedText position_text;
105 FixedText orientation_text;
106 FixedText block_text;
107 FixedText entity_text;
111 IntervalTimer msg_timer;
115 IntervalTimer place_timer;
116 IntervalTimer remove_timer;