Change some global variables names

This commit is contained in:
kilbith 2015-08-16 21:05:01 +02:00
parent 192eabd709
commit 5722aca858
8 changed files with 41 additions and 41 deletions

View File

@ -2,7 +2,7 @@ local enchanting = {}
function enchanting.construct(pos) function enchanting.construct(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", "size[8,7;]"..xdecor.fancy_gui.. meta:set_string("formspec", "size[8,7;]"..bg..
"label[0.85,-0.15;Enchant]".."image[0.6,0.2;2,2;xdecor_enchbook.png]".. "label[0.85,-0.15;Enchant]".."image[0.6,0.2;2,2;xdecor_enchbook.png]"..
"list[current_name;tool;0.5,2;1,1;]".. "list[current_name;tool;0.5,2;1,1;]"..
"list[current_name;mese;1.5,2;1,1;]".."image[1.5,2;1,1;mese_layout.png]".. "list[current_name;mese;1.5,2;1,1;]".."image[1.5,2;1,1;mese_layout.png]"..
@ -78,7 +78,7 @@ xdecor.register("enchantment_table", {
"xdecor_enchantment_side.png", "xdecor_enchantment_side.png" "xdecor_enchantment_side.png", "xdecor_enchantment_side.png"
}, },
groups = {cracky=1}, groups = {cracky=1},
sounds = xdecor.stone, sounds = sound.stone,
can_dig = enchanting.dig, can_dig = enchanting.dig,
on_construct = enchanting.construct, on_construct = enchanting.construct,
on_receive_fields = enchanting.fields, on_receive_fields = enchanting.fields,

View File

@ -1,5 +1,3 @@
xdecor = xdecor or {}
local default_can_dig = function(pos, _) local default_can_dig = function(pos, _)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -7,27 +5,29 @@ local default_can_dig = function(pos, _)
return inv:is_empty("main") return inv:is_empty("main")
end end
xdecor.wood = default.node_sound_wood_defaults() sound = {}
xdecor.glass = default.node_sound_glass_defaults() sound.wood = default.node_sound_wood_defaults()
xdecor.leaves = default.node_sound_leaves_defaults() sound.glass = default.node_sound_glass_defaults()
xdecor.stone = default.node_sound_stone_defaults() sound.leaves = default.node_sound_leaves_defaults()
xdecor.fancy_gui = default.gui_bg..default.gui_bg_img..default.gui_slots sound.stone = default.node_sound_stone_defaults()
bg = default.gui_bg..default.gui_bg_img..default.gui_slots
local default_inventory_size = 32 local default_inventory_size = 32
local default_inventory_formspecs = { local default_inventory_formspecs = {
["8"] = "size[8,6]"..xdecor.fancy_gui.. ["8"] = "size[8,6]"..bg..
"list[context;main;0,0;8,1;]".. "list[context;main;0,0;8,1;]"..
"list[current_player;main;0,2;8,4;]", "list[current_player;main;0,2;8,4;]",
["16"] = "size[8,7]"..xdecor.fancy_gui.. ["16"] = "size[8,7]"..bg..
"list[context;main;0,0;8,2;]".. "list[context;main;0,0;8,2;]"..
"list[current_player;main;0,3;8,4;]", "list[current_player;main;0,3;8,4;]",
["24"] = "size[8,8]"..xdecor.fancy_gui.. ["24"] = "size[8,8]"..bg..
"list[context;main;0,0;8,3;]".. "list[context;main;0,0;8,3;]"..
"list[current_player;main;0,4;8,4;]", "list[current_player;main;0,4;8,4;]",
["32"] = "size[8,9]"..xdecor.fancy_gui.. ["32"] = "size[8,9]"..bg..
"list[context;main;0,0.3;8,4;]".. "list[context;main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,1;]".. "list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]".. "list[current_player;main;0,6.08;8,3;8]"..

View File

@ -2,7 +2,7 @@ local hive = {}
function hive.construct(pos) function hive.construct(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", "size[8,5;]"..xdecor.fancy_gui.. meta:set_string("formspec", "size[8,5;]"..bg..
"label[1.35,0;Bees are making honey\nwith pollen around...]".. "label[1.35,0;Bees are making honey\nwith pollen around...]"..
"image[0.2,-0.1;1,1;flowers_dandelion_white.png]".. "image[0.2,-0.1;1,1;flowers_dandelion_white.png]"..
"image[7,0.1;1,1;flowers_viola.png]".. "image[7,0.1;1,1;flowers_viola.png]"..

View File

@ -82,7 +82,7 @@ end
xdecor.register("frame", { xdecor.register("frame", {
description = "Item frame", description = "Item frame",
groups = {choppy=3, snappy=2}, groups = {choppy=3, snappy=2},
sounds = xdecor.wood, sounds = sound.wood,
on_rotate = screwdriver.disallow, on_rotate = screwdriver.disallow,
node_box = { node_box = {
type = "fixed", type = "fixed",

View File

@ -62,7 +62,7 @@ xdecor.register("mailbox", {
function mailbox.get_formspec(pos) function mailbox.get_formspec(pos)
local spos = pos.x..","..pos.y..","..pos.z local spos = pos.x..","..pos.y..","..pos.z
local formspec = local formspec =
"size[8,9]"..xdecor.fancy_gui.. "size[8,9]"..bg..
"label[0,0;You received...]".. "label[0,0;You received...]"..
"list[nodemeta:"..spos..";main;0,0.75;8,4;]".. "list[nodemeta:"..spos..";main;0,0.75;8,4;]"..
"list[current_player;main;0,5.25;8,4;]" "list[current_player;main;0,5.25;8,4;]"
@ -72,7 +72,7 @@ end
function mailbox.get_insert_formspec(pos, owner) function mailbox.get_insert_formspec(pos, owner)
local spos = pos.x..","..pos.y..","..pos.z local spos = pos.x..","..pos.y..","..pos.z
local formspec = local formspec =
"size[8,5]"..xdecor.fancy_gui.. "size[8,5]"..bg..
"label[0.5,0;Send your goods\nto "..owner.." :]".. "label[0.5,0;Send your goods\nto "..owner.." :]"..
"list[nodemeta:"..spos..";drop;3.5,0;1,1;]".. "list[nodemeta:"..spos..";drop;3.5,0;1,1;]"..
"list[current_player;main;0,1.25;8,4;]" "list[current_player;main;0,1.25;8,4;]"

View File

@ -32,7 +32,7 @@ xdecor.register("barrel", {
infotext = "Barrel", infotext = "Barrel",
tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"}, tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
groups = {choppy=3, flammable=2}, groups = {choppy=3, flammable=2},
sounds = xdecor.wood sounds = sound.wood
}) })
xdecor.register("cabinet", { xdecor.register("cabinet", {
@ -40,7 +40,7 @@ xdecor.register("cabinet", {
inventory = {size=24}, inventory = {size=24},
infotext = "Cabinet", infotext = "Cabinet",
groups = {choppy=3, flammable=2}, groups = {choppy=3, flammable=2},
sounds = xdecor.wood, sounds = sound.wood,
tiles = { tiles = {
"default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png",
"default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png",
@ -53,7 +53,7 @@ xdecor.register("cabinet_half", {
inventory = {size=8}, inventory = {size=8},
infotext = "Half Cabinet", infotext = "Half Cabinet",
groups = {choppy=3, flammable=3}, groups = {choppy=3, flammable=3},
sounds = xdecor.wood, sounds = sound.wood,
node_box = xdecor.nodebox.slab_y(0.5, 0.5), node_box = xdecor.nodebox.slab_y(0.5, 0.5),
tiles = { tiles = {
"default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png",
@ -155,7 +155,7 @@ xpanes.register_pane("chainlink", {
xdecor.register("chair", { xdecor.register("chair", {
description = "Chair", description = "Chair",
tiles = {"xdecor_wood.png"}, tiles = {"xdecor_wood.png"},
sounds = xdecor.wood, sounds = sound.wood,
groups = {choppy=3, flammable=2}, groups = {choppy=3, flammable=2},
sunlight_propagates = true, sunlight_propagates = true,
node_box = { node_box = {
@ -187,7 +187,7 @@ xdecor.register("coalstone_tile", {
description = "Coalstone Tile", description = "Coalstone Tile",
tiles = {"xdecor_coalstone_tile.png"}, tiles = {"xdecor_coalstone_tile.png"},
groups = {cracky=2, stone=1}, groups = {cracky=2, stone=1},
sounds = xdecor.stone sounds = sound.stone
}) })
xdecor.register("cobweb", { xdecor.register("cobweb", {
@ -204,7 +204,7 @@ xdecor.register("cobweb", {
walkable = false, walkable = false,
selection_box = {type = "regular"}, selection_box = {type = "regular"},
groups = {dig_immediate=3, liquid=3, flammable=3}, groups = {dig_immediate=3, liquid=3, flammable=3},
sounds = xdecor.leaves sounds = sound.leaves
}) })
local colors = {"red"} -- Add more curtains colors simply here. local colors = {"red"} -- Add more curtains colors simply here.
@ -279,7 +279,7 @@ for _, d in pairs(door_types) do
tiles_bottom = {"xdecor_"..d[1].."_door_b.png", "xdecor_"..d[2]..".png"}, tiles_bottom = {"xdecor_"..d[1].."_door_b.png", "xdecor_"..d[2]..".png"},
tiles_top = {"xdecor_"..d[1].."_door_a.png", "xdecor_"..d[2]..".png"}, tiles_top = {"xdecor_"..d[1].."_door_a.png", "xdecor_"..d[2]..".png"},
only_placer_can_open = door_access(d[1]), only_placer_can_open = door_access(d[1]),
sounds = xdecor.wood, sounds = sound.wood,
sunlight = false sunlight = false
}) })
end end
@ -290,7 +290,7 @@ xdecor.register("empty_shelf", {
infotext = "Empty Shelf", infotext = "Empty Shelf",
tiles = {"default_wood.png", "xdecor_empty_shelf.png"}, tiles = {"default_wood.png", "xdecor_empty_shelf.png"},
groups = {choppy=3, flammable=2}, groups = {choppy=3, flammable=2},
sounds = xdecor.wood sounds = sound.wood
}) })
xdecor.register("enderchest", { xdecor.register("enderchest", {
@ -304,7 +304,7 @@ xdecor.register("enderchest", {
"xdecor_enderchest_front.png" "xdecor_enderchest_front.png"
}, },
groups = {cracky=2}, groups = {cracky=2},
sounds = xdecor.stone, sounds = sound.stone,
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",
@ -389,7 +389,7 @@ xdecor.register("ivy", {
tiles = {"xdecor_ivy.png"}, tiles = {"xdecor_ivy.png"},
inventory_image = "xdecor_ivy.png", inventory_image = "xdecor_ivy.png",
wield_image = "xdecor_ivy.png", wield_image = "xdecor_ivy.png",
sounds = xdecor.leaves sounds = sound.leaves
}) })
xdecor.register("lantern", { xdecor.register("lantern", {
@ -417,7 +417,7 @@ xdecor.register("lightbox", {
tiles = {"xdecor_lightbox.png"}, tiles = {"xdecor_lightbox.png"},
groups = {cracky=3}, groups = {cracky=3},
light_source = 13, light_source = 13,
sounds = xdecor.glass sounds = sound.glass
}) })
local flowerstype = { "dandelion_white", "dandelion_yellow", "geranium", local flowerstype = { "dandelion_white", "dandelion_yellow", "geranium",
@ -431,7 +431,7 @@ for _, f in pairs(flowerstype) do
tiles = {"xdecor_"..f.."_pot.png"}, tiles = {"xdecor_"..f.."_pot.png"},
inventory_image = "xdecor_"..f.."_pot.png", inventory_image = "xdecor_"..f.."_pot.png",
drawtype = "plantlike", drawtype = "plantlike",
sounds = xdecor.leaves, sounds = sound.leaves,
selection_box = xdecor.nodebox.slab_y(0.5, 0) selection_box = xdecor.nodebox.slab_y(0.5, 0)
}) })
@ -480,7 +480,7 @@ xdecor.register("moonbrick", {
description = "Moonbrick", description = "Moonbrick",
tiles = {"xdecor_moonbrick.png"}, tiles = {"xdecor_moonbrick.png"},
groups = {cracky=2}, groups = {cracky=2},
sounds = xdecor.stone sounds = sound.stone
}) })
xdecor.register("multishelf", { xdecor.register("multishelf", {
@ -489,7 +489,7 @@ xdecor.register("multishelf", {
infotext = "Multi Shelf", infotext = "Multi Shelf",
tiles = {"default_wood.png", "xdecor_multishelf.png"}, tiles = {"default_wood.png", "xdecor_multishelf.png"},
groups = {choppy=3, flammable=2}, groups = {choppy=3, flammable=2},
sounds = xdecor.wood sounds = sound.wood
}) })
xpanes.register_pane("rust_bar", { xpanes.register_pane("rust_bar", {
@ -522,14 +522,14 @@ xdecor.register("stone_rune", {
tiles = {"xdecor_stone_rune.png"}, tiles = {"xdecor_stone_rune.png"},
drawtype = "normal", drawtype = "normal",
groups = {cracky=2, stone=1}, groups = {cracky=2, stone=1},
sounds = xdecor.stone sounds = sound.stone
}) })
xdecor.register("stonepath", { xdecor.register("stonepath", {
description = "Garden Stone Path", description = "Garden Stone Path",
tiles = {"default_stone.png"}, tiles = {"default_stone.png"},
groups = {snappy=3, stone=1}, groups = {snappy=3, stone=1},
sounds = xdecor.stone, sounds = sound.stone,
sunlight_propagates = true, sunlight_propagates = true,
node_box = { node_box = {
type = "fixed", type = "fixed",
@ -555,14 +555,14 @@ xdecor.register("stone_tile", {
tiles = {"xdecor_stone_tile.png"}, tiles = {"xdecor_stone_tile.png"},
drawtype = "normal", drawtype = "normal",
groups = {cracky=2, stone=1}, groups = {cracky=2, stone=1},
sounds = xdecor.stone sounds = sound.stone
}) })
xdecor.register("table", { xdecor.register("table", {
description = "Table", description = "Table",
tiles = {"xdecor_wood.png"}, tiles = {"xdecor_wood.png"},
groups = {choppy=3, flammable=2}, groups = {choppy=3, flammable=2},
sounds = xdecor.wood, sounds = sound.wood,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -590,7 +590,7 @@ xdecor.register("trash_can", {
tiles = {"xdecor_wood.png"}, tiles = {"xdecor_wood.png"},
groups = {choppy=3, flammable=2}, groups = {choppy=3, flammable=2},
sunlight_propagates = true, sunlight_propagates = true,
sounds = xdecor.wood, sounds = sound.wood,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -642,7 +642,7 @@ xdecor.register("woodframed_glass", {
drawtype = "glasslike_framed", drawtype = "glasslike_framed",
tiles = {"xdecor_framed_glass.png", "xdecor_framed_glass_detail.png"}, tiles = {"xdecor_framed_glass.png", "xdecor_framed_glass_detail.png"},
groups = {cracky=3}, groups = {cracky=3},
sounds = xdecor.glass sounds = sound.glass
}) })
xdecor.register("wood_tile", { xdecor.register("wood_tile", {
@ -650,5 +650,5 @@ xdecor.register("wood_tile", {
tiles = {"xdecor_wood_tile.png"}, tiles = {"xdecor_wood_tile.png"},
drawtype = "normal", drawtype = "normal",
groups = {choppy=2, wood=1, flammable=2}, groups = {choppy=2, wood=1, flammable=2},
sounds = xdecor.wood sounds = sound.wood
}) })

View File

@ -34,7 +34,7 @@ function worktable.construct(pos)
end end
nodebtn = table.concat(nodebtn) nodebtn = table.concat(nodebtn)
meta:set_string("formspec", "size[8,7;]"..xdecor.fancy_gui.. meta:set_string("formspec", "size[8,7;]"..bg..
"label[0,0;Cut your material into...]"..nodebtn.. "label[0,0;Cut your material into...]"..nodebtn..
"label[0,1.5;Input]".."list[current_name;input;0,2;1,1;]".. "label[0,1.5;Input]".."list[current_name;input;0,2;1,1;]"..
"image[1,2;1,1;xdecor_saw.png]".. "image[1,2;1,1;xdecor_saw.png]"..
@ -118,7 +118,7 @@ end
xdecor.register("worktable", { xdecor.register("worktable", {
description = "Work Table", description = "Work Table",
groups = {cracky=2, choppy=2}, groups = {cracky=2, choppy=2},
sounds = xdecor.wood, sounds = sound.wood,
tiles = { tiles = {
"xdecor_worktable_top.png", "xdecor_worktable_top.png", "xdecor_worktable_top.png", "xdecor_worktable_top.png",
"xdecor_worktable_sides.png", "xdecor_worktable_sides.png", "xdecor_worktable_sides.png", "xdecor_worktable_sides.png",

View File

@ -184,7 +184,7 @@ function xwall.register_wall(name, tiles, def)
def = { def = {
description = string.sub(name:gsub("%l", string.upper, 7), 8, -6).." Wall", description = string.sub(name:gsub("%l", string.upper, 7), 8, -6).." Wall",
textures = {tiles, tiles, tiles, tiles}, textures = {tiles, tiles, tiles, tiles},
sounds = xdecor.stone, sounds = sound.stone,
groups = {cracky=3, stone=1, pane=1}, groups = {cracky=3, stone=1, pane=1},
sunlight_propagates = true, sunlight_propagates = true,
collision_box = { collision_box = {