1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-10-14 16:25:20 +02:00

Allow changing font of boards and remove wipe button (#5)

This commit is contained in:
Niklp
2023-09-13 15:45:25 +02:00
committed by GitHub
parent e52b742b9b
commit d7d55fbb79
9 changed files with 43 additions and 42 deletions

View File

@@ -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

View File

@@ -1,6 +1,6 @@
# textdomain: boards
Black board=Schwarze Tafel
Green board=Grüne Tafel
Text=Text
Write=Schreiben
Wipe=Abwischen
Font=Schriftart
Black board=Schwarze Tafel
Green board=Grüne Tafel

View File

@@ -1,6 +1,6 @@
# textdomain: boards
Black board=Tableau noir
Green board=Tableau vert
Text=Texte
Write=Écrire
Wipe=Effacer
Font=Police
Black board=Tableau noir
Green board=Tableau vert

View File

@@ -1,6 +1,6 @@
# textdomain: boards
Black board=Papan hitam
Green board=
Text=
Write=
Wipe=
Font=
Black board=Papan hitam
Green board=

View File

@@ -1,6 +1,6 @@
# textdomain: boards
Black board=
Green board=
Text=
Write=
Wipe=
Font=
Black board=
Green board=

View File

@@ -1,10 +1,4 @@
# textdomain: signs
Wooden sign=Hölzernes Schild
Wooden long sign=Langes hölzernes Schild
Wooden direction sign=Hölzerner Wegweiser
Poster=Poster
Small label=Kleines Etikett
Label=Etikett
Close=Schließen
Edit=Bearbeiten
Title=Titel
@@ -12,3 +6,9 @@ Text=Text
Title font=Titel Schriftart
Write=Schreiben
(right-click to read more text)=(Rechtsklick für mehr Text)
Wooden sign=Hölzernes Schild
Wooden long sign=Langes hölzernes Schild
Wooden direction sign=Hölzerner Wegweiser
Poster=Poster
Small label=Kleines Etikett
Label=Etikett

View File

@@ -1,10 +1,4 @@
# textdomain: signs
Wooden sign=Signe en bois
Wooden long sign=Long signe en bois
Wooden direction sign=Panneau de direction en bois
Poster=Affiche
Small label=Petite étiquette
Label=Étiquette
Close=Fermer
Edit=Éditer
Title=Titre
@@ -12,3 +6,9 @@ Text=Texte
Title font=Police de titre
Write=Écrire
(right-click to read more text)=(Clic-droit pour afficher le texte entier)
Wooden sign=Signe en bois
Wooden long sign=Long signe en bois
Wooden direction sign=Panneau de direction en bois
Poster=Affiche
Small label=Petite étiquette
Label=Étiquette

View File

@@ -1,10 +1,4 @@
# textdomain: signs
Wooden sign=
Wooden long sign=
Wooden direction sign=Papan tanda arah kayu
Poster=Poster
Small label=
Label=
Close=
Edit=
Title=
@@ -12,3 +6,9 @@ Text=
Title font=
Write=
(right-click to read more text)=(klik-kanan untuk baca teks penuh)
Wooden sign=
Wooden long sign=
Wooden direction sign=Papan tanda arah kayu
Poster=Poster
Small label=
Label=

View File

@@ -1,10 +1,4 @@
# textdomain: signs
Wooden sign=
Wooden long sign=
Wooden direction sign=
Poster=
Small label=
Label=
Close=
Edit=
Title=
@@ -12,3 +6,9 @@ Text=
Title font=
Write=
(right-click to read more text)=
Wooden sign=
Wooden long sign=
Wooden direction sign=
Poster=
Small label=
Label=