forked from mtcontrib/3d_armor
Improve get_armor_formspec
This commit is contained in:
parent
5911447048
commit
4083782246
@ -288,15 +288,15 @@ armor.get_preview = function(self, name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
armor.get_armor_formspec = function(self, name, listring)
|
armor.get_armor_formspec = function(self, name, listring)
|
||||||
if not armor.def[name] or not armor.textures[name] then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
local formspec = armor.formspec..
|
local formspec = armor.formspec..
|
||||||
"list[detached:"..name.."_armor;armor;0,0.5;2,3;]"
|
"list[detached:"..name.."_armor;armor;0,0.5;2,3;]"
|
||||||
if listring == true then
|
if listring == true then
|
||||||
formspec = formspec.."listring[current_player;main]"..
|
formspec = formspec.."listring[current_player;main]"..
|
||||||
"listring[detached:"..name.."_armor;armor]"
|
"listring[detached:"..name.."_armor;armor]"
|
||||||
end
|
end
|
||||||
|
if not armor.def[name] or not armor.textures[name] then
|
||||||
|
return formspec
|
||||||
|
end
|
||||||
formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
|
formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
|
||||||
formspec = formspec:gsub("armor_level", armor.def[name].level)
|
formspec = formspec:gsub("armor_level", armor.def[name].level)
|
||||||
for _, attr in pairs(self.attributes) do
|
for _, attr in pairs(self.attributes) do
|
||||||
|
Loading…
Reference in New Issue
Block a user