From 9b4209b3006e6b253f83023181bae020575fcf70 Mon Sep 17 00:00:00 2001 From: Katajisto Date: Sun, 26 Jul 2026 13:30:26 +0300 Subject: [PATCH] fix for trile editor trile selection bug --- src/editor/trile_editor.jai | 2 +- src/trile.jai | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/editor/trile_editor.jai b/src/editor/trile_editor.jai index 09d0c1e..a6d01c3 100644 --- a/src/editor/trile_editor.jai +++ b/src/editor/trile_editor.jai @@ -218,7 +218,7 @@ trile_copy :: (from: string) { tick_trile_editor :: () { if console_open_ignore_input then return; - if !editor_current_trile then editor_current_trile = get_trile("test"); + if !editor_current_trile then editor_current_trile = get_any_trile(); if input_button_states[Key_Code.MOUSE_BUTTON_LEFT] & .START { handle_tool_click(); diff --git a/src/trile.jai b/src/trile.jai index ef2e900..b6759a1 100644 --- a/src/trile.jai +++ b/src/trile.jai @@ -90,6 +90,15 @@ set_trile :: (name: string, trile: Trile) { } } +get_any_trile :: () -> (*Trile, success: bool) { + for v : trile_table { + print("Found trile: %\n", v.name); + trileptr, err := get_trile(v.name); + return trileptr, err; + } + return null, false; +} + get_trile :: (name: string) -> (*Trile, success: bool) { trileptr := table_find_pointer(*trile_table, name); if !trileptr {