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
|
2016-09-05 19:20:16 +02:00
|
|
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
|
|
|
|
2017-02-09 23:06:25 +01:00
|
|
|
skins = {}
|
2017-06-15 18:19:47 +02:00
|
|
|
skins.modpath = minetest.get_modpath(minetest.get_current_modname())
|
2017-02-09 23:06:25 +01:00
|
|
|
skins.default = "character_1"
|
2014-03-17 06:26:58 +01:00
|
|
|
|
2017-02-09 23:06:25 +01:00
|
|
|
skins.type = { SPRITE=0, MODEL=1, ERROR=99 }
|
|
|
|
skins.get_type = function(texture)
|
|
|
|
if not skins.is_skin(texture) then
|
|
|
|
return skins.type.ERROR
|
2014-07-23 19:06:46 +02:00
|
|
|
end
|
2017-02-09 23:06:25 +01:00
|
|
|
return skins.type.MODEL
|
2014-07-23 19:06:46 +02:00
|
|
|
end
|
|
|
|
|
2017-02-09 23:06:25 +01:00
|
|
|
skins.is_skin = function(texture)
|
2014-07-23 13:46:42 +02:00
|
|
|
if not texture then
|
|
|
|
return false
|
2014-03-17 06:26:58 +01:00
|
|
|
end
|
2017-02-09 23:06:25 +01:00
|
|
|
if not skins.meta[texture] then
|
2014-07-23 13:46:42 +02:00
|
|
|
return false
|
2014-03-17 06:26:58 +01:00
|
|
|
end
|
2014-07-23 13:46:42 +02:00
|
|
|
return true
|
2014-03-17 06:26:58 +01:00
|
|
|
end
|
|
|
|
|
2017-02-09 23:06:25 +01:00
|
|
|
dofile(skins.modpath.."/skinlist.lua")
|
|
|
|
dofile(skins.modpath.."/players.lua")
|
2014-03-17 06:26:58 +01:00
|
|
|
|
2017-02-09 23:06:25 +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
|