Lua API

Data module

Functions for managing the asset system.

With this module it is possible to reload built-in assets like textures and music.

Usage

local Data = ELONA.require("core.Data")

Functions

reload_assets () Reloads the UI assets defined in the core.asset table.
reload_charas () Reloads the UI assets defined in the core.chara table.
get (prototype_id, data_id) Get the data for the prototype ID and the data ID.
get_table (prototype_id) Get the data table for the prototype ID.
get_id_by_integer (prototype_id, integer_data_id) Get new ID by integer ID.

Functions

# reload_assets ()

Reloads the UI assets defined in the core.asset table.

Call this if you want changes to the core.asset table to be visible.

# reload_charas ()

Reloads the UI assets defined in the core.chara table.

Call this if you want changes to the core.chara table to be visible.

# get (prototype_id, data_id)

Get the data for the prototype ID and the data ID.

Parameters:
  • prototype_id : (string) a namespaced prototype ID.
  • data_id : (string) a namespaced data ID.
Returns:
Or
  • (nil) if not found.
# get_table (prototype_id)

Get the data table for the prototype ID.

Parameters:
  • prototype_id : (string) a namespaced prototype ID.
Returns:
  • (table) the table which stores data.
Or
  • (nil) if not found.
# get_id_by_integer (prototype_id, integer_data_id)

Get new ID by integer ID.

Parameters:
  • prototype_id : (string) a namespaced prototype ID.
  • integer_data_id : (num) an integer data ID.
Returns:
  • (string) the corresponding new ID.
Or
  • (nil) if not found.