Files
vertex_engine/bin/layers/local_panel/local_panel.cpp
2025-03-15 12:33:59 +03:00

61 lines
1.3 KiB
C++
Executable File

#include "local_panel.hpp"
#include "utils.hpp"
namespace sandbox
{
void local_panel::on_attach()
{
VE::CONNECT(this);
}
void local_panel::render()
{
if (ImGui::Button(VE_NAME("RUN thread"), ImVec2(128, 130)))
{
auto f = []()
{
VE::EMIT(test_event::TEST_EVEN, std::string("test event message from thread"));
};
std::thread th(f);
th.detach();
}
VE_PUSH_FONT(ICON, 18);
if (ImGui::Button(VE::style::icon::ICON_STOP, ImVec2(28, 30)))
{
VE::EMIT(test_event::TEST_EVEN, std::string("test icon button"));
}
ImGui::Text(VE::style::icon::ICON_PAINT_BRUSH, " Paint" );
ImGui::Text("\xef\x87\xbc");
VE_POP_FONT();
}
void local_panel::on_event(VE::event e)
{
// для событий от перефирии
// if (e.m_type.type() == typeid(VE::event_type))
// {
// auto t = std::any_cast<VE::event_type>(e.m_type);
// if (t != VE::event_type::MOUSE_CURSOR_POSITION)
// hack::log()((int)t);
// }
if (e.m_type.type() == typeid(test_event))
{
auto t = std::any_cast<test_event>(e.m_type);
if (t == test_event::TEST_EVEN)
hack::log()(std::any_cast<std::string>(e.m_data));
}
}
void local_panel::update()
{
}
}