mods - skin manager using simple_skins from tenplus1
* renmame mod to skins due conventions * reduce funtionality
@ -44,6 +44,8 @@ To download you can play this game with the following minetest engines:
|
||||
* so then default beds as `beds` [mods/beds](mods/beds) from default 0.4
|
||||
* minetest floatlands as `floatlands` [mods/floatlands](mods/floatlands) derived from Floatlands Realm made to this servers, as https://codeberg.org/minenux/minetest-mod-floatland
|
||||
* so then default flowers as `flowers` are need. Later this will need ethereal modifications.
|
||||
* tenplus1 simple skins as `skins` [mods/skins](mods/skins) from https://codeberg.org/minenux/minetest-mod-simple_skins
|
||||
* customized so this was renamed to mantain consistency and simplification, also some settiungs were minimalized
|
||||
|
||||
## Licensing
|
||||
|
||||
|
4
mods/skins/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*~
|
||||
.previews/output
|
||||
.previews/blender_out
|
||||
.previews/pngcrush_output
|
5
mods/skins/depends.txt
Normal file
@ -0,0 +1,5 @@
|
||||
default
|
||||
sfinv?
|
||||
inventory_plus?
|
||||
intllib?
|
||||
unified_inventory?
|
1
mods/skins/description.txt
Normal file
@ -0,0 +1 @@
|
||||
SKIN mnager Mod, Simple skin modified that allows players to set their individual skins.
|
333
mods/skins/init.lua
Normal file
@ -0,0 +1,333 @@
|
||||
|
||||
-- Simple Skins mod for minetest
|
||||
-- Adds a simple skin selector to the inventory by using
|
||||
-- the default sfinv or inventory_plus when running.
|
||||
-- Released by TenPlus1 and based on Zeg9's code under MIT license
|
||||
|
||||
-- check for minetest 5.x compatibility
|
||||
local is_54 = minetest.has_feature("direct_velocity_on_players") or nil
|
||||
local is_50 = minetest.has_feature("object_use_texture_alpha") or nil
|
||||
|
||||
-- Load support for translation.
|
||||
local S
|
||||
|
||||
if minetest.get_translator ~= nil then
|
||||
S = minetest.get_translator("skins")
|
||||
is_50 = true
|
||||
else
|
||||
if minetest.get_modpath("intllib") then
|
||||
dofile(minetest.get_modpath("intllib").."/init.lua")
|
||||
if intllib.make_gettext_pair then
|
||||
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
|
||||
else
|
||||
gettext = intllib.Getter() -- old text file method
|
||||
end
|
||||
S = gettext
|
||||
else -- boilerplate function
|
||||
S = function(str, ...)
|
||||
local args = {...}
|
||||
return str:gsub("@%d", function(match)
|
||||
return args[tonumber(match:sub(2))]
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
skins = {
|
||||
skins = {}, list = {}, meta = {}, formspec = {},
|
||||
modpath = minetest.get_modpath("skins"),
|
||||
invplus = minetest.get_modpath("inventory_plus"),
|
||||
unified_inventory = minetest.get_modpath("unified_inventory"),
|
||||
default_skin_tab = false,
|
||||
sfinv = minetest.get_modpath("sfinv"),
|
||||
transparant_list = false,
|
||||
id = 1,
|
||||
file = minetest.get_worldpath() .. "/skins.mt",
|
||||
preview = minetest.settings:get_bool("skins_preview") or true,
|
||||
translate = S,
|
||||
skin_limit = tonumber(minetest.settings:get("skins_limit")) or 160
|
||||
}
|
||||
|
||||
|
||||
-- check and use specific inventory
|
||||
if skins.unified_inventory then
|
||||
skins.transparant_list = true
|
||||
dofile(skins.modpath .. "/unified_inventory.lua")
|
||||
|
||||
elseif skins.invplus then
|
||||
skins.transparant_list = true
|
||||
dofile(skins.modpath .. "/inventory_plus.lua")
|
||||
|
||||
elseif skins.sfinv then
|
||||
skins.default_skin_tab = not skins.invplus and not skins.unified_inventory
|
||||
dofile(skins.modpath .. "/sfinv.lua")
|
||||
end
|
||||
|
||||
|
||||
-- load skin list and metadata
|
||||
local f, data, skin = 1
|
||||
|
||||
while skins.id <= skins.skin_limit do
|
||||
|
||||
skin = "character_" .. skins.id
|
||||
|
||||
-- does skin file exist ?
|
||||
f = io.open(skins.modpath .. "/textures/" .. skin .. ".png")
|
||||
|
||||
-- escape loop if not found and remove last entry
|
||||
if not f then
|
||||
skins.list[skins.id] = nil
|
||||
skins.id = skins.id - 1
|
||||
break
|
||||
end
|
||||
|
||||
f:close()
|
||||
|
||||
table.insert(skins.list, skin)
|
||||
|
||||
-- does metadata exist for that skin file ?
|
||||
f = io.open(skins.modpath .. "/meta/" .. skin .. ".txt")
|
||||
|
||||
if f then
|
||||
data = minetest.deserialize("return {" .. f:read("*all") .. "}")
|
||||
f:close()
|
||||
end
|
||||
|
||||
-- add metadata to list
|
||||
skins.meta[skin] = {
|
||||
name = data and data.name and data.name:gsub("[%p%c]", "") or "",
|
||||
author = data and data.author and data.author:gsub("[%p%c]", "") or ""
|
||||
}
|
||||
|
||||
skins.id = skins.id + 1
|
||||
end
|
||||
|
||||
|
||||
-- load player skins file for backwards compatibility
|
||||
local input = io.open(skins.file, "r")
|
||||
local data = nil
|
||||
|
||||
if input then
|
||||
data = input:read("*all")
|
||||
io.close(input)
|
||||
end
|
||||
|
||||
if data and data ~= "" then
|
||||
|
||||
local lines = string.split(data, "\n")
|
||||
|
||||
for _, line in pairs(lines) do
|
||||
data = string.split(line, " ", 2)
|
||||
skins.skins[data[1]] = data[2]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- create formspec for skin selection page
|
||||
skins.formspec.main = function(name)
|
||||
|
||||
local formspec = "label[.5,2;" .. S("Select Player Skin:") .. "]"
|
||||
.. "textlist[.5,2.5;6.8,6;skins_set;"
|
||||
|
||||
local meta
|
||||
local selected = 1
|
||||
|
||||
for i = 1, #skins.list do
|
||||
|
||||
formspec = formspec .. skins.meta[ skins.list[i] ].name
|
||||
|
||||
if skins.skins[name] == skins.list[i] then
|
||||
selected = i
|
||||
meta = skins.meta[ skins.skins[name] ]
|
||||
end
|
||||
|
||||
if i < #skins.list then
|
||||
formspec = formspec ..","
|
||||
end
|
||||
end
|
||||
|
||||
if skins.transparant_list then
|
||||
formspec = formspec .. ";" .. selected .. ";true]"
|
||||
else
|
||||
formspec = formspec .. ";" .. selected .. ";false]"
|
||||
end
|
||||
|
||||
if meta then
|
||||
|
||||
if meta.name then
|
||||
formspec = formspec .. "label[2,.5;" .. S("Name: ") .. meta.name .. "]"
|
||||
end
|
||||
|
||||
if meta.author then
|
||||
formspec = formspec .. "label[2,1;" .. S("Author: ") .. meta.author .. "]"
|
||||
end
|
||||
end
|
||||
|
||||
-- if preview enabled then add player model to formspec (5.4dev only)
|
||||
if skins.preview == true then
|
||||
if is_54 then
|
||||
formspec = formspec .. "model[6,-0.2;1.5,3;player;character.b3d;"
|
||||
.. skins.skins[name] .. ".png;0,180;false;true]"
|
||||
else
|
||||
local head = "[combine:8x8:-8,-8="..skins.skins[name]..".png"
|
||||
local body = "[combine:8x12:-20,-20="..skins.skins[name]..".png"
|
||||
local left_leg = "[combine:4x12:-4,-20="..skins.skins[name]..".png"
|
||||
local right_leg = "[combine:4x12:-4,-20="..skins.skins[name]..".png^[transformFX"
|
||||
local left_hand = "[combine:4x12:-44,-20="..skins.skins[name]..".png"
|
||||
local right_hand = "[combine:4x12:-44,-20="..skins.skins[name]..".png^[transformFX"
|
||||
local back_head = "[combine:8x8:-24,-8="..skins.skins[name]..".png"
|
||||
local body_back = "[combine:8x12:-32,-20="..skins.skins[name]..".png"
|
||||
local legs_back = "[combine:4x12:-12,-20="..skins.skins[name]..".png"
|
||||
local left_leg_back = "[combine:4x12:-12,-20="..skins.skins[name]..".png"
|
||||
local right_leg_back = "[combine:4x12:-12,-20="..skins.skins[name]..".png^[transformFX"
|
||||
local left_hand_back = "[combine:4x12:-52,-20="..skins.skins[name]..".png"
|
||||
local right_hand_back = "[combine:4x12:-52,-20="..skins.skins[name]..".png^[transformFX"
|
||||
formspec = formspec .. "image[3,1;2,2;".. head .. "] image[3,2.75;2,3;".. body .. "] image[3,5.35;1,3;".. left_leg .. "] image[3.82,5.35;1,3;".. right_leg .. "] image[2.2,2.75;1,3;".. left_hand .. "] image[4.63,2.75;1,3;".. right_hand .. "] image[7,1;2,2;".. back_head .. "] image[7,2.75;2,3;".. body_back .. "] image[7,5.35;1,3;".. left_leg_back .. "] image[7.82,5.35;1,3;".. right_leg_back .. "] image[6.2,2.75;1,3;".. left_hand_back .. "] image[8.63,2.75;1,3;".. right_hand_back .. "] image_button[0,1;2,2;"..head.."]"
|
||||
end
|
||||
end
|
||||
|
||||
return formspec
|
||||
end
|
||||
|
||||
|
||||
-- Read the image size from a PNG file. (returns width, height)
|
||||
local PNG_HDR = string.char(0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A)
|
||||
local function read_image_size(filename)
|
||||
|
||||
local f = io.open(filename, "rb")
|
||||
|
||||
if not f then return end
|
||||
|
||||
f:seek("set", 0x0)
|
||||
|
||||
local hdr = f:read(string.len(PNG_HDR))
|
||||
|
||||
if hdr ~= PNG_HDR then
|
||||
f:close() ; return
|
||||
end
|
||||
|
||||
f:seek("set", 0x13) ; local ws = f:read(1)
|
||||
f:seek("set", 0x17) ; local hs = f:read(1)
|
||||
f:close()
|
||||
|
||||
return ws:byte(), hs:byte()
|
||||
end
|
||||
|
||||
|
||||
-- update player skin
|
||||
skins.update_player_skin = function(player)
|
||||
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if minetest.get_modpath("player_api") then
|
||||
player_api.set_textures(player, {skins.skins[name] .. ".png"})
|
||||
else
|
||||
default.player_set_textures(player, {skins.skins[name] .. ".png"})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
skins.event_CHG = function(event, player)
|
||||
|
||||
local name = player:get_player_name()
|
||||
local index = math.min(event.index, skins.id)
|
||||
|
||||
if not skins.list[index] then
|
||||
return -- Do not update wrong skin number
|
||||
end
|
||||
|
||||
skins.skins[name] = skins.list[index]
|
||||
|
||||
skins.update_player_skin(player)
|
||||
|
||||
if is_50 then
|
||||
|
||||
local meta = player:get_meta()
|
||||
|
||||
meta:set_string("skins:skin", skins.skins[name])
|
||||
else
|
||||
player:set_attribute("skins:skin", skins.skins[name])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- load player skin on join
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
|
||||
local name = player:get_player_name() ; if not name then return end
|
||||
local skin
|
||||
|
||||
if is_50 then
|
||||
|
||||
local meta = player:get_meta()
|
||||
|
||||
skin = meta:get_string("skins:skin")
|
||||
else
|
||||
skin = player:get_attribute("skins:skins")
|
||||
end
|
||||
|
||||
-- do we already have a skin in player attributes?
|
||||
if skin and skin ~= "" then
|
||||
skins.skins[name] = skin
|
||||
|
||||
-- otherwise use skin from skins.mt file or default if not set
|
||||
elseif not skins.skins[name] then
|
||||
skins.skins[name] = "character_1"
|
||||
end
|
||||
|
||||
skins.update_player_skin(player)
|
||||
end)
|
||||
|
||||
|
||||
-- admin command to set player skin (usually for custom skins)
|
||||
minetest.register_chatcommand("setskin", {
|
||||
params = "<player> <skin number>",
|
||||
description = S("Admin command to set player skin"),
|
||||
privs = {server = true},
|
||||
func = function(name, param)
|
||||
|
||||
local playername, skin = string.match(param, "([^ ]+) (-?%d+)")
|
||||
|
||||
if not playername or not skin then
|
||||
return false, S("** Insufficient or wrong parameters")
|
||||
end
|
||||
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
|
||||
if not player then
|
||||
return false, S("** Player @1 not online!", playername)
|
||||
end
|
||||
|
||||
-- this check is only used when custom skins aren't in use
|
||||
-- if not skins.list[tonumber(skin)] then
|
||||
-- return false, S("** Invalid skin number (max value is @1)", id)
|
||||
-- end
|
||||
|
||||
skins.skins[playername] = "character_" .. tonumber(skin)
|
||||
|
||||
skins.update_player_skin(player)
|
||||
|
||||
if is_50 then
|
||||
|
||||
local meta = player:get_meta()
|
||||
|
||||
meta:set_string("skins:skin", skins.skins[playername])
|
||||
else
|
||||
player:set_attribute("skins:skin", skins.skins[playername])
|
||||
end
|
||||
|
||||
minetest.chat_send_player(playername,
|
||||
S("Your skin has been set to") .. " character_" .. skin)
|
||||
|
||||
return true, "** " .. playername .. S("'s skin set to")
|
||||
.. " character_" .. skin .. ".png"
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
print ("[MOD] skins (Simple Skins) loaded")
|
40
mods/skins/inventory_plus.lua
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
local S = skins.translate
|
||||
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
|
||||
inventory_plus.register_button(player, "skins", S("Skins"), 0,
|
||||
"inventory_plus_skins.png")
|
||||
end)
|
||||
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
if skins.sfinv then
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if fields.skins then
|
||||
|
||||
inventory_plus.set_inventory_formspec(player,
|
||||
"size[8,8.6]"
|
||||
.. "bgcolor[#08080822;true]"
|
||||
.. skins.formspec.main(name)
|
||||
.. "button[0,.75;2,.5;main;" .. S("Back") .. "]")
|
||||
end
|
||||
|
||||
local event = minetest.explode_textlist_event(fields["skins_set"])
|
||||
|
||||
if event.type == "CHG" then
|
||||
|
||||
skins.event_CHG(event, player)
|
||||
|
||||
inventory_plus.set_inventory_formspec(player,
|
||||
"size[8,8.6]"
|
||||
.. "bgcolor[#08080822;true]"
|
||||
.. skins.formspec.main(name)
|
||||
.. "button[0,.75;2,.5;main;" .. S("Back") .. "]")
|
||||
end
|
||||
end
|
||||
end)
|
36
mods/skins/license.txt
Normal file
@ -0,0 +1,36 @@
|
||||
License of Media:
|
||||
-----------------
|
||||
|
||||
Title: Minetest Skins Pack 1
|
||||
Title URL: https://opengameart.org/content/minetest-skins-pack-1
|
||||
Author: isaiah658
|
||||
License(s): License(s): CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )
|
||||
Original file names: Skin_1.png to Skin_32.png and Icon.png
|
||||
Simple Skins file names: character_1.png to character_31.png, character_900.png, and inventory_plus_skins.png
|
||||
Modifications: None
|
||||
|
||||
|
||||
License of Code:
|
||||
----------------
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 TenPlus1
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
52
mods/skins/locale/es.po
Normal file
@ -0,0 +1,52 @@
|
||||
# simple_skin <italian translate>.
|
||||
# Copyright (C) 2018
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# Stefano Peris <xenon77.dev@gmail.com>, 2018.
|
||||
# Github: <https://github.com/XenonCoder>
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-21 07:29+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: PICCORO Lenz McKAY <mckaygerhard@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.12\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: init.lua
|
||||
msgid "Select Player Skin:"
|
||||
msgstr "Seleciona la apariencia:"
|
||||
|
||||
#: init.lua
|
||||
msgid "Name: "
|
||||
msgstr "Nombre"
|
||||
|
||||
#: init.lua
|
||||
msgid "Author: "
|
||||
msgstr "Autor"
|
||||
|
||||
#: init.lua
|
||||
msgid "Admin command to set player skin"
|
||||
msgstr "Comando administrativo apra asignar apariencia de skin"
|
||||
|
||||
#: init.lua
|
||||
msgid "'s skin set to"
|
||||
msgstr ", apariencia asignada a"
|
||||
|
||||
#: init.lua
|
||||
msgid "Set player skin"
|
||||
msgstr "Configura la apariencia"
|
||||
|
||||
#: init.lua
|
||||
msgid "Close"
|
||||
msgstr "Cerrar"
|
||||
|
||||
#: init.lua
|
||||
msgid "Skins"
|
||||
msgstr "Figura"
|
51
mods/skins/locale/fr.po
Normal file
@ -0,0 +1,51 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-07-29 07:11+0200\n"
|
||||
"PO-Revision-Date: 2017-07-29 07:17+0200\n"
|
||||
"Last-Translator: fat115 <fat115@framasoft.org>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.12\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: init.lua
|
||||
msgid "Select Player Skin:"
|
||||
msgstr "Sélectionner l'apparence du joueur :"
|
||||
|
||||
#: init.lua
|
||||
msgid "Name: "
|
||||
msgstr "Nom : "
|
||||
|
||||
#: init.lua
|
||||
msgid "Author: "
|
||||
msgstr "Auteur : "
|
||||
|
||||
#: init.lua
|
||||
msgid "Admin command to set player skin"
|
||||
msgstr "Commande admin pour définir l'apparence du joueur"
|
||||
|
||||
#: init.lua
|
||||
msgid "'s skin set to"
|
||||
msgstr ", apparence définie pour"
|
||||
|
||||
#: init.lua
|
||||
msgid "Set player skin"
|
||||
msgstr "Définir l'apparence du joueur"
|
||||
|
||||
#: init.lua
|
||||
msgid "Close"
|
||||
msgstr "Fermer"
|
||||
|
||||
#: init.lua
|
||||
msgid "[MOD] Simple Skins loaded"
|
||||
msgstr "[MOD] Simple Skins chargé"
|
52
mods/skins/locale/it.po
Normal file
@ -0,0 +1,52 @@
|
||||
# simple_skin <italian translate>.
|
||||
# Copyright (C) 2018
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# Stefano Peris <xenon77.dev@gmail.com>, 2018.
|
||||
# Github: <https://github.com/XenonCoder>
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-21 07:29+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Stefano Peris <xenon77.dev@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.12\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: init.lua
|
||||
msgid "Select Player Skin:"
|
||||
msgstr "Seleziona la skin del giocatore"
|
||||
|
||||
#: init.lua
|
||||
msgid "Name: "
|
||||
msgstr "Nome"
|
||||
|
||||
#: init.lua
|
||||
msgid "Author: "
|
||||
msgstr "Autore"
|
||||
|
||||
#: init.lua
|
||||
msgid "Admin command to set player skin"
|
||||
msgstr "Comando di admin per impostare la skin del giocatore"
|
||||
|
||||
#: init.lua
|
||||
msgid "'s skin set to"
|
||||
msgstr ", la skin è impostata su"
|
||||
|
||||
#: init.lua
|
||||
msgid "Set player skin"
|
||||
msgstr "Imposta la skin del giocatore"
|
||||
|
||||
#: init.lua
|
||||
msgid "Close"
|
||||
msgstr "Chiudi"
|
||||
|
||||
#: init.lua
|
||||
msgid "[MOD] Simple Skins loaded"
|
||||
msgstr "[MOD] Skins semplici caricate"
|
51
mods/skins/locale/ms.po
Normal file
@ -0,0 +1,51 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-07-29 07:11+0200\n"
|
||||
"PO-Revision-Date: 2018-02-14 01:23+0800\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.0.6\n"
|
||||
"Last-Translator: MuhdNurHidayat (MNH48) <mnh48mail@gmail.com>\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"Language: ms\n"
|
||||
|
||||
#: init.lua
|
||||
msgid "Select Player Skin:"
|
||||
msgstr "Pilih Kulit Pemain:"
|
||||
|
||||
#: init.lua
|
||||
msgid "Name: "
|
||||
msgstr "Nama: "
|
||||
|
||||
#: init.lua
|
||||
msgid "Author: "
|
||||
msgstr "Pencipta: "
|
||||
|
||||
#: init.lua
|
||||
msgid "Admin command to set player skin"
|
||||
msgstr "Perintah pentadbir untuk menetapkan kulit pemain"
|
||||
|
||||
#: init.lua
|
||||
msgid "'s skin set to"
|
||||
msgstr " telah ditukarkan kulitnya kepada"
|
||||
|
||||
#: init.lua
|
||||
msgid "Set player skin"
|
||||
msgstr "Tetapkan kulit pemain"
|
||||
|
||||
#: init.lua
|
||||
msgid "Close"
|
||||
msgstr "Tutup"
|
||||
|
||||
#: init.lua
|
||||
msgid "[MOD] Simple Skins loaded"
|
||||
msgstr "[MODS] Simple Skins telah dimuatkan"
|
10
mods/skins/locale/skins.es.tr
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain: simple_skins
|
||||
|
||||
Select Player Skin:=Seleciona la apariencia:
|
||||
Name: =Nombre:
|
||||
Author: =Autor:
|
||||
Admin command to set player skin=Comando administrativo apra asignar apariencia de skin
|
||||
's skin set to=, apariencia asignada a
|
||||
Set player skin=Configura la apariencia
|
||||
Close=Cerrar
|
||||
Skins=Figura
|
10
mods/skins/locale/skins.fr.tr
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain: simple_skins
|
||||
|
||||
Select Player Skin:=Sélectionner l'apparence du joueur:
|
||||
Name: =Nom:
|
||||
Author: =Auteur:
|
||||
Admin command to set player skin=Commande admin pour définir l'apparence du joueur
|
||||
's skin set to=, apparence définie pour
|
||||
Set player skin=Définir l'apparence du joueur
|
||||
Close=Fermer
|
||||
Skins=Skins
|
10
mods/skins/locale/skins.it.tr
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain: simple_skins
|
||||
|
||||
Select Player Skin:=Seleziona la skin del giocatore
|
||||
Name: =Nome:
|
||||
Author: =Autore:
|
||||
Admin command to set player skin=Comando di admin per impostare la skin del giocatore
|
||||
's skin set to=, la skin è impostata su
|
||||
Set player skin=Imposta la skin del giocatore
|
||||
Close=Chiudi
|
||||
Skins=Pelli
|
10
mods/skins/locale/skins.ms.tr
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain: simple_skins
|
||||
|
||||
Select Player Skin:=Pilih Kulit Pemain:
|
||||
Name: =Nama:
|
||||
Author: =Pencipta:
|
||||
Admin command to set player skin=Perintah pentadbir untuk menetapkan kulit pemain
|
||||
's skin set to= telah ditukarkan kulitnya kepada
|
||||
Set player skin=Tetapkan kulit pemain
|
||||
Close=Tutup
|
||||
Skins=Kulit
|
11
mods/skins/locale/template.txt
Normal file
@ -0,0 +1,11 @@
|
||||
# textdomain: simple_skins
|
||||
|
||||
Select Player Skin:=
|
||||
Name: =
|
||||
Author: =
|
||||
Admin command to set player skin=
|
||||
's skin set to=
|
||||
Set player skin=
|
||||
Close=
|
||||
Skins=
|
||||
[MOD] Simple Skins loaded=
|
2
mods/skins/meta/character_1.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Farmer",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_10.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Farm Girl",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_11.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Jerry",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_12.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Scary",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_13.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Cool Dude",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_14.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Knight",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_15.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Derp Dirt",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_16.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Ice",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_17.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Robot",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_18.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "King",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_19.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Diced",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_2.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Waffles",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_20.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Glitch",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_21.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Pink Camouflage",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_22.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Biker",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_23.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Jade",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_24.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Split",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_25.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Camouflage",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_26.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Earth",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_27.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Stone",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_28.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Lab Coat",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_29.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Skeleton",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_3.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Autumn",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_30.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Winter Boy",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_31.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Winter Girl",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_4.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Cubed",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_5.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Tux",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_6.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Cool Guy",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_7.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Cool Girl",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_8.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Retro",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_9.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Jim",
|
||||
author = "isaiah658",
|
2
mods/skins/meta/character_900.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "PICCORO",
|
||||
author = "none",
|
4
mods/skins/mod.conf
Normal file
@ -0,0 +1,4 @@
|
||||
name = skins
|
||||
depends = default, player_api
|
||||
optional_depends = sfinv, inventory_plus, intllib, unified_inventory
|
||||
description = SKIN manager mod, Simple_Skin modified mod that allow players to set their individual skins.
|
93
mods/skins/readme.md
Normal file
@ -0,0 +1,93 @@
|
||||
minetest mod Simple Skins
|
||||
=========================
|
||||
|
||||
Mod for skin appereance change of your player in a nice tab of your inventory
|
||||
|
||||
Information
|
||||
------------
|
||||
|
||||
This is a modification of origina Simple Skins mod, in sync with minenux project,
|
||||
is a mod that's so easy to use you'll wonder why it hasn't been
|
||||
done before... Just download and start to use it in your inventory.
|
||||
|
||||
Must be named `skins` and uses SfInv or Inventory Plus mods,
|
||||
and Unified Inventory if you use lasted original (master branch)
|
||||
version when available to allow players to select a skin/texture from the list.
|
||||
|
||||
![screenshot.jpg](screenshot.jpg)
|
||||
|
||||
Original forum https://forum.minetest.net/viewtopic.php?id=9100
|
||||
|
||||
Technical Information
|
||||
---------------------
|
||||
|
||||
This mod its more basic and minimalis, no preview and no download/upload, management,
|
||||
it target is to be light for huge servers and be minimal for better performance.
|
||||
|
||||
This version is fully compatible with 5.X and 4.X also 0.4.16 versions of minetest
|
||||
|
||||
Based on Zeg9's Skins mod originally from https://github.com/Zeg9/minetest-skins/ and
|
||||
with some help from PilzAdam. Also implements some minimal features backported from SkinDB
|
||||
like preview (disabled by default). The preview is autogenerated (2d), unless others mods.
|
||||
|
||||
#### Download
|
||||
|
||||
You can clone this repository in your minetest mods directory or in your game.
|
||||
|
||||
#### Depends
|
||||
|
||||
* default
|
||||
* sfinv (optional, autodetected)
|
||||
* player_api (newer version only)
|
||||
* inventory_plus (optional, autodetected)
|
||||
* unified_inventory (optional, autodetected)
|
||||
|
||||
#### Skin management
|
||||
|
||||
You can download a skin from skin database, set a new skin converted
|
||||
from others boxel games or create it from scrat.
|
||||
|
||||
* **Download a mt-skin** It uses skins from Addi's **MT-Skin-DB**
|
||||
skin database, currently at http://minetest.fensta.bplaced.net/
|
||||
* **Download a mc-skind** Uses minecraft 1.7 skins, for 1.8+ will need newer 5.X mt,
|
||||
and some images must crop it from 64x64 to 64x32.
|
||||
|
||||
To download a skin mt made or mc ones, just:
|
||||
|
||||
1. go to the web page skin, and download it, will get you a `png` file,
|
||||
2. put into the textures directory and rename it accordingly e.g `character_2.png`
|
||||
3. pop into the meta directory and make a new `character_2.txt` empty file
|
||||
4. fill the txt file with as described in [Structure and formats](#structure-and-formats)
|
||||
|
||||
If you use the skindb download tool, that already generates all
|
||||
the necessary files, with the requested names and formats. https://github.com/minetest-mods/skinsdb/tree/master/updater
|
||||
|
||||
#### Structure and formats
|
||||
|
||||
Each skin is made up of at least two files, a png file and a txt file,
|
||||
the "png file" is placed in the `textures` directory and
|
||||
the "txt file" in the `meta` directory.
|
||||
|
||||
the format of the txt file is:
|
||||
|
||||
```
|
||||
name = "Skin Name",
|
||||
author = "author that make the skin",
|
||||
```
|
||||
|
||||
|
||||
Change log:
|
||||
-----------
|
||||
|
||||
- 1.01- Replace all unlicensed skins with CC0 one's (many thanks isaiah658)
|
||||
- 1.0 - Added skin_limit setting to limit skins loaded, sanitized skin description
|
||||
- 0.9 - Added Unified Inventory support (thanks Opvolger)
|
||||
- 0.8 - Added player model preview when viewing formspec (Minetest 5.4 dev only)
|
||||
- 0.7 - Add some error checks, improve /setskin and tweak & tidy code
|
||||
- 0.6 - Updated to use Minetest 0.4.16 functions
|
||||
- 0.5 - Added compatibility with default sfinv inventory, disabled /skin command for now
|
||||
- 0.4 - Added /skin command to set player skin, no longer dependent on Inventory+, also /setskin command for server admin to set custom skins for player.
|
||||
- 0.3 - Now works with Minetest 0.4.10+
|
||||
- 0.2 - Added 3D_Armor mod compatibility
|
||||
- 0.1 - Added addi's changes to highlight selected skin on list (thanks)
|
||||
- 0.0 - Initial release
|
BIN
mods/skins/screenshot.jpg
Normal file
After Width: | Height: | Size: 82 KiB |
5
mods/skins/settingtypes.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# When true character model will appear in formspec with current skin as texture
|
||||
skins_preview (Simple Skins Preview) bool true
|
||||
|
||||
# Skin limit number to limit the number of skins read onto list
|
||||
skins_limit (Skin Limit) int 300
|
39
mods/skins/sfinv.lua
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
local S = skins.translate
|
||||
|
||||
|
||||
if skins.default_skin_tab then
|
||||
|
||||
sfinv.register_page("skins:skins", {title = S("Skins"),
|
||||
|
||||
get = function(self, player, context)
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
return sfinv.make_formspec(player, context,skins.formspec.main(name))
|
||||
end,
|
||||
|
||||
on_player_receive_fields = function(self, player, context, fields)
|
||||
|
||||
local event = minetest.explode_textlist_event(fields["skins_set"])
|
||||
|
||||
if event.type == "CHG" then
|
||||
|
||||
skins.event_CHG(event, player)
|
||||
|
||||
sfinv.override_page("skins:skins", {
|
||||
|
||||
get = function(self, player, context)
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
return sfinv.make_formspec(player, context,
|
||||
skins.formspec.main(name))
|
||||
end
|
||||
})
|
||||
|
||||
sfinv.set_player_inventory_formspec(player)
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
BIN
mods/skins/textures/character_1.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
mods/skins/textures/character_10.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
mods/skins/textures/character_11.png
Normal file
After Width: | Height: | Size: 239 B |
BIN
mods/skins/textures/character_12.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
mods/skins/textures/character_13.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
mods/skins/textures/character_14.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
mods/skins/textures/character_15.png
Normal file
After Width: | Height: | Size: 967 B |
BIN
mods/skins/textures/character_16.png
Normal file
After Width: | Height: | Size: 837 B |
BIN
mods/skins/textures/character_17.png
Normal file
After Width: | Height: | Size: 235 B |
BIN
mods/skins/textures/character_18.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
mods/skins/textures/character_19.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
mods/skins/textures/character_2.png
Normal file
After Width: | Height: | Size: 247 B |
BIN
mods/skins/textures/character_20.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
mods/skins/textures/character_21.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
mods/skins/textures/character_22.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
mods/skins/textures/character_23.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
mods/skins/textures/character_24.png
Normal file
After Width: | Height: | Size: 210 B |
BIN
mods/skins/textures/character_25.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
mods/skins/textures/character_26.png
Normal file
After Width: | Height: | Size: 236 B |
BIN
mods/skins/textures/character_27.png
Normal file
After Width: | Height: | Size: 389 B |
BIN
mods/skins/textures/character_28.png
Normal file
After Width: | Height: | Size: 376 B |
BIN
mods/skins/textures/character_29.png
Normal file
After Width: | Height: | Size: 197 B |
BIN
mods/skins/textures/character_3.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
mods/skins/textures/character_30.png
Normal file
After Width: | Height: | Size: 319 B |
BIN
mods/skins/textures/character_31.png
Normal file
After Width: | Height: | Size: 675 B |
BIN
mods/skins/textures/character_4.png
Normal file
After Width: | Height: | Size: 202 B |
BIN
mods/skins/textures/character_5.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/skins/textures/character_6.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
mods/skins/textures/character_7.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
mods/skins/textures/character_8.png
Normal file
After Width: | Height: | Size: 211 B |
BIN
mods/skins/textures/character_9.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/skins/textures/character_900.png
Normal file
After Width: | Height: | Size: 316 B |
BIN
mods/skins/textures/inventory_plus_skins.png
Normal file
After Width: | Height: | Size: 518 B |
48
mods/skins/unified_inventory.lua
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
local S = skins.translate
|
||||
|
||||
|
||||
unified_inventory.register_button("skins", {
|
||||
type = "image",
|
||||
image = "inventory_plus_skins.png",
|
||||
tooltip = S("Skins")
|
||||
})
|
||||
|
||||
|
||||
unified_inventory.register_page("skins", {
|
||||
|
||||
get_formspec = function(player, perplayer_formspec)
|
||||
|
||||
local formheadery = perplayer_formspec.form_header_y
|
||||
local F = minetest.formspec_escape
|
||||
local player_name = player:get_player_name()
|
||||
local formspec = "label[0," .. formheadery .. ";" .. F(S("Skins")) .."]"
|
||||
|
||||
formspec = formspec .. "listcolors[#00000000;#00000000]"
|
||||
formspec = formspec .. skins.formspec.main(player_name)
|
||||
|
||||
return {formspec = formspec, draw_inventory = false}
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
if skins.sfinv then
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if fields.skins then
|
||||
unified_inventory.set_inventory_formspec(player, "skins")
|
||||
end
|
||||
|
||||
local event = minetest.explode_textlist_event(fields["skins_set"])
|
||||
|
||||
if event.type == "CHG" then
|
||||
|
||||
skins.event_CHG(event, player)
|
||||
|
||||
unified_inventory.set_inventory_formspec(player, "skins")
|
||||
end
|
||||
end
|
||||
end)
|