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

Add ColorParser component #289

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Tobi406
Copy link
Contributor

@Tobi406 Tobi406 commented Jul 2, 2020

Adds a component to parse strings with color codes, eg. prefixes.
Currently only on the Group creation modal. (Click the "+" right of "Groups" and type in a prefix)
Preview available at https://tobi406-luckpermsweb-dev.netlify.app/editor/demo

image

ToDo

  • Add to parse the prefix of a group/user directly

Closes #103

@Tobi406
Copy link
Contributor Author

Tobi406 commented Jul 2, 2020

Relates to #103 I think

Copy link
Member

@Turbotailz Turbotailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool, just a few changes I think you should review.

Do you have a list of places where you'll use this? I can think of the group list (in sidebar) and the header for each group, maybe also in the permission node for prefixes/displaynames

src/components/Editor/Utilities/ColorParser.vue Outdated Show resolved Hide resolved
@Tobi406
Copy link
Contributor Author

Tobi406 commented Sep 12, 2020

Just some heads up: As I found out every sessionData contains a list of prefix nodes, these are only for the group/user tough, and so wouldn't resolve inheritance like they normally would. Built some methods to resolve inheritance. Was asking myself what I should display now, the inheritited prefix, the one of the group/user or maybe both?

Also generally, there is the chance a user changed their meta-formatting section which would then also not display the prefix like it would be in-game, even tough that's what it should do.

@Andre601
Copy link
Contributor

Andre601 commented Jun 5, 2021

This is only a minor nitpick/idea, but maybe move the preview to a own pop-up window?
Like have a "Preview" text that, when clicked, would display a MC chat-like preview of the display name, prefix and suffix together with a (random?) username (or perhaps the name of who created the editor session?) to give a more real example of what it could look like.

If you don't get what I mean: Essentially something like this (Screenshot taken from minecraft.tool's JSON generator):
image

@Tobi406
Copy link
Contributor Author

Tobi406 commented Jun 5, 2021

This is only a minor nitpick/idea, but maybe move the preview to a own pop-up window?
Like have a "Preview" text that, when clicked, would display a MC chat-like preview of the display name, prefix and suffix together with a (random?) username (or perhaps the name of who created the editor session?) to give a more real example of what it could look like.

If you don't get what I mean: Essentially something like this (Screenshot taken from minecraft.tool's JSON generator):
image

Totally forgot this PR existed.
But yes, displaying the prefix and suffix like in chat is sure something that will be needed here.
What would be needed here is that the editor parses permission data tough, I'm not sure if that is something we wanna da.
Also, having the meta formatting section would be helpful. Displaying a prefix live would surely help many people. Question would again be if calculation is something we would like to do on the editor.

@Andre601
Copy link
Contributor

Andre601 commented Jun 5, 2021

This is only a minor nitpick/idea, but maybe move the preview to a own pop-up window?
Like have a "Preview" text that, when clicked, would display a MC chat-like preview of the display name, prefix and suffix together with a (random?) username (or perhaps the name of who created the editor session?) to give a more real example of what it could look like.
If you don't get what I mean: Essentially something like this (Screenshot taken from minecraft.tool's JSON generator):
image

Totally forgot this PR existed.
But yes, displaying the prefix and suffix like in chat is sure something that will be needed here.
What would be needed here is that the editor parses permission data tough, I'm not sure if that is something we wanna da.
Also, having the meta formatting section would be helpful. Displaying a prefix live would surely help many people. Question would again be if calculation is something we would like to do on the editor.

I would say that meta calculations should happen when editing users and only happen for groups, if they have a group permission set to true that inherits a group with higher weight value.
Otherwise just handle the group's own meta values without any extra stuff to do.

@Turbotailz
Copy link
Member

I plan to tackle a lot of this when I eventually get around to redoing the web editor. The main problem I foresee is the inheritance calculation... May need a bit of help from @lucko to get something similar to LP's permission calculation working for JavaScript if we want to properly show which prefix/suffix a user/group will inherit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color for prefixes/suffixes/displaynames
4 participants