add sounds

This commit is contained in:
1F616EMO 2023-09-01 07:11:12 +08:00
parent 9a40d663c0
commit 62690252d3
No known key found for this signature in database
GPG Key ID: EF52EFA8E05859B2
6 changed files with 38 additions and 5 deletions

View File

@ -1,4 +1,9 @@
## License of the code
# Licenses of Minetest rPlace
The source codes and media used in rPlace are in different licenses. However, they are all free (as in freedom) to use.
## License of the code (LGPLv2.1+)
Copyright (C) 2023 1F616EMO
This library is free software; you can redistribute it and/or
@ -15,7 +20,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
### License of Optional HTML Viewer
### License of HTML Viewer Utility (MIT)
This license covers files found in the `utils/html_viewer` file tree.
@ -41,6 +46,14 @@ This license covers files found in the `utils/html_viewer` file tree.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## License of media
All of them are CC BY-SA 4.0 or later unless other specified.
License URl: https://creativecommons.org/licenses/by-sa/4.0/
All of them are CC BY-SA 4.0 unless other specified. The attribution shoule be "1F616EMO".
License URL: <https://creativecommons.org/licenses/by-sa/4.0/>
However, the following media have different license:
1. `mods/rp_core/sounds/rp_nodes_pop.ogg`, `mods/rp_color_pick/sounds/rp_color_pick_suish_pop.ogg`
* Works from Scratch support materieals ("Choose a Sound" from editor menu).
* License: [Creative Commons Attribution-ShareAlike 2.0 license (CC BY-SA 2.0)](https://creativecommons.org/licenses/by-sa/2.0/)
* Please also see [the related Term of Use of Scratch](https://scratch.mit.edu/terms_of_use#scratch-content).

View File

@ -21,6 +21,16 @@
local S = minetest.get_translator("rp_color_pick")
local function play_suish_pop(pname)
minetest.sound_play({
name = "rp_color_pick_suish_pop",
fade = 0,
gain = 0.7,
}, {
to_player = pname,
}, true)
end
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
if not puncher:is_player() then return end
local pname = puncher:get_player_name()
@ -37,6 +47,7 @@ minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
puncher:set_wielded_item(new_equip)
inv:add_item("main", old_wield)
play_suish_pop(pname)
minetest.chat_send_player(pname, minetest.colorize("orange", S("Picked @1",def.description)))
end
end

Binary file not shown.

View File

@ -70,6 +70,14 @@ rp_utils.every_n_seconds(0.5, function()
end
end)
local function play_pop(pos)
minetest.sound_play({
name = "rp_nodes_pop",
fade = 0,
}, {
pos = pos,
}, true)
end
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if not placer:is_player() then return true end
@ -91,6 +99,7 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
deny[name] = nil
deny_clear[name] = nil
end)
play_pop(pos)
return true
end)

Binary file not shown.