MCPcopy Create free account
hub / github.com/chrxh/alien / processEditWidget

Method processEditWidget

source/Gui/SimulationInteractionController.cpp:84–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void 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
108void SimulationInteractionController::processEvents()
109{

Callers

nothing calls this directly

Calls 4

ImVec2Class · 0.85
scaleFunction · 0.85
setOnMethod · 0.45
isOnMethod · 0.45

Tested by

no test coverage detected