Files
SL1900 5e0d58cfad Initial version - 1.2.0.60
EN: 1.2.0.60
CN: 1.2.0.61
JP: 1.2.0.63
KR: 1.2.0.67
2025-12-03 01:00:00 +09:00

92 lines
2.9 KiB
Lua

local BaseCtrl = require("GameCore.UI.BaseCtrl")
local StoryClueCtrl = class("StoryClueCtrl", BaseCtrl)
local AvgData = PlayerData.Avg
StoryClueCtrl._mapNodeConfig = {
got_fullscreen = {
sNodeName = "t_fullscreen",
sComponentName = "GameObject"
},
btnsnapshot = {
sNodeName = "btnsnapshot",
sComponentName = "Button",
callback = "OnBtn_ClickClose"
},
btnClose = {
sNodeName = "btnClose",
sComponentName = "UIButton",
callback = "OnBtn_ClickClose"
},
anit_window = {sNodeName = "t_window", sComponentName = "Animator"},
loopsvClue = {
sNodeName = "svClue",
sComponentName = "LoopScrollView"
},
txtWindowTitle = {sComponentName = "TMP_Text", sLanguageId = "Story_Clue"},
txtUnkownClueDecs = {
sComponentName = "TMP_Text",
sLanguageId = "Story_Unkown_Clue"
}
}
StoryClueCtrl._mapEventConfig = {}
function StoryClueCtrl:Awake()
end
function StoryClueCtrl:FadeIn()
end
function StoryClueCtrl:FadeOut()
end
function StoryClueCtrl:OnEnable()
end
function StoryClueCtrl:RefreshPanel()
self.gameObject:SetActive(true)
self._mapNode.anit_window:Play("t_window_04_t_in")
self._mapNode.got_fullscreen:SetActive(true)
self.tbEvidence = {}
for k, v in pairs(AvgData.CFG_StoryEvidence) do
if v.visible == 1 then
table.insert(self.tbEvidence, v)
end
end
table.sort(self.tbEvidence, function(a, b)
return a < b
end)
local count = #self.tbEvidence
self._mapNode.loopsvClue.gameObject:SetActive(true)
self._mapNode.loopsvClue:SetAnim(0.07)
self._mapNode.loopsvClue:Init(count, self, self.OnRefreshClueList)
end
function StoryClueCtrl:OnRefreshClueList(grid)
local index = tonumber(grid.name) + 1
local evidenceId = self.tbEvidence[index]
local mapData = ConfigTable.GetData("StoryEvidence", evidenceId)
local bUnlock = AvgData:IsEvidenceUnlock(mapData.EvId)
local trans = grid.transform:Find("btnGrid/AnimRoot")
local goUnlock = trans:Find("goUnlockClue")
local goLock = trans:Find("goLockClue")
local imgBg = goUnlock:Find("imgChoiceBg"):GetComponent("Image")
local imgItem = goUnlock:Find("imgClueItem"):GetComponent("Image")
local txtClueTitle = goUnlock:Find("txtClueTitle"):GetComponent("TMP_Text")
local txtClueDesc = goUnlock:Find("txtClueDesc"):GetComponent("TMP_Text")
local reddot = trans:Find("reddot")
goLock.gameObject:SetActive(not bUnlock)
goUnlock.gameObject:SetActive(bUnlock)
reddot.gameObject:SetActive(false)
if bUnlock then
if mapData.Icon ~= "" then
self:SetPngSprite(imgItem, mapData.Icon)
end
NovaAPI.SetTMPText(txtClueTitle, mapData.Name)
NovaAPI.SetTMPText(txtClueDesc, mapData.Desc)
local bReddot = RedDotManager.GetValid(RedDotDefine.MianStoryClue_Use, evidenceId)
reddot.gameObject:SetActive(bReddot)
end
end
function StoryClueCtrl:OnBtn_ClickClose()
self._mapNode.anit_window:Play("t_window_04_t_out")
self._mapNode.got_fullscreen:SetActive(false)
self:AddTimer(1, 0.3, "OnCloseAnimFinish", true, true, true)
end
function StoryClueCtrl:OnCloseAnimFinish()
self.gameObject:SetActive(false)
end
return StoryClueCtrl