Closed EliteMasterEric closed 21 hours ago
Limiting the dialog length may cause mod incompatibilities if a mod has a massive string.
The reason I limited dialogue length is because I had to convert the internal dialog string into a char*
that could be passed to Lua; this requires using convert_string_sm64_to_ascii
, which requires a fixed length buffer.
I feel like it'd be best to use autogen instead of manually creating
smlua_func_smlua_text_utils_dialog_get
. This would require exposing the structDialogEntry
, and allowing cobjects to handle strings.
I previously used autogen and then switched to manual in order to return a table containing all the values. I am new to Lua C and do not know how to expose a struct or allow cobjects to handle the strings being passed to Lua
Please feel free to reopen this pull request when you have implemented the requested changes.
smlua_text_utils_dialog_get
as a new Lua API function.smlua_text_utils_dialog_replace
.smlua_text_utils_dialog_replace
.smlua_text_utils_dialog_replace
which displays if the provided string exceeds the hard-coded length limit of1024
.smlua_text_utils_dialog_replace
which displays if the target dialog ID is invalid (outside the range of 1-170).