mirror of
https://github.com/pyrollo/display_modpack.git
synced 2025-10-15 08:35:35 +02:00
Allow changing font of boards and remove wipe button (#5)
This commit is contained in:
@@ -33,10 +33,10 @@ local function set_formspec(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local display_text = minetest.formspec_escape(meta:get_string("display_text"))
|
||||
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;"..FS("Text")..";" .. display_text .. "]"..
|
||||
"button_exit[3,3.5;2,1;ok;"..FS("Write").."]"..
|
||||
"button_exit[1,3.5;2,1;wipe;"..FS("Wipe").."]")
|
||||
"size[6,3.5]"..default.gui_bg..default.gui_bg_img..default.gui_slots..
|
||||
"textarea[0.55,0.25;5.5,3;display_text;"..FS("Text")..";" .. display_text .. "]"..
|
||||
"button_exit[1,2.75;2,1;ok;"..FS("Write").."]"..
|
||||
"button[3,2.75;2,1;font;"..FS("Font").."]")
|
||||
end
|
||||
|
||||
-- On boards, everyone is allowed to write and wipe
|
||||
@@ -45,8 +45,9 @@ local function on_receive_fields(pos, formname, fields, player)
|
||||
if fields.ok or fields.key_enter then
|
||||
signs_api.set_display_text(pos, fields.display_text, fields.font)
|
||||
end
|
||||
if fields.wipe then
|
||||
signs_api.set_display_text(pos, "", fields.font)
|
||||
if fields.font then
|
||||
signs_api.set_display_text(pos, fields.display_text)
|
||||
font_api.show_font_list(player, pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user