Enchant. Table : better looking glyphes

This commit is contained in:
kilbith 2016-04-02 21:34:00 +02:00
parent 3dbd30a6da
commit c49978f25e
17 changed files with 5 additions and 28 deletions

View File

@ -150,7 +150,7 @@ function enchanting.timer(pos)
acceleration = {x=0, y=-2.2, z=0}, acceleration = {x=0, y=-2.2, z=0},
expirationtime = 1, expirationtime = 1,
size = 2, size = 2,
texture = "xdecor_glyph"..math.random(1,14)..".png" texture = "xdecor_glyph"..math.random(1,18)..".png"
}) })
end end
return true return true

View File

@ -1,10 +1,3 @@
--[[ local default_can_dig = function(pos, _)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:is_empty("main")
end --]]
xbg = default.gui_bg..default.gui_bg_img..default.gui_slots xbg = default.gui_bg..default.gui_bg_img..default.gui_slots
local default_inventory_size = 32 local default_inventory_size = 32
@ -44,24 +37,9 @@ local function get_formspec_by_size(size)
return formspec or default_inventory_formspecs return formspec or default_inventory_formspecs
end end
local function drop_stuff() local default_can_dig = function(pos)
return function(pos, oldnode, oldmetadata, digger) local inv = minetest.get_meta(pos):get_inventory()
local meta = minetest.get_meta(pos) return inv:is_empty("main")
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for i=1, inv:get_size("main") do
local stack = inv:get_stack("main", i)
if not stack:is_empty() then
local p = {
x = pos.x + math.random(0,5) / 5 - 0.5,
y = pos.y,
z = pos.z + math.random(0,5) / 5 - 0.5
}
minetest.add_item(p, stack)
end
end
end
end end
function xdecor.register(name, def) function xdecor.register(name, def)
@ -94,8 +72,7 @@ function xdecor.register(name, def)
inv:set_size("main", size) inv:set_size("main", size)
meta:set_string("formspec", (inventory.formspec or get_formspec_by_size(size))..xbg) meta:set_string("formspec", (inventory.formspec or get_formspec_by_size(size))..xbg)
end end
def.after_dig_node = def.after_dig_node or drop_stuff() def.can_dig = def.can_dig or default_can_dig
--def.can_dig = def.can_dig or default_can_dig
elseif infotext and not def.on_construct then elseif infotext and not def.on_construct then
def.on_construct = function(pos) def.on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 B

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

After

Width:  |  Height:  |  Size: 159 B

BIN
textures/xdecor_glyph15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

BIN
textures/xdecor_glyph16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

BIN
textures/xdecor_glyph17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

BIN
textures/xdecor_glyph18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 B

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 B

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 B

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 158 B