taobin_project/inter/mys/xml/event/mystery_cup/check_menu.ev
2025-05-26 14:32:46 +07:00

174 lines
No EOL
4.2 KiB
Text

DEBUGVAR "Syncing Pool ..."
Var RandomCoffeeCheckIdx = 0
Var RandomCoffeeCheckOkIdx = 0
For RandomCoffeeCheckIdx < 5 Loop
Var CurrentPd = RandMystCoffee[RandomCoffeeCheckIdx]
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
DEBUGVAR CurrentPd
DEBUGVAR CurrentState
Var RandMystCoffeeEnabled[RandomCoffeeCheckOkIdx] = CurrentPd
Var RandomCoffeeCheckOkIdx = RandomCoffeeCheckOkIdx + 1
EndIf
Var RandomCoffeeCheckIdx = RandomCoffeeCheckIdx + 1
EndFor
DEBUGVAR RandomCoffeeCheckOkIdx
Var RandomTeaCheckIdx = 0
Var RandomTeaCheckOkIdx = 0
For RandomTeaCheckIdx < 7 Loop
Var CurrentPd = RandMystTea[RandomTeaCheckIdx]
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
Var RandMystTeaEnabled[RandomTeaCheckOkIdx] = CurrentPd
Var RandomTeaCheckOkIdx = RandomTeaCheckOkIdx + 1
EndIf
Var RandomTeaCheckIdx = RandomTeaCheckIdx + 1
EndFor
DEBUGVAR RandomTeaCheckOkIdx
Var RandomMilkCheckIdx = 0
Var RandomMilkCheckOkIdx = 0
For RandomMilkCheckIdx < 7 Loop
Var CurrentPd = RandMystMilk[RandomMilkCheckIdx]
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
Var RandMystMilkEnabled[RandomMilkCheckOkIdx] = CurrentPd
Var RandomMilkCheckOkIdx = RandomMilkCheckOkIdx + 1
EndIf
Var RandomMilkCheckIdx = RandomMilkCheckIdx + 1
EndFor
DEBUGVAR RandomMilkCheckOkIdx
; TODO: check all state of each menu (Hot, Cold, Blend)
Var RandomOtherCheckIdx = 0
Var RandomOtherCheckOkIdx = 0
Var DisabledOtherPds = ""
For RandomOtherCheckIdx < 12 Loop
Var CurrentPd = RandMystOther[RandomOtherCheckIdx][0]
SPLIT CurrentPd "-" 1 CountryCode
SPLIT CurrentPd "-" 2 DrinkCategory
SPLIT CurrentPd "-" 3 DrinkType
SPLIT CurrentPd "-" 4 DrinkId
Var TypeIdx = 0
SPLIT RandMystOther[RandomOtherCheckIdx][1] "," 1 CurrentType[0]
SPLIT RandMystOther[RandomOtherCheckIdx][1] "," 2 CurrentType[1]
SPLIT RandMystOther[RandomOtherCheckIdx][1] "," 3 CurrentType[2]
Var AtLeastOneEnable = 0
STRCONTAIN "x" CurrentPd HasXInPd
If HasXInPd = "true" Then
; 12-type-0x-id
For TypeIdx < 3 Loop
Var CurrentTypeI = CurrentType[TypeIdx]
If CurrentTypeI = "X" Then
Else
Var DrinkType !assigned @AutoVar "0{CurrentTypeI}"
Var NewCurrentPd !assigned @AutoVar "{CountryCode}-{DrinkCategory}-{DrinkType}-{DrinkId}"
Var CurrentStateByType !assigned @AutoVar ${NewCurrentPd}.Button
If CurrentStateByType = "Enable" Then
Var AtLeastOneEnable = AtLeastOneEnable + 1
EndIf
;
EndIf
Var TypeIdx = TypeIdx + 1
EndFor
If AtLeastOneEnable >= 1 Then
Var RandMystOtherEnabled[RandomOtherCheckOkIdx] = RandomOtherCheckIdx
Var RandomOtherCheckOkIdx = RandomOtherCheckOkIdx + 1
Else
Var DisabledOtherPds = DisabledOtherPds + NewCurrentPd
Var DisabledOtherPds = DisabledOtherPds + ","
EndIf
Else
; single-state-menu
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
Var RandMystOtherEnabled[RandomOtherCheckOkIdx] = RandomOtherCheckIdx
Var RandomOtherCheckOkIdx = RandomOtherCheckOkIdx + 1
Else
Var DisabledOtherPds = DisabledOtherPds + NewCurrentPd
Var DisabledOtherPds = DisabledOtherPds + ","
EndIf
EndIf
Var RandomOtherCheckIdx = RandomOtherCheckIdx + 1
EndFor
DEBUGVAR RandomOtherCheckOkIdx
DEBUGVAR DisabledOtherPds
; disable-random-by-status
If RandomMilkCheckOkIdx = 0 Then
Var SubRandMilkButtonEnable = "Disable"
SAVELOG "Disable Random Milk"
Else
Var SubRandMilkButtonEnable = "Enable"
EndIf
If RandomTeaCheckOkIdx = 0 Then
Var SubRandTeaButtonEnable = "Disable"
SAVELOG "Disable Random Tea"
Else
Var SubRandTeaButtonEnable = "Enable"
EndIf
If RandomCoffeeCheckOkIdx = 0 Then
Var SubRandCoffButtonEnable = "Disable"
SAVELOG "Disable Random Coffee"
Else
Var SubRandCoffButtonEnable = "Enable"
EndIf