mirror of
https://github.com/pyrollo/display_modpack.git
synced 2025-10-15 08:35:35 +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:
@@ -18,8 +18,8 @@
|
||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||
--]]
|
||||
|
||||
local S = signs.intllib
|
||||
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||
local S = signs.S
|
||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
||||
|
||||
-- Poster specific formspec
|
||||
local function display_poster(pos, node, player)
|
||||
@@ -47,11 +47,11 @@ local function display_poster(pos, node, player)
|
||||
minetest.formspec_escape(meta:get_string("text"))))
|
||||
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, F("Close"))
|
||||
fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, FS("Close"))
|
||||
else
|
||||
fs = string.format(
|
||||
"%sbutton[1,8;2,1;edit;%s]button_exit[4,8;2,1;ok;%s]",
|
||||
fs, F("Edit"), F("Close"))
|
||||
fs, FS("Edit"), FS("Close"))
|
||||
end
|
||||
minetest.show_formspec(player:get_player_name(), fname, fs)
|
||||
end
|
||||
@@ -70,10 +70,10 @@ local function edit_poster(pos, node, player)
|
||||
textarea[0.5,1.7;6,6;text;%s;%s]
|
||||
button[1.25,7;2,1;font;%s]
|
||||
button_exit[3.25,7;2,1;write;%s]]=],
|
||||
default.gui_bg, default.gui_bg_img, default.gui_slots, F("Title"),
|
||||
default.gui_bg, default.gui_bg_img, default.gui_slots, FS("Title"),
|
||||
minetest.formspec_escape(meta:get_string("display_text")),
|
||||
F("Text"), minetest.formspec_escape(meta:get_string("text")),
|
||||
F("Title font"), F("Write"))
|
||||
FS("Text"), minetest.formspec_escape(meta:get_string("text")),
|
||||
FS("Title font"), FS("Write"))
|
||||
minetest.show_formspec(player:get_player_name(), fname, fs)
|
||||
end
|
||||
end
|
||||
@@ -95,17 +95,17 @@ local function on_receive_fields_poster(pos, formname, fields, player)
|
||||
meta:set_string("display_text", fields.display_text)
|
||||
meta:set_string("text", fields.text)
|
||||
meta:set_string("infotext", "\""..fields.display_text
|
||||
.."\"\n"..S("(right-click to read more text)"))
|
||||
.."\"\n"..FS("(right-click to read more text)"))
|
||||
display_api.update_entities(pos)
|
||||
end
|
||||
if (fields.write or fields.key_enter) then
|
||||
display_poster(pos, node, player)
|
||||
elseif (fields.font) then
|
||||
font_api.show_font_list(player, pos, function (playername, pos)
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
local node = minetest.get_node(pos)
|
||||
if player and node then
|
||||
edit_poster(pos, node, player)
|
||||
font_api.show_font_list(player, pos, function (playername, npos)
|
||||
local user = minetest.get_player_by_name(playername)
|
||||
local node2 = minetest.get_node(npos)
|
||||
if user and node2 then
|
||||
edit_poster(npos, node2, user)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -168,7 +168,7 @@ local models = {
|
||||
drawtype = "mesh",
|
||||
mesh = "signs_dir_right.obj",
|
||||
selection_box = { type="fixed", fixed = {-0.5, -7/32, 0.5, 7/16, 7/32, 7/16}},
|
||||
collision_box = { type="fixed", fixed = {-0,5, -7/32, 0.5, 7/16, 7/32, 7/16}},
|
||||
collision_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}},
|
||||
groups= { dig_immediate = 2 },
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user