Skip to content

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 ​

MapIconCatalogget_catalog() static
MapIconCatalogcreate_default() static
MapIconDefinitionget_icon( id: StringName )
Texture2Dget_texture( id: StringName )
Colorget_color( id: StringName, faction_color: Variant = null )
Array[StringName]get_ids( category: String = "" )
Array[String]get_categories()
MapIconDefinitionmake_default( id: StringName ) static
intadd_missing_defaults()
boolreset_icon( id: StringName )
boolis_default_id( id: StringName ) static
PackedStringArrayget_problems()

Constants ​

  • String CATALOG_PATH = "res://src/data/config_data/map_icon_catalog.tres" - The file the catalog is saved in
  • String ICON_FOLDER = "res://assets/ui/map_icons/" - The folder of the pictures that come with the toolkit
  • Array[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