This contains the source code documentation of the class DialogicGlossary
.
DialogicGlossary
Inherits: Resource
Resource used to store glossary entries. Can be saved to disc and used as a glossary. Add/create glossaries fom the glossaries editor
Properties
Name | Type | Default |
---|---|---|
entries | Dictionary | {} |
enabled | bool | true |
Methods
Returns | Method |
---|---|
bool | remove_entry ( entry_key : String ) |
void | replace_entry_key ( old_entry_key : String, new_entry_key : String ) |
Dictionary | get_entry ( entry_key : String ) |
bool | try_add_entry ( entry : Dictionary ) |
String | get_set_regex_option ( entry_key : String ) |
String | add_translation_id ( ) |
void | remove_translation_id ( ) |
void | remove_entry_translation_ids ( ) |
void | clear_translation_keys ( ) |
String | get_property_translation_key ( entry_key : String, property : String ) |
String | get_set_glossary_entry_translation_id ( entry_key : String ) |
String | get_set_glossary_translation_id ( ) |
Constants
const RESOURCE_NAME = "Glossary"
No description available.
No description available.
const ALTERNATIVE_PROPERTY = "alternatives"
No description available.
const TITLE_PROPERTY = "title"
No description available.
No description available.
const EXTRA_PROPERTY = "extra"
No description available.
const TRANSLATION_PROPERTY = "_translation_id"
No description available.
const REGEX_OPTION_PROPERTY = "regex_options"
No description available.
const PRIVATE_PROPERTY_PREFIX = "_"
No description available.
Property Descriptions
Stores all entries for the glossary. The value may either be a dictionary, representing an entry, or a string, representing the actual key for the key used. The string key-value pairs are the alias keys, they allow to redirect the actual glossary entry.
If false, no entries from this glossary will be shown
Method Descriptions
func remove_entry ( entry_key
: String ) ⇒ bool
Removes an entry and all its aliases (alternative property) from the glossary. entry_key
may be an entry name or an alias. Returns true if the entry matching the given entry_key
was found.
func replace_entry_key ( old_entry_key
: String, new_entry_key
: String ) ⇒ void
Do not use this to update alternative names. In order to update alternative names, delete all with _remove_entry_alias
and then add them again with _add_entry_key_alias
.
func get_entry ( entry_key
: String ) ⇒ Dictionary
Gets the glossary entry for the given entry_key
. If there is no matching entry, an empty Dictionary will be returned. Valid glossary entry dictionaries will never be empty.
func try_add_entry ( entry
: Dictionary ) ⇒ bool
Adds entry
to the glossary if it does not exist. If it does exist, returns false.
func get_set_regex_option ( entry_key
: String ) ⇒ String
Gets the regex option for the given entry_key
. If the regex option does not exist, it will be generated. A regex option is the accumulation of valid words that can trigger the glossary popup. The entry_key
must be valid or an error will occur.
func add_translation_id ( ) ⇒ String
This is automatically called, no need to use this.
func remove_translation_id ( ) ⇒ void
Removes the translation ID of this glossary.
func remove_entry_translation_ids ( ) ⇒ void
Removes the translation ID of all glossary entries.
func clear_translation_keys ( ) ⇒ void
Clears the lookup tables using translation keys.
func get_property_translation_key ( entry_key
: String, property
: String ) ⇒ String
Returns a key used to reference this glossary in the translation CSV file. Time complexity: O(1)
func get_set_glossary_entry_translation_id ( entry_key
: String ) ⇒ String
Tries to get the glossary entry's translation ID. If it does not exist, a new one will be generated.
func get_set_glossary_translation_id ( ) ⇒ String
Tries to get the glossary's translation ID. If it does not exist, a new one will be generated.