Skip to content
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

[Feature Request]: Allow colors in punishment-expired-display #228

Open
1 task done
fabianmakila opened this issue Aug 12, 2023 · 1 comment
Open
1 task done

[Feature Request]: Allow colors in punishment-expired-display #228

fabianmakila opened this issue Aug 12, 2023 · 1 comment
Labels
feature New feature or request good-first-issue A task ideal for a new contributor to work on
Milestone

Comments

@fabianmakila
Copy link

I have confirmed that ...

  • There is no duplicate feature request.

Description

Some servers might want to color code the Expired and Not expired texts seen in the /history command to make it easier to differentiate between the two by a quick glance.

My first intuition was to do this which doesn't work currently.

  punishment-expired-display:
     # How do you describe an expired punishment?
    expired: '&cExpired'
     # How do you describe a punishment which is not expired?
    not-expired: '&aNot expired'

I'm proposing the addition of color code support for the two fields above, which would allow the use of colors without adding any additional fields to the configuration.

@fabianmakila fabianmakila added the feature New feature or request label Aug 12, 2023
@A248 A248 added this to the 1.1.2 milestone Aug 14, 2023
@A248 A248 added the good-first-issue A task ideal for a new contributor to work on label Aug 16, 2023
@KoxSosen
Copy link
Collaborator

KoxSosen commented Mar 20, 2024

Hello! I have looked into implementing this feature, but was quickly stopped by an idea.

punishment-expired-display falls under the formatting category, and is responsible for the %HAS_EXPIRED% variable. But, variables are usually used in messages, which allow for color codes to be used. So, using the %HAS_EXPIRED% variable with colors can be accomplished by coloring it like any other message.

But, at the same time I understand that this is not an ideal solution, in terms of the work required to set up messages, since you need to use color codes every time you want to use the variable. Allowing variables under the formatting section to be colored allows for easier messages setup, but it does bring some challenges.

Most sections under the formatting section in the configuration are implemented as Strings as opposed to Components, or TextComponents. They get their values set in Formatter.java#181, and well formatted in messages with punishments down the line. Making them colorable, to my understanding would require a small refactor in the formatting code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good-first-issue A task ideal for a new contributor to work on
Projects
None yet
Development

No branches or pull requests

3 participants