MapIconCatalog ​
Inherits: Resource
The map icons of the project: named pictures (MapIconDefinition) that the mini map and the world map draw for quest givers, shops, professions, gathering nodes, creatures, places, travel points and loot. The catalog is a file (res://src/data/config_data/map_icon_catalog.tres) edited in UI settings > Map icons. Without the file the icons that come with the toolkit are used (assets/ui/map_icons). Ask for a picture by name: MapIconCatalog.get_catalog().get_texture(&"blacksmith").
Properties ​
Array[MapIconDefinition] | icons | [] |
Methods ​
MapIconCatalog | get_catalog() static |
MapIconCatalog | create_default() static |
MapIconDefinition | get_icon( id: StringName ) |
Texture2D | get_texture( id: StringName ) |
Color | get_color( id: StringName, faction_color: Variant = null ) |
Array[StringName] | get_ids( category: String = "" ) |
Array[String] | get_categories() |
MapIconDefinition | make_default( id: StringName ) static |
int | add_missing_defaults() |
bool | reset_icon( id: StringName ) |
bool | is_default_id( id: StringName ) static |
PackedStringArray | get_problems() |
Constants ​
StringCATALOG_PATH ="res://src/data/config_data/map_icon_catalog.tres"- The file the catalog is saved inStringICON_FOLDER ="res://assets/ui/map_icons/"- The folder of the pictures that come with the toolkitArray[Array]DEFAULTS =[- The icons that come with the toolkit: id, name, group, the colour laid on it (white = as drawn), tinted by faction
Property descriptions ​
Array[MapIconDefinition] icons = [] ​
The icons, in the order they are listed
Method descriptions ​
MapIconCatalog get_catalog() ​
The catalog of the project: the file, or the icons that come with the toolkit when there is no file
MapIconCatalog create_default() ​
A catalog of the icons that come with the toolkit
MapIconDefinition get_icon( id: StringName ) ​
The icon with this id (null when there is none)
Texture2D get_texture( id: StringName ) ​
The picture of an icon (null when there is no such icon)
Color get_color( id: StringName, faction_color: Variant = null ) ​
The colour an icon is drawn in: its tint, or faction_color when it is tinted by faction (and a colour is given)
Array[StringName] get_ids( category: String = "" ) ​
The ids, all of them or the ones of one group
Array[String] get_categories() ​
The groups, in the order they first appear
MapIconDefinition make_default( id: StringName ) ​
Makes the icon of the toolkit with this id (its picture, name, group and tint); null when the toolkit has none
int add_missing_defaults() ​
Adds the icons of the toolkit that the catalog does not have (all of them in a new catalog); returns how many. What is already there is not touched
bool reset_icon( id: StringName ) ​
Puts an icon of the toolkit back as it comes (picture, name, group, tint); false when the toolkit has no icon with this id
bool is_default_id( id: StringName ) ​
True when the toolkit has an icon with this id (its id cannot be changed or removed)
PackedStringArray get_problems() ​
Problems of the catalog in words (empty when it is fine): an icon with no id, two with the same id, an icon with no picture