Add loudspeaker, to toggle music
This commit is contained in:
parent
05d5e84508
commit
f6b84a2742
@ -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.
|
||||
|
@ -1,2 +1,3 @@
|
||||
default
|
||||
mpd
|
||||
intllib?
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
BIN
mods/supplemental/textures/supplemental_loudspeaker.png
Normal file
BIN
mods/supplemental/textures/supplemental_loudspeaker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 814 B |
Loading…
x
Reference in New Issue
Block a user