SwitchCraftCC / issues

Report general bugs for the SwitchCraft 3 server here. This tracker is NOT for exploits - please disclose those responsibly and privately to a member of staff.
1 stars 0 forks source link

[Suggestion] Essentials-style hex color codes #32

Open Allymonies opened 1 year ago

Allymonies commented 1 year ago

Minecraft 1.16 added support for 24 bit color codes, and Essentials chat added support in the form &#ff0000 to specify specific colors. It could be neat if Chatbox messages in format mode supported this feature, allowing more control over the messages sent and unlocking the ability to do things like gradients.

Lemmmy commented 1 year ago

I was initially hesitant to implement anything like this, and still might not, but we may be able to implement a parser on top of commonmark to bring something similar to hugeblank's \help parser, which not only provides 24-bit colors, but text interactions too. Each of these functionalities would be gated behind their own license capabilities, and for command execution I would even consider allowlisting the commands a chatbox owner can execute. Doing this would make the distinction between markdown and format mode redundant, as markdown mode would be fully compatible with formatting mode.

It's worth noting that we can now execute backslash commands with run_command.

Alternatively, I already have a working DSL that we used for timed broadcasts, which is a primitive but extensible set of JSON shorthands for text formatting. Again, individual features would be gated behind permissions, and the full raw JSON fallback would be removed/gated behind another permission. Example of what that looks like:

{
  "broadcasts": [
    ["Help keep SwitchCraft alive by buying a ",{"text":"\ue002\ue001\ue001","color":"white"},{"text":"Supporter","color":"aqua"}," tag! ",{"url":"https://sc3.io/supporter"}],
    ["You can create ClaimKit claims with a golden shovel, and resize them with a golden axe. Get the items by running ",{"command":"/kit ck"},"."],
    ["You can install MBS, a Mildly Better Shell, on your computer by running ",{"copyable":"mbs install"},"."],
    ["You can change the color of your claims on Dynmap with ",{"text":"/claimcolor","command":"/claimcolor "},"."],
    ["The ",{"text":"/pay","command":"/pay "}," command will suggest addresses when looking at a monitor or sign!"],
    ["Upload files to your computer by running ",{"copyable":"import"}," to drag and drop from your system."],
    ["Add your pronouns to the tab list by running ",{"text":"/pronouns","command":"/pronouns "},"."],
    ["Check out the SwitchCraft documentation! ",{"url":"https://docs.sc3.io"}],
    ["Check out the ComputerCraft documentation! ",{"url":"https://tweaked.cc"}],
    ["Join our ",{"text":"\ue003\ue001\ue001","color":"white"},{"text":"Discord!","url":"https://discord.sc3.io"}],
    ["Do you have a shop, or anything important that needs to be added to the ",{"text":"Computer Startup List","color":"gold"},"? If so, please contact staff to discuss your eligibility."]
  ]
}