add on attach for emit signal
This commit is contained in:
@@ -12,7 +12,7 @@ namespace sandbox
|
||||
void local_panel::render()
|
||||
{
|
||||
|
||||
if (ImGui::Button("RUN thread", ImVec2(28, 30)))
|
||||
if (ImGui::Button("RUN thread", ImVec2(128, 130)))
|
||||
{
|
||||
auto f = []()
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace sandbox
|
||||
{
|
||||
VE_FN_OVERIDE();
|
||||
|
||||
ImVec2 m_size = ImVec2{ 400.f, 400.f };
|
||||
ImVec2 m_size = ImVec2{ 800.f, 400.f };
|
||||
ImVec2 m_pos = ImVec2{ 400.f, 400.f };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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