Module api
Public API functions.
Functions
subtitles.on_sound_play (spec, parameters, handle) | Handles a call to minetest.sound_play(), or an equivalent event. |
subtitles.on_sound_stop (handle) | Handles a call to minetest.sound_stop(), or an equivalent event. |
subtitles.get_agent (player) | Returns the Agent object associated with the specified player. |
subtitles.on_node_action (pos, node, action) | Handles a node action. |
subtitles.register_description (name, description, parameters) | Registers a description associated with a sound name. |
subtitles.report_missing (name) | Reports a missing subtitle to the debug log. |
Functions
- subtitles.on_sound_play (spec, parameters, handle)
-
Handles a call to minetest.sound_play(), or an equivalent event.
Parameters:
- spec A SimpleSoundSpec.
- parameters The sound parameters.
- handle The sound's handle, or nil if the sound is ephemeral.
- subtitles.on_sound_stop (handle)
-
Handles a call to minetest.sound_stop(), or an equivalent event.
Parameters:
- handle The sound's handle.
- subtitles.get_agent (player)
-
Returns the Agent object associated with the specified player.
The agent is created if necessary.
Parameters:
- player A username or `ObjectRef` of a connected player.
Returns:
-
An `Agent` object.
- subtitles.on_node_action (pos, node, action)
-
Handles a node action.
Parameters:
- pos The position of the node, as a integer vector.
- node The node table or node name.
- action A key in the `sounds` table, such as 'dig' or 'footstep'.
- subtitles.register_description (name, description, parameters)
-
Registers a description associated with a sound name.
When this sound is played, it will have the specified description unless a
description is explicitly specified.
Parameters:
- name The technical name of the sound, without the extension or index.
- description The human-readable description of the sound, or nil to not associate a description.
- parameters A table of parameters to override when playing this sound, or nil.
- subtitles.report_missing (name)
-
Reports a missing subtitle to the debug log.
Parameters:
- name The technical name of the sound.