2021-12-19 11:42:37 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace gui
|
|
|
|
{
|
2021-12-20 11:32:06 -05:00
|
|
|
struct notification_t
|
|
|
|
{
|
|
|
|
std::string title;
|
|
|
|
std::string text;
|
|
|
|
std::chrono::milliseconds duration{};
|
|
|
|
std::chrono::high_resolution_clock::time_point creation_time{};
|
|
|
|
};
|
|
|
|
|
2021-12-19 19:53:01 -05:00
|
|
|
extern std::unordered_map<std::string, bool> enabled_menus;
|
|
|
|
|
2021-12-19 11:42:37 -05:00
|
|
|
bool gui_key_event(const int local_client_num, const int key, const int down);
|
|
|
|
bool gui_char_event(const int local_client_num, const int key);
|
|
|
|
bool gui_mouse_event(const int local_client_num, int x, int y);
|
2021-12-19 19:53:01 -05:00
|
|
|
|
|
|
|
void on_frame(const std::function<void()>& callback);
|
|
|
|
bool is_menu_open(const std::string& name);
|
2021-12-20 11:32:06 -05:00
|
|
|
void notification(const std::string& title, const std::string& text, const std::chrono::milliseconds duration = 3s);
|
2021-12-19 11:42:37 -05:00
|
|
|
}
|