mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
nodes: Move ImNodes initialization to window class
This commit is contained in:
@@ -697,6 +697,7 @@ namespace hex {
|
||||
|
||||
GImGui = ImGui::CreateContext();
|
||||
GImPlot = ImPlot::CreateContext();
|
||||
GImNodes = ImNodes::CreateContext();
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
@@ -731,6 +732,14 @@ namespace hex {
|
||||
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
|
||||
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
|
||||
|
||||
ImNodes::PushAttributeFlag(ImNodesAttributeFlags_EnableLinkDetachWithDragClick);
|
||||
ImNodes::PushAttributeFlag(ImNodesAttributeFlags_EnableLinkCreationOnSnap);
|
||||
|
||||
{
|
||||
static bool always = true;
|
||||
ImNodes::GetIO().LinkDetachWithModifierClick.Modifier = &always;
|
||||
}
|
||||
|
||||
io.UserData = new ImGui::ImHexCustomData();
|
||||
|
||||
if (this->m_globalScale != 0.0f)
|
||||
@@ -818,8 +827,12 @@ namespace hex {
|
||||
void Window::deinitImGui() {
|
||||
delete static_cast<ImGui::ImHexCustomData*>(ImGui::GetIO().UserData);
|
||||
|
||||
ImNodes::PopAttributeFlag();
|
||||
ImNodes::PopAttributeFlag();
|
||||
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
ImNodes::DestroyContext();
|
||||
ImPlot::DestroyContext();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user