Basic maintainance + fix bugs

master
Jean-Patrick Guerrero 2021-02-28 21:02:06 +01:00
parent 7e3549842f
commit b3fc6daf71
5 changed files with 71 additions and 71 deletions

View File

@ -1,4 +1,3 @@
unused_args = false
allow_defined_top = true
read_globals = {

View File

@ -1015,18 +1015,16 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player
if from_y < to_y then
-- Goes down
-- Ensure that no piece disturbs the way
for i = 1, dx - 1 do
if inv:get_stack(
from_list, xy_to_index(from_x, from_y + i)):get_name() ~= "" then
for i = from_y + 1, to_y - 1 do
if inv:get_stack(from_list, xy_to_index(from_x, i)):get_name() ~= "" then
return 0
end
end
else
-- Goes up
-- Ensure that no piece disturbs the way
for i = 1, dx - 1 do
if inv:get_stack(
from_list, xy_to_index(from_x, from_y - i)):get_name() ~= "" then
for i = to_y + 1, from_y - 1 do
if inv:get_stack(from_list, xy_to_index(from_x, i)):get_name() ~= "" then
return 0
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
-- Goes right
-- Ensure that no piece disturbs the way
for i = 1, dx - 1 do
if inv:get_stack(
from_list, xy_to_index(from_x + i, from_y)):get_name() ~= "" then
for i = from_x + 1, to_x - 1 do
if inv:get_stack(from_list, xy_to_index(i, from_y)):get_name() ~= "" then
return 0
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
-- Goes left
-- Ensure that no piece disturbs the way and destination cell does
for i = 1, dx - 1 do
if inv:get_stack(
from_list, xy_to_index(from_x - i, from_y)):get_name() ~= "" then
for i = to_x + 1, from_x - 1 do
if inv:get_stack(from_list, xy_to_index(i, from_y)):get_name() ~= "" then
return 0
end
end

View File

@ -65,12 +65,15 @@ local enchant_buttons = {
function enchanting.formspec(pos, num)
local meta = minetest.get_meta(pos)
local formspec = [[ size[9,9;]
local formspec = [[
size[9,8.6;]
no_prepend[]
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;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[context;tool]
listring[current_player;main]
@ -80,7 +83,7 @@ function enchanting.formspec(pos, num)
.."tooltip[sharp;"..FS("Your weapon inflicts more damages").."]"
.."tooltip[durable;"..FS("Your tool last longer").."]"
.."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 "")
meta:set_string("formspec", formspec)

View File

@ -83,7 +83,7 @@ local main_fs = "label[0.9,1.23;"..FS("Cut").."]"
box[-0.05,2;2.05,0.9;#555555] ]]
.."button[0,0;2,1;craft;"..FS("Crafting").."]"
.."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,2;1,1;worktable_anvil.png]
image[3,2;1,1;hammer_layout.png]
@ -274,8 +274,9 @@ xdecor.register("workbench", {
allow_metadata_inventory_move = workbench.allow_move
})
for _, d in ipairs(workbench.defs) do
for i = 1, #nodes do
minetest.register_on_mods_loaded(function()
for _, d in ipairs(workbench.defs) do
for i = 1, #nodes do
local node = nodes[i]
local mod_name, item_name = node:match("^(.-):(.*)")
local def = registered_nodes[node]
@ -333,8 +334,9 @@ for i = 1, #nodes do
("stairs:stair_outer_%s"):format(item_name)
)
end
end
end
end
end
end)
-- Craft items

BIN
textures/gui_arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B