Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add change font button to board formspec #5

Merged
merged 4 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions boards/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions boards/locale/boards.de.tr
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions boards/locale/boards.fr.tr
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions boards/locale/boards.ms.tr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# textdomain: boards
Black board=Papan hitam
Green board=
Text=
Write=
Wipe=
Font=
Black board=Papan hitam
Green board=
6 changes: 3 additions & 3 deletions boards/locale/template.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# textdomain: boards
Black board=
Green board=
Text=
Write=
Wipe=
Font=
Black board=
Green board=
12 changes: 6 additions & 6 deletions signs/locale/signs.de.tr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 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
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
12 changes: 6 additions & 6 deletions signs/locale/signs.fr.tr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 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
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
12 changes: 6 additions & 6 deletions signs/locale/signs.ms.tr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# textdomain: signs
Wooden sign=
Wooden long sign=
Wooden direction sign=Papan tanda arah kayu
Poster=Poster
Small label=
Label=
Close=
Edit=
Title=
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=
12 changes: 6 additions & 6 deletions signs/locale/template.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# textdomain: signs
Wooden sign=
Wooden long sign=
Wooden direction sign=
Poster=
Small label=
Label=
Close=
Edit=
Title=
Text=
Title font=
Write=
(right-click to read more text)=
Wooden sign=
Wooden long sign=
Wooden direction sign=
Poster=
Small label=
Label=