mirror of
https://codeberg.org/minenux/minetest-mod-xdecor
synced 2023-10-20 21:43:39 -07:00
Basic maintainance + fix bugs
This commit is contained in:
parent
7e3549842f
commit
b3fc6daf71
@ -1,4 +1,3 @@
|
|||||||
unused_args = false
|
|
||||||
allow_defined_top = true
|
allow_defined_top = true
|
||||||
|
|
||||||
read_globals = {
|
read_globals = {
|
||||||
|
@ -1015,18 +1015,16 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player
|
|||||||
if from_y < to_y then
|
if from_y < to_y then
|
||||||
-- Goes down
|
-- Goes down
|
||||||
-- Ensure that no piece disturbs the way
|
-- Ensure that no piece disturbs the way
|
||||||
for i = 1, dx - 1 do
|
for i = from_y + 1, to_y - 1 do
|
||||||
if inv:get_stack(
|
if inv:get_stack(from_list, xy_to_index(from_x, i)):get_name() ~= "" then
|
||||||
from_list, xy_to_index(from_x, from_y + i)):get_name() ~= "" then
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Goes up
|
-- Goes up
|
||||||
-- Ensure that no piece disturbs the way
|
-- Ensure that no piece disturbs the way
|
||||||
for i = 1, dx - 1 do
|
for i = to_y + 1, from_y - 1 do
|
||||||
if inv:get_stack(
|
if inv:get_stack(from_list, xy_to_index(from_x, i)):get_name() ~= "" then
|
||||||
from_list, xy_to_index(from_x, from_y - i)):get_name() ~= "" then
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1035,9 +1033,8 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player
|
|||||||
if from_y == to_y then
|
if from_y == to_y then
|
||||||
-- Goes right
|
-- Goes right
|
||||||
-- Ensure that no piece disturbs the way
|
-- Ensure that no piece disturbs the way
|
||||||
for i = 1, dx - 1 do
|
for i = from_x + 1, to_x - 1 do
|
||||||
if inv:get_stack(
|
if inv:get_stack(from_list, xy_to_index(i, from_y)):get_name() ~= "" then
|
||||||
from_list, xy_to_index(from_x + i, from_y)):get_name() ~= "" then
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1064,9 +1061,8 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player
|
|||||||
if from_y == to_y then
|
if from_y == to_y then
|
||||||
-- Goes left
|
-- Goes left
|
||||||
-- Ensure that no piece disturbs the way and destination cell does
|
-- Ensure that no piece disturbs the way and destination cell does
|
||||||
for i = 1, dx - 1 do
|
for i = to_x + 1, from_x - 1 do
|
||||||
if inv:get_stack(
|
if inv:get_stack(from_list, xy_to_index(i, from_y)):get_name() ~= "" then
|
||||||
from_list, xy_to_index(from_x - i, from_y)):get_name() ~= "" then
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -65,12 +65,15 @@ local enchant_buttons = {
|
|||||||
|
|
||||||
function enchanting.formspec(pos, num)
|
function enchanting.formspec(pos, num)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local formspec = [[ size[9,9;]
|
local formspec = [[
|
||||||
|
size[9,8.6;]
|
||||||
|
no_prepend[]
|
||||||
bgcolor[#080808BB;true]
|
bgcolor[#080808BB;true]
|
||||||
background[0,0;9,9;ench_ui.png]
|
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]
|
||||||
|
background9[0,0;9,9;ench_ui.png;6]
|
||||||
list[context;tool;0.9,2.9;1,1;]
|
list[context;tool;0.9,2.9;1,1;]
|
||||||
list[context;mese;2,2.9;1,1;]
|
list[context;mese;2,2.9;1,1;]
|
||||||
list[current_player;main;0.5,4.5;8,4;]
|
list[current_player;main;0.55,4.5;8,4;]
|
||||||
listring[current_player;main]
|
listring[current_player;main]
|
||||||
listring[context;tool]
|
listring[context;tool]
|
||||||
listring[current_player;main]
|
listring[current_player;main]
|
||||||
@ -80,7 +83,7 @@ function enchanting.formspec(pos, num)
|
|||||||
.."tooltip[sharp;"..FS("Your weapon inflicts more damages").."]"
|
.."tooltip[sharp;"..FS("Your weapon inflicts more damages").."]"
|
||||||
.."tooltip[durable;"..FS("Your tool last longer").."]"
|
.."tooltip[durable;"..FS("Your tool last longer").."]"
|
||||||
.."tooltip[fast;"..FS("Your tool digs faster").."]"
|
.."tooltip[fast;"..FS("Your tool digs faster").."]"
|
||||||
..default.gui_slots .. default.get_hotbar_bg(0.5,4.5)
|
..default.gui_slots .. default.get_hotbar_bg(0.55, 4.5)
|
||||||
|
|
||||||
formspec = formspec .. (enchant_buttons[num] or "")
|
formspec = formspec .. (enchant_buttons[num] or "")
|
||||||
meta:set_string("formspec", formspec)
|
meta:set_string("formspec", formspec)
|
||||||
|
@ -83,7 +83,7 @@ local main_fs = "label[0.9,1.23;"..FS("Cut").."]"
|
|||||||
box[-0.05,2;2.05,0.9;#555555] ]]
|
box[-0.05,2;2.05,0.9;#555555] ]]
|
||||||
.."button[0,0;2,1;craft;"..FS("Crafting").."]"
|
.."button[0,0;2,1;craft;"..FS("Crafting").."]"
|
||||||
.."button[2,0;2,1;storage;"..FS("Storage").."]"
|
.."button[2,0;2,1;storage;"..FS("Storage").."]"
|
||||||
..[[ image[3,1;1,1;gui_furnace_arrow_bg.png^[transformR270]
|
..[[ image[3,1;1,1;gui_arrow.png]
|
||||||
image[0,1;1,1;worktable_saw.png]
|
image[0,1;1,1;worktable_saw.png]
|
||||||
image[0,2;1,1;worktable_anvil.png]
|
image[0,2;1,1;worktable_anvil.png]
|
||||||
image[3,2;1,1;hammer_layout.png]
|
image[3,2;1,1;hammer_layout.png]
|
||||||
@ -274,8 +274,9 @@ xdecor.register("workbench", {
|
|||||||
allow_metadata_inventory_move = workbench.allow_move
|
allow_metadata_inventory_move = workbench.allow_move
|
||||||
})
|
})
|
||||||
|
|
||||||
for _, d in ipairs(workbench.defs) do
|
minetest.register_on_mods_loaded(function()
|
||||||
for i = 1, #nodes do
|
for _, d in ipairs(workbench.defs) do
|
||||||
|
for i = 1, #nodes do
|
||||||
local node = nodes[i]
|
local node = nodes[i]
|
||||||
local mod_name, item_name = node:match("^(.-):(.*)")
|
local mod_name, item_name = node:match("^(.-):(.*)")
|
||||||
local def = registered_nodes[node]
|
local def = registered_nodes[node]
|
||||||
@ -333,8 +334,9 @@ for i = 1, #nodes do
|
|||||||
("stairs:stair_outer_%s"):format(item_name)
|
("stairs:stair_outer_%s"):format(item_name)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
-- Craft items
|
-- Craft items
|
||||||
|
|
||||||
|
BIN
textures/gui_arrow.png
Normal file
BIN
textures/gui_arrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 469 B |
Loading…
x
Reference in New Issue
Block a user