diff --git a/autogen/convert_functions.py b/autogen/convert_functions.py index 15b24993e..5071a7dfd 100644 --- a/autogen/convert_functions.py +++ b/autogen/convert_functions.py @@ -212,6 +212,8 @@ manual_index_documentation = """ - [add_scroll_target](#add_scroll_target) - [collision_find_surface_on_ray](#collision_find_surface_on_ray) - [cast_graph_node](#cast_graph_node) + - [get_uncolored_string](#get_uncolored_string) + - [gfx_set_command](#gfx_set_command)
@@ -726,6 +728,56 @@ N/A
+## [get_uncolored_string](#get_uncolored_string) + +Removes color codes from a string. + +### Lua Example +```lua +print(get_uncolored_string("\#210059\Colored \#FF086F\String")) -- "Colored String" +``` + +### Parameters +| Field | Type | +| ----- | ---- | +| str | 'string' | + +### Returns +- `string` + +### C Prototype +N/A + +[:arrow_up_small:](#) + +
+ +## [gfx_set_command](#gfx_set_command) + +Sets the specified display list command on the display list given. + +### Lua Example +```lua +gfx_set_command(gfx, "gsDPSetEnvColor", 0x00, 0xFF, 0x00, 0xFF) +``` + +### Parameters +| Field | Type | +| ----- | ---- | +| gfx | [Gfx](structs.md#Gfx) | +| command | `string` | +| (Any number of arguments) | `integer` | + +### Returns +- None + +### C Prototype +N/A + +[:arrow_up_small:](#) + +
+ """ ############################################################################ diff --git a/docs/lua/functions.md b/docs/lua/functions.md index fd8d8b7b0..470fb34ae 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -27,6 +27,8 @@ - [add_scroll_target](#add_scroll_target) - [collision_find_surface_on_ray](#collision_find_surface_on_ray) - [cast_graph_node](#cast_graph_node) + - [get_uncolored_string](#get_uncolored_string) + - [gfx_set_command](#gfx_set_command)
@@ -2457,6 +2459,56 @@ N/A
+## [get_uncolored_string](#get_uncolored_string) + +Removes color codes from a string. + +### Lua Example +```lua +print(get_uncolored_string("\#210059\Colored \#FF086F\String")) -- "Colored String" +``` + +### Parameters +| Field | Type | +| ----- | ---- | +| str | 'string' | + +### Returns +- `string` + +### C Prototype +N/A + +[:arrow_up_small:](#) + +
+ +## [gfx_set_command](#gfx_set_command) + +Sets the specified display list command on the display list given. + +### Lua Example +```lua +gfx_set_command(gfx, "gsDPSetEnvColor", 0x00, 0xFF, 0x00, 0xFF) +``` + +### Parameters +| Field | Type | +| ----- | ---- | +| gfx | [Gfx](structs.md#Gfx) | +| command | `string` | +| (Any number of arguments) | `integer` | + +### Returns +- None + +### C Prototype +N/A + +[:arrow_up_small:](#) + +
+ --- # functions from area.h diff --git a/src/pc/lua/smlua_functions.c b/src/pc/lua/smlua_functions.c index 91133086b..02b3d5ab3 100644 --- a/src/pc/lua/smlua_functions.c +++ b/src/pc/lua/smlua_functions.c @@ -1083,7 +1083,7 @@ if (strcmp(command, #symb) == 0) { \ if (paramCount != params) { LOG_LUA("gfx_set_command: '" #symb "' received incorrect number of parameters. Received %u, expected %u", paramCount, params); return 0; } \ UNUSED const char symbolName[] = #symb; \ REPEAT(HANDLE_PARAM, params); \ - Gfx _Gfx[] = { CALL_SYMB(symb, LIST_ARGS(GET_ARG, params)) }; \ + const Gfx _Gfx[] = { CALL_SYMB(symb, LIST_ARGS(GET_ARG, params)); } \ memcpy(gfx, _Gfx, sizeof(_Gfx)); \ return 1; \ }