diff --git a/docs/infrastructure.md b/docs/infrastructure.md index 7cf74ea6..95e9bd40 100644 --- a/docs/infrastructure.md +++ b/docs/infrastructure.md @@ -61,7 +61,7 @@ For developers to reference. - [app/editor/dungeon_editor.cc](../src/app/editor/dungeon_editor.cc) - [app/editor/graphics_editor.cc](../src/app/editor/graphics_editor.cc) - [app/editor/music_editor.cc](../src/app/editor/music_editor.cc) - - [app/editor/overworld_editor.cc](../src/app/editor/overworld_editor.cc) + - [app/editor/overworld/overworld_editor.cc](../src/app/editor/overworld/overworld_editor.cc) - [app/editor/screen_editor.cc](../src/app/editor/screen_editor.cc) - [app/editor/sprite_editor.cc](../src/app/editor/sprite_editor.cc) diff --git a/src/app/editor/CMakeLists.txt b/src/app/editor/CMakeLists.txt index 39dcf6a4..3337a518 100644 --- a/src/app/editor/CMakeLists.txt +++ b/src/app/editor/CMakeLists.txt @@ -3,7 +3,7 @@ set( app/editor/dungeon/dungeon_editor.cc app/editor/master_editor.cc app/editor/settings_editor.cc - app/editor/overworld_editor.cc + app/editor/overworld/overworld_editor.cc app/editor/sprite/sprite_editor.cc app/editor/music/music_editor.cc app/editor/message/message_editor.cc diff --git a/src/app/editor/code/memory_editor.h b/src/app/editor/code/memory_editor.h index 7b49cbea..0923cf2c 100644 --- a/src/app/editor/code/memory_editor.h +++ b/src/app/editor/code/memory_editor.h @@ -17,7 +17,7 @@ #include "app/editor/graphics/palette_editor.h" #include "app/editor/graphics/screen_editor.h" #include "app/editor/music/music_editor.h" -#include "app/editor/overworld_editor.h" +#include "app/editor/overworld/overworld_editor.h" #include "app/editor/sprite/sprite_editor.h" #include "app/editor/utils/editor.h" #include "app/editor/utils/gfx_context.h" diff --git a/src/app/editor/master_editor.cc b/src/app/editor/master_editor.cc index 439b3bc5..a6c52891 100644 --- a/src/app/editor/master_editor.cc +++ b/src/app/editor/master_editor.cc @@ -14,7 +14,7 @@ #include "app/editor/graphics/palette_editor.h" #include "app/editor/graphics/screen_editor.h" #include "app/editor/music/music_editor.h" -#include "app/editor/overworld_editor.h" +#include "app/editor/overworld/overworld_editor.h" #include "app/editor/sprite/sprite_editor.h" #include "app/editor/utils/flags.h" #include "app/editor/utils/recent_files.h" diff --git a/src/app/editor/master_editor.h b/src/app/editor/master_editor.h index 988a9304..e8b5b9a3 100644 --- a/src/app/editor/master_editor.h +++ b/src/app/editor/master_editor.h @@ -17,7 +17,7 @@ #include "app/editor/graphics/screen_editor.h" #include "app/editor/message/message_editor.h" #include "app/editor/music/music_editor.h" -#include "app/editor/overworld_editor.h" +#include "app/editor/overworld/overworld_editor.h" #include "app/editor/settings_editor.h" #include "app/editor/sprite/sprite_editor.h" #include "app/editor/utils/gfx_context.h" diff --git a/src/app/editor/overworld/entity.h b/src/app/editor/overworld/entity.h index 3697972a..244a7a0a 100644 --- a/src/app/editor/overworld/entity.h +++ b/src/app/editor/overworld/entity.h @@ -3,7 +3,7 @@ #include "imgui/imgui.h" -#include "app/editor/overworld_editor.h" +#include "app/editor/overworld/overworld_editor.h" #include "app/zelda3/common.h" #include "app/zelda3/overworld/overworld.h" diff --git a/src/app/editor/overworld_editor.cc b/src/app/editor/overworld/overworld_editor.cc similarity index 96% rename from src/app/editor/overworld_editor.cc rename to src/app/editor/overworld/overworld_editor.cc index 5f7ec55b..22835e39 100644 --- a/src/app/editor/overworld_editor.cc +++ b/src/app/editor/overworld/overworld_editor.cc @@ -647,6 +647,12 @@ void OverworldEditor::DrawOverworldCanvas() { ow_map_canvas_.DrawGrid(); ow_map_canvas_.DrawOverlay(); EndChild(); + + // Handle mouse wheel activity + if (ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && ImGui::IsMouseDragging(ImGuiMouseButton_Middle)) { + ImGui::SetScrollX(ImGui::GetScrollX() + ImGui::GetIO().MouseWheelH * 16.0f); + ImGui::SetScrollY(ImGui::GetScrollY() + ImGui::GetIO().MouseWheel * 16.0f); + } } absl::Status OverworldEditor::DrawTile16Selector() { diff --git a/src/app/editor/overworld_editor.h b/src/app/editor/overworld/overworld_editor.h similarity index 100% rename from src/app/editor/overworld_editor.h rename to src/app/editor/overworld/overworld_editor.h diff --git a/src/app/editor/overworld/refresh.cc b/src/app/editor/overworld/refresh.cc index 13f29f70..f79bafd2 100644 --- a/src/app/editor/overworld/refresh.cc +++ b/src/app/editor/overworld/refresh.cc @@ -1,5 +1,5 @@ #include "app/core/platform/renderer.h" -#include "app/editor/overworld_editor.h" +#include "app/editor/overworld/overworld_editor.h" namespace yaze { namespace app {