Daripher / Apothic-Curios

Compatibility bridge between Apotheosis and Curios mods
Other
0 stars 1 forks source link

Curios attribute tooltips improvements #6

Open SiverDX opened 5 months ago

SiverDX commented 5 months ago

https://github.com/Shadows-of-Fire/Apotheosis/blob/8c41616c3b05e446abb3d718c37f46d963875033/src/main/java/shadows/apotheosis/core/attributeslib/client/AttributesLibClient.java#L73-L100

is responsible for removing the original tooltips and adding them back in a sorted format

at that point in time https://github.com/TheIllusiveC4/Curios/blob/1.19.x/src/main/java/top/theillusivec4/curios/client/ClientEventHandler.java hasn't run yet, so nothing to remove

but apotheosis also doesn't add / sort anything, since it doesn't know / check the curios equipment slot(s)


https://github.com/Shadows-of-Fire/Apotheosis/blob/8c41616c3b05e446abb3d718c37f46d963875033/src/main/java/shadows/apotheosis/core/attributeslib/client/AttributesLibClient.java#L218-L219

and

https://github.com/Shadows-of-Fire/Apotheosis/blob/8c41616c3b05e446abb3d718c37f46d963875033/src/main/java/shadows/apotheosis/adventure/client/AdventureModuleClient.java#L182-L188

seem to be responsible for removing the tooltips added by gems at the moment this doesn't happen correctly for curios items (because the tooltip hasn't been added yet), which is why you get stuff like this:

image


do you have plans to apply apotheosis logic for curios as well? i think there was also sth. about missing attributes for certain curios items (display-wise) (i think due to their custom way on how to gather attributes in the standard method)

SiverDX commented 5 months ago

played around with it a bit: https://gist.github.com/SiverDX/d09f4568b23f13ceddc0e19f1d1be5b4

image

image

SiverDX commented 5 months ago

The NullPointer might be due to this

image

I think the talisman slot attribute is the problem in this case same case here

image

so things which increase or reduce slots seem to cause issues? they seem to be an instance of top.theillusivec4.curios.common.CuriosHelper$SlotAttributeWrapper, could check for that or just swallow the error since it at least displays actually it displaying was due to a bug displaying left over tooltips

it causing null is probably due to the attribute not existing in the registry?

    public static Multimap<Attribute, AttributeModifier> sortedMap() {
        return TreeMultimap.create(Comparators.idComparator(Registry.ATTRIBUTE), modifierComparator());
    }
SiverDX commented 5 months ago

fixed the issue with curios slots

image

SiverDX commented 5 months ago

no duplicate tooltip in this case

haven't seen this happen yet: https://gist.github.com/SiverDX/d09f4568b23f13ceddc0e19f1d1be5b4#file-mixinclienteventhandler-java-L50

image

image

SiverDX commented 5 months ago

some default lang entries

    "item.modifiers.necklace": "When worn as necklace:",
    "item.modifiers.back": "When worn as back:",
    "item.modifiers.extra": "When worn as extra:",
    "item.modifiers.glider": "When worn as glider:",
    "item.modifiers.spellstone": "When worn as spellstone:",
    "item.modifiers.spyglass": "When worn as spyglass:",
    "item.modifiers.trinkets": "When worn as trinkets:",
    "item.modifiers.bracelet": "When worn as bracelet:",
    "item.modifiers.hands": "When worn as hands:",
    "item.modifiers.ring": "When worn as ring:",
    "item.modifiers.belt": "When worn as belt:",
    "item.modifiers.charm": "When worn as charm:",
    "item.modifiers.feet": "When worn as feet:",
    "item.modifiers.pocket": "When worn as pocket:",

alternatively you could add extra logic to retain the original one and replace the apotheosis-added with it might actually do that to make it more clear it's a curios slot

SiverDX commented 5 months ago

now uses the curios slot tooltip

image

Code: https://gist.github.com/SiverDX/d09f4568b23f13ceddc0e19f1d1be5b4