Partial fix for not working formspecs in MCL
This commit is contained in:
parent
6c62b8d4a3
commit
71618b2f3f
@ -461,6 +461,17 @@ if industrialtest.mclAvailable then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
-- FIXME: Formspecs when used with MCL are misaligned, to fix that and also preserve compatibilty
|
||||||
|
-- with MTG MCL has to stop using legacy formspec coordinates ~mrkubax10
|
||||||
|
industrialtest.formspecVersion=function()
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
industrialtest.formspecList=function(ctx,name,x,y,w,h)
|
||||||
|
return "list["..ctx..";"..name..";"..x..","..y..";"..w..","..h.."]"..mcl_formspec.get_itemslot_bg(x,y,w,h)
|
||||||
|
end
|
||||||
|
industrialtest.formspecPlayerInv=function()
|
||||||
|
return "list[current_player;main;0.5,5.5;9,3;9]"..mcl_formspec.get_itemslot_bg(0.5,5.5,9,3).."list[current_player;main;0.5,8.74;9,1]"..mcl_formspec.get_itemslot_bg(0.5,8.74,9,1)
|
||||||
|
end
|
||||||
-- assign element keys for elements that are required later
|
-- assign element keys for elements that are required later
|
||||||
industrialtest.elementKeys.stick="mcl_core:stick"
|
industrialtest.elementKeys.stick="mcl_core:stick"
|
||||||
|
|
||||||
@ -609,6 +620,15 @@ elseif industrialtest.mtgAvailable then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
industrialtest.formspecVersion=function()
|
||||||
|
return "formspec_version[4]"
|
||||||
|
end
|
||||||
|
industrialtest.formspecList=function(ctx,name,x,y,w,h)
|
||||||
|
return "list["..ctx..";"..name..";"..x..","..y..";"..w..","..h.."]"
|
||||||
|
end
|
||||||
|
industrialtest.formspecPlayerInv=function()
|
||||||
|
return "list[current_player;main;0.5,6.25;8,1]list[current_player;main;0.5,7.5;8,3;8]"
|
||||||
|
end
|
||||||
industrialtest.elementKeys.tinIngot="default:tin_ingot"
|
industrialtest.elementKeys.tinIngot="default:tin_ingot"
|
||||||
industrialtest.elementKeys.bronzeIngot="default:bronze_ingot"
|
industrialtest.elementKeys.bronzeIngot="default:bronze_ingot"
|
||||||
industrialtest.elementKeys.stick="default:stick"
|
industrialtest.elementKeys.stick="default:stick"
|
||||||
|
@ -19,16 +19,15 @@ local S=minetest.get_translator("industrialtest")
|
|||||||
-- Generators
|
-- Generators
|
||||||
local function generatorFormspec(fuelPercent)
|
local function generatorFormspec(fuelPercent)
|
||||||
local formspec={
|
local formspec={
|
||||||
"formspec_version[4]",
|
industrialtest.formspecVersion(),
|
||||||
"size[10.8,12]",
|
"size[10.8,12]",
|
||||||
"label[0.5,0.5;"..S("Generator").."]",
|
"label[0.5,0.5;"..S("Generator").."]",
|
||||||
"list[context;charged;4.9,1.8;1,1]",
|
industrialtest.formspecList("context","charged",4.9,1.8,1,1),
|
||||||
"listring[context;charged]",
|
"listring[context;charged]",
|
||||||
"image[4.9,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]",
|
"image[4.9,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]",
|
||||||
"list[context;fuel;4.9,3.9;1,1]",
|
industrialtest.formspecList("context","fuel",4.9,3.9,1,1),
|
||||||
"listring[context;fuel]",
|
"listring[context;fuel]",
|
||||||
"list[current_player;main;0.5,6.25;8,1;]",
|
industrialtest.formspecPlayerInv()
|
||||||
"list[current_player;main;0.5,7.5;8,3;8]"
|
|
||||||
}
|
}
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user