ModFest / glowcase

A mod that adds blocks to help showcase mods and modded items!
https://modrinth.com/mod/glowcase
Creative Commons Zero v1.0 Universal
5 stars 12 forks source link

[Modtoberfest] Text Block Built-in Access to Text Formatting, Color Picker #51

Closed Superkat32 closed 2 weeks ago

Superkat32 commented 1 month ago

Adds some extra buttons to the Text Block edit screen to access the already implemented formatting abilities. Also adds the ability to more easily choose custom colors for the entire block, or specific parts of the text.

A little showcase of pretty much everything (I even added some spooky music for the season :) )

https://github.com/user-attachments/assets/c64ba734-edaa-4b46-aeab-1712695bc5a1

Rest of details: Clicking any of the formatting buttons will add the associated formatting tag, then place the cursor/caret in between the tags. If text is highlighted when a tag is added, the tags surround the highlighted text. I chose an @ symbol for the obfuscated text icon because I found the constant moving of the actual obfuscated effect on the screen to be really distracting. An alternative could be the # symbol.

Hotkeys are also supported, with commonly accepted hotkeys like:

Additionally, pressing enter while the color picker is open will act as pressing the green check mark confirm button, and pressing escape while it is open will act as pressing the red X cancel button. Some presets for the color picker have also been added. They are added directly from Minecraft's Formatting enum, which is also what PlaceholderText uses. Presets from just a Color is also supported in case a future use-case appears.

Everything has been designed with a possible visual redesign in mind, meaning that it should all hopefully be easily adjustable and even reusable. Especially with the color picker widget.

Give it a try, make sure everything is intuitive and works the way you'd expect as a user! The goal with this PR is to make using this block much easier and quicker. /lh

Tested with Neoforge using Connector, to make sure it is all ready for use this upcoming Modfest!

Happy Modtoberfest!

TheEpicBlock commented 2 weeks ago

This seems great, thank you!