Thread Tools Display Modes
06/06/14, 03:24 AM   #1
Firegael
Join Date: Jun 2014
Posts: 4
Event_werewolf_state_changed

Has anyone noticed that this event seems to only fire on activation of werewolf and not when it ends? Does anyone know a way around this?

Example:
Lua Code:
  1. -- This will display true upon activation and not fire upon turning back into human form
  2. EVENT_MANAGER:RegisterForEvent( '_EVENT_WEREWOLF_STATE_CHANGED', EVENT_WEREWOLF_STATE_CHANGED, function( eventCode, werewolf ) d( werewolf ) end )
  Reply With Quote
06/06/14, 03:58 AM   #2
Firegael
Join Date: Jun 2014
Posts: 4
The solution I've come up with which works, is this:

Inside POWER_UPDATE function
Lua Code:
  1. -- Temporary fix until WEREWOLF_STATE_CHANGE works correctly
  2.     if ( self.werewolf and powerValue == 0 ) then
  3.         self.werewolf = false
  4.         self:updateWerewolf( self.werewolf )
  5.     end

inside updateWerewolf()
Lua Code:
  1. self.werewolf = werewolf
  2.     if ( self.werewolf ) then
  3.         _FireUI.resources:updateBar( POWERTYPE_WEREWOLF, GetUnitPower( 'player', POWERTYPE_WEREWOLF ) )
  4.     else
  5.         _FireUI.resources:updateBar( POWERTYPE_MAGICKA, GetUnitPower( 'player', POWERTYPE_MAGICKA ) )
  6.     end

Last edited by Firegael : 06/06/14 at 04:48 AM.
  Reply With Quote
06/06/14, 04:43 AM   #3
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
function IsWerewolf()

If you want, you can use function IsWerewolf().

Lua Code:
  1. if IsWerewolf() then
  2.     _FireUI.resources:updateBar( POWERTYPE_WEREWOLF, GetUnitPower( 'player', POWERTYPE_WEREWOLF ) )
  3. else
  4.     _FireUI.resources:updateBar( POWERTYPE_MAGICKA, GetUnitPower( 'player', POWERTYPE_MAGICKA ) )
  5. end
  Reply With Quote
06/06/14, 04:48 AM   #4
Firegael
Join Date: Jun 2014
Posts: 4
Originally Posted by Garkin View Post
If you want, you can use function IsWerewolf().

Lua Code:
  1. if IsWerewolf() then
  2.     _FireUI.resources:updateBar( POWERTYPE_WEREWOLF, GetUnitPower( 'player', POWERTYPE_WEREWOLF ) )
  3. else
  4.     _FireUI.resources:updateBar( POWERTYPE_MAGICKA, GetUnitPower( 'player', POWERTYPE_MAGICKA ) )
  5. end
That's true - still have the issue of the event not firing correctly, though. Either way is going to have to be a band aid for now it seems.
  Reply With Quote
06/06/14, 05:35 AM   #5
JadeKnightblazer
Join Date: Feb 2014
Posts: 24
So what are you working on if I may ask? I been looking for some Werewolf addons --> http://www.esoui.com/forums/showthread.php?t=1597
  Reply With Quote
06/06/14, 06:13 AM   #6
Firegael
Join Date: Jun 2014
Posts: 4
Originally Posted by JadeKnightblazer View Post
So what are you working on if I may ask? I been looking for some Werewolf addons --> http://www.esoui.com/forums/showthread.php?t=1597
I'm working on a full very flexible UI overhaul. Currently the werewolf transformation timer replaces the magicka bar as you cannot use magicka in werewolf form, and the mount stamina bar replaces stamina. I hadn't thought of including a werewolf devour timer, that could be useful. If I do make one, I'll also make a standalone version in the normal ESO UI style for you.
  Reply With Quote
06/06/14, 08:12 AM   #7
JadeKnightblazer
Join Date: Feb 2014
Posts: 24
That would be most wonderful!!!
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Event_werewolf_state_changed


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