Add util get_portrait(skin)
This commit is contained in:
parent
8cfb970042
commit
6b642d5809
19
DOCS.md
19
DOCS.md
@ -16,22 +16,35 @@ TODO: documentare comandi? Se sì, qui e basta o anche nel README?
|
|||||||
|
|
||||||
## 1 Skins
|
## 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
|
## 2 API
|
||||||
|
|
||||||
TODO: spiega
|
TODO: spiega
|
||||||
|
|
||||||
### 2.1 Skins handlers
|
### 2.1 Skins handlers
|
||||||
* `collectible_skins.unlock_skin(p_name, skin_ID)`: unlock skin with ID `skin_ID` for `p_name`
|
* `collectible_skins.unlock_skin(p_name, skin_ID)`: unlock skin with ID `skin_ID` for `p_name`
|
||||||
* `collectible_skins.remove_skin(p_name, skin_ID)`: remove skin with ID `skin_ID` from `p_name`
|
* `collectible_skins.remove_skin(p_name, skin_ID)`: remove skin with ID `skin_ID` from `p_name`
|
||||||
|
|
||||||
### 2.2 Utils
|
### 2.2 Utils
|
||||||
* `collectible_skins.is_skin_unlocked(p_name, skin_ID)`: returns whether `p_name` has the skin with ID `skin_ID`, as a boolean
|
* `collectible_skins.is_skin_unlocked(p_name, skin_ID)`: returns whether `p_name` has the skin with ID `skin_ID`, as a boolean
|
||||||
|
|
||||||
### 2.3 Getters
|
### 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_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_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(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
|
* `collectible_skins.get_player_skin_ID(p_name)`: returns the ID of the skin that `p_name` has currently equipped
|
||||||
|
|
||||||
|
@ -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)
|
function collectible_skins.get_player_skin(p_name)
|
||||||
return loaded_skins[equipped_skin[p_name]]
|
return loaded_skins[equipped_skin[p_name]]
|
||||||
end
|
end
|
||||||
|
BIN
textures/skins_portraitmask.png
Normal file
BIN
textures/skins_portraitmask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 87 B |
Loading…
x
Reference in New Issue
Block a user