github
8 of 25 new or added lines in 3 files covered. (32.0%)
875 of 1719 relevant lines covered (50.9%)
1833.97 hits per line
|
local FORMNAME = "bx_main" |
1✔ |
2 |
|
|
3 |
local function area_fs(player, pos) |
|
NEW
|
local area = blockexchange.get_area(pos) |
× |
NEW
|
if not area then |
× |
NEW
|
return "" |
× |
7 |
end
|
|
8 |
|
|
NEW
|
print(dump(area))
|
× |
10 |
|
|
NEW
|
return [[ |
× |
12 |
label[2,2;Area selected] |
|
NEW
|
]]
|
× |
14 |
end
|
|
15 |
|
|
|
function blockexchange.ui.main(playername) |
2✔ |
NEW
|
local player = minetest.get_player_by_name(playername) |
× |
NEW
|
if not player then |
× |
NEW
|
return
|
× |
20 |
end
|
|
NEW
|
local pos = player:get_pos() |
× |
22 |
|
|
23 |
local fs = [[ |
|
24 |
formspec_version[2] |
|
25 |
size[8,9] |
|
NEW
|
]] .. area_fs(player, pos) .. [[ |
× |
27 |
button_exit[4,8;4,1;quit;Exit] |
|
NEW
|
]]
|
× |
NEW
|
print(fs)
|
× |
NEW
|
minetest.show_formspec(playername, FORMNAME, fs) |
× |
31 |
end
|
|
32 |
|
|
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
2✔ |
NEW
|
if formname ~= FORMNAME then |
× |
NEW
|
return
|
× |
36 |
end
|
|
37 |
end)
|
|
38 |
|