Mario384 Posted May 15, 2019 Share Posted May 15, 2019 (edited) Back when mod support for DST was added, Klei's Peter made a whisper-only mod. At some point it broke, but currently I want to mute global for a TTT-style gamemode I want to make. This is the only code Peter had in his mod, in modmain.lua: function WhisperInit( self ) self.whisper = true self.chat_type:SetString(GLOBAL.STRINGS.UI.CHATINPUTSCREEN.WHISPER) GLOBAL.STRINGS.UI.CONTROLSSCREEN.CONTROLS[GLOBAL.CONTROL_TOGGLE_SAY] = GLOBAL.STRINGS.UI.CONTROLSSCREEN.CONTROLS[GLOBAL.CONTROL_TOGGLE_WHISPER] end AddGlobalClassPostConstruct( "screens/chatinputscreen", "ChatInputScreen", WhisperInit) Any ideas on how to make it work now? Even manually modifing chatinputscreen.lua to always have self.whisper be true seems to have no effect. Edited May 15, 2019 by Mario384 Link to comment Share on other sites More sharing options...
CarlZalph Posted May 15, 2019 Share Posted May 15, 2019 @Mario384 The entire whisper subsystem is reliant on the client to filter- every client receives the chat messages everywhere all the time but it hides it from the user. Take a look at hooking the Networking_Say function. Peter changed how the input text box handles sending, whereas if you hook that function there you're going a little lower level and modifying the underlying function that sends off the prints to the client's UI. Link to comment Share on other sites More sharing options...
Mario384 Posted May 15, 2019 Author Share Posted May 15, 2019 (edited) Alright, that certainly is a step in the right direction. Now, the issue is implanting the modified version of Networking_Say into the game. Networking is just a collection of functions, so I'm not exactly sure how to target it. I've tried using AddGamePostInit to add a different version of Networking_Say from modmain, but it doesn't seem to work. EDIT: I've also just tried replacing networking.lua using the mod and commented out the entirety of Networking_Say, but it still works. Am I missing something here? Edited May 15, 2019 by Mario384 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now