mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2025-02-03 19:20:21 +01:00
Merge remote-tracking branch 'origin/master' into HEAD
This commit is contained in:
commit
abc3df86e3
11
.github/workflows/build.yml
vendored
Normal file
11
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
on: [push, pull_request]
|
||||||
|
name: build
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: lint
|
||||||
|
uses: Roang-zero1/factorio-mod-luacheck@master
|
||||||
|
with:
|
||||||
|
luacheckrc_url: ""
|
13
.luacheckrc
Normal file
13
.luacheckrc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
unused_args = false
|
||||||
|
allow_defined_top = true
|
||||||
|
max_line_length = 999
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
"minetest", "unified_inventory", "core",
|
||||||
|
"player_api", "clothing", "armor", "sfinv",
|
||||||
|
}
|
||||||
|
|
||||||
|
read_globals = {
|
||||||
|
string = {fields = {"split", "trim"}},
|
||||||
|
table = {fields = {"copy", "getn"}},
|
||||||
|
}
|
3
API.md
3
API.md
@ -59,7 +59,8 @@ Could be redefined for dynamic texture generation
|
|||||||
Set the hand node to be used with this skin
|
Set the hand node to be used with this skin
|
||||||
|
|
||||||
## skin:set_hand_from_texture()
|
## skin:set_hand_from_texture()
|
||||||
Register and set hand node based on skin texture
|
Register and set hand node based on skin texture.
|
||||||
|
Uses different model depending on get_meta("format") ("1.0" or "1.8")
|
||||||
Only works on mod load
|
Only works on mod load
|
||||||
|
|
||||||
## skin:get_hand()
|
## skin:get_hand()
|
||||||
|
@ -57,7 +57,7 @@ function skins.get_skin_selection_formspec(player, context, perplayer_formspec)
|
|||||||
local yspc = 2
|
local yspc = 2
|
||||||
local skinwidth = 1
|
local skinwidth = 1
|
||||||
local skinheight = 2
|
local skinheight = 2
|
||||||
local xscale = 1
|
local xscale = 1 -- luacheck: ignore
|
||||||
local btn_y = 8.15
|
local btn_y = 8.15
|
||||||
local drop_y = 8
|
local drop_y = 8
|
||||||
local btn_width = 1
|
local btn_width = 1
|
||||||
@ -104,7 +104,7 @@ function skins.get_skin_selection_formspec(player, context, perplayer_formspec)
|
|||||||
|
|
||||||
local page = context.skins_page
|
local page = context.skins_page
|
||||||
local formspec = ""
|
local formspec = ""
|
||||||
|
|
||||||
for i = (page-1)*maxdisp+1, page*maxdisp do
|
for i = (page-1)*maxdisp+1, page*maxdisp do
|
||||||
local skin = context.skins_list[i]
|
local skin = context.skins_list[i]
|
||||||
if not skin then
|
if not skin then
|
||||||
|
20
locale/skinsdb.pt_BR.tr
Normal file
20
locale/skinsdb.pt_BR.tr
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# textdomain: skinsdb
|
||||||
|
|
||||||
|
Raw texture=Textura crua
|
||||||
|
Name=Nome
|
||||||
|
Author=Autor
|
||||||
|
Change=Mudar
|
||||||
|
Page=Página
|
||||||
|
License=Licença
|
||||||
|
Description=Descrição
|
||||||
|
Show, list or set player's skin=Mostrar, listar ou definir a skin do jogador
|
||||||
|
Player not found=Jogador não encontrado
|
||||||
|
unknown command=Comando desconhecido
|
||||||
|
see /help skinsdb for supported parameters= consulte /help skinsdb para obter os parâmetros suportados
|
||||||
|
skin set to=Aparência definida para
|
||||||
|
invalid skin=Aparência inválida
|
||||||
|
unknown parameter=parâmetro desconhecido
|
||||||
|
unknown skin=Aparência desconhecida
|
||||||
|
Downloads thespecified range of skins and shuts down the server= Baixa o intervalo especificado de capas e desliga o servidor
|
||||||
|
Skins=Aparência
|
||||||
|
Requires skin key=Requer chave de aparência
|
BIN
models/skinsdb_hand_18.b3d
Normal file
BIN
models/skinsdb_hand_18.b3d
Normal file
Binary file not shown.
BIN
models/skinsdb_hand_18.blend
Normal file
BIN
models/skinsdb_hand_18.blend
Normal file
Binary file not shown.
@ -69,7 +69,11 @@ function skin_class:set_hand_from_texture()
|
|||||||
hand_def.wield_scale = {x=1,y=1,z=1}
|
hand_def.wield_scale = {x=1,y=1,z=1}
|
||||||
hand_def.paramtype = "light"
|
hand_def.paramtype = "light"
|
||||||
hand_def.drawtype = "mesh"
|
hand_def.drawtype = "mesh"
|
||||||
hand_def.mesh = "skinsdb_hand.b3d"
|
if(self:get_meta("format") == "1.0") then
|
||||||
|
hand_def.mesh = "skinsdb_hand.b3d"
|
||||||
|
else
|
||||||
|
hand_def.mesh = "skinsdb_hand_18.b3d"
|
||||||
|
end
|
||||||
hand_def.use_texture_alpha = ALPHA_CLIP
|
hand_def.use_texture_alpha = ALPHA_CLIP
|
||||||
minetest.register_node(hand, hand_def)
|
minetest.register_node(hand, hand_def)
|
||||||
self:set_hand(hand)
|
self:set_hand(hand)
|
||||||
@ -221,6 +225,6 @@ end
|
|||||||
function skin_class:is_applicable_for_player(playername)
|
function skin_class:is_applicable_for_player(playername)
|
||||||
local assigned_player = self:get_meta("playername")
|
local assigned_player = self:get_meta("playername")
|
||||||
return assigned_player == nil or assigned_player == true or
|
return assigned_player == nil or assigned_player == true or
|
||||||
playername and (minetest.check_player_privs(playername, {server=true}) or
|
playername and (minetest.check_player_privs(playername, {server=true}) or
|
||||||
assigned_player:lower() == playername:lower())
|
assigned_player:lower() == playername:lower())
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local skins_dir_list = minetest.get_dir_list(skins.modpath.."/textures")
|
local skins_dir_list = minetest.get_dir_list(skins.modpath.."/textures")
|
||||||
|
|
||||||
for _, fn in pairs(skins_dir_list) do
|
for _, fn in pairs(skins_dir_list) do
|
||||||
local name, sort_id, assignment, is_preview, playername
|
local name, sort_id, is_preview, playername
|
||||||
local nameparts = string.gsub(fn, "[.]", "_"):split("_")
|
local nameparts = string.gsub(fn, "[.]", "_"):split("_")
|
||||||
|
|
||||||
-- check allowed prefix and file extension
|
-- check allowed prefix and file extension
|
||||||
@ -51,9 +51,7 @@ for _, fn in pairs(skins_dir_list) do
|
|||||||
local skin_format = skins.get_skin_format(file)
|
local skin_format = skins.get_skin_format(file)
|
||||||
skin_obj:set_meta("format", skin_format)
|
skin_obj:set_meta("format", skin_format)
|
||||||
file:close()
|
file:close()
|
||||||
if skin_format == "1.0" then
|
skin_obj:set_hand_from_texture()
|
||||||
skin_obj:set_hand_from_texture()
|
|
||||||
end
|
|
||||||
file = io.open(skins.modpath.."/meta/"..name..".txt", "r")
|
file = io.open(skins.modpath.."/meta/"..name..".txt", "r")
|
||||||
if file then
|
if file then
|
||||||
local data = string.split(file:read("*all"), "\n", 3)
|
local data = string.split(file:read("*all"), "\n", 3)
|
||||||
|
@ -115,7 +115,7 @@ internal.get_pages_count = function(callback, ...)
|
|||||||
callback(math.ceil(list.pages / 20), unpack(vars))
|
callback(math.ceil(list.pages / 20), unpack(vars))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Function to fetch a range of pages
|
-- Function to fetch a range of pages
|
||||||
internal.fetch_function = function(pages_total, start_page, len)
|
internal.fetch_function = function(pages_total, start_page, len)
|
||||||
start_page = math.max(start_page, 1)
|
start_page = math.max(start_page, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user