summaryrefslogtreecommitdiffhomepage
path: root/editor/editor.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-05-19 05:50:06 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-05-19 05:50:06 +0200
commita4870b515381b222f5dcb9d4d3cfe34102967ce4 (patch)
tree26c21db43a47635ca28594153bd5640f95ebcf62 /editor/editor.cpp
parentf5a7dc9d264c4231d9f688704ceef6971bddf272 (diff)
add selecting and placing vobj's
TODO: - saving to disk - inspect dialog - actual lightmap shader
Diffstat (limited to 'editor/editor.cpp')
-rw-r--r--editor/editor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index 3c470bf2..1b0611e1 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -88,6 +88,7 @@ void editor::on_mouse_move(world& world, global_coords& pos, int mods)
void editor::on_click_(world& world, global_coords pos, button b)
{
+ // todo make template
if (auto* mode = current_tile_editor(); mode != nullptr)
{
if (auto opt = mode->get_selected(); opt || b == button::remove)
@@ -126,10 +127,10 @@ void editor::on_click_(world& world, global_coords pos, button b)
default: break;
case button::place:
if (const auto& sel = mode->get_selected())
- mode->place_tile(world, pos, sel);
+ mode->place_tile(world, pos, sel, *_app);
break;
case button::remove:
- mode->place_tile(world, pos, {});
+ mode->place_tile(world, pos, {}, *_app);
break;
}
}
@@ -144,7 +145,7 @@ void editor::on_click(world& world, global_coords pos, int mods, button b)
_last_pos = { InPlaceInit, pos, pos, mode->check_snap(mods), b };
on_click_(world, pos, b);
}
- else if (current_scenery_editor())
+ else if (current_scenery_editor() || current_vobj_editor())
{
_last_pos = {};
on_click_(world, pos, b);