# PairRaceActivity_View_PairRaceActivityTokenReplaceWindow_1841.luac
; fn @PairRaceActivityTokenReplaceWindow.lua  line 0-0 np=0 va=1 ms=3 code=25 consts=11 upvals=1 protos=5
;   K[0]='PairRaceActivityTokenReplaceWindow'
;   K[1]='setmetatable'
;   K[2]='canClickWindowMask'
;   K[3]=false
;   K[4]='PairRaceActivityBaseWindow'
;   K[5]='__index'
;   K[6]='Init'
;   K[7]='OnBtnClicked'
;   K[8]='OnCloseBtnClick'
;   K[9]='_OnStateChanged'
;   K[10]='_GiveRewardsAndCheckRecover'
;   upvals: _ENV
0000  GETTABUP  R0 = _ENV[K1('setmetatable')]
0001  NEWTABLE  R1 = {} (0 items)
0002  SETTABLE  R1[K2('canClickWindowMask')] = K3(false)
0003  GETTABUP  R2 = _ENV[K4('PairRaceActivityBaseWindow')]
0004  CALL      R0 = call(R0, 1 args, 2 rets)
0005  SETTABUP  _ENV[K0('PairRaceActivityTokenReplaceWindow')] = R0
0006  GETTABUP  R0 = _ENV[K0('PairRaceActivityTokenReplaceWindow')]
0007  GETTABUP  R1 = _ENV[K0('PairRaceActivityTokenReplaceWindow')]
0008  SETTABLE  R0[K5('__index')] = R1
0009  GETTABUP  R0 = _ENV[K0('PairRaceActivityTokenReplaceWindow')]
0010  CLOSURE   R1 = closure proto0
0011  SETTABLE  R0[K6('Init')] = R1
0012  GETTABUP  R0 = _ENV[K0('PairRaceActivityTokenReplaceWindow')]
0013  CLOSURE   R1 = closure proto1
0014  SETTABLE  R0[K7('OnBtnClicked')] = R1
0015  GETTABUP  R0 = _ENV[K0('PairRaceActivityTokenReplaceWindow')]
0016  CLOSURE   R1 = closure proto2
0017  SETTABLE  R0[K8('OnCloseBtnClick')] = R1
0018  GETTABUP  R0 = _ENV[K0('PairRaceActivityTokenReplaceWindow')]
0019  CLOSURE   R1 = closure proto3
0020  SETTABLE  R0[K9('_OnStateChanged')] = R1
0021  GETTABUP  R0 = _ENV[K0('PairRaceActivityTokenReplaceWindow')]
0022  CLOSURE   R1 = closure proto4
0023  SETTABLE  R0[K10('_GiveRewardsAndCheckRecover')] = R1
0024  RETURN    return R0..R-1
; ---------- proto0 [Init] ----------
  ; fn ?  line 8-17 np=4 va=0 ms=9 code=26 consts=12 upvals=1 protos=0
  ;   K[0]='PairRaceActivityBaseWindow'
  ;   K[1]='Init'
  ;   K[2]='m_model'
  ;   K[3]='GetSurplusTokenCount'
  ;   K[4]=0
  ;   K[5]='m_tokenText'
  ;   K[6]='text'
  ;   K[7]='m_arrRewards'
  ;   K[8]='ClaimTokenEnergy'
  ;   K[9]='m_unclaimedRewards'
  ;   K[10]='ClaimLeftRewards'
  ;   K[11]='CheckGroupEnd'
  ;   upvals: _ENV
  ;   locals: self(0-26), activityType(0-26), id(0-26), bAutoPop(0-26), surplusTokenCount(10-26)
  0000  GETTABUP  R4 = _ENV[K0('PairRaceActivityBaseWindow')]
  0001  GETTABLE  R4 = R4[K1('Init')]
  0002  MOVE      R5 = R0
  0003  MOVE      R6 = R0
  0004  MOVE      R7 = R0
  0005  MOVE      R8 = R0
  0006  CALL      R4 = call(R4, 0 args, 4 rets)
  0007  GETTABLE  R4 = R0[K2('m_model')]
  0008  SELF      R5 = R4[K3('GetSurplusTokenCount')] (self)
  0009  CALL      R4 = call(R4, 1 args, 1 rets)
  0010  LT        if R0 lt R4   -> 2064
  0011  JMP       (jump)   -> 18
  0012  GETTABLE  R5 = R0[K5('m_tokenText')]
  0013  SETTABLE  R5[K6('text')] = R4
  0014  GETTABLE  R5 = R0[K2('m_model')]
  0015  SELF      R6 = R5[K8('ClaimTokenEnergy')] (self)
  0016  CALL      R5 = call(R5, 1 args, 1 rets)
  0017  SETTABLE  R0[K7('m_arrRewards')] = R5
  0018  GETTABLE  R5 = R0[K2('m_model')]
  0019  SELF      R6 = R5[K10('ClaimLeftRewards')] (self)
  0020  CALL      R5 = call(R5, 1 args, 1 rets)
  0021  SETTABLE  R0[K9('m_unclaimedRewards')] = R5
  0022  GETTABLE  R5 = R0[K2('m_model')]
  0023  SELF      R6 = R5[K11('CheckGroupEnd')] (self)
  0024  CALL      R5 = call(R5, 0 args, 1 rets)
  0025  RETURN    return R0..R-1
; ---------- proto1 [OnBtnClicked] ----------
  ; fn ?  line 19-22 np=1 va=0 ms=3 code=5 consts=2 upvals=0 protos=0
  ;   K[0]='Close'
  ;   K[1]='_GiveRewardsAndCheckRecover'
  ;   locals: self(0-5)
  0000  SELF      R2 = R0[K0('Close')] (self)
  0001  CALL      R1 = call(R1, 0 args, 1 rets)
  0002  SELF      R2 = R0[K1('_GiveRewardsAndCheckRecover')] (self)
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  RETURN    return R0..R-1
; ---------- proto2 [OnCloseBtnClick] ----------
  ; fn ?  line 24-27 np=1 va=0 ms=3 code=7 consts=3 upvals=1 protos=0
  ;   K[0]='PairRaceActivityBaseWindow'
  ;   K[1]='OnCloseBtnClick'
  ;   K[2]='_GiveRewardsAndCheckRecover'
  ;   upvals: _ENV
  ;   locals: self(0-7)
  0000  GETTABUP  R1 = _ENV[K0('PairRaceActivityBaseWindow')]
  0001  GETTABLE  R1 = R1[K1('OnCloseBtnClick')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  SELF      R2 = R0[K2('_GiveRewardsAndCheckRecover')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  RETURN    return R0..R-1
; ---------- proto3 [_OnStateChanged] ----------
  ; fn ?  line 29-32 np=1 va=0 ms=3 code=7 consts=3 upvals=1 protos=0
  ;   K[0]='PairRaceActivityBaseWindow'
  ;   K[1]='_OnStateChanged'
  ;   K[2]='_GiveRewardsAndCheckRecover'
  ;   upvals: _ENV
  ;   locals: self(0-7)
  0000  GETTABUP  R1 = _ENV[K0('PairRaceActivityBaseWindow')]
  0001  GETTABLE  R1 = R1[K1('_OnStateChanged')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  SELF      R2 = R0[K2('_GiveRewardsAndCheckRecover')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  RETURN    return R0..R-1
; ---------- proto4 [_GiveRewardsAndCheckRecover] ----------
  ; fn ?  line 35-41 np=1 va=0 ms=8 code=25 consts=17 upvals=1 protos=0
  ;   K[0]='RewardApi'
  ;   K[1]='AcquireRewardsInView'
  ;   K[2]='m_arrRewards'
  ;   K[3]='alwaysInMiddle'
  ;   K[4]=true
  ;   K[5]='ERewardScene'
  ;   K[6]='Other'
  ;   K[7]='Table'
  ;   K[8]='IsEmpty'
  ;   K[9]='m_unclaimedRewards'
  ;   K[10]='GM'
  ;   K[11]='UIManager'
  ;   K[12]='OpenView'
  ;   K[13]='m_activityDefinition'
  ;   K[14]='RewardRecoverWindowPrefabName'
  ;   K[15]='m_activityType'
  ;   K[16]='m_id'
  ;   upvals: _ENV
  ;   locals: self(0-25)
  0000  GETTABUP  R1 = _ENV[K0('RewardApi')]
  0001  GETTABLE  R1 = R1[K1('AcquireRewardsInView')]
  0002  GETTABLE  R2 = R0[K2('m_arrRewards')]
  0003  NEWTABLE  R3 = {} (0 items)
  0004  SETTABLE  R3[K3('alwaysInMiddle')] = K4(true)
  0005  GETTABUP  R4 = _ENV[K5('ERewardScene')]
  0006  GETTABLE  R4 = R4[K6('Other')]
  0007  CALL      R1 = call(R1, 0 args, 3 rets)
  0008  GETTABUP  R1 = _ENV[K7('Table')]
  0009  GETTABLE  R1 = R1[K8('IsEmpty')]
  0010  GETTABLE  R2 = R0[K9('m_unclaimedRewards')]
  0011  CALL      R1 = call(R1, 1 args, 1 rets)
  0012  TEST      if not R1 then   -> -131057
  0013  JMP       (jump)   -> 24
  0014  GETTABUP  R1 = _ENV[K10('GM')]
  0015  GETTABLE  R1 = R1[K11('UIManager')]
  0016  SELF      R2 = R1[K12('OpenView')] (self)
  0017  GETTABLE  R3 = R0[K13('m_activityDefinition')]
  0018  GETTABLE  R3 = R3[K14('RewardRecoverWindowPrefabName')]
  0019  GETTABLE  R4 = R0[K15('m_activityType')]
  0020  GETTABLE  R5 = R0[K16('m_id')]
  0021  LOADBOOL  R6 = true
  0022  GETTABLE  R7 = R0[K9('m_unclaimedRewards')]
  0023  CALL      R1 = call(R1, 0 args, 6 rets)
  0024  RETURN    return R0..R-1
