Tweaks, Update .lua-format
parent
7b70895ea5
commit
41757e03f4
10
.lua-format
10
.lua-format
|
@ -1,13 +1,15 @@
|
|||
column_limit: 120
|
||||
indent_width: 1
|
||||
use_tab: true
|
||||
keep_simple_block_one_line: true
|
||||
keep_simple_block_one_line: false
|
||||
indent_width: 1
|
||||
continuation_indent_width: 1
|
||||
keep_simple_function_one_line: false
|
||||
keep_simple_control_block_one_line: false
|
||||
align_args: false
|
||||
align_parameter: false
|
||||
align_table_field: false
|
||||
chop_down_parameter: true
|
||||
chop_down_table: true
|
||||
chop_down_parameter: true
|
||||
break_before_table_rb: true
|
||||
break_after_table_lb: true
|
||||
extra_sep_at_table_end: true
|
||||
single_quote_to_double_quote: true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ignore = {"212"}
|
||||
ignore = {"212", "542"}
|
||||
read_globals = {
|
||||
"minetest",
|
||||
"VoxelArea",
|
||||
|
|
|
@ -12,7 +12,6 @@ schems.floor = schematic.new({x = 16, y = 1, z = 16}, "showroom:floor")
|
|||
|
||||
ikea.register_department({
|
||||
name = "showroom",
|
||||
|
||||
get_schematic = function(edges, x, z)
|
||||
return schems.floor, nil
|
||||
end,
|
||||
|
|
|
@ -165,7 +165,7 @@ minetest.register_entity("ikea_staff:member", {
|
|||
local eye = table.copy(ppos)
|
||||
eye.y = eye.y + puncher:get_properties().eye_height
|
||||
local ray = Raycast(eye, vector.add(eye, vector.multiply(puncher:get_look_dir(),
|
||||
vector.distance(ppos, self.object:get_pos()))))
|
||||
vector.distance(ppos, self.object:get_pos()))))
|
||||
local intersect
|
||||
for pointed in ray do
|
||||
if pointed.type == "object" and not pointed.ref:is_player() then
|
||||
|
|
|
@ -6,7 +6,7 @@ local LOW_WEAR = 65535
|
|||
|
||||
-- Pen. It is used to write on things. Can write 65533 characters in its lifetime.
|
||||
minetest.register_tool(":staff:pen",
|
||||
{description = "Pen", inventory_image = "ikea_staff_item_pen.png", damage_groups = {fleshy = 1}})
|
||||
{description = "Pen", inventory_image = "ikea_staff_item_pen.png", damage_groups = {fleshy = 1}})
|
||||
|
||||
-- Functional notepad. Write stuff on it.
|
||||
local function notepad_show(itemstack, player)
|
||||
|
@ -59,7 +59,7 @@ local function notepad_show(itemstack, player)
|
|||
|
||||
label[3.5,1.6;%s]
|
||||
]]):format(B("save"), P("save"), B("tear"), P("tear"), turn.prev.B, turn.prev.P, turn.next.B, turn.next.P,
|
||||
C("black", current_page .. " / " .. #pages))
|
||||
C("black", current_page .. " / " .. #pages))
|
||||
|
||||
-- Custom line wrap
|
||||
local max_len = 30
|
||||
|
@ -247,4 +247,4 @@ minetest.register_craftitem(":staff:id", {description = "Employee ID", inventory
|
|||
|
||||
-- Scanner. Don't know what it's good for yet.
|
||||
minetest.register_craftitem(":staff:scanner",
|
||||
{description = "PDA Scanner", inventory_image = "ikea_staff_item_scanner.png"})
|
||||
{description = "PDA Scanner", inventory_image = "ikea_staff_item_scanner.png"})
|
||||
|
|
|
@ -21,11 +21,7 @@ local function half_equals(t1, t2)
|
|||
end
|
||||
|
||||
function table.equals(t1, t2)
|
||||
if half_equals(t1, t2) and half_equals(t2, t1) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
return half_equals(t1, t2) and half_equals(t2, t1)
|
||||
end
|
||||
|
||||
assert(table.equals({"a", "b", c = "d", e = {"f", "g", "h", {"h"}}}, {"a", "b", c = "d", e = {"f", "g", "h", {"h"}}}))
|
||||
|
@ -63,7 +59,7 @@ function table.match(t1, t2)
|
|||
if (type(k) == "number") and table.is_in(t1, v) then
|
||||
table.insert(results, v)
|
||||
elseif not t1[k] then
|
||||
break
|
||||
-- Do Nothing
|
||||
elseif type(v) == "table" then
|
||||
local tmp_tbl = table.match(t1[k], v)
|
||||
if not table.equals(tmp_tbl, {}) then
|
||||
|
@ -111,7 +107,7 @@ local search_test_table = {
|
|||
|
||||
local search_expected_results = {search_test_table[4]}
|
||||
local search_test_results = table.search(search_test_table,
|
||||
{includes = {tags = {"b"}, num = 1}, excludes = {tags = {"a"}, num2 = 4}})
|
||||
{includes = {tags = {"b"}, num = 1}, excludes = {tags = {"a"}, num2 = 4}})
|
||||
local search_error_message =
|
||||
error_message:format("table.search", t2s(search_expected_results), t2s(search_test_results))
|
||||
error_message:format("table.search", t2s(search_expected_results), t2s(search_test_results))
|
||||
assert(table.equals(search_test_results, search_expected_results), search_error_message)
|
||||
|
|
Loading…
Reference in New Issue