Skip to content

Conversation

@Meivyn
Copy link

@Meivyn Meivyn commented Nov 8, 2025

This is the only thing I am missing from your addon, which is arguably the most complete teleport addon out there. So here it is.
Note that ITEM_LOCK_CHANGED had to be registered early, as this event sometimes might be fired before OnClick and PostClick for some reason. So I couldn't rely on click handlers to achieve that.

Also ClearAllInvalidHighlights should probably be renamed to RefreshHighlights as it should take care of highlighting as well. You previously highlighted twice in the handler.

Using ZONE_CHANGED_NEW_AREA also has the advantage of ensuring the player reequips their item if they change their mind and doesn't teleport after clicking once.

@Meivyn Meivyn force-pushed the patch-1 branch 3 times, most recently from ce30208 to 4944a94 Compare November 8, 2025 08:47
@Justw8
Copy link
Owner

Justw8 commented Nov 8, 2025

I am currently on holiday until the end of November, can you bump this PR if I forget about it come december?

@Meivyn
Copy link
Author

Meivyn commented Nov 11, 2025

Anyway, I'll be reworking it a bit. Avoid merging for now. Might be unrelated to this PR, but there are issues with highlight/cooldown check that need to be addressed.

@Meivyn Meivyn force-pushed the patch-1 branch 2 times, most recently from eea2592 to a614ca3 Compare November 18, 2025 09:03
@Meivyn
Copy link
Author

Meivyn commented Nov 18, 2025

So to explain the recent changes:

  • UNIT_SPELLCAST_SUCCEEDED is used to avoid the case where the player might not get into a new zone. For instance, when the player wants to teleport back to the main area of the Timeless Isle rapidly after killing Ordos.
  • SPELL_UPDATE_COOLDOWN is used to update the cooldown of all buttons in real-time. Previously, it was required to toggle the menu again, and it was pretty unreliable on refreshing the cooldowns. Cooldown info isn't available in UNIT_SPELLCAST_SUCCEEDED so it can't be used for that.
  • ZONE_CHANGED_NEW_AREA is used as a fallback to ensure that the player unequips any teleportation item, no matter what. It also avoids unnecessarily listening for casts forever. If the player changes their mind and wants to teleport somewhere else for example, or if they choose to stay where they are and don't complete the teleport cast at all.
  • PLAYER_EQUIPMENT_CHANGED is used to refresh the highlight. This is needed for it to work properly in real-time. It is also used to know when original item info data can be queried. It also refreshes cooldowns, as some items get a cooldown when they are equipped.
  • PLAYER_REGEN_ENABLED is used to try to reequip the item in case they are in combat when EquipItemByName is called, which would cause it to pickup the item rather than equipping it.
  • ITEM_LOCKED is used because by the time PostClick is fired, the info we need is already gone. Do note that this code does rely on the visibility check; if the frame becomes visible by any other means than hovering the flyout, it might introduce subtle bugs.

I tried to avoid doing work such as refreshing cooldowns and refreshing highlights when the buttons are not visible, but this seems to be required for it to work. I can't think of any other side case where this stuff wouldn't work; it's a bit more verbose, but it's to ensure reliability.

@Meivyn Meivyn force-pushed the patch-1 branch 2 times, most recently from 635b9d1 to 0b5235a Compare November 18, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants