# DoubleWheelActivity_View_DoubleWheelActivityMainEntry_1997.luac
; fn @DoubleWheelActivityMainEntry.lua  line 0-0 np=0 va=1 ms=3 code=57 consts=20 upvals=1 protos=16
;   K[0]='DoubleWheelActivityMainEntry'
;   K[1]='setmetatable'
;   K[2]='HudCountDownButton'
;   K[3]='__index'
;   K[4]='Awake'
;   K[5]='Init'
;   K[6]='_TryAddListeners'
;   K[7]='_InitModelData'
;   K[8]='_UpdateFinishTime'
;   K[9]='GetModel'
;   K[10]='_IsModelIdChanged'
;   K[11]='GetTriggerStartTime'
;   K[12]='_OnRefreshEntryEvent'
;   K[13]='_OnScoreChangedEvent'
;   K[14]='_OnWheelUpgradedEvent'
;   K[15]='_OnMainWindowOpenedEvent'
;   K[16]='_UpdateRedPoint'
;   K[17]='OnBtnClicked'
;   K[18]='_ResetAddedTokenCount'
;   K[19]='OnGameModeChanged'
;   upvals: _ENV
0000  GETTABUP  R0 = _ENV[K1('setmetatable')]
0001  NEWTABLE  R1 = {} (0 items)
0002  GETTABUP  R2 = _ENV[K2('HudCountDownButton')]
0003  CALL      R0 = call(R0, 1 args, 2 rets)
0004  SETTABUP  _ENV[K0('DoubleWheelActivityMainEntry')] = R0
0005  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0006  GETTABUP  R1 = _ENV[K0('DoubleWheelActivityMainEntry')]
0007  SETTABLE  R0[K3('__index')] = R1
0008  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0009  CLOSURE   R1 = closure proto0
0010  SETTABLE  R0[K4('Awake')] = R1
0011  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0012  CLOSURE   R1 = closure proto1
0013  SETTABLE  R0[K5('Init')] = R1
0014  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0015  CLOSURE   R1 = closure proto2
0016  SETTABLE  R0[K6('_TryAddListeners')] = R1
0017  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0018  CLOSURE   R1 = closure proto3
0019  SETTABLE  R0[K7('_InitModelData')] = R1
0020  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0021  CLOSURE   R1 = closure proto4
0022  SETTABLE  R0[K8('_UpdateFinishTime')] = R1
0023  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0024  CLOSURE   R1 = closure proto5
0025  SETTABLE  R0[K9('GetModel')] = R1
0026  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0027  CLOSURE   R1 = closure proto6
0028  SETTABLE  R0[K10('_IsModelIdChanged')] = R1
0029  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0030  CLOSURE   R1 = closure proto7
0031  SETTABLE  R0[K11('GetTriggerStartTime')] = R1
0032  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0033  CLOSURE   R1 = closure proto8
0034  SETTABLE  R0[K12('_OnRefreshEntryEvent')] = R1
0035  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0036  CLOSURE   R1 = closure proto9
0037  SETTABLE  R0[K13('_OnScoreChangedEvent')] = R1
0038  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0039  CLOSURE   R1 = closure proto10
0040  SETTABLE  R0[K14('_OnWheelUpgradedEvent')] = R1
0041  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0042  CLOSURE   R1 = closure proto11
0043  SETTABLE  R0[K15('_OnMainWindowOpenedEvent')] = R1
0044  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0045  CLOSURE   R1 = closure proto12
0046  SETTABLE  R0[K16('_UpdateRedPoint')] = R1
0047  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0048  CLOSURE   R1 = closure proto13
0049  SETTABLE  R0[K17('OnBtnClicked')] = R1
0050  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0051  CLOSURE   R1 = closure proto14
0052  SETTABLE  R0[K18('_ResetAddedTokenCount')] = R1
0053  GETTABUP  R0 = _ENV[K0('DoubleWheelActivityMainEntry')]
0054  CLOSURE   R1 = closure proto15
0055  SETTABLE  R0[K19('OnGameModeChanged')] = R1
0056  RETURN    return R0..R-1
; ---------- proto0 [Awake] ----------
  ; fn ?  line 12-19 np=1 va=0 ms=3 code=10 consts=6 upvals=1 protos=0
  ;   K[0]='HudCountDownButton'
  ;   K[1]='Awake'
  ;   K[2]='_InitModelData'
  ;   K[3]='m_bAwaked'
  ;   K[4]=true
  ;   K[5]='_TryAddListeners'
  ;   upvals: _ENV
  ;   locals: self(0-10)
  0000  GETTABUP  R1 = _ENV[K0('HudCountDownButton')]
  0001  GETTABLE  R1 = R1[K1('Awake')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  SELF      R2 = R0[K2('_InitModelData')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  SETTABLE  R0[K3('m_bAwaked')] = K4(true)
  0007  SELF      R2 = R0[K5('_TryAddListeners')] (self)
  0008  CALL      R1 = call(R1, 0 args, 1 rets)
  0009  RETURN    return R0..R-1
; ---------- proto1 [Init] ----------
  ; fn ?  line 22-31 np=2 va=0 ms=5 code=11 consts=7 upvals=0 protos=0
  ;   K[0]='m_model'
  ;   K[1]='_InitModelData'
  ;   K[2]='m_addScore'
  ;   K[3]='Init'
  ;   K[4]='m_bInited'
  ;   K[5]=true
  ;   K[6]='_TryAddListeners'
  ;   locals: self(0-11), model(0-11)
  0000  SETTABLE  R0[K0('m_model')] = R1
  0001  SELF      R3 = R0[K1('_InitModelData')] (self)
  0002  CALL      R2 = call(R2, 0 args, 1 rets)
  0003  GETTABLE  R2 = R0[K2('m_addScore')]
  0004  SELF      R3 = R2[K3('Init')] (self)
  0005  MOVE      R4 = R0
  0006  CALL      R2 = call(R2, 0 args, 2 rets)
  0007  SETTABLE  R0[K4('m_bInited')] = K5(true)
  0008  SELF      R3 = R0[K6('_TryAddListeners')] (self)
  0009  CALL      R2 = call(R2, 0 args, 1 rets)
  0010  RETURN    return R0..R-1
; ---------- proto2 [_TryAddListeners] ----------
  ; fn ?  line 33-43 np=1 va=0 ms=6 code=36 consts=14 upvals=1 protos=0
  ;   K[0]='m_bAwaked'
  ;   K[1]='m_bInited'
  ;   K[2]='GetModel'
  ;   K[3]='GetActivityDefinition'
  ;   K[4]='EventDispatcher'
  ;   K[5]='AddListener'
  ;   K[6]='RefreshEntryEvent'
  ;   K[7]='_OnRefreshEntryEvent'
  ;   K[8]='ScoreChangedEvent'
  ;   K[9]='_OnScoreChangedEvent'
  ;   K[10]='WheelUpgradedEvent'
  ;   K[11]='_OnWheelUpgradedEvent'
  ;   K[12]='MainWindowOpenedEvent'
  ;   K[13]='_OnMainWindowOpenedEvent'
  ;   upvals: _ENV
  ;   locals: self(0-36), activityDefinition(11-36)
  0000  GETTABLE  R1 = R0[K0('m_bAwaked')]
  0001  TEST      if not R1 then   -> -131069
  0002  JMP       (jump)   -> 6
  0003  GETTABLE  R1 = R0[K1('m_bInited')]
  0004  TEST      if not R1 then   -> -131065
  0005  JMP       (jump)   -> 7
  0006  RETURN    return R0..R-1
  0007  SELF      R2 = R0[K2('GetModel')] (self)
  0008  CALL      R1 = call(R1, 1 args, 1 rets)
  0009  SELF      R2 = R1[K3('GetActivityDefinition')] (self)
  0010  CALL      R1 = call(R1, 1 args, 1 rets)
  0011  GETTABUP  R2 = _ENV[K4('EventDispatcher')]
  0012  GETTABLE  R2 = R2[K5('AddListener')]
  0013  GETTABLE  R3 = R1[K6('RefreshEntryEvent')]
  0014  MOVE      R4 = R0
  0015  GETTABLE  R5 = R0[K7('_OnRefreshEntryEvent')]
  0016  CALL      R2 = call(R2, 0 args, 3 rets)
  0017  GETTABUP  R2 = _ENV[K4('EventDispatcher')]
  0018  GETTABLE  R2 = R2[K5('AddListener')]
  0019  GETTABLE  R3 = R1[K8('ScoreChangedEvent')]
  0020  MOVE      R4 = R0
  0021  GETTABLE  R5 = R0[K9('_OnScoreChangedEvent')]
  0022  CALL      R2 = call(R2, 0 args, 3 rets)
  0023  GETTABUP  R2 = _ENV[K4('EventDispatcher')]
  0024  GETTABLE  R2 = R2[K5('AddListener')]
  0025  GETTABLE  R3 = R1[K10('WheelUpgradedEvent')]
  0026  MOVE      R4 = R0
  0027  GETTABLE  R5 = R0[K11('_OnWheelUpgradedEvent')]
  0028  CALL      R2 = call(R2, 0 args, 3 rets)
  0029  GETTABUP  R2 = _ENV[K4('EventDispatcher')]
  0030  GETTABLE  R2 = R2[K5('AddListener')]
  0031  GETTABLE  R3 = R1[K12('MainWindowOpenedEvent')]
  0032  MOVE      R4 = R0
  0033  GETTABLE  R5 = R0[K13('_OnMainWindowOpenedEvent')]
  0034  CALL      R2 = call(R2, 0 args, 3 rets)
  0035  RETURN    return R0..R-1
; ---------- proto3 [_InitModelData] ----------
  ; fn ?  line 45-54 np=1 va=0 ms=3 code=16 consts=8 upvals=0 protos=0
  ;   K[0]='m_model'
  ;   K[1]=nil
  ;   K[2]='m_id'
  ;   K[3]='GetModel'
  ;   K[4]='GetId'
  ;   K[5]='_ResetAddedTokenCount'
  ;   K[6]='_UpdateFinishTime'
  ;   K[7]='_UpdateRedPoint'
  ;   locals: self(0-16)
  0000  GETTABLE  R1 = R0[K0('m_model')]
  0001  EQ        if R0 eq K1(nil)   -> -130300
  0002  JMP       (jump)   -> 4
  0003  RETURN    return R0..R-1
  0004  SELF      R2 = R0[K3('GetModel')] (self)
  0005  CALL      R1 = call(R1, 1 args, 1 rets)
  0006  SELF      R2 = R1[K4('GetId')] (self)
  0007  CALL      R1 = call(R1, 1 args, 1 rets)
  0008  SETTABLE  R0[K2('m_id')] = R1
  0009  SELF      R2 = R0[K5('_ResetAddedTokenCount')] (self)
  0010  CALL      R1 = call(R1, 0 args, 1 rets)
  0011  SELF      R2 = R0[K6('_UpdateFinishTime')] (self)
  0012  CALL      R1 = call(R1, 0 args, 1 rets)
  0013  SELF      R2 = R0[K7('_UpdateRedPoint')] (self)
  0014  CALL      R1 = call(R1, 0 args, 1 rets)
  0015  RETURN    return R0..R-1
; ---------- proto4 [_UpdateFinishTime] ----------
  ; fn ?  line 56-59 np=1 va=0 ms=3 code=8 consts=4 upvals=0 protos=0
  ;   K[0]='m_finishTime'
  ;   K[1]='GetModel'
  ;   K[2]='GetEndTime'
  ;   K[3]='UpdatePerSecond'
  ;   locals: self(0-8)
  0000  SELF      R2 = R0[K1('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K2('GetEndTime')] (self)
  0003  CALL      R1 = call(R1, 1 args, 1 rets)
  0004  SETTABLE  R0[K0('m_finishTime')] = R1
  0005  SELF      R2 = R0[K3('UpdatePerSecond')] (self)
  0006  CALL      R1 = call(R1, 0 args, 1 rets)
  0007  RETURN    return R0..R-1
; ---------- proto5 [GetModel] ----------
  ; fn ?  line 61-63 np=1 va=0 ms=2 code=3 consts=1 upvals=0 protos=0
  ;   K[0]='m_model'
  ;   locals: self(0-3)
  0000  GETTABLE  R1 = R0[K0('m_model')]
  0001  RETURN    return R1..R0
  0002  RETURN    return R0..R-1
; ---------- proto6 [_IsModelIdChanged] ----------
  ; fn ?  line 65-67 np=1 va=0 ms=4 code=11 consts=3 upvals=0 protos=0
  ;   K[0]='m_id'
  ;   K[1]='GetModel'
  ;   K[2]='GetId'
  ;   locals: self(0-11)
  0000  GETTABLE  R1 = R0[K0('m_id')]
  0001  SELF      R3 = R0[K1('GetModel')] (self)
  0002  CALL      R2 = call(R2, 1 args, 1 rets)
  0003  SELF      R3 = R2[K2('GetId')] (self)
  0004  CALL      R2 = call(R2, 1 args, 1 rets)
  0005  EQ        if R0 eq R2   -> -130551
  0006  JMP       (jump)   -> 8
  0007  LOADBOOL  R1 = false
  0008  LOADBOOL  R1 = true
  0009  RETURN    return R1..R0
  0010  RETURN    return R0..R-1
; ---------- proto7 [GetTriggerStartTime] ----------
  ; fn ?  line 69-71 np=1 va=0 ms=3 code=6 consts=2 upvals=0 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='GetTriggerStartTime'
  ;   locals: self(0-6)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('GetTriggerStartTime')] (self)
  0003  TAILCALL  tailcall(R1, 0)
  0004  RETURN    return R1..R0
  0005  RETURN    return R0..R-1
; ---------- proto8 [_OnRefreshEntryEvent] ----------
  ; fn ?  line 73-79 np=1 va=0 ms=3 code=10 consts=3 upvals=0 protos=0
  ;   K[0]='_IsModelIdChanged'
  ;   K[1]='_InitModelData'
  ;   K[2]='_UpdateFinishTime'
  ;   locals: self(0-10)
  0000  SELF      R2 = R0[K0('_IsModelIdChanged')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  TEST      if not R1 then   -> -131068
  0003  JMP       (jump)   -> 7
  0004  SELF      R2 = R0[K1('_InitModelData')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  JMP       (jump)   -> 9
  0007  SELF      R2 = R0[K2('_UpdateFinishTime')] (self)
  0008  CALL      R1 = call(R1, 0 args, 1 rets)
  0009  RETURN    return R0..R-1
; ---------- proto9 [_OnScoreChangedEvent] ----------
  ; fn ?  line 81-90 np=2 va=0 ms=5 code=9 consts=4 upvals=0 protos=0
  ;   K[0]='delta'
  ;   K[1]=0
  ;   K[2]='m_addedTokenCount'
  ;   K[3]='_UpdateRedPoint'
  ;   locals: self(0-9), msg(0-9), delta(1-9)
  0000  GETTABLE  R2 = R1[K0('delta')]
  0001  LT        if R0 lt R2   -> 517
  0002  JMP       (jump)   -> 6
  0003  GETTABLE  R3 = R0[K2('m_addedTokenCount')]
  0004  ADD       R3 = R2 add R3
  0005  SETTABLE  R0[K2('m_addedTokenCount')] = R3
  0006  SELF      R4 = R0[K3('_UpdateRedPoint')] (self)
  0007  CALL      R3 = call(R3, 0 args, 1 rets)
  0008  RETURN    return R0..R-1
; ---------- proto10 [_OnWheelUpgradedEvent] ----------
  ; fn ?  line 92-95 np=1 va=0 ms=3 code=3 consts=1 upvals=0 protos=0
  ;   K[0]='_UpdateRedPoint'
  ;   locals: self(0-3)
  0000  SELF      R2 = R0[K0('_UpdateRedPoint')] (self)
  0001  CALL      R1 = call(R1, 0 args, 1 rets)
  0002  RETURN    return R0..R-1
; ---------- proto11 [_OnMainWindowOpenedEvent] ----------
  ; fn ?  line 97-100 np=1 va=0 ms=3 code=3 consts=1 upvals=0 protos=0
  ;   K[0]='_ResetAddedTokenCount'
  ;   locals: self(0-3)
  0000  SELF      R2 = R0[K0('_ResetAddedTokenCount')] (self)
  0001  CALL      R1 = call(R1, 0 args, 1 rets)
  0002  RETURN    return R0..R-1
; ---------- proto12 [_UpdateRedPoint] ----------
  ; fn ?  line 102-107 np=1 va=0 ms=5 code=16 consts=6 upvals=1 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='IsActivityOpen'
  ;   K[2]='UIUtil'
  ;   K[3]='SetActive'
  ;   K[4]='m_exclamationGo'
  ;   K[5]='ShouldShowRedPoint'
  ;   upvals: _ENV
  ;   locals: self(0-16)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('IsActivityOpen')] (self)
  0003  CALL      R1 = call(R1, 1 args, 1 rets)
  0004  TEST      if not R1 then   -> -131065
  0005  JMP       (jump)   -> 7
  0006  RETURN    return R0..R-1
  0007  GETTABUP  R1 = _ENV[K2('UIUtil')]
  0008  GETTABLE  R1 = R1[K3('SetActive')]
  0009  GETTABLE  R2 = R0[K4('m_exclamationGo')]
  0010  SELF      R4 = R0[K0('GetModel')] (self)
  0011  CALL      R3 = call(R3, 1 args, 1 rets)
  0012  SELF      R4 = R3[K5('ShouldShowRedPoint')] (self)
  0013  CALL      R3 = call(R3, -1 args, 1 rets)
  0014  CALL      R1 = call(R1, 0 args, -1 rets)
  0015  RETURN    return R0..R-1
; ---------- proto13 [OnBtnClicked] ----------
  ; fn ?  line 109-111 np=1 va=0 ms=3 code=5 consts=2 upvals=0 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='OnEntryClicked'
  ;   locals: self(0-5)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('OnEntryClicked')] (self)
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  RETURN    return R0..R-1
; ---------- proto14 [_ResetAddedTokenCount] ----------
  ; fn ?  line 113-115 np=1 va=0 ms=2 code=2 consts=2 upvals=0 protos=0
  ;   K[0]='m_addedTokenCount'
  ;   K[1]=0
  ;   locals: self(0-2)
  0000  SETTABLE  R0[K0('m_addedTokenCount')] = K1(0)
  0001  RETURN    return R0..R-1
; ---------- proto15 [OnGameModeChanged] ----------
  ; fn ?  line 117-137 np=1 va=0 ms=7 code=44 consts=20 upvals=1 protos=0
  ;   K[0]='HudCountDownButton'
  ;   K[1]='OnGameModeChanged'
  ;   K[2]='GetModel'
  ;   K[3]=nil
  ;   K[4]='GM'
  ;   K[5]='SceneManager'
  ;   K[6]='GetGameMode'
  ;   K[7]='EGameMode'
  ;   K[8]='Main'
  ;   K[9]='IsActivityOpen'
  ;   K[10]='m_addedTokenCount'
  ;   K[11]=0
  ;   K[12]='m_addScore'
  ;   K[13]='PlayAnimation'
  ;   K[14]='GetActivityDefinition'
  ;   K[15]='ActivityTokenIconName'
  ;   K[16]='string'
  ;   K[17]='format'
  ;   K[18]='+%d'
  ;   K[19]='_ResetAddedTokenCount'
  ;   upvals: _ENV
  ;   locals: self(0-44)
  0000  GETTABUP  R1 = _ENV[K0('HudCountDownButton')]
  0001  GETTABLE  R1 = R1[K1('OnGameModeChanged')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  SELF      R2 = R0[K2('GetModel')] (self)
  0005  CALL      R1 = call(R1, 1 args, 1 rets)
  0006  EQ        if R0 eq K3(nil)   -> -130293
  0007  JMP       (jump)   -> 9
  0008  RETURN    return R0..R-1
  0009  GETTABUP  R1 = _ENV[K4('GM')]
  0010  GETTABLE  R1 = R1[K5('SceneManager')]
  0011  SELF      R2 = R1[K6('GetGameMode')] (self)
  0012  CALL      R1 = call(R1, 1 args, 1 rets)
  0013  GETTABUP  R2 = _ENV[K7('EGameMode')]
  0014  GETTABLE  R2 = R2[K8('Main')]
  0015  EQ        if R1 eq R2   -> -130541
  0016  JMP       (jump)   -> 18
  0017  RETURN    return R0..R-1
  0018  SELF      R2 = R0[K2('GetModel')] (self)
  0019  CALL      R1 = call(R1, 1 args, 1 rets)
  0020  SELF      R2 = R1[K9('IsActivityOpen')] (self)
  0021  CALL      R1 = call(R1, 1 args, 1 rets)
  0022  TEST      if not R1 then   -> -131047
  0023  JMP       (jump)   -> 25
  0024  RETURN    return R0..R-1
  0025  GETTABLE  R1 = R0[K10('m_addedTokenCount')]
  0026  LT        if R0 lt R1   -> 5661
  0027  JMP       (jump)   -> 43
  0028  GETTABLE  R1 = R0[K12('m_addScore')]
  0029  SELF      R2 = R1[K13('PlayAnimation')] (self)
  0030  SELF      R4 = R0[K2('GetModel')] (self)
  0031  CALL      R3 = call(R3, 1 args, 1 rets)
  0032  SELF      R4 = R3[K14('GetActivityDefinition')] (self)
  0033  CALL      R3 = call(R3, 1 args, 1 rets)
  0034  GETTABLE  R3 = R3[K15('ActivityTokenIconName')]
  0035  GETTABUP  R4 = _ENV[K16('string')]
  0036  GETTABLE  R4 = R4[K17('format')]
  0037  LOADK     R5 = K18 '+%d'
  0038  GETTABLE  R6 = R0[K10('m_addedTokenCount')]
  0039  CALL      R4 = call(R4, -1 args, 2 rets)
  0040  CALL      R1 = call(R1, 0 args, -1 rets)
  0041  SELF      R2 = R0[K19('_ResetAddedTokenCount')] (self)
  0042  CALL      R1 = call(R1, 0 args, 1 rets)
  0043  RETURN    return R0..R-1
