# SurpriseChest_View_SurpriseChestActivityPopupHelper_782.luac
; fn @SurpriseChestActivityPopupHelper.lua  line 0-0 np=0 va=1 ms=4 code=27 consts=15 upvals=1 protos=4
;   K[0]='SurpriseChestActivityPopupHelper'
;   K[1]='setmetatable'
;   K[2]='canPopScene'
;   K[3]='EPopupScene'
;   K[4]='Board'
;   K[5]=true
;   K[6]='canIgnorePopup'
;   K[7]=false
;   K[8]='BasePopupHelper'
;   K[9]='__index'
;   K[10]='Create'
;   K[11]='SurpriseChestActivityPopupHelper'
;   K[12]='Init'
;   K[13]='_OnStateChanged'
;   K[14]='CheckPopup'
;   upvals: _ENV
0000  GETTABUP  R0 = _ENV[K1('setmetatable')]
0001  NEWTABLE  R1 = {} (0 items)
0002  NEWTABLE  R2 = {} (0 items)
0003  GETTABUP  R3 = _ENV[K3('EPopupScene')]
0004  GETTABLE  R3 = R3[K4('Board')]
0005  SETTABLE  R2[R3] = K5(true)
0006  SETTABLE  R1[K2('canPopScene')] = R2
0007  SETTABLE  R1[K6('canIgnorePopup')] = K7(false)
0008  GETTABUP  R2 = _ENV[K8('BasePopupHelper')]
0009  CALL      R0 = call(R0, 1 args, 2 rets)
0010  SETTABUP  _ENV[K0('SurpriseChestActivityPopupHelper')] = R0
0011  GETTABUP  R0 = _ENV[K0('SurpriseChestActivityPopupHelper')]
0012  GETTABUP  R1 = _ENV[K0('SurpriseChestActivityPopupHelper')]
0013  SETTABLE  R0[K9('__index')] = R1
0014  GETTABUP  R0 = _ENV[K0('SurpriseChestActivityPopupHelper')]
0015  CLOSURE   R1 = closure proto0
0016  SETTABLE  R0[K10('Create')] = R1
0017  GETTABUP  R0 = _ENV[K11('SurpriseChestActivityPopupHelper')]
0018  CLOSURE   R1 = closure proto1
0019  SETTABLE  R0[K12('Init')] = R1
0020  GETTABUP  R0 = _ENV[K11('SurpriseChestActivityPopupHelper')]
0021  CLOSURE   R1 = closure proto2
0022  SETTABLE  R0[K13('_OnStateChanged')] = R1
0023  GETTABUP  R0 = _ENV[K11('SurpriseChestActivityPopupHelper')]
0024  CLOSURE   R1 = closure proto3
0025  SETTABLE  R0[K14('CheckPopup')] = R1
0026  RETURN    return R0..R-1
; ---------- proto0 [Create] ----------
  ; fn ?  line 9-13 np=0 va=0 ms=3 code=8 consts=3 upvals=1 protos=0
  ;   K[0]='setmetatable'
  ;   K[1]='SurpriseChestActivityPopupHelper'
  ;   K[2]='Init'
  ;   upvals: _ENV
  ;   locals: helper(4-8)
  0000  GETTABUP  R0 = _ENV[K0('setmetatable')]
  0001  NEWTABLE  R1 = {} (0 items)
  0002  GETTABUP  R2 = _ENV[K1('SurpriseChestActivityPopupHelper')]
  0003  CALL      R0 = call(R0, 1 args, 2 rets)
  0004  SELF      R2 = R0[K2('Init')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  RETURN    return R0..R-1
  0007  RETURN    return R0..R-1
; ---------- proto1 [Init] ----------
  ; fn ?  line 15-25 np=1 va=0 ms=10 code=45 consts=14 upvals=1 protos=0
  ;   K[0]='BasePopupHelper'
  ;   K[1]='Init'
  ;   K[2]='pairs'
  ;   K[3]='SurpriseChestActivityDefinition'
  ;   K[4]='EventDispatcher'
  ;   K[5]='AddListener'
  ;   K[6]='StateChangedEvent'
  ;   K[7]='_OnStateChanged'
  ;   K[8]='SurpriseChestManagerDefinition'
  ;   K[9]='MainWindowClosedEvent'
  ;   K[10]='AcquireSurpriseChestEvent'
  ;   K[11]='EEventType'
  ;   K[12]='ChangeGameMode'
  ;   K[13]='OrderStateChanged'
  ;   upvals: _ENV
  ;   locals: self(0-45), (for generator)(7-16), (for state)(7-16), (for control)(7-16), _(8-14), activityDefinition(8-14)
  0000  GETTABUP  R1 = _ENV[K0('BasePopupHelper')]
  0001  GETTABLE  R1 = R1[K1('Init')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  GETTABUP  R1 = _ENV[K2('pairs')]
  0005  GETTABUP  R2 = _ENV[K3('SurpriseChestActivityDefinition')]
  0006  CALL      R1 = call(R1, 3 args, 1 rets)
  0007  JMP       (jump)   -> 14
  0008  GETTABUP  R6 = _ENV[K4('EventDispatcher')]
  0009  GETTABLE  R6 = R6[K5('AddListener')]
  0010  GETTABLE  R7 = R5[K6('StateChangedEvent')]
  0011  MOVE      R8 = R0
  0012  GETTABLE  R9 = R0[K7('_OnStateChanged')]
  0013  CALL      R6 = call(R6, 0 args, 3 rets)
  0014  TFORCALL  tforcall R1
  0015  TFORLOOP  tforloop R3(sBx=-8)   -> 8
  0016  GETTABUP  R1 = _ENV[K4('EventDispatcher')]
  0017  GETTABLE  R1 = R1[K5('AddListener')]
  0018  GETTABUP  R2 = _ENV[K8('SurpriseChestManagerDefinition')]
  0019  GETTABLE  R2 = R2[K9('MainWindowClosedEvent')]
  0020  MOVE      R3 = R0
  0021  GETTABLE  R4 = R0[K7('_OnStateChanged')]
  0022  CALL      R1 = call(R1, 0 args, 3 rets)
  0023  GETTABUP  R1 = _ENV[K4('EventDispatcher')]
  0024  GETTABLE  R1 = R1[K5('AddListener')]
  0025  GETTABUP  R2 = _ENV[K8('SurpriseChestManagerDefinition')]
  0026  GETTABLE  R2 = R2[K10('AcquireSurpriseChestEvent')]
  0027  MOVE      R3 = R0
  0028  GETTABLE  R4 = R0[K7('_OnStateChanged')]
  0029  CALL      R1 = call(R1, 0 args, 3 rets)
  0030  GETTABUP  R1 = _ENV[K4('EventDispatcher')]
  0031  GETTABLE  R1 = R1[K5('AddListener')]
  0032  GETTABUP  R2 = _ENV[K11('EEventType')]
  0033  GETTABLE  R2 = R2[K12('ChangeGameMode')]
  0034  MOVE      R3 = R0
  0035  GETTABLE  R4 = R0[K7('_OnStateChanged')]
  0036  CALL      R1 = call(R1, 0 args, 3 rets)
  0037  GETTABUP  R1 = _ENV[K4('EventDispatcher')]
  0038  GETTABLE  R1 = R1[K5('AddListener')]
  0039  GETTABUP  R2 = _ENV[K11('EEventType')]
  0040  GETTABLE  R2 = R2[K13('OrderStateChanged')]
  0041  MOVE      R3 = R0
  0042  GETTABLE  R4 = R0[K7('_OnStateChanged')]
  0043  CALL      R1 = call(R1, 0 args, 3 rets)
  0044  RETURN    return R0..R-1
; ---------- proto2 [_OnStateChanged] ----------
  ; fn ?  line 27-30 np=1 va=0 ms=4 code=4 consts=1 upvals=0 protos=0
  ;   K[0]='SetNeedCheckPopup'
  ;   locals: self(0-4)
  0000  SELF      R2 = R0[K0('SetNeedCheckPopup')] (self)
  0001  LOADBOOL  R3 = true
  0002  CALL      R1 = call(R1, 0 args, 2 rets)
  0003  RETURN    return R0..R-1
; ---------- proto3 [CheckPopup] ----------
  ; fn ?  line 32-50 np=1 va=0 ms=13 code=52 consts=15 upvals=1 protos=0
  ;   K[0]='GM'
  ;   K[1]='SceneManager'
  ;   K[2]='GetGameMode'
  ;   K[3]='EGameMode'
  ;   K[4]='Board'
  ;   K[5]='pairs'
  ;   K[6]='SurpriseChestActivityDefinition'
  ;   K[7]='ActivityManager'
  ;   K[8]='GetModel'
  ;   K[9]='CanTriggerSurpriseChest'
  ;   K[10]='SurpriseChestManagerDefinition'
  ;   K[11]='MainWindowPrefabName'
  ;   K[12]='GetTriggerData'
  ;   K[13]='SurpriseChestManager'
  ;   K[14]='CanTriggerSurpriseChestByProperty'
  ;   upvals: _ENV
  ;   locals: self(0-52), model(10-52), (for generator)(13-35), (for state)(13-35), (for control)(13-35), activityType(14-33), activityDefinition(14-33)
  0000  GETTABUP  R1 = _ENV[K0('GM')]
  0001  GETTABLE  R1 = R1[K1('SceneManager')]
  0002  SELF      R2 = R1[K2('GetGameMode')] (self)
  0003  CALL      R1 = call(R1, 1 args, 1 rets)
  0004  GETTABUP  R2 = _ENV[K3('EGameMode')]
  0005  GETTABLE  R2 = R2[K4('Board')]
  0006  EQ        if R1 eq R2   -> -130550
  0007  JMP       (jump)   -> 9
  0008  RETURN    return R0..R-1
  0009  LOADNIL   R1..R1 = nil
  0010  GETTABUP  R2 = _ENV[K5('pairs')]
  0011  GETTABUP  R3 = _ENV[K6('SurpriseChestActivityDefinition')]
  0012  CALL      R2 = call(R2, 3 args, 1 rets)
  0013  JMP       (jump)   -> 33
  0014  GETTABUP  R7 = _ENV[K0('GM')]
  0015  GETTABLE  R7 = R7[K7('ActivityManager')]
  0016  SELF      R8 = R7[K8('GetModel')] (self)
  0017  MOVE      R9 = R0
  0018  CALL      R7 = call(R7, 1 args, 2 rets)
  0019  MOVE      R1 = R0
  0020  SELF      R8 = R1[K9('CanTriggerSurpriseChest')] (self)
  0021  CALL      R7 = call(R7, 1 args, 1 rets)
  0022  TEST      if not R7 then   -> -131048
  0023  JMP       (jump)   -> 33
  0024  GETTABUP  R7 = _ENV[K10('SurpriseChestManagerDefinition')]
  0025  GETTABLE  R7 = R7[K11('MainWindowPrefabName')]
  0026  NEWTABLE  R8 = {} (2 items)
  0027  MOVE      R9 = R0
  0028  LOADNIL   R10..R10 = nil
  0029  SELF      R12 = R1[K12('GetTriggerData')] (self)
  0030  CALL      R11 = call(R11, -1 args, 1 rets)
  0031  SETLIST   setlist R8[B=1,C=0]
  0032  RETURN    return R7..R6
  0033  TFORCALL  tforcall R2
  0034  TFORLOOP  tforloop R4(sBx=-21)   -> 14
  0035  GETTABUP  R2 = _ENV[K0('GM')]
  0036  GETTABLE  R2 = R2[K13('SurpriseChestManager')]
  0037  SELF      R3 = R2[K14('CanTriggerSurpriseChestByProperty')] (self)
  0038  CALL      R2 = call(R2, 1 args, 1 rets)
  0039  TEST      if not R2 then   -> -131031
  0040  JMP       (jump)   -> 51
  0041  GETTABUP  R2 = _ENV[K10('SurpriseChestManagerDefinition')]
  0042  GETTABLE  R2 = R2[K11('MainWindowPrefabName')]
  0043  NEWTABLE  R3 = {} (2 items)
  0044  LOADNIL   R4..R4 = nil
  0045  GETTABUP  R6 = _ENV[K0('GM')]
  0046  GETTABLE  R6 = R6[K13('SurpriseChestManager')]
  0047  SELF      R7 = R6[K12('GetTriggerData')] (self)
  0048  CALL      R6 = call(R6, -1 args, 1 rets)
  0049  SETLIST   setlist R3[B=1,C=0]
  0050  RETURN    return R2..R1
  0051  RETURN    return R0..R-1
