Files
StellaSora_DataLua/lua/game/ui/activity/mathparkour/mathparkourresultsuccessctrl.lua
T
SL1900 08b515afd9 Major Update - 2.0.0.143
EN: 2.0.0.143
CN: 2.0.0.142
JP: 2.0.0.145
KR: 2.0.0.150
2026-10-20 13:00:00 +09:00

68 lines
2.3 KiB
Lua

local MathParkourResultSuccessCtrl = class("MathParkourResultSuccessCtrl", BaseCtrl)
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
MathParkourResultSuccessCtrl._mapNodeConfig = {
txtCompleteTipsPrev1 = {
sComponentName = "TMP_Text",
sLanguageId = "MathParkour_StarTitle"
},
ScoreStar = {nCount = 3},
txtCompleteTipsPrev2 = {
sComponentName = "TMP_Text",
sLanguageId = "MathParkour_Text_CompleteTipsPrev"
},
txt_Complete = {sComponentName = "TMP_Text"},
txt_curScore = {
sComponentName = "TMP_Text",
sLanguageId = "MathParkour_Text_NewScore"
},
btn_Confirm = {
sComponentName = "UIButton",
callback = "OnBtnClick_Confirm"
},
txt_confirm = {
sComponentName = "TMP_Text",
sLanguageId = "MathParkour_Text_Confirm"
},
btn_Nextlevel = {
sComponentName = "UIButton",
callback = "OnBtnClick_NextLevel"
},
txt_nextlevel = {
sComponentName = "TMP_Text",
sLanguageId = "MathParkour_Text_NextLevel"
}
}
MathParkourResultSuccessCtrl._mapEventConfig = {}
MathParkourResultSuccessCtrl._mapRedDotConfig = {}
function MathParkourResultSuccessCtrl:ShowPanel(nScore, bNew, nStarCount, bCanNextLevel, nActId)
self.gameObject:SetActive(true)
NovaAPI.SetTMPText(self._mapNode.txt_Complete, nScore)
self._mapNode.txt_curScore.gameObject:SetActive(bNew)
for i = 1, 3 do
self._mapNode.ScoreStar[i].gameObject:SetActive(i <= nStarCount)
end
bCanNextLevel = bCanNextLevel or false
self._mapNode.btn_Nextlevel.gameObject:SetActive(bCanNextLevel)
self.actData = PlayerData.Activity:GetActivityDataById(nActId)
if self.actData ~= nil then
EventManager.Hit(EventId.TemporaryBlockInput, 1)
self:AddTimer(1, 1, function()
self.actData:OpenTempChangeInfo()
end, true, true, true)
end
self.tbGamepadUINode = self:GetGamepadUINode()
GamepadUIManager.EnableGamepadUI("MathParkourResultSuccessCtrl", self.tbGamepadUINode, nil, true)
end
function MathParkourResultSuccessCtrl:HidePanel()
self.gameObject:SetActive(false)
end
function MathParkourResultSuccessCtrl:OnBtnClick_Confirm()
GamepadUIManager.DisableGamepadUI("MathParkourResultSuccessCtrl")
EventManager.Hit("MathParkour_Confirm")
end
function MathParkourResultSuccessCtrl:OnBtnClick_NextLevel()
GamepadUIManager.DisableGamepadUI("MathParkourResultSuccessCtrl")
EventManager.Hit("MathParkour_NextLevel")
end
return MathParkourResultSuccessCtrl