1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-12-16 03:15:20 +01:00

Alternate optional parsing mechanism

This commit is contained in:
Yves Quemener
2019-08-24 16:29:38 +09:00
parent 89fc7f863d
commit ccd4840c42
9 changed files with 47 additions and 11 deletions

View File

@@ -22,6 +22,14 @@ boards = {}
boards.name = minetest.get_current_modname()
boards.path = minetest.get_modpath(boards.name)
-- Load support for utfparse
local UParse
if minetest.global_exists("utfparse") then
UParse = function(...) return utfparse.parse(...) end
else
UParse = function(...) return ... end
end
-- Load support for intllib.
local S, NS = dofile(boards.path.."/intllib.lua")
boards.intllib = S
@@ -43,7 +51,7 @@ end
local function on_receive_fields(pos, formname, fields, player)
if fields then
if fields.ok or fields.key_enter then
signs_api.set_display_text(pos, fields.display_text, fields.font)
signs_api.set_display_text(pos, UParse(fields.display_text), fields.font)
end
if fields.wipe then
signs_api.set_display_text(pos, "", fields.font)