mirror of
https://github.com/adrido/darkage.git
synced 2025-01-09 09:20:19 +01:00
update Formspec of box and shelf to fit into minetest_game
This commit is contained in:
parent
15ec997551
commit
e4d0438bf4
@ -18,6 +18,16 @@ minetest.register_node("darkage:chain", {
|
|||||||
groups = {snappy=1,cracky=2,oddly_breakable_by_hand=2},
|
groups = {snappy=1,cracky=2,oddly_breakable_by_hand=2},
|
||||||
legacy_wallmounted = true
|
legacy_wallmounted = true
|
||||||
})
|
})
|
||||||
|
local box_formspec = [[
|
||||||
|
size[8,9]
|
||||||
|
list[context;main;0,0.3;8,4;]
|
||||||
|
list[current_player;main;0,4.85;8,1;]
|
||||||
|
list[current_player;main;0,6.08;8,3;8]
|
||||||
|
listring[context;main]
|
||||||
|
listring[current_player;main]
|
||||||
|
]].. darkage.formbg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("darkage:box", {
|
minetest.register_node("darkage:box", {
|
||||||
description = "Box",
|
description = "Box",
|
||||||
@ -26,11 +36,7 @@ minetest.register_node("darkage:box", {
|
|||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", [[
|
meta:set_string("formspec", box_formspec )
|
||||||
size[8,8]
|
|
||||||
list[context;main;0,0;8,3;]
|
|
||||||
list[current_player;main;0,4;8,4;]
|
|
||||||
]])
|
|
||||||
meta:set_string("infotext", "Box")
|
meta:set_string("infotext", "Box")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 16)
|
inv:set_size("main", 16)
|
||||||
@ -54,6 +60,18 @@ minetest.register_node("darkage:box", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local shelves_formspec = [[
|
||||||
|
size[8,9]
|
||||||
|
list[context;up;0,0;8,2;]
|
||||||
|
list[context;down;0,2.3;8,2;]
|
||||||
|
|
||||||
|
list[current_player;main;0,4.85;8,1;]
|
||||||
|
list[current_player;main;0,6.08;8,3;8]
|
||||||
|
listring[context;up]
|
||||||
|
listring[context;down]
|
||||||
|
listring[current_player;main]
|
||||||
|
]].. darkage.formbg
|
||||||
|
|
||||||
minetest.register_node("darkage:wood_shelves", {
|
minetest.register_node("darkage:wood_shelves", {
|
||||||
description = "Wooden Shelves",
|
description = "Wooden Shelves",
|
||||||
tiles = { "darkage_shelves.png","darkage_shelves.png","darkage_shelves.png",
|
tiles = { "darkage_shelves.png","darkage_shelves.png","darkage_shelves.png",
|
||||||
@ -63,13 +81,7 @@ minetest.register_node("darkage:wood_shelves", {
|
|||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec",[[
|
meta:set_string("formspec", shelves_formspec)
|
||||||
size[8,10]
|
|
||||||
list[context;up;0,0;8,3;]
|
|
||||||
list[context;down;0,3;8,3;]
|
|
||||||
|
|
||||||
list[current_player;main;0,6;8,4;]
|
|
||||||
]])
|
|
||||||
meta:set_string("infotext", "Wooden Shelves")
|
meta:set_string("infotext", "Wooden Shelves")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("up", 16)
|
inv:set_size("up", 16)
|
||||||
|
4
init.lua
4
init.lua
@ -2,6 +2,10 @@ minetest.log("action"," ---- Dark Age Version 1.3 is Loading! ---- ")
|
|||||||
|
|
||||||
darkage = {}; -- Create darkage namespace
|
darkage = {}; -- Create darkage namespace
|
||||||
|
|
||||||
|
darkage.formbg = (default.gui_bg or "")..
|
||||||
|
(default.gui_bg_img or "")..
|
||||||
|
(default.gui_slots or "")
|
||||||
|
|
||||||
local MODPATH = minetest.get_modpath("darkage")
|
local MODPATH = minetest.get_modpath("darkage")
|
||||||
|
|
||||||
dofile(MODPATH.."/nodes.lua")
|
dofile(MODPATH.."/nodes.lua")
|
||||||
|
Loading…
Reference in New Issue
Block a user