Add util get_portrait(skin)

This commit is contained in:
Zughy 2023-09-24 23:09:31 +02:00
parent 8cfb970042
commit 6b642d5809
3 changed files with 22 additions and 3 deletions

15
DOCS.md
View File

@ -16,7 +16,19 @@ TODO: documentare comandi? Se sì, qui e basta o anche nel README?
## 1 Skins
(TODO, check the README for now)
A skin is a table with the following fields:
```yaml
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
@ -32,6 +44,7 @@ TODO: spiega
### 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 value
* `collectible_skins.get_skin(skin_ID)`: returns the skin corresponding to `skin_ID`, if any
* `collectible_skins.get_portrait(skin)`: returns the portrait associated to the skin, if any
* `collectible_skins.get_player_skin(p_name)`: returns the skin that `p_name` has currently equipped
* `collectible_skins.get_player_skin_ID(p_name)`: returns the ID of the skin that `p_name` has currently equipped

View File

@ -251,6 +251,12 @@ end
function collectible_skins.get_portrait(skin)
return "([combine:24x24:0,0=" .. skin.texture .. "^[mask:skins_portraitmask.png)"
end
function collectible_skins.get_player_skin(p_name)
return loaded_skins[equipped_skin[p_name]]
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B