-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom ban deferral cards with images/customisation supported #821
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! some code changes i'd like to see though, currently it would break on non-english locales which is kind of a big deal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a third party url isn't really much of a chance, most server owners will (or should ) use the new convars to form better server branding - larger applications such as txadmin (bundled with fxserver) pull user-display images through FIveM's deferral system in IMGUR//external PNG host formats as i'm not actually sure you can reference a local SVG/PNG file. - if you can, welcome to change obviously.
Convar added in above commit: |
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.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good apart from that function that seemingly never gets referenced, i'll merge it once thats addressed
Unused function removed - should be all good |
perfect! merging this then. |
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. :)