Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rhotator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
rhotator
Commits
9fee3779
Commit
9fee3779
authored
6 years ago
by
entuland
Browse files
Options
Downloads
Patches
Plain Diff
integrated notify improvements
parent
8ffef59d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
notify.lua
+11
-4
11 additions, 4 deletions
notify.lua
with
11 additions
and
4 deletions
notify.lua
+
11
−
4
View file @
9fee3779
...
...
@@ -14,8 +14,7 @@ local notify = {}
notify
.
__index
=
notify
setmetatable
(
notify
,
notify
)
local
function
hud_remove
(
player
)
local
playername
=
player
:
get_player_name
()
local
function
hud_remove
(
player
,
playername
)
local
hud
=
huds
[
playername
]
if
not
hud
then
return
end
if
os.time
()
<
hud_timeout_seconds
+
hud
.
time
then
...
...
@@ -57,15 +56,23 @@ end
notify
.
error
=
notify
.
err
notify
.
__call
=
function
(
self
,
player
,
message
,
params
)
local
playername
if
type
(
player
)
==
"string"
then
playername
=
player
player
=
minetest
.
get_player_by_name
(
playername
)
elseif
player
and
player
.
get_player_name
then
playername
=
player
:
get_player_name
()
else
return
end
message
=
"["
..
mod_name
..
"] "
..
message
local
playername
=
player
:
get_player_name
()
local
hud
=
huds
[
playername
]
if
hud
then
player
:
hud_remove
(
hud
.
id
)
end
hud_create
(
player
,
message
,
params
)
minetest
.
after
(
hud_timeout_seconds
,
function
()
hud_remove
(
player
)
hud_remove
(
player
,
playername
)
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