From f20c1ee94a48bbe2d1aa7612df91e497b180fe43 Mon Sep 17 00:00:00 2001 From: tritonas00 Date: Tue, 16 Feb 2021 05:55:07 +0200 Subject: [PATCH] terrain editor fixes --- source/main/main.cpp | 1 + source/main/terrain/TerrainEditor.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/main/main.cpp b/source/main/main.cpp index b77b4acc72..ff4977a1cd 100644 --- a/source/main/main.cpp +++ b/source/main/main.cpp @@ -725,6 +725,7 @@ int main(int argc, char *argv[]) App::GetOverlayWrapper()->update(dt); if (App::sim_state->GetEnum() == SimState::EDITOR_MODE) { + App::GetGameContext()->UpdateSimInputEvents(dt); App::GetSimTerrain()->GetTerrainEditor()->UpdateInputEvents(dt); } else if (App::sim_state->GetEnum() == SimState::RUNNING) diff --git a/source/main/terrain/TerrainEditor.cpp b/source/main/terrain/TerrainEditor.cpp index 17edfab2cd..94ade0c837 100644 --- a/source/main/terrain/TerrainEditor.cpp +++ b/source/main/terrain/TerrainEditor.cpp @@ -41,7 +41,7 @@ void TerrainEditor::UpdateInputEvents(float dt) auto& object_list = App::GetSimTerrain()->getObjectManager()->GetEditorObjects(); bool update = false; - if (ImGui::IsMouseClicked(1)) // Middle button + if (ImGui::IsMouseClicked(2)) // Middle button { ImVec2 mouse_screen = ImGui::GetIO().MousePos / ImGui::GetIO().DisplaySize; Ogre::Ray terrain_editor_mouse_ray = App::GetCameraManager()->GetCamera()->getCameraToViewportRay(mouse_screen.x, mouse_screen.y);