diff --git a/src/editor/trile_editor.jai b/src/editor/trile_editor.jai index a540f27..26b674e 100644 --- a/src/editor/trile_editor.jai +++ b/src/editor/trile_editor.jai @@ -40,6 +40,23 @@ current_mode : Trile_Editor_Tool_Mode = .AREA; current_trile : *Trile; +#scope_export + +new_trile :: (name: string) { + print("Create new trile: %\n", name); + set_trile_gfx(current_trile.name, generate_trile_gfx_matias(current_trile)); + newt : Trile; + newt.name = sprint("%", name); + set_trile(newt.name, newt); + current_trile = get_trile(newt.name); +} @Command + +edit_trile :: (name: string) { + set_trile_gfx(current_trile.name, generate_trile_gfx_matias(current_trile)); + current_trile = get_trile(name); +} @Command + + #scope_file apply_tool_to_trixel :: (x: s64, y: s64, z: s64) { diff --git a/src/meta/console_commands.jai b/src/meta/console_commands.jai index f844a3e..c7c63e3 100644 --- a/src/meta/console_commands.jai +++ b/src/meta/console_commands.jai @@ -90,7 +90,7 @@ add_console_commands :: (message: *Message, w: *Workspace) { case .STRING; print_to_builder(*builder, "a% : string;;\n", i); print_to_builder(*builder, "if args.count > % {\n", i); - print_to_builder(*builder, "a% := args[%];\n", i, i); + print_to_builder(*builder, "a% = args[%];\n", i, i); print_to_builder(*builder, "}\n"); case; compiler_report(sprint("Argument % is of type %, which is not handled by automatic command registration.", arg_name, type_tag), make_location(cast(*Code_Node)arg), .ERROR); @@ -102,6 +102,7 @@ add_console_commands :: (message: *Message, w: *Workspace) { print_to_builder(*builder, "return \"Something really really weird has happened. Your argument count somehow went trough all the return checks....\";\n"); print_to_builder(*builder, "}\n"); str := builder_to_string(*builder); + // print("Generated: %\n", str); array_add(*console_commands_to_register, sprint("%", expression.name)); add_build_string(str, w.*); free(str); diff --git a/src/trile.jai b/src/trile.jai index dbc1d58..358fc7f 100644 --- a/src/trile.jai +++ b/src/trile.jai @@ -65,6 +65,15 @@ get_trile :: (name: string) -> (*Trile, success: bool) { return trileptr, true; } +list_trile :: () -> string { + count := 0; + for v : trile_table { + console_add_output_line(sprint("%", v.name)); + count += 1; + } + return tprint("% triles", count); +} @Command + Material :: struct { addRoughness : u8 = 0; roughness : u8 = 4; @@ -79,6 +88,7 @@ Trixel :: struct { }; Trile :: struct { + name : string = "test"; trixels : [16][16][16] Trixel; };