add on attach for emit signal
This commit is contained in:
@@ -16,9 +16,9 @@ namespace sandbox
|
||||
|
||||
if (!ImGui::Begin("#test_panel_1", &m_p_open, m_window_flags)) ImGui::End();
|
||||
|
||||
if (ImGui::Button("RUN", ImVec2(28, 30)))
|
||||
if (ImGui::Button("RUN test_panel_1", ImVec2(128, 130)))
|
||||
{
|
||||
VE::event e { test_event::TEST_EVEN , std::string("test event message") };
|
||||
VE::event e { test_event::TEST_EVEN , std::string("test event message tp 1") };
|
||||
VE_EMIT(e);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,13 @@ namespace sandbox
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user