Compare commits
32 Commits
247bcdd058
...
contentdb
Author | SHA1 | Date | |
---|---|---|---|
8d5870c54c | |||
bc69b03d0b | |||
bde2f1e3f2 | |||
59f0dcaf3f | |||
c6f9a26970 | |||
353f36d551 | |||
d4b398eae2 | |||
ea7aacc9e7 | |||
743e2cfc9c | |||
abc3df86e3 | |||
41524201d1 | |||
41be19fc7a | |||
ad189102d5 | |||
e0765da839 | |||
482a13b495 | |||
56353133e1 | |||
443cda2183 | |||
fab418b56f | |||
00f6a8137e | |||
9b8fb79030 | |||
02323fc427 | |||
3aebed6fed | |||
63555ed0be | |||
7b59880736 | |||
8e1e525340 | |||
af8212a1bd | |||
361d0222ca | |||
436809f8fa | |||
04b43a5969 | |||
dcca582ef3 | |||
f1d0f0789d | |||
5c13010014 |
4
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
textures/character_*.png
|
#textures/character_*.png
|
||||||
textures/player_*.png
|
textures/player_*.png
|
||||||
meta/character_*.txt
|
#meta/character_*.txt
|
||||||
meta/player_*.txt
|
meta/player_*.txt
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# skinsdb
|
# skinsdb - User-facing branch that includes a few basic skins
|
||||||
|
|
||||||
This Minetest mod offers changeable player skins with a graphical interface for multiple inventory mods.
|
This Minetest mod offers changeable player skins with a graphical interface for multiple inventory mods.
|
||||||
|
|
||||||
@ -66,3 +66,4 @@ The Script will download all the skins from the database for you.
|
|||||||
- bell07 (source code)
|
- bell07 (source code)
|
||||||
- stujones11 (player models)
|
- stujones11 (player models)
|
||||||
- jordan4ibanez (1st person view hand)
|
- jordan4ibanez (1st person view hand)
|
||||||
|
- sirrobzeroone (skins)
|
||||||
|
3
meta/character_castaway_female.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Castaway female
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
3
meta/character_castaway_male.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Castaway male
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
3
meta/character_farmer_female.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Farmer female
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
3
meta/character_farmer_male.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Farmer male
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
3
meta/character_prince.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Prince
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
3
meta/character_princess.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Princess
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
3
meta/character_rogue_female.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Rogue female
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
3
meta/character_rogue_male.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Rogue male
|
||||||
|
sirrobzeroone
|
||||||
|
CC0/Public Domain
|
2
mod.conf
@ -1,5 +1,5 @@
|
|||||||
name = skinsdb
|
name = skinsdb
|
||||||
description = Player skin mod, supporting unified_inventory, sfinv and smart_inventory
|
description = Player skin mod, supporting unified_inventory, sfinv and smart_inventory
|
||||||
depends = player_api
|
depends = player_api
|
||||||
optional_depends = unified_inventory,3d_armor,clothing,sfinv,hand_monoid
|
optional_depends = unified_inventory, 3d_armor, clothing, creative, sfinv, hand_monoid
|
||||||
min_minetest_version = 5.4.0
|
min_minetest_version = 5.4.0
|
||||||
|
@ -49,23 +49,25 @@ function skin_class:set_texture(value)
|
|||||||
self._texture = value
|
self._texture = value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Retrieves the character texture
|
||||||
function skin_class:get_texture()
|
function skin_class:get_texture()
|
||||||
return self._texture
|
return self._texture
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Assigns an existing hand item (/node) name to this skin
|
||||||
function skin_class:set_hand(hand)
|
function skin_class:set_hand(hand)
|
||||||
self._hand = hand
|
self._hand = hand
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function skin_class:get_hand()
|
||||||
|
return self._hand
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Registers a new hand item based on the skin meta
|
||||||
local ALPHA_CLIP = minetest.features.use_texture_alpha_string_modes and "clip" or true
|
local ALPHA_CLIP = minetest.features.use_texture_alpha_string_modes and "clip" or true
|
||||||
function skin_class:set_hand_from_texture()
|
function skin_class:set_hand_from_texture()
|
||||||
local hand = core.get_current_modname()..':'..self._texture:gsub('[%p%c%s]', '')
|
local hand = core.get_current_modname()..':'..self._texture:gsub('[%p%c%s]', '')
|
||||||
local hand_def = {}
|
local hand_def = {}
|
||||||
for k,v in pairs(minetest.registered_items[""]) do
|
|
||||||
if k ~= "mod_origin" and k ~= "type" and k ~= "wield_image" then
|
|
||||||
hand_def[k] = v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
hand_def.tiles = {self:get_texture()}
|
hand_def.tiles = {self:get_texture()}
|
||||||
hand_def.visual_scale = 1
|
hand_def.visual_scale = 1
|
||||||
hand_def.wield_scale = {x=1,y=1,z=1}
|
hand_def.wield_scale = {x=1,y=1,z=1}
|
||||||
@ -77,13 +79,39 @@ function skin_class:set_hand_from_texture()
|
|||||||
hand_def.mesh = "skinsdb_hand_18.b3d"
|
hand_def.mesh = "skinsdb_hand_18.b3d"
|
||||||
end
|
end
|
||||||
hand_def.use_texture_alpha = ALPHA_CLIP
|
hand_def.use_texture_alpha = ALPHA_CLIP
|
||||||
minetest.register_node(hand, hand_def)
|
|
||||||
|
core.register_node(hand, table.copy(hand_def))
|
||||||
|
|
||||||
|
self._hand_def = hand_def -- for wieldhand overrides
|
||||||
self:set_hand(hand)
|
self:set_hand(hand)
|
||||||
end
|
end
|
||||||
|
|
||||||
function skin_class:get_hand()
|
-- creative (and other mods?) may overwrite the wieldhand very late.
|
||||||
return self._hand
|
-- Grab the most recent definition and use them as default for our skin hands.
|
||||||
|
core.register_on_mods_loaded(function()
|
||||||
|
local default_hand_def = {}
|
||||||
|
for k, v in pairs(core.registered_items[""]) do
|
||||||
|
if k ~= "mod_origin"
|
||||||
|
and k ~= "name"
|
||||||
|
and k ~= "type"
|
||||||
|
and k ~= "wield_image"
|
||||||
|
and string.sub(k, 1, 1) ~= "_" then
|
||||||
|
default_hand_def[k] = v
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
for _, meta in pairs(skins.meta) do
|
||||||
|
local def = core.registered_nodes[meta._hand]
|
||||||
|
if def then
|
||||||
|
local new_def = table.copy(default_hand_def)
|
||||||
|
-- Overwrite the hand with our fields from `set_hand_from_texture`
|
||||||
|
for k, v in pairs(meta._hand_def) do
|
||||||
|
new_def[k] = v
|
||||||
|
end
|
||||||
|
core.override_item(meta._hand, new_def)
|
||||||
|
end
|
||||||
|
meta._hand_def = nil -- no longer needed, free up RAM
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
function skin_class:set_preview(value)
|
function skin_class:set_preview(value)
|
||||||
self._preview = value
|
self._preview = value
|
||||||
|
BIN
textures/character_castaway_female.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
textures/character_castaway_male.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
textures/character_farmer_female.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/character_farmer_male.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
textures/character_prince.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
textures/character_princess.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
textures/character_rogue_female.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
textures/character_rogue_male.png
Normal file
After Width: | Height: | Size: 3.9 KiB |