[Mod] HUD Notify [hud_notify]

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

[Mod] HUD Notify [hud_notify]

by ANAND » Sat Apr 28, 2018 11:19

HUD Notify is a very simple mod that comprises of just one command /notify, which is very similar to the builtin /msg command, except for the fact that /notify displays a message using HUD elements (instead of displaying via chat) for better noticeability. Due to the higher potential for abuse, the use of this command is restricted to moderators and above.

Syntax:
Code: Select all
/notify <player_name> <msg>


Example:
Code: Select all
/notify LegendaryGriefer Stop griefing or face a ban!


minetest.conf
Code: Select all
notify.hud_duration

This setting takes a numeric value (10 by default) in seconds, which represents the duration of the message's visibility.

Screenshot:
Image

Mod dependencies: None
License: MIT

View code
Download

EDIT: Mod has been renamed to hud_notify to resolve any naming conflicts with existing / future mods
Last edited by ANAND on Fri May 11, 2018 02:13, edited 3 times in total.
 

User avatar
ExeterDad
Member
 
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
Location: New Hampshire U.S.A
In-game: ExeterDad

Re: [Mod] Notify [notify]

by ExeterDad » Sat Apr 28, 2018 12:53

I like the concept :)
But a potential downfall (no pun intended) is a player who is sneaking over lava, or any other dangerous place would lose control of all controls when the formspec appears. They would fall.
Perhaps check the players controls and detect the use of "sneak" at least before displaying? And que the PM to be displayed later if "sneak" is in use?
 

User avatar
Krock
Developer
 
Posts: 4148
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Notify [notify]

by Krock » Sat Apr 28, 2018 12:56

Alternatively you could move the text to a HUD element, which then can be dismissed using a chat command.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

Re: [Mod] Notify [notify]

by ANAND » Sat Apr 28, 2018 13:05

ExeterDad wrote:I like the concept :)
But a potential downfall (no pun intended) is a player who is sneaking over lava, or any other dangerous place would lose control of all controls when the formspec appears. They would fall.
Perhaps check the players controls and detect the use of "sneak" at least before displaying? And que the PM to be displayed later if "sneak" is in use?


Very true, and just when I was looking for a more elegant solution...

Krock wrote:Alternatively you could move the text to a HUD element, which then can be dismissed using a chat command.


... HUD element it is! :)

I'll get it done within the next 24 hours.
 

User avatar
Stix
Member
 
Posts: 1297
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

Re: [Mod] Notify [notify]

by Stix » Sat Apr 28, 2018 20:17

very useful, but id like an option to be notified with chat under your crosshairs and you cant type /view to see the notification, and a bell sound for notifications.
Hey, what can i say? I'm the bad guy.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

Re: [Mod] Notify [notify]

by ANAND » Sun Apr 29, 2018 13:56

Stix wrote:very useful, but id like an option to be notified with chat under your crosshairs and you cant type /view to see the notification, and a bell sound for notifications.


Good idea, but I'm afraid it won't adhere to the "theme" of this mod, which is fast, quick and noticeable. I'm in the process of converting the formspec into an HUD element, which automatically disappears when a custom command, let's say, /ok, is entered.

I am open to other suggestions to dismiss the HUD, which is more elegant than having to type /ok in the chat; maybe another HUD element within the message element itself?
 

User avatar
Stix
Member
 
Posts: 1297
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

Re: [Mod] Notify [notify]

by Stix » Mon Apr 30, 2018 20:06

ANAND wrote:
Stix wrote:very useful, but id like an option to be notified with chat under your crosshairs and you cant type /view to see the notification, and a bell sound for notifications.


Good idea, but I'm afraid it won't adhere to the "theme" of this mod, which is fast, quick and noticeable. I'm in the process of converting the formspec into an HUD element, which automatically disappears when a custom command, let's say, /ok, is entered.

I am open to other suggestions to dismiss the HUD, which is more elegant than having to type /ok in the chat; maybe another HUD element within the message element itself?

have the notification disapear from the hud after 30 seconds, so no clunky controls.
Hey, what can i say? I'm the bad guy.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

Re: [Mod] Notify [notify]

by ANAND » Tue May 01, 2018 04:12

Stix wrote:have the notification disapear from the hud after 30 seconds, so no clunky controls.


That's precisely what I'm doing right now, but 30 secs. is too long IMO. I'll make it read a setting from minetest.conf, and if it doesn't exist, it defaults to 10 seconds.
 

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

Re: [Mod] Notify [notify]

by ANAND » Tue May 01, 2018 09:45

Major update:

  • Re-implemented using HUD elements
  • Made duration of message visibility configurable (by means of a numeric setting in minetest.conf)
 

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

Re: [Mod] HUD Notify [hud_notify]

by ANAND » Wed May 09, 2018 16:22

Update:

Mod has been renamed to hud_notify to resolve potential naming conflicts.
 

User avatar
PETE
Member
 
Posts: 70
Joined: Thu Sep 21, 2017 05:21
Location: IDK Ctf server
GitHub: PETE
In-game: PETE-Randomizer

Re: [Mod] HUD Notify [hud_notify]

by PETE » Mon Jun 04, 2018 10:02

is this only used by moderators and admin because people can spam this to people
Whats the trick? I wish I knew
 

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

Re: [Mod] HUD Notify [hud_notify]

by ANAND » Mon Jun 04, 2018 12:16

Yes, this requires kick, ban privs (as mentioned in the first post).
 

User avatar
BillyS
Member
 
Posts: 18
Joined: Thu May 31, 2018 17:10
Location: By my computer
GitHub: Billy-S
IRC: BillyS
In-game: BillyS

Re: [Mod] HUD Notify [hud_notify]

by BillyS » Mon Jun 04, 2018 14:45

Sweet. This is very useful for players who have turned their chat off (Especially if they do so to ignore an admin or moderator).
<SHAMELESS PLUG> Play on my server Blocky Survival! It's unique! </SHAMELESS PLUG>
 

User avatar
ANAND
Member
 
Posts: 252
Joined: Sun Jan 28, 2018 12:54
Location: India
GitHub: ClobberXD
IRC: ANAND
In-game: ANAND ClobberXD [A-Za-z]+Tomato

Re: [Mod] HUD Notify [hud_notify]

by ANAND » Mon Sep 17, 2018 13:02

Major Update

  • Added a setting [hud_notify.hide_sender] which toggles the showing of sender name.
  • Added support for server-wide notifications using [/notify_all <msg>].
  • Numerous other improvements to the code.
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 10 guests