Add button to toggle music

This commit is contained in:
Wuzzy 2018-09-13 22:37:28 +02:00
parent 35d3760353
commit 55120c92da
11 changed files with 22 additions and 0 deletions

View File

@ -38,6 +38,7 @@ default.gui_suvival_form = "size[8,10]"..
default.gui_bg_img.. default.gui_bg_img..
default.gui_slots.. default.gui_slots..
"button_exit[-0.1,-0.3;3,1;gotostart;"..minetest.formspec_escape(S("Back to start")).."]".. "button_exit[-0.1,-0.3;3,1;gotostart;"..minetest.formspec_escape(S("Back to start")).."]"..
"button[-0.1,0.7;3,1;togglemusic;"..minetest.formspec_escape(S("Toggle music")).."]"..
"label[0,3.75;"..minetest.formspec_escape(S("Player inventory:")).."]".. "label[0,3.75;"..minetest.formspec_escape(S("Player inventory:")).."]"..
"list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]".. "list[current_player;main;0,5.5;8,3;8]"..

View File

@ -49,6 +49,7 @@ Player inventory: = Spielerinventar:
This furnace is active and constantly burning its fuel. = Der Ofen ist aktiv und verbrennt beständig seinen Brennstoff. This furnace is active and constantly burning its fuel. = Der Ofen ist aktiv und verbrennt beständig seinen Brennstoff.
This furnace is inactive. Please read the sign above. = Der Ofen ist inaktiv. Bitte lesen Sie das obige Schild. This furnace is inactive. Please read the sign above. = Der Ofen ist inaktiv. Bitte lesen Sie das obige Schild.
Back to start = Zurück zum Anfang Back to start = Zurück zum Anfang
Toggle music = Musik umschalten
Crafting grid: = Fertigungsgitter: Crafting grid: = Fertigungsgitter:
Output slot: = Resultat: Output slot: = Resultat:

View File

@ -50,6 +50,7 @@ Player inventory: = Αντικείμενα παίχτη
This furnace is active and constantly burning its fuel. = Αυτός ο φούρνος είναι ανοιχτός και καει συνεχώς το καύσιμο. This furnace is active and constantly burning its fuel. = Αυτός ο φούρνος είναι ανοιχτός και καει συνεχώς το καύσιμο.
This furnace is inactive. Read the instructions to learn how to activate it. = Αυτός ο φούρνος είναι σβηστός. Διάβασε τις οδηγίες για να μάθεις πως να τον ανοίξεις. This furnace is inactive. Read the instructions to learn how to activate it. = Αυτός ο φούρνος είναι σβηστός. Διάβασε τις οδηγίες για να μάθεις πως να τον ανοίξεις.
Back to start = Πίσω στην αρχή Back to start = Πίσω στην αρχή
#Toggle music =
Crafting grid: = Τετραγωνα κατασκευών Crafting grid: = Τετραγωνα κατασκευών
Output slot: = τετράγωνο εξόδου Output slot: = τετράγωνο εξόδου

View File

@ -49,6 +49,7 @@ Player inventory: = inventario del jugador:
This furnace is active and constantly burning its fuel. = Este horno está encendido y quemando su combustible constantemente. This furnace is active and constantly burning its fuel. = Este horno está encendido y quemando su combustible constantemente.
This furnace is inactive. Read the instructions to learn how to activate it. = Este horno está apagado. Lee las instrucciones para aprender a encenderlo. This furnace is inactive. Read the instructions to learn how to activate it. = Este horno está apagado. Lee las instrucciones para aprender a encenderlo.
Back to start = Volver al principio Back to start = Volver al principio
#Toggle music =
Crafting grid: = cuadrícula de manufactura: Crafting grid: = cuadrícula de manufactura:
Output slot: = hueco de productos: Output slot: = hueco de productos:

View File

@ -50,6 +50,7 @@ Player inventory: = Inventaire du joueur :
This furnace is active and constantly burning its fuel. = Ce four est actif et brûle constamment son carburant. This furnace is active and constantly burning its fuel. = Ce four est actif et brûle constamment son carburant.
This furnace is inactive. Read the instructions to learn how to activate it. = Ce four est inactif. Lisez les instructions pour savoir comment l'activer. This furnace is inactive. Read the instructions to learn how to activate it. = Ce four est inactif. Lisez les instructions pour savoir comment l'activer.
Back to start = Revenir au début Back to start = Revenir au début
#Toggle music =
Crafting grid: = Grille de fabrication : Crafting grid: = Grille de fabrication :
Output slot: = Production : Output slot: = Production :

View File

@ -50,6 +50,7 @@ Player inventory: = Inventaris pemain:
This furnace is active and constantly burning its fuel. = Tungku ini nyala dan secara konstan membakar bahan bakarnya. This furnace is active and constantly burning its fuel. = Tungku ini nyala dan secara konstan membakar bahan bakarnya.
This furnace is inactive. Read the instructions to learn how to activate it. = Tungku ini mati. Baca instruksi untuk mempelajari cara menyalakannya. This furnace is inactive. Read the instructions to learn how to activate it. = Tungku ini mati. Baca instruksi untuk mempelajari cara menyalakannya.
Back to start = Ke awal Back to start = Ke awal
#Toggle music =
Crafting grid: = Papan kerajinan: Crafting grid: = Papan kerajinan:
Output slot: = Hasil: Output slot: = Hasil:

View File

@ -50,6 +50,7 @@ Player inventory: = Inventario giocatore:
This furnace is active and constantly burning its fuel. = Questa fornace è attiva e sta bruciando il combustibile. This furnace is active and constantly burning its fuel. = Questa fornace è attiva e sta bruciando il combustibile.
This furnace is inactive. Please read the sign above. = Questa fornace è inattiva. Leggere il cartello. This furnace is inactive. Please read the sign above. = Questa fornace è inattiva. Leggere il cartello.
Back to start = Da capo Back to start = Da capo
#Toggle music =
Crafting grid: = Griglia di fabbricazione: Crafting grid: = Griglia di fabbricazione:
Output slot: = Prodotto: Output slot: = Prodotto:

View File

@ -49,6 +49,7 @@ Player inventory: = Bezittingen:
This furnace is active and constantly burning its fuel. = De oven is actief en verbrandt voortdurend brandstof. This furnace is active and constantly burning its fuel. = De oven is actief en verbrandt voortdurend brandstof.
This furnace is inactive. Read the instructions to learn how to activate it. = Deze oven is niet actief. Lees de aanwijzingen en leer hoe de oven aangezet wordt. This furnace is inactive. Read the instructions to learn how to activate it. = Deze oven is niet actief. Lees de aanwijzingen en leer hoe de oven aangezet wordt.
Back to start = Terug Back to start = Terug
#Toggle music =
Crafting grid: = Crafting raster: Crafting grid: = Crafting raster:
Output slot: = Resultaat: Output slot: = Resultaat:

View File

@ -50,6 +50,7 @@ Player inventory:
This furnace is active and constantly burning its fuel. This furnace is active and constantly burning its fuel.
This furnace is inactive. Please read the sign above. This furnace is inactive. Please read the sign above.
Back to start Back to start
Toggle music
Crafting grid: Crafting grid:
Output slot: Output slot:

View File

@ -197,3 +197,14 @@ minetest.register_chatcommand("mvolume", {
end end
end, end,
}) })
minetest.register_on_player_receive_fields(function(player, formname, fields)
if(fields.togglemusic) then
if mpd.playing then
mpd.stop_song()
else
mpd.next_song()
end
end
end)

View File

@ -1,6 +1,8 @@
### mpd Mod for Minetest ### mpd Mod for Minetest
(c) 2017 orwell96 (c) 2017 orwell96
Slightly modified for the Tutorial.
This mod is licensed under the MIT License. This mod is licensed under the MIT License.
Adds an easy but powerful background music backend. Adds an easy but powerful background music backend.