Thread Tools Display Modes
12/12/14, 01:06 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Function PlayOnEquippedAnimation is executed sometimes without reason?

Hey,

I've hooked the function "PlayOnEquippedAnimation" to see when an item gets equipped to the character.
It is working well.
But sometimes as I stand around doing nothing this function will be executed all of sudden.
This makes no sense because no item was de-/equipped?!

Did anyone experience the same and got a fix for this? Or is it just normal and wished?

Thanks
  Reply With Quote
12/12/14, 01:19 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Baertram View Post
Hey,

I've hooked the function "PlayOnEquippedAnimation" to see when an item gets equipped to the character.
It is working well.
But sometimes as I stand around doing nothing this function will be executed all of sudden.
This makes no sense because no item was de-/equipped?!

Did anyone experience the same and got a fix for this? Or is it just normal and wished?

Thanks
It works for me the same way. I'm just standing with open inventory and animation is triggered seemingly for no reason. In my opinion it is a bug and no, I do not have fix for that.
  Reply With Quote
12/12/14, 01:41 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Thanks for the answer.
It seems as if in 90% of this events only the main and offhand are checked.
Maybe it is some kind of detection event for the "weapon switch" button.

btw: My function for this event is now checking if the character window is shown and will react on it only then:
if not ZO_Character:IsHidden() then
-- do your code here
end
This works for me as I only need to do something if you can see the equipped items too.

You could hook the right-click/context menu and mouse double click events too to check if someone has manually changed the equipment by wish, put a variable in your addon and set it to true in this case. Then check if this variable is true in the event function for "PlayOnEquippedAnimation".

Last edited by Baertram : 12/12/14 at 01:47 PM.
  Reply With Quote
12/16/14, 05:32 AM   #4
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
If your inventory is open, the UI starts randomly playing glow effect for the equipped items. Is it that?
  Reply With Quote
12/16/14, 09:08 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Not always. I noticed that too but it sometimes just palys the animations for all your equipped items randomly one after another if you are standing around (even with the inventory closed).
  Reply With Quote
12/16/14, 08:40 PM   #6
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Baertram View Post
Hey,

I've hooked the function "PlayOnEquippedAnimation" to see when an item gets equipped to the character.
It is working well.
But sometimes as I stand around doing nothing this function will be executed all of sudden.
This makes no sense because no item was de-/equipped?!

Did anyone experience the same and got a fix for this? Or is it just normal and wished?

You could use EquipItem.

Lua Code:
  1. local function itemEquipped(bagId, slotId)
  2.         -- do whatever --
  3.     end
  4.  
  5.     ZO_PreHook("EquipItem", function(bagId, slotId) itemEquipped(bagId, slotId) end)
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Function PlayOnEquippedAnimation is executed sometimes without reason?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off