LuckPermsWeb icon indicating copy to clipboard operation
LuckPermsWeb copied to clipboard

Add ColorParser component

Open Tobi406 opened this issue 5 years ago • 6 comments

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 avatar Jul 02 '20 13:07 Tobi406

Relates to #103 I think

Tobi406 avatar Jul 02 '20 13:07 Tobi406

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.

Tobi406 avatar Sep 12 '20 15:09 Tobi406

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

Andre601 avatar Jun 05 '21 13:06 Andre601

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.

Tobi406 avatar Jun 05 '21 14:06 Tobi406

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.

Andre601 avatar Jun 05 '21 14:06 Andre601

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.

Turbotailz avatar Jun 06 '21 02:06 Turbotailz