Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
minetest_game
Commits
5dbc738d
Commit
5dbc738d
authored
10 years ago
by
Jat
Committed by
BlockMen
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add API doors : Sound for door open and close.
parent
5b5aa493
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game_api.txt
+2
-0
2 additions, 0 deletions
game_api.txt
mods/doors/init.lua
+14
-6
14 additions, 6 deletions
mods/doors/init.lua
with
16 additions
and
6 deletions
game_api.txt
+
2
−
0
View file @
5dbc738d
...
...
@@ -46,6 +46,8 @@ The doors mod allows modders to register custom doors.
node_box_top = regular nodebox, see [Node boxes], OPTIONAL,
selection_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
selection_box_top = regular nodebox, see [Node boxes], OPTIONAL,
sound_open_door = sound play for open door, OPTIONAL,
sound_close_door = sound play for close door, OPTIONAL,
only_placer_can_open = true/false,
^ If true, only placer can open the door (locked for others)
}
...
...
This diff is collapsed.
Click to expand it.
mods/doors/init.lua
+
14
−
6
View file @
5dbc738d
...
...
@@ -46,6 +46,14 @@ function doors.register_door(name, def)
def
.
selection_box_top
=
box
end
if
not
def
.
sound_close_door
then
def
.
sound_close_door
=
"door_close"
end
if
not
def
.
sound_open_door
then
def
.
sound_open_door
=
"door_open"
end
minetest
.
register_craftitem
(
name
,
{
description
=
def
.
description
,
inventory_image
=
def
.
inventory_image
,
...
...
@@ -138,17 +146,17 @@ function doors.register_door(name, def)
pos
.
y
=
pos
.
y
-
dir
minetest
.
swap_node
(
pos
,
{
name
=
replace
,
param2
=
p2
})
local
snd_1
=
"
_close
"
local
snd_2
=
"_open"
local
snd_1
=
def
.
sound
_close
_door
local
snd_2
=
def
.
sound_open_door
if
params
[
1
]
==
3
then
snd_1
=
"_open"
snd_2
=
"
_close
"
snd_1
=
def
.
sound_open_door
snd_2
=
def
.
sound
_close
_door
end
if
is_right
(
pos
)
then
minetest
.
sound_play
(
"door"
..
snd_1
,
{
pos
=
pos
,
gain
=
0
.
3
,
max_hear_distance
=
10
})
minetest
.
sound_play
(
snd_1
,
{
pos
=
pos
,
gain
=
0
.
3
,
max_hear_distance
=
10
})
else
minetest
.
sound_play
(
"door"
..
snd_2
,
{
pos
=
pos
,
gain
=
0
.
3
,
max_hear_distance
=
10
})
minetest
.
sound_play
(
snd_2
,
{
pos
=
pos
,
gain
=
0
.
3
,
max_hear_distance
=
10
})
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment