skinsdb/init.lua

36 lines
1.1 KiB
Lua
Raw Normal View History

2014-03-17 06:26:58 +01:00
-- Unified Skins for Minetest - based modified Bags from unfied_inventory and skins from inventory_plus
-- Copyright (c) 2012 cornernote, Dean Montgomery
2017-06-15 18:19:47 +02:00
-- Rework 2017 by bell07
2014-03-17 06:26:58 +01:00
-- License: GPLv3
-- Boilerplate to support localized strings if intllib mod is installed.
skins = {}
2017-06-15 18:19:47 +02:00
skins.modpath = minetest.get_modpath(minetest.get_current_modname())
skins.default = "character_1"
2014-03-17 06:26:58 +01:00
dofile(skins.modpath.."/skin_meta_api.lua")
dofile(skins.modpath.."/api.lua")
dofile(skins.modpath.."/skinlist.lua")
2014-03-17 06:26:58 +01:00
-- Unified inventory page/integration
if minetest.get_modpath("unified_inventory") then
dofile(skins.modpath.."/unified_inventory_page.lua")
2014-03-17 06:26:58 +01:00
end
2017-06-15 17:18:51 +02:00
if minetest.get_modpath("sfinv") then
dofile(skins.modpath.."/sfinv_page.lua")
end
2017-06-16 23:00:36 +02:00
-- 3d_armor compatibility
if minetest.global_exists("armor") then
armor.get_player_skin = function(self, name)
local skin = skins.get_player_skin(minetest.get_player_by_name(name))
return skin:get_meta("_key") --3d_armor adds a ".png" but it should be compatible in most cases
end
armor.get_preview = function(self, name)
local skin = skins.get_player_skin(minetest.get_player_by_name(name))
return skin:get_preview()
2017-06-16 23:00:36 +02:00
end
end