committing so i do not forget what i was doing later
|
@ -1414,8 +1414,8 @@ minetest.register_node("core:furnace", {
|
|||
description = "Furnace",
|
||||
tiles = {
|
||||
"core_furnace_top.png", "core_furnace_top.png",
|
||||
"core_furnace_side.png", "core_furnace_side.png",
|
||||
"core_furnace_side.png", "core_furnace_front.png"
|
||||
"core_furnace_top.png", "core_furnace_top.png",
|
||||
"core_furnace_top.png", "core_furnace_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2},
|
||||
|
@ -1453,8 +1453,8 @@ minetest.register_node("core:furnace_active", {
|
|||
description = "Furnace",
|
||||
tiles = {
|
||||
"core_furnace_top.png", "core_furnace_top.png",
|
||||
"core_furnace_side.png", "core_furnace_side.png",
|
||||
"core_furnace_side.png", "core_furnace_front_active.png"
|
||||
"core_furnace_top.png", "core_furnace_top.png",
|
||||
"core_furnace_top.png", "core_furnace_front_active.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
light_source = 8,
|
||||
|
@ -1493,6 +1493,9 @@ function mcore.register_fence(name, def)
|
|||
})
|
||||
|
||||
-- Allow almost everything to be overridden
|
||||
|
||||
-- items in this table appear to be unable to be overridden
|
||||
|
||||
local default_fields = {
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
|
@ -1501,23 +1504,26 @@ function mcore.register_fence(name, def)
|
|||
fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}},
|
||||
-- connect_top =
|
||||
-- connect_bottom =
|
||||
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
|
||||
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
|
||||
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
|
||||
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
|
||||
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
|
||||
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
|
||||
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
|
||||
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
|
||||
connect_front = {{-1/16, 5/16, -1/2, 1/16, 7/16, -1/8},
|
||||
{-1/16, -3/16, -1/2, 1/16, -1/16, -1/8}},
|
||||
connect_left = {{-1/2, 5/16, -1/16, -1/8, 7/16, 1/16},
|
||||
{-1/2, -3/16, -1/16, -1/8, -1/16, 1/16}},
|
||||
connect_back = {{-1/16, 5/16, 1/8, 1/16, 7/16, 1/2},
|
||||
{-1/16, -3/16, 1/8, 1/16, -1/16, 1/2}},
|
||||
connect_right = {{1/8, 5/16, -1/16, 1/2, 7/16, 1/16},
|
||||
{1/8, -3/16, -1/16, 1/2, -1/16, 1/16}},
|
||||
},
|
||||
connects_to = {"group:fence", "group:wood", "group:tree", "group:solid"},
|
||||
inventory_image = def.inventory_image,
|
||||
wield_image = def.wield_image,
|
||||
--inventory_image = def.inventory_image,
|
||||
--wield_image = def.wield_image,
|
||||
tiles = {def.texture},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {},
|
||||
}
|
||||
|
||||
-- insert missing table values into the def table for node def
|
||||
|
||||
for k, v in pairs(default_fields) do
|
||||
if not def[k] then
|
||||
def[k] = v
|
||||
|
@ -1538,9 +1544,31 @@ end
|
|||
mcore.register_fence("core:fence_oak", {
|
||||
description = "Oak Fence",
|
||||
texture = "core_oak_planks.png",
|
||||
inventory_image = "core_fence_oak.png",
|
||||
wield_image = "core_fence_oak.png",
|
||||
material = "core:oak_planks",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = mcore.sound_wood,
|
||||
})
|
||||
|
||||
mcore.register_fence("core:fence_birch", {
|
||||
description = "Birch Fence",
|
||||
texture = "core_birch_planks.png",
|
||||
material = "core:birch_planks",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = mcore.sound_wood,
|
||||
})
|
||||
|
||||
mcore.register_fence("core:fence_pine", {
|
||||
description = "Pine Fence",
|
||||
texture = "core_pine_planks.png",
|
||||
material = "core:pine_planks",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = mcore.sound_wood,
|
||||
})
|
||||
|
||||
mcore.register_fence("core:fence_cherry", {
|
||||
description = "Cherry Fence",
|
||||
texture = "core_cherry_planks.png",
|
||||
material = "core:cherry_planks",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = mcore.sound_wood,
|
||||
})
|
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 227 B |
After Width: | Height: | Size: 245 B |
After Width: | Height: | Size: 242 B |
After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 372 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
|
@ -79,12 +79,15 @@ inventory_plus.get_formspec = function(player, page)
|
|||
end
|
||||
|
||||
-- default inventory page
|
||||
local formspec = "size[8,7.5]"
|
||||
local formspec = "size[8,9]"
|
||||
-- .. default.gui_bg
|
||||
-- .. default.gui_bg_img
|
||||
-- .. default.gui_slots
|
||||
.. "list[current_player;main;0,3.5;8,4;]"
|
||||
|
||||
.. "list[current_player;main;0,4.5;8,1;]"
|
||||
.. "list[current_player;main;0,6;8,3;8]"
|
||||
.. "listcolors[#573b2e;#de9860;#ffffff;#3f2832;#ffffff]"
|
||||
|
||||
|
||||
-- craft page
|
||||
if page == "craft" then
|
||||
|
||||
|
@ -94,14 +97,16 @@ inventory_plus.get_formspec = function(player, page)
|
|||
end
|
||||
|
||||
formspec = formspec
|
||||
.. "button[0,1;2,0.5;main;Back]"
|
||||
.. "image_button[0,0;1.85,1;core_button_wood.png;cguide;Crafting Guide;false;false;core_button_wood_pressed.png]"
|
||||
.. "list[current_player;craftpreview;7,1;1,1;]"
|
||||
.. "list[current_player;craft;3,0;3,3;]"
|
||||
.. "listring[current_name;craft]"
|
||||
.. "listring[current_player;main]"
|
||||
-- trash icon
|
||||
.. "list[detached:trash;main;1,2;1,1;]"
|
||||
.. "image[1.1,2.1;0.8,0.8;trash_icon.png]"
|
||||
.. "list[detached:trash;main;0,2.95;1,1;]"
|
||||
.. "image[6,1;1,1;core_crafting_arrow.png]"
|
||||
.. "background[-0.45,-0.5;8.9,10;core_inv_plus_craft.png]"
|
||||
--.. "image[1.1,2.1;0.8,0.8;trash_icon.png]"
|
||||
end
|
||||
|
||||
-- main page
|
||||
|
@ -118,12 +123,12 @@ inventory_plus.get_formspec = function(player, page)
|
|||
-- buttons
|
||||
local x = 0
|
||||
local f = math.ceil(num / 4)
|
||||
local y = (2.5 / 2) / f
|
||||
local y = 0
|
||||
|
||||
for k, v in pairs( inventory_plus.buttons[name] ) do
|
||||
|
||||
formspec = formspec .. "button[" .. x .. ","
|
||||
.. y .. ";2,0.5;" .. k .. ";" .. v .. "]"
|
||||
formspec = formspec .. "image_button[" .. x .. ","
|
||||
.. y .. ";2,1;core_button_wood.png;" .. k .. ";" .. v .. ";false;false;core_button_wood_pressed.png]"
|
||||
|
||||
x = x + 2
|
||||
|
||||
|
@ -132,6 +137,8 @@ inventory_plus.get_formspec = function(player, page)
|
|||
y = y + 1
|
||||
end
|
||||
end
|
||||
|
||||
formspec = formspec .. "background[-0.45,-0.5;8.9,10;core_inv_plus.png]"
|
||||
end
|
||||
|
||||
return formspec
|
||||
|
@ -140,7 +147,7 @@ end
|
|||
-- register_on_joinplayer
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
|
||||
inventory_plus.register_button(player,"craft", "Craft")
|
||||
inventory_plus.register_button(player,"craft", "Crafting")
|
||||
|
||||
if minetest.settings:get_bool("creative_mode")
|
||||
or minetest.check_player_privs(player:get_player_name(), {creative = true}) then
|
||||
|
@ -157,17 +164,16 @@ end)
|
|||
-- register_on_player_receive_fields
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
-- main
|
||||
if fields.main then
|
||||
if fields.cguide then
|
||||
|
||||
inventory_plus.set_inventory_formspec(player,
|
||||
inventory_plus.get_formspec(player, "main"))
|
||||
inventory_plus.set_inventory_formspec(player, zcg.formspec(player:get_player_name()))
|
||||
|
||||
return
|
||||
|
||||
end
|
||||
|
||||
-- craft
|
||||
if fields.craft then
|
||||
if fields.main then
|
||||
|
||||
inventory_plus.set_inventory_formspec(player,
|
||||
inventory_plus.get_formspec(player, "craft"))
|
||||
|
|
After Width: | Height: | Size: 219 B |
|
@ -103,17 +103,19 @@ zcg.formspec = function(pn)
|
|||
page = zcg.users[pn].page
|
||||
alt = zcg.users[pn].alt
|
||||
current_item = zcg.users[pn].current_item
|
||||
local formspec = "size[8,7.5]"
|
||||
.. "button[0,0;2,.5;main;Back]"
|
||||
local formspec = "size[8,8]"
|
||||
.. "image_button[0,0;3,1;core_button_wood.png;main;Return to Inventory;false;false;core_button_wood_pressed.png]"
|
||||
.. "background[-0.45,-0.5;8.9,9;core_inv_plus_guide.png]"
|
||||
|
||||
if zcg.users[pn].history.index > 1 then
|
||||
formspec = formspec .. "image_button[0,1;1,1;zcg_previous.png;zcg_previous;;false;false;zcg_previous_press.png]"
|
||||
formspec = formspec .. "image_button[0,2;1.55,1;core_button_wood.png;zcg_previous;Last Recipe;false;false;core_button_wood_pressed.png]"
|
||||
else
|
||||
formspec = formspec .. "image[0,1;1,1;zcg_previous_inactive.png]"
|
||||
--formspec = formspec .. "image[0,1;1,1;zcg_previous_inactive.png]"
|
||||
end
|
||||
if zcg.users[pn].history.index < #zcg.users[pn].history.list then
|
||||
formspec = formspec .. "image_button[1,1;1,1;zcg_next.png;zcg_next;;false;false;zcg_next_press.png]"
|
||||
formspec = formspec .. "image_button[1.5,2;1.55,1;core_button_wood.png;zcg_next;Next Recipe;false;false;core_button_wood_pressed.png]"
|
||||
else
|
||||
formspec = formspec .. "image[1,1;1,1;zcg_next_inactive.png]"
|
||||
--formspec = formspec .. "image[1,1;1,1;zcg_next_inactive.png]"
|
||||
end
|
||||
-- Show craft recipe
|
||||
if current_item ~= "" then
|
||||
|
@ -134,12 +136,14 @@ zcg.formspec = function(pn)
|
|||
for i, item in pairs(c.items) do
|
||||
formspec = formspec .. "item_image_button["..((i-1)%c.width+x)..","..(math.floor((i-1)/c.width+y))..";1,1;"..item..";zcg:"..item..";]"
|
||||
end
|
||||
if c.type == "normal" or c.type == "cooking" then
|
||||
if c.type == "normal" then
|
||||
formspec = formspec .. "image[6,2;1,1;zcg_method_"..c.type..".png]"
|
||||
else -- we don't have an image for other types of crafting
|
||||
elseif c.type == "cooking" then -- we don't have an image for other types of crafting
|
||||
formspec = formspec .. "image[6,2;1,1;"..minetest.inventorycube("core_furnace_top.png", "core_furnace_front_active.png", "core_furnace_top.png").."]"
|
||||
else
|
||||
formspec = formspec .. "label[0,2;Method: "..c.type.."]"
|
||||
end
|
||||
formspec = formspec .. "image[6,1;1,1;zcg_craft_arrow.png]"
|
||||
formspec = formspec .. "image[6,1;1,1;core_crafting_arrow.png]"
|
||||
formspec = formspec .. "item_image_button[7,1;1,1;"..zcg.users[pn].current_item..";;]"
|
||||
end
|
||||
end
|
||||
|
@ -152,22 +156,22 @@ zcg.formspec = function(pn)
|
|||
for _, name in ipairs(zcg.itemlist) do
|
||||
if s < page*npp then s = s+1 else
|
||||
if i >= npp then break end
|
||||
formspec = formspec .. "item_image_button["..(i%8)..","..(math.floor(i/8)+3.5)..";1,1;"..name..";zcg:"..name..";]"
|
||||
formspec = formspec .. "item_image_button["..(i%8)..","..(math.floor(i/8)+4)..";1,1;"..name..";zcg:"..name..";]"
|
||||
i = i+1
|
||||
end
|
||||
end
|
||||
if page > 0 then
|
||||
formspec = formspec .. "button[0,7;1,.5;zcg_page:"..(page-1)..";<<]"
|
||||
formspec = formspec .. "image_button[0,7.1;2,1;core_button_wood.png;zcg_page:"..(page-1)..";Previous Page;false;false;core_button_wood_pressed.png]"
|
||||
end
|
||||
if i >= npp then
|
||||
formspec = formspec .. "button[1,7;1,.5;zcg_page:"..(page+1)..";>>]"
|
||||
formspec = formspec .. "image_button[2,7.1;2,1;core_button_wood.png;zcg_page:"..(page+1)..";Next Page;false;false;core_button_wood_pressed.png]"
|
||||
end
|
||||
formspec = formspec .. "label[2,6.85;Page "..(page+1).."/"..(math.floor(#zcg.itemlist/npp+1)).."]" -- The Y is approximatively the good one to have it centered vertically...
|
||||
formspec = formspec .. "label[0,3.45;Crafting Page: "..(page+1).." of "..(math.floor(#zcg.itemlist/npp+1)).."]" -- The Y is approximatively the good one to have it centered vertically...
|
||||
return formspec
|
||||
end
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
inventory_plus.register_button(player,"zcg","Craft guide")
|
||||
inventory_plus.register_button(player,"zcg","Crafting Guide")
|
||||
end)
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||
|
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 214 B |