isXander / AdaptiveTooltips

Highly configurable tooltip rendering so they always fit on the screen.
GNU Lesser General Public License v3.0
21 stars 12 forks source link

Bedrock Centering not working #30

Open totrider opened 1 year ago

totrider commented 1 year ago

Adaptive Tooltips config:

{ "wrap_text": "SCREEN_WIDTH", "prioritize_tooltip_top": true, "bedrock_centering": true, "best_corner": false, "always_best_corner": false, "scroll_key_code": 342, "horizontal_scroll_key_code": 341, "smooth_scrolling": true, "scroll_direction": "REVERSE", "vertical_scroll_sensitivity": 10, "horizontal_scroll_sensitivity": 10, "tooltip_transparency": 1.0 }

Am I right that the tooltip is supposed to be centered in this case? 2023-05-15_02 32 10

I am working on, and running "Dragon Claw Adventure 1": https://www.curseforge.com/minecraft/modpacks/dragon-claw-adventure-1

Additionally, I am also running the following mods that in various degrees are now outside the CF ecosystem: mods

Let me know if I can be of any further help.

isXander commented 1 year ago

It should not be centered in this case, as you can fully see the tooltip with no problems.

totrider commented 1 year ago

Ok, so Bedrock centering does nothing if word wrapping is enabled? Cause according to your modpage, it is decribed as: "Bedrock centering centers the tooltip if it's too long" - which is true in this example. The description for Beast Surge had to wrap down to another line cause it is "too long".

So it seems pretty unclear to me in which case any tooltip would ever get centered, as word wrapping seems to take precedence.

This would also mean that the suggestion "For the best experience, it is best to pair this with Screen Width Text Wrapping." seems kinda moot, as there would be no instance of the two features ever "working together" - if you will.

I hope that clarifies what I mean a bit better :)

isXander commented 1 year ago

It looks like something else is wrapping the text, not Adaptive Tooltips. Because screen width wrapping would only wrap as on the tin, with the screen's width.

So from that point, the tooltip is still at the cursor, in the middle of the screen, but wrapped for the screen's whole width, so it goes off-screen.

In that case, bedrock centering kicks in and places it above or below the mouse cursor, rather than the left or right.

isXander commented 1 year ago

Bedrock centering will never work with remaining width wrapping, as that wraps according to how much space the tooltip has left, before going off-screen.

totrider commented 1 year ago

You are indeed correct, something else is also applying a word wrapping effect. Something I did not notice before, because I had PlayerEx break the wrapping on some items due to another config.

I am facing the same issue with a slightly more lightweight modpack "Dragon Claw Creations 2" which makes it a bit easier to test stuff. https://legacy.curseforge.com/minecraft/modpacks/dragon-claw-creations-2/files

I looked through various config settings for some mods I suspected could be tampering with it, but so far no luck on finding the culprit. I will provide an update if I find out what is causing the issue.

totrider commented 1 year ago

Well, that was an interesting rabbithole to dig into. After gradually enabling mods to cause the issue and then disabling to find the exact mod, it turns out that the library mod "Iceberg" adds word wrapping functionality without any other mods present.

I don't see any config file for Iceberg either, which makes sense considering it is supposed to be a library mod.

It is dependency for the following mods: Advancement Plaques Equipment Compare Item Highlighter Legendary Tooltips

However, after re-enabling all mods except Adaptive Tooltips, Iceberg and the mods depending on it, I am still having word wrapping. So there is yet another mod doing it still. I will update if I find the other culprit I guess.