Bugfix
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*~
|
||||
.previews/output
|
||||
.previews/blender_out
|
||||
.previews/pngcrush_output
|
BIN
.previews/skin_previews.blend
Normal file
2
depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
inventory_plus
|
176
init.lua
Normal file
@ -0,0 +1,176 @@
|
||||
-- Simple Skins mod for minetest
|
||||
-- Adds a skin gallery to the inventory, using inventory_plus
|
||||
-- Released by TenPlus1 and based on Zeg9's code under WTFPL
|
||||
|
||||
skins = {}
|
||||
skins.skins = {}
|
||||
skins.modpath = minetest.get_modpath("simple_skins")
|
||||
|
||||
-- Load Skins List
|
||||
|
||||
skins.list = {}
|
||||
skins.add = function(skin)
|
||||
table.insert(skins.list,skin)
|
||||
end
|
||||
|
||||
local id = 1
|
||||
while true do
|
||||
local f = io.open(skins.modpath.."/textures/character_"..id..".png")
|
||||
if (not f) then break end
|
||||
f:close()
|
||||
skins.add("character_"..id)
|
||||
id = id +1
|
||||
end
|
||||
|
||||
-- Load Metadata
|
||||
|
||||
skins.meta = {}
|
||||
for _, i in ipairs(skins.list) do
|
||||
skins.meta[i] = {}
|
||||
local f = io.open(skins.modpath.."/meta/"..i..".txt")
|
||||
local data = nil
|
||||
if f then
|
||||
data = minetest.deserialize("return {"..f:read('*all').."}")
|
||||
f:close()
|
||||
end
|
||||
data = data or {}
|
||||
skins.meta[i].name = data.name or ""
|
||||
skins.meta[i].author = data.author or ""
|
||||
end
|
||||
|
||||
-- Player Load/Save Routines
|
||||
|
||||
skins.file = minetest.get_worldpath() .. "/simple_skins.mt"
|
||||
|
||||
skins.load = function()
|
||||
local input = io.open(skins.file, "r")
|
||||
local data = nil
|
||||
if input then
|
||||
data = input:read('*all')
|
||||
end
|
||||
if data and data ~= "" then
|
||||
local lines = string.split(data,"\n")
|
||||
for _, line in ipairs(lines) do
|
||||
data = string.split(line, ' ', 2)
|
||||
skins.skins[data[1]] = data[2]
|
||||
end
|
||||
io.close(input)
|
||||
end
|
||||
end
|
||||
|
||||
skins.load()
|
||||
|
||||
skins.save = function()
|
||||
local output = io.open(skins.file,'w')
|
||||
for name, skin in pairs(skins.skins) do
|
||||
if name and skin then
|
||||
output:write(name .. " " .. skin .. "\n")
|
||||
end
|
||||
end
|
||||
io.close(output)
|
||||
end
|
||||
|
||||
-- Skins Selection Page
|
||||
|
||||
skins.formspec = {}
|
||||
skins.formspec.main = function(name)
|
||||
|
||||
local selected = 1; --just to set the default
|
||||
|
||||
local formspec = "size[7,7]".."bgcolor[#08080822;true]"
|
||||
.. "button[0,.75;2,.5;main;Back]"
|
||||
.. "label[.5,2;Select Player Skin:]"
|
||||
.. "textlist[.5,2.5;5.8,4;skins_set;"
|
||||
|
||||
for i, v in ipairs(skins.list) do
|
||||
formspec = formspec .. skins.meta[v].name .. ","
|
||||
if skins.skins[name] == skins.list[i] then -- if the current skin of the player the skin of the loop then
|
||||
selected = i; --save the index
|
||||
end
|
||||
end
|
||||
|
||||
formspec = formspec ..";"..selected..";true]";--so it can be used here to highlight the selected skin.
|
||||
|
||||
local meta = skins.meta[skins.skins[name]]
|
||||
if meta then
|
||||
if meta.name then
|
||||
formspec = formspec .. "label[2,.5;Name: "..meta.name.."]"
|
||||
end
|
||||
if meta.author then
|
||||
formspec = formspec .. "label[2,1;Author: "..meta.author.."]"
|
||||
end
|
||||
end
|
||||
|
||||
return formspec
|
||||
end
|
||||
|
||||
-- Update Player Skin
|
||||
|
||||
skins.update_player_skin = function(player)
|
||||
--name = player:get_player_name()
|
||||
player:set_properties({
|
||||
visual = "mesh",
|
||||
textures = {skins.skins[player:get_player_name()]..".png"},
|
||||
visual_size = {x=1, y=1},
|
||||
})
|
||||
skins.save()
|
||||
end
|
||||
|
||||
-- Load Skin on Join
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if not skins.skins[player:get_player_name()] then
|
||||
skins.skins[player:get_player_name()] = "character_1"
|
||||
end
|
||||
skins.update_player_skin(player)
|
||||
inventory_plus.register_button(player,"skins","Skin")
|
||||
end)
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||
if fields.skins then
|
||||
inventory_plus.set_inventory_formspec(player,skins.formspec.main(player:get_player_name()))
|
||||
end
|
||||
|
||||
--if formname ~= "skins" then return end
|
||||
local event = minetest.explode_textlist_event(fields["skins_set"])
|
||||
|
||||
if event.type == "CHG" then
|
||||
|
||||
local index = event.index
|
||||
|
||||
if skins.list[index] then
|
||||
skins.skins[player:get_player_name()] = skins.list[index]
|
||||
skins.update_player_skin(player)
|
||||
local name = player:get_player_name()
|
||||
inventory_plus.set_inventory_formspec(player,skins.formspec.main(player:get_player_name()))
|
||||
|
||||
if minetest.get_modpath("3d_armor") then
|
||||
armor.textures[player:get_player_name()].skin = skins.list[index]..".png"
|
||||
minetest.after(0, function(player)
|
||||
local skin = armor:get_player_skin(name)
|
||||
armor.textures[name].skin = skin..".png"
|
||||
armor:set_player_armor(player)
|
||||
end, player)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_chatcommand("setskin", {
|
||||
params = "<user> <skin>",
|
||||
description = "Admin command to set user skin",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
|
||||
if not param or param == "" then return end
|
||||
|
||||
local user, skin = string.match(param, "([^ ]+) (-?%d+)")
|
||||
|
||||
if not user or not skin then return end
|
||||
|
||||
skins.skins[user] = "character_"..tonumber(skin)
|
||||
-- skins.update_player_skin(user)
|
||||
skins.save()
|
||||
|
||||
end,
|
||||
})
|
4
meta/character_1.txt
Normal file
@ -0,0 +1,4 @@
|
||||
name = "Sam",
|
||||
author = "Jordach",
|
||||
description = "The default skin.",
|
||||
comment = "Sam Ain't Minecraft",
|
2
meta/character_10.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Assassin",
|
||||
author = "jmf",
|
2
meta/character_11.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Harry",
|
||||
author = "jmf",
|
2
meta/character_12.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Bob",
|
||||
author = "Chinchow",
|
2
meta/character_13.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Jannette",
|
||||
author = "Chinchow",
|
2
meta/character_14.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Sheriff",
|
||||
author = "Chinchow",
|
2
meta/character_15.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Sepia Sam",
|
||||
author = "Hybrid Dog",
|
2
meta/character_16.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Hybrid Sam",
|
||||
author = "Hybrid Dog",
|
2
meta/character_17.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Original Sam",
|
||||
author = "Jordach",
|
2
meta/character_18.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Unnamed",
|
||||
author = "Hybrid Dog",
|
3
meta/character_19.txt
Normal file
@ -0,0 +1,3 @@
|
||||
name = "VanessaE",
|
||||
author = "Jordach",
|
||||
comment = "Actually based from an old picture",
|
3
meta/character_2.txt
Normal file
@ -0,0 +1,3 @@
|
||||
name = "Zeg9",
|
||||
author = "Zeg9",
|
||||
description = "My own skin.",
|
2
meta/character_20.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Female Sam",
|
||||
author = "Jordach",
|
2
meta/character_21.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Battlefield 3 Soldier",
|
||||
author = "Jordach",
|
2
meta/character_22.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Smooth Sam",
|
||||
author = "Jordach",
|
3
meta/character_23.txt
Normal file
@ -0,0 +1,3 @@
|
||||
name = "Celeron55",
|
||||
author = "Jordach",
|
||||
comment = "Based on a picture from the wiki.",
|
2
meta/character_24.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Tuxedo Sam",
|
||||
author = "Jordach",
|
2
meta/character_25.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Iron Man MK. 7",
|
||||
author = "Jordach",
|
2
meta/character_26.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Jordach",
|
||||
author = "Jordach",
|
2
meta/character_27.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Max",
|
||||
author = "Stuart Jones",
|
2
meta/character_28.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Slenderman",
|
||||
author = "prof_turbo",
|
2
meta/character_29.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Strange Killer",
|
||||
author = "prof_turbo",
|
2
meta/character_3.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Alien",
|
||||
author = "jmf",
|
2
meta/character_30.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "jojoa1997",
|
||||
author = "jojoa1997",
|
2
meta/character_31.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "DrakeOfDuty",
|
||||
author = "jmfApprentice Prince",
|
2
meta/character_32.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Katniss Everdeen",
|
||||
author = "agapl00",
|
2
meta/character_33.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Skydoesminecraft Girl",
|
||||
author = "oleg100607",
|
2
meta/character_34.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Lizardman",
|
||||
author = "Nudisohn",
|
2
meta/character_35.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Snoe Edit",
|
||||
author = "Puppieslovebudder",
|
2
meta/character_36.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Valentines Day skin-chikk",
|
||||
author = "chikk7490",
|
2
meta/character_37.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Tabby Cat",
|
||||
author = "Roobus",
|
2
meta/character_38.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Rainbow at Night",
|
||||
author = "SkinKontor",
|
2
meta/character_39.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Joker",
|
||||
author = "Teco",
|
2
meta/character_4.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Soldier",
|
||||
author = "jmf",
|
2
meta/character_40.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Mario Bros",
|
||||
author = "nachocapo51",
|
2
meta/character_41.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Demon Girl",
|
||||
author = "groovyron",
|
2
meta/character_42.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Piggy Better",
|
||||
author = "craftboy8922",
|
2
meta/character_43.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Sweater Girl",
|
||||
author = "shortyshore",
|
2
meta/character_44.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Shin-chan",
|
||||
author = "ReMeVN",
|
2
meta/character_45.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Cheech",
|
||||
author = "OreoCrakcer",
|
2
meta/character_46.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Megaman X",
|
||||
author = "Agumon",
|
2
meta/character_47.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Goblin",
|
||||
author = "GabrielFA",
|
2
meta/character_48.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Sexy Black Man",
|
||||
author = "TheBizzz",
|
2
meta/character_49.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Scientise",
|
||||
author = "cats12",
|
2
meta/character_5.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "John",
|
||||
author = "jmf",
|
2
meta/character_50.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Ash Ketchum",
|
||||
author = "Leostereo",
|
2
meta/character_51.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Link",
|
||||
author = "mastersword",
|
2
meta/character_52.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Elvis Presley",
|
||||
author = "chrispig951",
|
2
meta/character_53.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Bender",
|
||||
author = "BrohanGamer",
|
2
meta/character_54.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Cheshire Cat",
|
||||
author = "Kefka",
|
2
meta/character_55.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Casual Girl",
|
||||
author = "Waffle Toaster",
|
2
meta/character_56.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Darth Maul",
|
||||
author = "aphung2",
|
2
meta/character_57.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Storm Trooper",
|
||||
author = "xvminer",
|
2
meta/character_58.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Monster",
|
||||
author = "crazyine10",
|
2
meta/character_59.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Skull",
|
||||
author = "Redbones",
|
2
meta/character_6.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Ninja",
|
||||
author = "jmf",
|
2
meta/character_60.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Old Black Assassin",
|
||||
author = "InfiltratorHero",
|
2
meta/character_61.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Girl Jock Skin",
|
||||
author = "logan5232",
|
2
meta/character_62.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Batman",
|
||||
author = "Halucid",
|
2
meta/character_63.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Girl",
|
||||
author = "unknown",
|
2
meta/character_64.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Cute Gothic Girl",
|
||||
author = "BlahBlahBlahBlah",
|
2
meta/character_65.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Stitch (HD)",
|
||||
author = "unknown",
|
2
meta/character_66.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Sympathy (HD)",
|
||||
author = "unknown",
|
2
meta/character_67.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Fox Onesie",
|
||||
author = "MegaWolf122",
|
2
meta/character_68.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Daft Punk",
|
||||
author = "Kaychain",
|
2
meta/character_69.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Guy Manual (Dart Punk)",
|
||||
author = "kvSketch",
|
2
meta/character_7.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Oerkki",
|
||||
author = "jmf",
|
2
meta/character_70.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Thomas Bangalter (Daft Punk)",
|
||||
author = "kvSketch",
|
2
meta/character_71.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Pika Girl",
|
||||
author = "Sugarbun",
|
2
meta/character_72.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Pug",
|
||||
author = "LordTrilobite",
|
2
meta/character_73.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Nyan Cat Girl",
|
||||
author = "Unknown",
|
2
meta/character_8.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Tux",
|
||||
author = "jmf",
|
2
meta/character_9.txt
Normal file
@ -0,0 +1,2 @@
|
||||
name = "Black belt",
|
||||
author = "jmf",
|
BIN
textures/character_1.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/character_10.png
Normal file
After Width: | Height: | Size: 382 B |
BIN
textures/character_11.png
Normal file
After Width: | Height: | Size: 373 B |
BIN
textures/character_12.png
Normal file
After Width: | Height: | Size: 534 B |
BIN
textures/character_13.png
Normal file
After Width: | Height: | Size: 493 B |
BIN
textures/character_14.png
Normal file
After Width: | Height: | Size: 362 B |
BIN
textures/character_15.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/character_16.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/character_17.png
Normal file
After Width: | Height: | Size: 951 B |
BIN
textures/character_18.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
textures/character_19.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/character_2.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/character_20.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/character_21.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/character_22.png
Normal file
After Width: | Height: | Size: 426 B |
BIN
textures/character_23.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/character_24.png
Normal file
After Width: | Height: | Size: 928 B |
BIN
textures/character_25.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/character_26.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/character_27.png
Normal file
After Width: | Height: | Size: 938 B |
BIN
textures/character_28.png
Normal file
After Width: | Height: | Size: 1022 B |
BIN
textures/character_29.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/character_3.png
Normal file
After Width: | Height: | Size: 293 B |