add base dialogs

This commit is contained in:
chatlanin
2023-03-13 13:29:59 +03:00
parent 44ed461df9
commit 681327e663
13 changed files with 431 additions and 28 deletions

View File

@@ -1,5 +1,7 @@
#include "history.hpp"
#include "utils/types.hpp"
namespace rrr::layers::gui
{
void history::on_attach()
@@ -17,11 +19,13 @@ namespace rrr::layers::gui
void history::gui_render()
{
if (!show) return;
ImGui::SetNextWindowPos(ImVec2(pos_x, pos_y));
ImGui::SetNextWindowSize(ImVec2(width, height));
ImGuiStyle& st = ImGui::GetStyle();
st.Colors[ImGuiCol_WindowBg] = ImVec4(0.13f, 0.14f, 0.18f, 1.00f);
st.Colors[ImGuiCol_WindowBg] = func::get_IMGUI_color<ImVec4>(33.f, 36.f, 46.f);
BEGIN_IMGUI_WIN();
@@ -77,8 +81,19 @@ namespace rrr::layers::gui
width = try_engine::application::get()->get_window()->width() / 3.f;
}
void history::on_event(std::any e, std::any value)
void history::on_event(std::any event_type, std::any value)
{
auto et = std::any_cast<types::event_type>(event_type);
switch (et)
{
case types::event_type::NAVIGATION_LEFT:
case types::event_type::NAVIGATION_RIGHT:
cursor_position = cnt->get_cursor_position(TYPE_WIN::HISTORY);
break;
default:
break;
}
}
void history::on_update(time t)