Add support for inline RGB everywhere#1064
Add support for inline RGB everywhere#1064alppp wants to merge 17 commits intoGTNewHorizons:masterfrom
Conversation
|
Does the ampersand represent the paragraph symbol, or are we just letting every player color their text however they want? (Not a bad thing by any means, it opens up creativity.) |
The ampersand symbol is typically used by Plugins in Bukkit to allow players to type the |
|
I found an issue. I think it has to do with the String Length system and it the way it calculates. I have a mod known a Book Editor that allows you to click and edit books within the Book GUI system. https://github.com/KAMKEEL/BookEditor If I test this mod on However, once I move to this branch the cursor length becomes completely unreasonable. |
|
Also I think it would be extremely beneficial to have the String Length, Strip Colorcodes, etc all in |
|
Yah. I'd love to see nhlib have these functions and strip the extra out of Angelica or another compatible mod isn't available. |
Almost all mods need a patch, including BQ (in theory last pr shouldn't) and other areas that does NOT use similar techniques for rendering/displaying text. It did work for chat and sign and names, and probably it will work on other areas that are more "vanilla" (like tooltips). Outside this becomes a nightmare to fix every singular mod(as long it does not use cursed system is not needed). The system works only if you don't change mouse (to preview, however as long "text" is done doesn't matter).
Whole reason i did on angelica because is much easier for me to handle everything related to fonts without becoming a mess, especially rendering part. (also that smoothfont PR helped quite bit). I haven't check the GTNHLib repo to see if is similar with this. Better idea would be JSON TextComponents where has multiple pro's but that would be in hodgepodge where i have to strip quite bit of things(and would be far too more complicate) and compat with angelica for rendering part. P.S GTNHLib also deal's with rendering? |
|
Take a look at GTNewHorizons/BetterQuesting#172 and how it interacts with the PRs it links, specifically the GTNHLib PR. If you implement your string width calculations there, you should be fine, because it overwrites vanilla methods and simultaneously acts as a central point for unruly mods (like BQ) to be redirected to. I'm not sure if it's a perfect system, but it's worked well so far |
|
Also, the formatting for color codes are not in par with legacy. Essentially, ever new color code should reset the formatting state to that new color. For example
It should not be Therefore: |
Angelica requires GTNHLib to run. It's a dependency of the mod and utilized by a lot of other maintained 1.7.10 mods. |
|
Alright, I made a ton of fixes on my branch https://github.com/KAMKEEL/Angelica/tree/color-code It now calculates string lengths correctly. Therefore, the book editor works as intended which means its producing a Vanilla-Like output to help bring compatibility to other mods without the need of a library so far. They will require everyone to have Angelica to see the RBG values. But, for now this is a great solution. Still working on other fixes. |
The better solution would be to create extra font metadata that can store font colors like other text editors that deal with this, probably is a good idea but to apply in practice might take quite bit of time. And 70+% for sure not compatible with proxies.
Well i tried to introduce modern formatting and legacy hybrid. Tried to consume least amount of time to do it and i wanted to be intuitive and not waste any characters. I like at-least not waste any extra space that is precious in other places. But if others thinks is not good idea then feel free to true legacy. |
|
There is a specific area in Unicode specifically for application specific data like color codes yes, and yes they should work with proxies because if they didn't then they'd be violating Unicode, and thus would break on random other things anyway. |
…e Port for Hodgepodge, etc Added Better Utility Handling within ForattedTextMetrics and ColorCodeUtils. Created an optional Strip Color Codes method for Universal Usage.
Merge changes from kamkeel to continue effort
This PR adds support for custom RGB colors and fun text effects to Angelica's font rendering system. (Thanks to the person/s worked on smoothfont alternative)
This supports actual RGB + Legacy
&x&l,&r0-9,a-f,g-h,k-o,r).&RRGGBB&FF8800<RRGGBB><00FFAA></RRGGBB></00FFAA>Examples
Also i tried my best highlight UI in text to make creating colored text easier.


Works on names of items, and possibly tooltips and basically everywhere as long person is using angelica.