From 24f31174787281a308a53e4a647ea947f6c82e8f Mon Sep 17 00:00:00 2001 From: Katajisto Date: Sun, 29 Mar 2026 16:44:44 +0300 Subject: [PATCH] add cursor for inspector tool --- src/editor/level_editor.jai | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/editor/level_editor.jai b/src/editor/level_editor.jai index 46ae9da..0b34549 100644 --- a/src/editor/level_editor.jai +++ b/src/editor/level_editor.jai @@ -628,14 +628,32 @@ tick_level_editor :: () { create_level_editor_preview_tasks :: () { curworld := get_current_world(); if !curworld.valid then return; + + px := trile_preview_x; py := trile_preview_y; pz := trile_preview_z; + + if current_tool_mode == .INSPECTOR { + name, orientation, found := get_trile_at(*curworld.world, xx px, xx py, xx pz); + cursor_trile := ifx found then name else (ifx editor_current_trile then editor_current_trile.name else ""); + if cursor_trile != "" { + positions: [..]Vector4; + positions.allocator = temp; + array_add(*positions, .{cast(float)px, cast(float)py, cast(float)pz, cast(float)orientation}); + task: Rendering_Task_Trile; + task.trile = cursor_trile; + task.positions = positions; + task.worldConf = *curworld.world.conf; + task.preview_mode = 1; + add_rendering_task(task); + } + return; + } + if !editor_current_trile then return; positions: [..]Vector4; positions.allocator = temp; ori := cast(float) get_current_orientation(); - px := trile_preview_x; py := trile_preview_y; pz := trile_preview_z; - if current_tool_mode == .POINT { array_add(*positions, .{cast(float)px, cast(float)py, cast(float)pz, ori}); } else if current_tool_mode == .BRUSH {