Add loudspeaker, to toggle music

master
Wuzzy 2018-11-14 19:34:46 +01:00
parent 05d5e84508
commit f6b84a2742
6 changed files with 39 additions and 0 deletions

View File

@ -64,6 +64,8 @@ The mod “`castle`” falls under the MIT License (the author allowed me an exc
The mod “`arrow_signs`” falls under the CC BY-SA 3.0.
The mod “`areas`” falls under the GNU LGPLv2.1 (or later).
The mod “`cottages`” falls under the GNU GPLv2 (the author allowed me an exception).
The mod “`supplemental`” falls under the MIT License, with one exception:
The texture `supplemental_loudspeaker.png` falls under the CC BY-SA 3.0 (from the developers of the Mesecons mod).
Everything else falls under the MIT License.
For even more detailed information (including credits), look for README files in the respective mod directories.

View File

@ -1,2 +1,3 @@
default
mpd
intllib?

View File

@ -89,6 +89,38 @@ minetest.register_node("supplemental:spikes_large", {
damage_per_second = 2
})
-- TODO: Remove the loudspeaker node when there is a more user-friendly means
-- to control the music.
local set_loudspeaker_infotext = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("loudspeaker (rightclick to toggle music)"))
end
minetest.register_node("supplemental:loudspeaker", {
description = S("loudspeaker"),
tiles = {"supplemental_loudspeaker.png"},
groups = { creative_breakable = 1 },
sounds = default.node_sound_wood_defaults(),
on_construct = set_loudspeaker_infotext,
on_rightclick = function(pos, node, clicker)
if mpd.playing then
mpd.stop_song()
clicker:set_attribute("play_music", "0")
else
mpd.next_song()
clicker:set_attribute("play_music", "1")
end
end,
})
minetest.register_abm({
nodenames = { "supplemental:loudspeaker" },
interval = 5,
chance = 1,
action = set_loudspeaker_infotext,
})
minetest.register_craftitem("supplemental:rock", {
description = S("piece of rock"),
inventory_image = "supplemental_rock.png",

View File

@ -11,6 +11,8 @@ purple sheet of paper = violettes Blatt Papier
green sheet of paper = grünes Blatt Papier
wheat = Weizen
piece of rock = Stück Stein
loudspeaker = Lautsprecher
loudspeaker (rightclick to toggle music) = Lautsprecher (Rechtsklick, um Musik umzuschalten)
# Test liquids are those seen at the viscosity station
flowing test liquid %i = fließende Testflüssigkeit %i
test liquid source %i = Testflüssigkeitsquelle %i

View File

@ -11,6 +11,8 @@ purple sheet of paper
green sheet of paper
wheat
piece of rock
loudspeaker
loudspeaker (rightclick to toggle music)
# Test liquids are those seen at the viscosity station
flowing test liquid %i
test liquid source %i

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B