You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow the user to setup a callback function to run if the user wants to use tags which are not defined in the normal extension.
Example for a possible action tag would be
<action=particles:text_emitter>Make this pretty</action>
and
<action=sound:ding/>
The main thing the callback needs to be used for is defining how the data of the tag is handled so in the sound case the "sound:ding" would need to be handled when doing parse_tag.
local parse = require("richtext.parse")
parse.callback = function(tag, params, settings)
if tag == "action" then
local action_type, action_option = params:match("(.-):(.*)")
settings.action = {
type = action_type,
option = action_option
}
end
end
.... in parse.lua below other tag definitions
elseif M.callback then
M.callback(tag, params, settings)
end
The text was updated successfully, but these errors were encountered:
More complicated non-data tags would require multiple callbacks too though, how to handle them in all of the situations of RichText, but just the data part would be useful to people no doubt.
And in these cases users may want to just edit RichText itself or suggest / contribute new core feature tags.
Allow the user to setup a callback function to run if the user wants to use tags which are not defined in the normal extension.
Example for a possible action tag would be
<action=particles:text_emitter>Make this pretty</action>
and
<action=sound:ding/>
The main thing the callback needs to be used for is defining how the data of the tag is handled so in the sound case the "sound:ding" would need to be handled when doing parse_tag.
The text was updated successfully, but these errors were encountered: