blob: edff6721becc9df47953de00547c5628cda82180 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#ifndef CLIENT_WINDOW_TEXT_INPUT_WINDOW_HH_
#define CLIENT_WINDOW_TEXT_INPUT_WINDOW_HH_
#include <string>
#include "client/input.hh"
#include "client/shared.hh"
#include "client/state/state.hh"
#include "client/window/basic_window.hh"
#include "shared/net/proto.hh"
namespace client {
namespace window {
void pop_window() noexcept; // forward declaration
class text_input_window : public basic_window {
private:
// text restricted to a size of 32.
static const std::string& get_send_text() noexcept;
static proto::packet make_say_packet() noexcept;
static bool maybe_handle_keydown(const SDL_Event& event) noexcept;
static const glm::vec3& get_draw_colour() noexcept;
public:
template <typename... Args>
text_input_window(Args&&... args) noexcept
: basic_window(std::forward<Args>(args)...) {
client::input::set_text_input(true);
}
virtual ~text_input_window() noexcept {
client::input::set_text_input(false);
}
virtual bool maybe_handle_event(const SDL_Event& event) noexcept override;
virtual void draw() noexcept override;
};
} // namespace window
} // namespace client
#endif
|