Vanilla-Expanded / VanillaExpandedFramework

Vanilla Expanded Framework for RimWorld
Other
69 stars 34 forks source link

Ability tooltips broken when shrunk #78

Closed abel1502 closed 6 months ago

abel1502 commented 6 months ago

Tooltips on psycasts (and other abilities, but psycasts are the most frequent case) don't show when the gizmo icon is shrunk. I've tracked the issue down to:

https://github.com/Vanilla-Expanded/VanillaExpandedFramework/blob/c3e880e0e27a6814d78818751728c6bb1af876e6/Source/VFECore/Abilities/Command_Ability.cs#L43-L46

This seems to cause infinitely stacking side effects, and since it's called in an OnGui method, it results in the description being unable to load itself. Removing those lines through dnSpy fixed the issue for me, so I'm certain this is indeed the cause.

legodude17 commented 6 months ago

Actually, Gizmos are destroyed and remade each frame, so that line works as intended and updates the description once per gizmo.

abel1502 commented 6 months ago

@legodude17 perhaps this is a conflict with some performance mod, like RocketMan or Dub's Mint Menus? Apparently some mod caches gui elements for performance reasons. If so, I'd argue this issue still deserves attention, since those mods are used very frequently, including in conjuction with VE.

Also, once again, I have evidence that:

As such, I'd argue this is both frequent enough and trivial enought to hotfix, that it deserves attention from the VE team, despite apparently being a mod conflict.

legodude17 commented 6 months ago

It's a conflict with Performance Optimizer, which has been known for a very long time. You can disable the gizmo optimization in that mod and it will fix the issue. Removing that line would remove the name of the ability from the tooltip when shrunk, which is a problem, because the name doesn't show anywhere else. There's not really a simple way to fix the issue while keeping the name. Technically we could keep another variable to only update the description once, but personally that's more complexity than I'm willing to introduce to fix what is essentially an issue with a seperate mod.

abel1502 commented 6 months ago

I've implemented a more robust mechanism which will work correctly with cached gizmos in #80, and will be glad if you take a look. I believe it's simple enough to your liking