LuckPermsWeb
LuckPermsWeb copied to clipboard
Add ColorParser component
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

ToDo
- Add to parse the prefix of a group/user directly
Closes #103
Relates to #103 I think
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.
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):

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):
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.
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):
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.
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.