| 82 | } |
| 83 | |
| 84 | void SimulationInteractionController::processEditWidget() |
| 85 | { |
| 86 | ImGuiViewport* viewport = ImGui::GetMainViewport(); |
| 87 | ImGui::SetNextWindowPos(ImVec2(viewport->Pos.x, viewport->Pos.y + viewport->Size.y - scale(120.0f))); |
| 88 | ImGui::SetNextWindowSize(ImVec2(scale(160.0f), scale(100.0f))); |
| 89 | |
| 90 | ImGuiWindowFlags windowFlags = 0 | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar |
| 91 | | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoBackground; |
| 92 | ImGui::Begin("TOOLBAR", NULL, windowFlags); |
| 93 | |
| 94 | ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor()); |
| 95 | ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor()); |
| 96 | ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor()); |
| 97 | |
| 98 | auto actionTexture = _modes.editMode ? _editorOn.textureId : _editorOff.textureId; |
| 99 | if (ImGui::ImageButton((void*)(intptr_t)actionTexture, {scale(80.0f), scale(80.0f)}, {0, 0}, {1.0f, 1.0f})) { |
| 100 | _modes.editMode = !_modes.editMode; |
| 101 | EditorController::get().setOn(!EditorController::get().isOn()); |
| 102 | } |
| 103 | |
| 104 | ImGui::PopStyleColor(3); |
| 105 | ImGui::End(); |
| 106 | } |
| 107 | |
| 108 | void SimulationInteractionController::processEvents() |
| 109 | { |