coop-deluxe / sm64coopdx

An official continuation of https://github.com/djoslin0/sm64ex-coop on sm64coopdx for the enhancements and progress it already has.
https://sm64coopdx.com
408 stars 73 forks source link

Implemented smlua_text_utils_dialog_get #321

Closed EliteMasterEric closed 21 hours ago

EliteMasterEric commented 2 months ago
EliteMasterEric commented 2 months 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 struct DialogEntry, 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

Isaac0-dev commented 21 hours ago

Please feel free to reopen this pull request when you have implemented the requested changes.