EMI

EMI

14M Downloads

[Mod Compat] EmiTooltipMetadata API fails when other mods add components before title

AHilyard opened this issue · 0 comments

commented

When other mods (e.g., Legendary Tooltips) prepend custom tooltip components before the item name/title, EMI’s EmiTextTooltipWrapper assumes the first line is the item’s title and fails to attach context data.

Reproduction Steps

  1. Install EMI alongside Legendary Tooltips.
  2. Find an item in the sidebar that displays a 3D item model, such as a weapon or armor, and click it. (I recommend a mace because it should also have border decorations by default)
  3. Note that the tooltip rendered by EMI in the recipe window lacks a title separator and applicable decorations, whereas tooltips without a 3D item model render properly.

Proposed Solution

  1. Insert a non-rendering marker component that contains contextual information towards the end of the tooltip component list instead of using a wrapper component.
  2. EmiTooltipMetadata can then search backwards from the end of the list to find this marker instead of checking the first component.

Thank you!