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>
32 std::string player_name = "default";
34 float move_velocity = 0.005f;
35 float pitch_sensitivity = -0.0025f;
36 float yaw_sensitivity = -0.001f;
38 bool keyboard_disabled = false;
39 bool mouse_disabled = false;
40 bool audio_disabled = false;
41 bool visual_disabled = false;
44 Interface(const Config &, Environment &, World &, Entity &);
46 Entity &Player() noexcept { return ctrl.Controlled(); }
47 const Entity &Player() const noexcept { return ctrl.Controlled(); }
49 void HandlePress(const SDL_KeyboardEvent &);
50 void HandleRelease(const SDL_KeyboardEvent &);
51 void Handle(const SDL_MouseMotionEvent &);
52 void HandlePress(const SDL_MouseButtonEvent &);
53 void HandleRelease(const SDL_MouseButtonEvent &);
54 void Handle(const SDL_MouseWheelEvent &);
59 void ToggleCollision();
63 void RemoveBlock() noexcept;
66 void SelectPrevious();
73 void UpdatePosition();
74 void UpdateOrientation();
75 void UpdateBlockInfo();
76 void UpdateEntityInfo();
78 void PostMessage(const char *);
79 void PostMessage(const std::string &msg) {
80 PostMessage(msg.c_str());
85 void Render(Viewport &) noexcept;
98 WorldCollision aim_world;
99 EntityCollision aim_entity;
101 OutlineModel outline;
102 glm::mat4 outline_transform;
104 FixedText counter_text;
105 FixedText position_text;
106 FixedText orientation_text;
107 FixedText block_text;
108 FixedText entity_text;
112 IntervalTimer msg_timer;
116 IntervalTimer place_timer;
117 IntervalTimer remove_timer;