2.5 KiB
2.5 KiB
Collectible skins docs
THIS IS AN ALPHA, EXPECT BREAKAGES
Table of Contents
1 Skins
A skin is a table with the following fields:
skinID:
name:
description:
texture:
hint: (optional, default "(locked)")
model: (optional, default none)
tier: (optional, default 1)
author: (optional, default "???")
Check the README to know how to add new skins
2 API
TODO: spiega
2.1 Skins handlers
collectible_skins.unlock_skin(p_name, skin_ID)
: unlocks skin with IDskin_ID
forp_name
collectible_skins.remove_skin(p_name, skin_ID)
: removes skin with IDskin_ID
fromp_name
2.2 Utils
collectible_skins.is_skin_unlocked(p_name, skin_ID)
: returns whetherp_name
has the skin with IDskin_ID
, as a boolean
2.3 Getters
collectible_skins.get_skins()
: returns a table with all the loaded skins, with their IDs as a key and the skin as a valuecollectible_skins.get_skin(skin_ID)
: returns the skin corresponding toskin_ID
, if anycollectible_skins.get_portrait(skin)
: returns the portrait associated to the skin, if anycollectible_skins.get_player_skin(p_name)
: returns the skin thatp_name
has currently equippedcollectible_skins.get_player_skin_ID(p_name)
: returns the ID of the skin thatp_name
has currently equipped
2.4 Setters
collectible_skins.set_skin(player, skin_ID, <is_permanent>)
: sets skin with IDskin_ID
toplayer
.is_permanent
is an optional boolean indicating whether the skin should be remembered the next time they log in if they didn't change it before logging out (defaults tofalse
)
2.5 Callbacks
collectible_skins.register_on_set_skin(function(p_name, skin_ID))
: additional behaviour when a player changes skin. This callback is not launched when people log in
3. About the author(s)
I'm Zughy (Marco), a professional Italian pixel artist who fights for FOSS and digital ethics. If this library spared you a lot of time and you want to support me somehow, please consider donating on Liberapay. Also, this project wouldn't have been possible if it hadn't been for some friends who helped me testing through: Giov4
, SonoMichele
, _Zaizen_
and Xx_Crazyminer_xX