mirror of
https://github.com/pyrollo/display_modpack.git
synced 2025-10-16 00:55:36 +02:00
Add luacheck, update translations, replace ABMs, bug fixes (#1)
* luacheck, mt 5 translation, german translation, maintenance * fix luacheck warnings * Fix digital clock nodebox and texture * Fix luacheck usage * Add comment why fonts are not split into several lines
This commit is contained in:
@@ -22,10 +22,9 @@ boards = {}
|
||||
boards.name = minetest.get_current_modname()
|
||||
boards.path = minetest.get_modpath(boards.name)
|
||||
|
||||
-- Load support for intllib.
|
||||
local S, NS = dofile(boards.path.."/intllib.lua")
|
||||
boards.intllib = S
|
||||
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||
-- Translation support
|
||||
local S = minetest.get_translator(boards.name)
|
||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
||||
|
||||
-- Load font
|
||||
dofile(boards.path.."/font_tinycurs.lua")
|
||||
@@ -34,9 +33,9 @@ local function set_formspec(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec",
|
||||
"size[6,4]"..default.gui_bg..default.gui_bg_img..default.gui_slots..
|
||||
"textarea[0.5,0.7;5.5,3;display_text;"..F("Text")..";${display_text}]"..
|
||||
"button_exit[3,3.5;2,1;ok;"..F("Write").."]"..
|
||||
"button_exit[1,3.5;2,1;wipe;"..F("Wipe").."]")
|
||||
"textarea[0.5,0.7;5.5,3;display_text;"..FS("Text")..";${display_text}]"..
|
||||
"button_exit[3,3.5;2,1;ok;"..FS("Write").."]"..
|
||||
"button_exit[1,3.5;2,1;wipe;"..FS("Wipe").."]")
|
||||
end
|
||||
|
||||
-- On boards, everyone is allowed to write and wipe
|
||||
@@ -51,7 +50,7 @@ local function on_receive_fields(pos, formname, fields, player)
|
||||
end
|
||||
end
|
||||
|
||||
models = {
|
||||
local models = {
|
||||
black_board = {
|
||||
depth = 1/16, width = 1, height = 1,
|
||||
entity_fields = {
|
||||
@@ -67,6 +66,7 @@ models = {
|
||||
tiles = { "default_wood.png", "default_wood.png",
|
||||
"default_wood.png", "default_wood.png",
|
||||
"default_wood.png", "board_black_front.png" },
|
||||
_itemframe_texture = "board_black_front.png",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@@ -79,6 +79,10 @@ models = {
|
||||
set_formspec(pos)
|
||||
display_api.on_construct(pos)
|
||||
end,
|
||||
on_punch = function(pos)
|
||||
set_formspec(pos)
|
||||
display_api.update_entities(pos)
|
||||
end,
|
||||
on_receive_fields = on_receive_fields,
|
||||
},
|
||||
},
|
||||
@@ -98,6 +102,7 @@ models = {
|
||||
"default_wood.png", "default_wood.png",
|
||||
"default_wood.png", "board_green_front.png" },
|
||||
drawtype = "nodebox",
|
||||
_itemframe_texture = "board_green_front.png",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
@@ -109,6 +114,10 @@ models = {
|
||||
set_formspec(pos)
|
||||
display_api.on_construct(pos)
|
||||
end,
|
||||
on_punch = function(pos)
|
||||
set_formspec(pos)
|
||||
display_api.update_entities(pos)
|
||||
end,
|
||||
on_receive_fields = on_receive_fields,
|
||||
},
|
||||
},
|
||||
@@ -126,7 +135,7 @@ minetest.register_craft(
|
||||
output = "boards:black_board",
|
||||
recipe = {
|
||||
{"group:wood", "group:stone", "dye:black"},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft(
|
||||
@@ -134,6 +143,6 @@ minetest.register_craft(
|
||||
output = "boards:green_board",
|
||||
recipe = {
|
||||
{"group:wood", "group:stone", "dye:dark_green"},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user