Add list_categories()

This commit is contained in:
JeremyStar™ 2024-05-15 21:16:28 +02:00
parent 7954882a31
commit 2b4a7da347
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 6 additions and 0 deletions

View file

@ -20,6 +20,8 @@ Adds a splash to the specified category.
Adds an array of splashes to the specified category.
#### *CoreBaseModule* <u>delete_category</u>(*String* <u>category</u>)
Removes the specified category.
#### *Array[String]* <u>get_categories()</u>()
Returns a list of all categories.
#### *CoreBaseModule* <u>copy_splashes</u>(*String* <u>source_category</u>, *String* <u>target_category</u>)
Copies all splashes from the source category to the target category.
#### *String* <u>get_random_splash</u>(*String* <u>category</u>)

View file

@ -139,6 +139,10 @@ func add_splashes(category: String, splash_array: Array[String]) -> CoreBaseModu
return self
## Returns a list of all categories.
func list_categories() -> Array[String]:
return core.misc.array_to_stringarray(splashes.keys())
## Removes the specified category.
func delete_category(category: String) -> CoreBaseModule:
splashes.erase(category)