updated mesecons, switched to cheapie's player_textures fork

master
Vanessa Ezekowitz 2017-02-13 14:27:23 -05:00
parent aa601daf67
commit c66f03b6fe
5 changed files with 1024 additions and 1003 deletions

File diff suppressed because it is too large Load Diff

24
player_textures/LICENSE Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <http://unlicense.org/>

1
player_textures/README Normal file
View File

@ -0,0 +1 @@
Works pretty much the same as every other version of this mod. Put skins in the textures directory, with the name following the pattern "player_%s.png", where %s is the player name.

View File

@ -1 +1 @@
default
default?

View File

@ -1,27 +1,25 @@
local mod_path = minetest.get_modpath(minetest.get_current_modname())
local got_tex = {}
local got_gdl = minetest.get_dir_list
if got_gdl then
for _, name in pairs(minetest.get_dir_list(mod_path.."/textures")) do
if name:sub(1, 7) == "player_" then
local player_name = name:sub(8):match("(.+)%.")
got_tex[player_name] = true
end
local function pivot(table)
local ret = {}
for k,v in pairs(table) do
ret[v] = k
end
return ret
end
local textures = pivot(minetest.get_dir_list(minetest.get_modpath("player_textures")..DIR_DELIM.."textures"))
local function applyskin(player)
local name = player:get_player_name()
if textures[string.format("player_%s.png",name)] then
if minetest.get_modpath("default") then
default.player_set_textures(player,string.format("[combine:64x32:0,0=player_%s.png",name))
end
player:set_properties({textures={string.format("[combine:64x32:0,0=player_%s.png",name)}})
end
player:set_properties({visual="mesh",visual_size={x=1,y=1},mesh="character.b3d"})
end
minetest.register_on_joinplayer(function(player)
local player_name = player:get_player_name()
local tex = "player_"..player_name..".png"
if got_gdl then
if not got_tex[player_name] then return end
else
if not io.open(mod_path.."/textures/"..tex) then
return
end
end
player:set_properties({textures = {tex}})
applyskin(player)
minetest.after(10,applyskin,player)
end)