This is a state machine that provides fishing states for other addons.

This addon is needed by other addons and has no effect on it's own.

~~~
For Developers:

I made this addon so that I don't run the same state machine multiple times simultaneously for different addons.

Available states are:
Lua Code:
  1. FishingStateMachine.state     = {
  2.     idle      =  0, --Running around, neither looking at an interactable nor fighting
  3.     lookaway  =  1, --Looking at an interactable which is NOT a fishing hole
  4.     looking   =  2, --Looking at a fishing hole
  5.     depleted  =  3, --fishing hole just depleted
  6.  
  7.     nobait    =  5, --Looking at a fishing hole, with NO bait equipped
  8.     fishing   =  6, --Fishing
  9.     reelin    =  7, --Reel in!
  10.     loot      =  8, --Lootscreen open, only right after Reel in!
  11.     invfull   =  9, --No free inventory slots
  12.  
  13.     fight     = 14, --Fighting / Enemys taunted
  14.     dead      = 15  --Dead
  15. }

You can register a callback on "FishingStateMachine_STATE_CHANGE" with
Lua Code:
  1. FishingStateMachine:registerOnStateChange(callback)
and unregister with
Lua Code:
  1. FishingStateMachine:unregisterOnStateChange(callback)
or read out FishingStateMachine.currentState by calling
Lua Code:
  1. FishingStateMachine:getState()

返回
顶部