50 lines
1.1 KiB
C++
Executable File
50 lines
1.1 KiB
C++
Executable File
#include "test_panel.hpp"
|
|
#include "utils.hpp"
|
|
|
|
namespace sandbox
|
|
{
|
|
void test_panel::on_attach()
|
|
{
|
|
VE::CONNECT(this);
|
|
hack::log()("on_attach", VE::application::get()->get_glfw()->width());
|
|
}
|
|
|
|
void test_panel::render()
|
|
{
|
|
ImGui::SetNextWindowPos(m_pos);
|
|
ImGui::SetNextWindowSize(m_size);
|
|
|
|
if (!ImGui::Begin("#test_panel_1", &m_p_open, m_window_flags)) ImGui::End();
|
|
|
|
if (ImGui::Button("RUN test_panel_1", ImVec2(128, 130)))
|
|
{
|
|
VE::EMIT(test_event::TEST_EVEN, std::string("test event message tp 1"));
|
|
}
|
|
|
|
ImGui::End();
|
|
}
|
|
|
|
void test_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_BUTTON_DOUBLE_PRESSED) hack::log()("double");
|
|
if (t == VE::event_type::MOUSE_BUTTON_PRESSED) hack::log()("once");
|
|
}
|
|
|
|
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 test_panel::update()
|
|
{
|
|
|
|
}
|
|
}
|
|
|