txAdmin
txAdmin copied to clipboard
[Feature]: Option to suppress txAdmin announcements and utilize own system
Scope
Developer API
Feature Description
Some servers would like to disable txAdmin notifications and instead utilize their own system bridged by the txAdmin:events:announcement
event. At the moment, although you can hook into event, there is no way to purely disable txAdmin's standalone handling.
Use Case
Server can utilize their own notification system instead of the txAdmin system.
Proposed Solution
We can solve this by implementing a ConVar that would disable internal handling.
Additional Info
No response
I would like this convar to be generic, where you would be able to specify more than one event handler to be bypassed.
For example:
+set txAdmin-bypassEventHandler "playerWarned, announcement"
Due to the complexity of the convar (csv is so hard isn't it) would be nice to have a custom inbox for it in the settings that would do some validating (input.trim().split(/,\s*/)
and check individual parts).
Just adding back reference:
So i do not want the events to be bypassed, but this still brings the question, how do we handle people wanting to handle announcements/dm messages? I don't know, but that's much more a "ugly notistack bypass" than an event bypass per se. Also, considering we only have announcements and DM to overwrite, this could totally be a checkbox in the settings.
@tabarra So how about implementing a convar that prevents anything notification related which can also be toggled via a checkbox in webinterface as you said?
Maybe something like:
+set txAdmin-useCustomNotifications true
Just to make sure it's clear: By Notification related i mean: announcements, dm's and player warns.
I think player warns should still be handled by txadmin, as it is (imho) the best implementation of a warn in fivem.
And keep in mind that DM via snackbar is actually new in txadmin v5, not yet released.
And i'm not so sure about joining both in a single setting, may be better to have two separate vars, and whatever it is done, should be restricted to changes on the server side only like preventing the events to being sent to the client or something like that.
I'm one of those developers who wants everything in one design, and I'm sure I'm not the only one. So there's nothing wrong with having the option to implement a custom warning imo.
And i'm not so sure about joining both in a single setting, may be better to have two separate vars, and whatever it is done, should be restricted to changes on the server side only like preventing the events to being sent to the client or something like that.
Sounds right. In this case (if we allow custom warning screens) We need 3 cvars right?
Yes
Okay so:
The convars could be:
txAdmin-customAnnouncements txAdmin-customMessages txAdmin-customWarnings
In the Webinterface we will have 3 new checkboxes in the settings section "fxserver" I guess.
If those cvars/checkboxes are true only the corresponding client event will not be triggered. The rest of the server logic will still be in tact.
If @tabarra approves that, I'd start implementing it.
And keep in mind that DM via snackbar is actually new in txadmin v5, not yet released.
in v4 there also not even an event for dms to implement custom behaviour for that. (except having your own chatbox but that's something different)
To add this feature to the current version I would suggest only adding two cvars/checkboxes: txAdmin-customAnnouncement and txAdmin-customWarnings and adding the third one with v5.
Other way would be to bring this feature to v5 only, but when will it release?
The next update will be the v5, coming in a few weeks.
Nothing comes out before that.
Okay so:
The convars could be:
txAdmin-customAnnouncements txAdmin-customMessages txAdmin-customWarnings
In the Webinterface we will have 3 new checkboxes in the settings section "fxserver" I guess.
If those cvars/checkboxes are true only the corresponding client event will not be triggered. The rest of the server logic will still be in tact.
If @tabarra approves that, I'd start implementing it.
Does this meet your expectations?
Change them to singular, and Message becomes DirectMessage.
Also don't bother editing the settings page, just hardcode it on fxrunner and I'll do the core myself.
Keep in mind i'm working on feat/core-playerlist so make sure it wont cause me any conflicts
👍
I just remembered we also need to integrate it with the existing monitor.disableChatWarnings
config, which right now is a setting that just prevents the scheduler from sending an txAdmin:events:announcement
event, but this can be treated as the other ones (probably full in lua's side).
I would suggest removing this Code https://github.com/tabarra/txAdmin/blob/develop/core/components/Scheduler.js#L193-L201 And then handle it over the scheduledRestart event on lua side. We could even add a convar for it.
About DM: Is the implemention of snackbar for it already in a branch? Or is it just planned?
While looking at the code I've seen that there is no event for DirectMessages which would be mandatory for implementing the possibility of custom direct messages.
I would add an new event: txAdmin:events:directMessage
for this.
I would suggest removing this Code Sure, i'll do it.
Is the implemention of snackbar for it already in a branch? Yes, and i'll merge the branch into develop probably today or tomorrow
It's already documented as well
https://github.com/tabarra/txAdmin/blob/feat/core-playerlist/docs/events.md#txadmineventsplayerdirectmessage-v50
Alright I wait for the merge and will then implement the customDirectMessage on my end
@tabarra Where should I add documentation for that convars?
This file https://github.com/tabarra/txAdmin/blob/master/docs/menu.md
Done