skins-collectible/DOCS.md

46 lines
2.1 KiB
Markdown
Raw Normal View History

2021-02-01 08:56:40 -08:00
# Skins collectible docs
2022-04-16 05:36:34 -07:00
> THIS IS AN ALPHA, EXPECT BREAKAGES
2021-02-01 08:56:40 -08:00
2022-04-16 05:36:34 -07:00
# Table of Contents
* [1 Skins](#1-skins)
* [2 API](#2-api)
* [2.1 Skins handlers](#21-skins-handlers)
* [2.2 Utils](#22-utils)
* [2.3 Getters](#23-getters)
* [2.4 Setters](#24-setters)
* [2.5 Callbacks](#25-callbacks)
* [3 About the author(s)](#3-about-the-authors)
2021-02-01 08:56:40 -08:00
2022-04-16 05:36:34 -07:00
TODO: documentare comandi? Se sì, qui e basta o anche nel README?
2021-02-01 08:56:40 -08:00
2022-04-16 05:36:34 -07:00
## 1 Skins
(TODO, check the README for now)
## 2 API
TODO: spiega
### 2.1 Skins handlers
2022-04-24 01:08:52 -07:00
* `skins_collectible.unlock_skin(p_name, skin_ID)`: unlock skin with ID `skin_ID` for `p_name`
* `skins_collectible.remove_skin(p_name, skin_ID)`: remove skin with ID `skin_ID` from `p_name`
2022-04-16 05:36:34 -07:00
### 2.2 Utils
2022-04-24 01:08:52 -07:00
* `skins_collectible.is_skin_unlocked(p_name, skin_ID)`: returns whether `p_name` has the skin with ID `skin_ID`, as a boolean
2022-04-16 05:36:34 -07:00
### 2.3 Getters
2022-04-24 01:08:52 -07:00
* `skins_collectible.get_skins()`: returns a table with all the loaded skins, with their IDs as a key and the skin as a value
* `skins_collectible.get_skin(skin_ID)`: returns the skin corresponding to `skin_ID`, if any
* `skins_collectible.get_player_skin(p_name)`: returns the skin that `p_name` has currently equipped
* `skins_collectible.get_player_skin_ID(p_name)`: returns the ID of the skin that `p_name` has currently equipped
2022-04-16 05:36:34 -07:00
### 2.4 Setters
2022-04-24 01:08:52 -07:00
* `skins_collectible.set_skin(player, skin_ID, <is_permanent>)`: set skin with ID `skin_ID` to `player`. `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 to `false`)
2022-04-16 05:36:34 -07:00
### 2.5 Callbacks
2022-04-24 01:08:52 -07:00
* `skins_collectible.register_on_set_skin(p_name, skin_ID)`: additional behaviour when a player changes skin
2022-04-16 05:36:34 -07:00
## 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](https://liberapay.com/Zughy/). 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`