DatabaseIcons ​
Inherits: RefCounted
The icon library of the project, read from the folders under res://src/data/icons/.
Description ​
A folder is a CATEGORY, and an icon is an image file named by its number (12.png): the number is its id. get_icon_by_id finds the file in any category, and import_icons_to_category moves a folder of images in and numbers them from the first free id.
Methods ​
void | ensure_directories() static |
void | ensure_initialized() static |
PackedStringArray | get_all_categories() static |
Array[String] | get_icons_by_category( category: String ) static |
Array[String] | get_all_icons() static |
String | get_icon_by_id( icon_id: int ) static |
String | get_icon_category( icon_id: int ) static |
bool | icon_exists( icon_id: int ) static |
int | get_next_icon_id() static |
int | get_category_icon_count( category: String ) static |
bool | ensure_category_exists( category: String ) static |
Array[Dictionary] | get_icons_for_list( category: String = "" ) static |
String | get_icon_category_from_path( icon_path: String ) static |
Dictionary | import_icons_to_category( import_folder: String, target_category: String ) static |
Constants ​
StringICONS_BASE_PATH ="res://src/data/icons/"- The folder the icons are read from.
Method descriptions ​
void ensure_directories() ​
Ensure all required directories exist
void ensure_initialized() ​
Makes the icons folder when missing.
PackedStringArray get_all_categories() ​
Get all categories (folder names in icons directory)
Array[String] get_icons_by_category( category: String ) ​
Get all icons from a specific category (folder)
Array[String] get_all_icons() ​
Get all icons from all categories
String get_icon_by_id( icon_id: int ) ​
Get icon by ID (finds the file named {id}.png/jpg/etc in any category)
String get_icon_category( icon_id: int ) ​
Get category of an icon by its ID
bool icon_exists( icon_id: int ) ​
Check if icon exists
int get_next_icon_id() ​
Get next available ID by scanning all existing icons
int get_category_icon_count( category: String ) ​
Get icon count for a category
bool ensure_category_exists( category: String ) ​
Ensure category folder exists
Array[Dictionary] get_icons_for_list( category: String = "" ) ​
Get icons for list display
String get_icon_category_from_path( icon_path: String ) ​
Extract category from icon path
Dictionary import_icons_to_category( import_folder: String, target_category: String ) ​
Import icons from import folder to specific category