Disabling or editing the chat hud

Legoracer
New member
 
Posts: 3
Joined: Tue Oct 08, 2019 21:59
GitHub: Legoracer
In-game: Legoracer

Disabling or editing the chat hud

by Legoracer » Tue Oct 08, 2019 22:18

(I'm new to these forums, so I apologize if I posted in wrong category / copy of the post from general discussion after I realized that it's wrong category)

Hello,
I've been looking at the documentation for the past hour and can't seem to find anything that could be used to disable or edit the chat/command/console ("/" key).

Is this possible or is it currently past the possibilities of the engine?
Thanks!
 

User avatar
Nathan.S
Member
 
Posts: 919
Joined: Wed Sep 24, 2014 17:47
Location: Bigsby Texas
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Disabling or editing the chat hud

by Nathan.S » Wed Oct 09, 2019 02:31

Open Minetest, Settings, Change Keys, you can edit what key is used to open up the commands. I feel like that's probably not what you are actually wanting to attempt though. As you can still use F10 to open the console, or T to open chat, and then type your commands or chat messages. F2 will toggle the visibility of chat messages on screen during gameplay, but again as soon as you hit T or F10 the console will show up.

If you are trying to completely disable the ability to chat you might have to change source code and compile. I took a quick look through the settings, and you can reduce chat messages displayed to 2 and change the console height to 10% of the screensize, but it's still possible to scroll through that, so it really just make it more annoying than anything.

Depending again on what you are trying to achieve a mod could probably be used to just intercept and delete all chat messages, but of course this wouldn't work on a server unless you were running the server.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course
 

User avatar
Linuxdirk
Member
 
Posts: 2196
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: Disabling or editing the chat hud

by Linuxdirk » Wed Oct 09, 2019 08:52

Nathan.S wrote:If you are trying to completely disable the ability to chat you might have to change source code and compile.

... or you could write a mod containing this code.

Code: Select all
minetest.register_on_chat_message(function(name, message)
    return true
end)

By returning true the message gets marked as handled and the normal chat send function does not trigger.

https://github.com/minetest/minetest/bl ... 4055-L4058
 

micheal65536
Member
 
Posts: 130
Joined: Mon May 22, 2017 20:27

Re: Disabling or editing the chat hud

by micheal65536 » Wed Oct 09, 2019 18:41

Are you trying to disable it client-side or server-side? i.e. Are you trying to stop your little kid from seeing or using the chat (client-side), or are you trying to set up a server where nobody can chat (server-side)?

If it's server-side then Linuxdirk's code should work (although I believe commands, most notably /me and /msg, will still be allowed).

If it's client-side then I believe it's possible using CSM (client-side mods), although a lot of servers will (annoyingly) tell the client to never load any CSM (even if the CSM isn't doing anything that might affect the server... sigh). Unless the server blocks CSM, this code should work:

Code: Select all
minetest.regster_on_receiving_chat_message(function(message)
    return true
end)

minetest.register_on_sending_chat_message(function(message)
    return true
end)


This should block any messages from being displayed and should prevent both chat messages and commands from being sent.
 

Legoracer
New member
 
Posts: 3
Joined: Tue Oct 08, 2019 21:59
GitHub: Legoracer
In-game: Legoracer

Re: Disabling or editing the chat hud

by Legoracer » Fri Oct 11, 2019 21:17

Thank you all for replies,

What I'm exactly trying to do is replace the Chat UI with UI of my own.
Exactly what I want to do is either: remove the chat completely (unbind the key, block messages), or change the user interface related to the console/chat.
 

micheal65536
Member
 
Posts: 130
Joined: Mon May 22, 2017 20:27

Re: Disabling or editing the chat hud

by micheal65536 » Mon Oct 14, 2019 21:14

Legoracer wrote:Exactly what I want to do is either: remove the chat completely (unbind the key, block messages), or change the user interface related to the console/chat.

Could you clarify if you want to do this a) just for yourself, on all servers that you play on, or b) for everyone who plays on your own server/uses your mod?
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest