| 33 | } |
| 34 | |
| 35 | void SpatialControlWindow::processIntern() |
| 36 | { |
| 37 | processZoomInButton(); |
| 38 | ImGui::SameLine(); |
| 39 | processZoomOutButton(); |
| 40 | ImGui::SameLine(); |
| 41 | processCenterButton(); |
| 42 | ImGui::SameLine(); |
| 43 | AlienImGui::ToolbarSeparator(); |
| 44 | ImGui::SameLine(); |
| 45 | processResizeButton(); |
| 46 | |
| 47 | ImGui::Spacing(); |
| 48 | ImGui::Spacing(); |
| 49 | ImGui::Separator(); |
| 50 | ImGui::Spacing(); |
| 51 | ImGui::Spacing(); |
| 52 | |
| 53 | if (ImGui::BeginChild("##", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar)) { |
| 54 | |
| 55 | ImGui::Text("World size"); |
| 56 | ImGui::PushFont(StyleRepository::get().getLargeFont()); |
| 57 | ImGui::PushStyleColor(ImGuiCol_Text, Const::TextDecentColor); |
| 58 | auto worldSize = _simulationFacade->getWorldSize(); |
| 59 | ImGui::TextUnformatted( |
| 60 | (StringHelper::format(worldSize.x) + " x " + StringHelper::format(worldSize.y)).c_str()); |
| 61 | ImGui::PopStyleColor(); |
| 62 | ImGui::PopFont(); |
| 63 | |
| 64 | ImGui::Text("Zoom factor"); |
| 65 | ImGui::PushFont(StyleRepository::get().getLargeFont()); |
| 66 | ImGui::PushStyleColor(ImGuiCol_Text, Const::TextDecentColor); |
| 67 | ImGui::TextUnformatted(StringHelper::format(Viewport::get().getZoomFactor(), 2).c_str()); |
| 68 | ImGui::PopStyleColor(); |
| 69 | ImGui::PopFont(); |
| 70 | |
| 71 | ImGui::Text("Center position"); |
| 72 | ImGui::PushFont(StyleRepository::get().getLargeFont()); |
| 73 | ImGui::PushStyleColor(ImGuiCol_Text, Const::TextDecentColor); |
| 74 | auto centerPos = Viewport::get().getCenterInWorldPos(); |
| 75 | ImGui::TextUnformatted( |
| 76 | (StringHelper::format(centerPos.x, 1) + ", " + StringHelper::format(centerPos.y, 1)).c_str()); |
| 77 | ImGui::PopStyleColor(); |
| 78 | ImGui::PopFont(); |
| 79 | |
| 80 | AlienImGui::Separator(); |
| 81 | AlienImGui::ToggleButton(AlienImGui::ToggleButtonParameters().name("Autotracking on selection"), _centerSelection); |
| 82 | ImGui::Spacing(); |
| 83 | ImGui::Spacing(); |
| 84 | float sensitivity = Viewport::get().getZoomSensitivity(); |
| 85 | if (AlienImGui::SliderFloat(AlienImGui::SliderFloatParameters().name("Zoom sensitivity").min(1.0f).max(1.1f).textWidth(130).format(""), &sensitivity)) { |
| 86 | Viewport::get().setZoomSensitivity(sensitivity); |
| 87 | } |
| 88 | } |
| 89 | ImGui::EndChild(); |
| 90 | } |
| 91 | |
| 92 | void SpatialControlWindow::processBackground() |
nothing calls this directly
no test coverage detected