Files
StellaSora_DataLua/lua/game/ui/trekkerversus_600002/trekkerversusgiftquestgridctrl.lua
T
SL1900 e0549005e1 Update - 1.9.0.103
EN: 1.9.0.103
CN: 1.9.0.104
JP: 1.9.0.106
KR: 1.9.0.108
2026-04-18 00:15:00 +09:00

93 lines
3.0 KiB
Lua

local TrekkerVersusGiftQuestGridCtrl = class("TrekkerVersusGiftQuestGridCtrl", BaseCtrl)
TrekkerVersusGiftQuestGridCtrl._mapNodeConfig = {
TMPDesc = {sComponentName = "TMP_Text"},
TMPIncomplete = {
sComponentName = "TMP_Text",
sLanguageId = "Quest_undone"
},
txtBtnJump = {
sComponentName = "TMP_Text",
sLanguageId = "Quest_JumpTo"
},
TMPReceiveGrid = {
sComponentName = "TMP_Text",
sLanguageId = "Quest_Receive"
},
item = {
sCtrlName = "Game.UI.TemplateEx.TemplateItemCtrl",
nCount = 3
},
btnItem = {
sNodeName = "btnItem_",
sComponentName = "UIButton",
callback = "OnBtnClick_Item",
nCount = 3
},
maskComplete = {},
imgComplete = {},
btnReceive = {
sComponentName = "UIButton",
callback = "OnBtnClick_Receive"
},
btnJump = {
sComponentName = "UIButton",
callback = "OnBtnClick_JumpTo"
}
}
TrekkerVersusGiftQuestGridCtrl._mapEventConfig = {}
TrekkerVersusGiftQuestGridCtrl._mapRedDotConfig = {}
function TrekkerVersusGiftQuestGridCtrl:Awake()
end
function TrekkerVersusGiftQuestGridCtrl:FadeIn()
end
function TrekkerVersusGiftQuestGridCtrl:FadeOut()
end
function TrekkerVersusGiftQuestGridCtrl:OnEnable()
end
function TrekkerVersusGiftQuestGridCtrl:OnDisable()
end
function TrekkerVersusGiftQuestGridCtrl:OnDestroy()
end
function TrekkerVersusGiftQuestGridCtrl:OnRelease()
end
function TrekkerVersusGiftQuestGridCtrl:Refresh(mapQuestData, actData)
self._mapActData = actData
local mapQuestCfgData = ConfigTable.GetData("TravelerDuelChallengeQuest", mapQuestData.Id)
if mapQuestCfgData == nil then
return
end
self.cfgData = mapQuestCfgData
NovaAPI.SetTMPText(self._mapNode.TMPDesc, mapQuestCfgData.Title)
self._mapNode.btnReceive.gameObject:SetActive(mapQuestData.Status == 1)
self._mapNode.btnJump.gameObject:SetActive(mapQuestData.Status == 0 and 0 < #self.cfgData.AffixJumpTo)
self._mapNode.TMPIncomplete.gameObject:SetActive(mapQuestData.Status == 0)
self._mapNode.imgComplete:SetActive(mapQuestData.Status == 2)
self._mapNode.maskComplete:SetActive(mapQuestData.Status == 2)
for i = 1, 3 do
local sFieldName1 = "AwardItemTid" .. i
local sFieldName2 = "AwardItemNum" .. i
local nItemTid = mapQuestCfgData[sFieldName1]
local nCount = mapQuestCfgData[sFieldName2]
if 0 < nItemTid then
self._mapNode.btnItem[i].gameObject:SetActive(true)
self._mapNode.item[i]:SetItem(nItemTid, nil, nCount, nil, mapQuestData.Status == 2, nil, nil, true)
else
self._mapNode.btnItem[i].gameObject:SetActive(false)
end
end
end
function TrekkerVersusGiftQuestGridCtrl:OnBtnClick_Item(btn, nIdx)
local sFieldName1 = "AwardItemTid" .. nIdx
local sFieldName2 = "AwardItemNum" .. nIdx
local nItemTid = self.cfgData[sFieldName1]
local nCount = self.cfgData[sFieldName2]
UTILS.ClickItemGridWithTips(nItemTid, btn.transform, true, true, false)
end
function TrekkerVersusGiftQuestGridCtrl:OnBtnClick_JumpTo(btn)
EventManager.Hit("TrekkerVersusAffixJump", self.cfgData.AffixJumpTo)
end
function TrekkerVersusGiftQuestGridCtrl:OnBtnClick_Receive()
self._mapActData:ReceiveQuestReward()
end
return TrekkerVersusGiftQuestGridCtrl