fix for trile editor trile selection bug

This commit is contained in:
Tuomas Katajisto 2026-07-26 13:30:26 +03:00
parent 651984ba43
commit 9b4209b300
2 changed files with 10 additions and 1 deletions

View File

@ -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();

View File

@ -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 {