EasyAdmin
EasyAdmin copied to clipboard
feat: custom ban deferral cards with images/customisation supported
NEW Ban Deferral Cards
This update brings more customisation, improved UI/branding for server owners as well as just an overall nice addition for EasyAdmin's branding.
Before:
After:
This change also solves or at least contributes some functionality to an original idea/"to-do" item from #419
New Convars On the documentation for installation, we have sections such as Administration Configuration & Bot Configuration, I would suggest a new section for Ban Message Configuration or something similar - just a food for thought for ease of use.
set ea_banMessageTitleColour "#ff0000"
This allows you to change the server name title colour, defaults to "#354557" (easyadmin colour)
ea_banMessageServerName "EasyAdmin Roleplay"
Pretty self explanatory, you can add your server name here as an owner to show at the top. Defaults to "sv_projectName"
Replaced with pulling the server name from the sv_projectName convar.
ea_banMessageShowStaff "true/false"
Whether or not to show a banned player who they are banned by - simply added because some servers may not want to open that staff member up to harassment or whatever it may be - again, another customisation option for server owners. Defaults to true.
ea_banMessageFooter "You can appeal this ban by visiting example.com"
Defaults to "You can appeal this by ban by visiting our discord." - server owners can change this to their forums, website, discord whatever they want, as it's HTML markdown, it's also clickable which gives nice ease of access straight to a ban appeal form. (direct reference to #419)
ea_banMessageSubHeader "You Have Been Expelled From This City"
Defaults to "You have been banned from this server." - Some servers may want this message to fit their branding etc, something to make it easier as people that want to change these messages will try to hardcode change which makes updating more complicated and annoying.
With this change, normally the ban reason would be test ( Nickname: ~u~Player ), Banned by: Grav however i used a simple function to remove the suffix (end of string) so that we can display the staff member in a separate row to clean it up (with the added option to hide staff names) - this change is only on this deferral card and does not change any other logic in the easyadmin ban system.
Thank you for reading - hopefully this can be another good addition and improvement to this resource. :)
Convar added in above commit:
ea_banMessageWatermark "logo-url-here" - defaults to an easyadmin banner.
The changes above should solve the code breaking aspect as it will now with each language - i honestly spent a lot of time looking for a better way to achieve the desired result but ended up settling on this so if there's a better way any suggestions are welcome.
Apologies for delay - practically had to overhaul entire setup with new computer//internet and had to wait to get back a lot of files etc - changes have been corrected using regex to be compatible with all languages - thanks for your patience
Any chance of this being merged or should we close out?
haven't been near a fivem compatible computer for a while, can I merge this blindly? if so I might just do that..
Unused function removed - should be all good
perfect! merging this then.