Update - 1.12.0.120
EN: 1.12.0.120 CN: 1.12.0.120 JP: 1.12.0.124 KR: 1.12.0.124
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
local StarTowerEventBookCtrl = class("StarTowerEventBookCtrl", BaseCtrl)
|
||||
local sRootPath = Settings.AB_ROOT_PATH
|
||||
local GameResourceLoader = require("Game.Common.Resource.GameResourceLoader")
|
||||
local ResType = GameResourceLoader.ResType
|
||||
local typeof = typeof
|
||||
local Path = require("path")
|
||||
local ResTypeAny = GameResourceLoader.ResType.Any
|
||||
local Offset = CS.Actor2DOffsetData
|
||||
local Actor2DManager = require("Game.Actor2D.Actor2DManager")
|
||||
StarTowerEventBookCtrl._mapNodeConfig = {
|
||||
@@ -68,9 +65,6 @@ function StarTowerEventBookCtrl:Init()
|
||||
self.nSelectEventId = 0
|
||||
self:RefreshEventList()
|
||||
self:RefreshSelectEvent()
|
||||
self:AddTimer(1, 0.1, function()
|
||||
local nWidth = self._mapNode.rtTxtAreaCn2.sizeDelta.x
|
||||
end, true, true, true)
|
||||
end
|
||||
function StarTowerEventBookCtrl:Back()
|
||||
self:UnRegisterRedDot()
|
||||
@@ -78,9 +72,9 @@ function StarTowerEventBookCtrl:Back()
|
||||
end
|
||||
function StarTowerEventBookCtrl:RefreshSelectEvent()
|
||||
local eventData = self.mapEventBook[self.nSelectIndex]
|
||||
self._mapNode.goEventLock.gameObject:SetActive(eventData.Status == AllEnum.BookQuestStatus.UnComplete)
|
||||
self._mapNode.goEventUnlock.gameObject:SetActive(eventData.Status ~= AllEnum.BookQuestStatus.UnComplete)
|
||||
if eventData ~= nil then
|
||||
self._mapNode.goEventLock.gameObject:SetActive(eventData.Status == AllEnum.BookQuestStatus.UnComplete)
|
||||
self._mapNode.goEventUnlock.gameObject:SetActive(eventData.Status ~= AllEnum.BookQuestStatus.UnComplete)
|
||||
NovaAPI.SetVerticalNormalizedPosition(self._mapNode.eventDescSv, 1)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtEventName, eventData.CfgData.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtEventDesc, eventData.CfgData.Story)
|
||||
@@ -163,7 +157,7 @@ function StarTowerEventBookCtrl:GetCharPortrait(imgBody, imgFace, nCharId, nType
|
||||
mapSkinData = ConfigTable.GetData("NPCSkin", nSkinId)
|
||||
end
|
||||
if mapSkinData == nil then
|
||||
return
|
||||
return Vector3.zero, Vector3.one
|
||||
end
|
||||
local sAssetPath = mapSkinData.Portrait
|
||||
local sFace = "002"
|
||||
@@ -214,10 +208,6 @@ function StarTowerEventBookCtrl:RefreshEventList()
|
||||
self._mapNode.btnReceiveAllEvent.gameObject:SetActive(bShowAllReceive)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtCollect, string.format("%s/%s", nCount, nAllCount))
|
||||
end
|
||||
function StarTowerEventBookCtrl:GetCharBgPath(nSkinId, sFace)
|
||||
local sPortrait = string.format("Actor2D/Character/%s/atlas_png/a/%s_%s.png", nSkinId, nSkinId, "001")
|
||||
local sFace = string.format("Actor2D/Character/%s/atlas_png/a/%s_%s.png", nSkinId, nSkinId, "002")
|
||||
end
|
||||
function StarTowerEventBookCtrl:OnRefreshGrid(goGrid, gridIndex)
|
||||
local nInstanceID = goGrid:GetInstanceID()
|
||||
if nil == self.mapGrids[nInstanceID] then
|
||||
|
||||
@@ -51,8 +51,6 @@ function FateCardBookItemCtrl:RegisterRedDot()
|
||||
RedDotManager.RegisterNode(RedDotDefine.StarTowerBook_FateCard_New, self.nId, self._mapNode.redDotCard)
|
||||
end
|
||||
end
|
||||
function FateCardBookItemCtrl:UnRegisterRedDot()
|
||||
end
|
||||
function FateCardBookItemCtrl:PlayClickAnim(bClick)
|
||||
if bClick then
|
||||
self._mapNode.animCard:Play("CardBookItem_in")
|
||||
|
||||
@@ -425,27 +425,16 @@ function StarTowerFateCardBookCtrl:OnBtnClick_CardItem(btn, nIdx)
|
||||
else
|
||||
local animFinishFunc = function()
|
||||
RedDotManager.SetValid(RedDotDefine.StarTowerBook_FateCard_New, cardData.nId, false)
|
||||
if cardData.nStatus == AllEnum.FateCardBookStatus.Lock then
|
||||
NovaAPI.SetTMPText(self._mapNode.txtUnlockTip, cardCfg.UnlockTip)
|
||||
self._mapNode.goCardTip.gameObject:SetActive(false)
|
||||
self._mapNode.goBlur.gameObject:SetActive(true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.goCardTip.gameObject:SetActive(true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
else
|
||||
self._mapNode.goCardDetail.gameObject:SetActive(false)
|
||||
self._mapNode.goBlur.gameObject:SetActive(true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.goCardDetail.gameObject:SetActive(true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.5)
|
||||
self:OnBtnClick_CardTypeSurvivor()
|
||||
NovaAPI.SetTMPText(self._mapNode.txtArea, ConfigTable.GetUIText("StarTower_Event_Book_Source") .. cardCfg.Source)
|
||||
self._mapNode.goCardDetail.gameObject:SetActive(false)
|
||||
self._mapNode.goBlur.gameObject:SetActive(true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.goCardDetail.gameObject:SetActive(true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.5)
|
||||
self:OnBtnClick_CardTypeSurvivor()
|
||||
NovaAPI.SetTMPText(self._mapNode.txtArea, ConfigTable.GetUIText("StarTower_Event_Book_Source") .. cardCfg.Source)
|
||||
end
|
||||
self.nClickIndex = nIdx
|
||||
if self._mapNode.goCardItem[nIdx] ~= nil then
|
||||
|
||||
@@ -28,7 +28,6 @@ function PotentialBookCharItemCtrl:InitItem(nCharId)
|
||||
self._mapNode.imgNormal.gameObject:SetActive(nCharId ~= 0)
|
||||
self._mapNode.imgLockMask.gameObject:SetActive(nCharId ~= 0 and not bUnlock)
|
||||
self._mapNode.goUnlock.gameObject:SetActive(nCharId ~= 0 and bUnlock)
|
||||
self._mapNode.imgLockMask.gameObject:SetActive(not bUnlock)
|
||||
self._mapNode.imgChar.gameObject:SetActive(bUnlock)
|
||||
if nCharId ~= 0 then
|
||||
local mapCharCfg = ConfigTable.GetData_Character(nCharId)
|
||||
|
||||
@@ -301,6 +301,10 @@ function StarTowerPotentialBookCtrl:InitPotentialList()
|
||||
self._mapNode.btnReceiveAllPotential.gameObject:SetActive(false)
|
||||
local mapCharCfg = ConfigTable.GetData_Character(self.nCharId)
|
||||
if mapCharCfg ~= nil then
|
||||
RedDotManager.RegisterNode(RedDotDefine.StarTowerBook_Potential_Reward, {
|
||||
mapCharCfg.EET,
|
||||
self.nCharId
|
||||
}, self._mapNode.redDotReward)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtCharName, mapCharCfg.Name)
|
||||
local nSkinId = mapCharCfg.DefaultSkinId
|
||||
local mapSkin = ConfigTable.GetData_CharacterSkin(nSkinId)
|
||||
@@ -320,13 +324,6 @@ function StarTowerPotentialBookCtrl:InitPotentialList()
|
||||
})
|
||||
self._mapNode.btnReward.gameObject:SetActive(not bCanReceive)
|
||||
self._mapNode.btnReceiveReward.gameObject:SetActive(bCanReceive)
|
||||
local mapCharCfg = ConfigTable.GetData_Character(self.nCharId)
|
||||
if mapCharCfg ~= nil then
|
||||
RedDotManager.RegisterNode(RedDotDefine.StarTowerBook_Potential_Reward, {
|
||||
mapCharCfg.EET,
|
||||
self.nCharId
|
||||
}, self._mapNode.redDotReward)
|
||||
end
|
||||
end
|
||||
function StarTowerPotentialBookCtrl:SwitchPotentialType()
|
||||
self._mapNode.goAssist.gameObject:SetActive(self.bMasterPotential)
|
||||
@@ -406,13 +403,15 @@ function StarTowerPotentialBookCtrl:RefreshReceiveAllBtn()
|
||||
for _, v in ipairs(tbCharHave) do
|
||||
local nCharID = v.nId
|
||||
local mapCharCfg = ConfigTable.GetData_Character(nCharID)
|
||||
local bCanReceive = RedDotManager.GetValid(RedDotDefine.StarTowerBook_Potential_Reward, {
|
||||
mapCharCfg.EET,
|
||||
nCharID
|
||||
})
|
||||
if bCanReceive and not self.bPotentialList then
|
||||
self._mapNode.btnReceiveAllPotential.gameObject:SetActive(true)
|
||||
break
|
||||
if mapCharCfg ~= nil then
|
||||
local bCanReceive = RedDotManager.GetValid(RedDotDefine.StarTowerBook_Potential_Reward, {
|
||||
mapCharCfg.EET,
|
||||
nCharID
|
||||
})
|
||||
if bCanReceive and not self.bPotentialList then
|
||||
self._mapNode.btnReceiveAllPotential.gameObject:SetActive(true)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -47,7 +47,8 @@ function BookQuestItemCtrl:SetProgress(nProgress, nAllProgress, nStatus)
|
||||
self._mapNode.goComplete.gameObject:SetActive(nStatus == AllEnum.BookQuestStatus.Complete)
|
||||
self._mapNode.goReceived.gameObject:SetActive(nStatus == AllEnum.BookQuestStatus.Received)
|
||||
if nStatus == AllEnum.BookQuestStatus.UnComplete then
|
||||
self._mapNode.imgBar.sizeDelta = Vector2(nProgress / nAllProgress * self.nAllWidth, self._mapNode.imgBar.sizeDelta.y)
|
||||
local fRatio = 0 < nAllProgress and nProgress / nAllProgress or 0
|
||||
self._mapNode.imgBar.sizeDelta = Vector2(fRatio * self.nAllWidth, self._mapNode.imgBar.sizeDelta.y)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtProgress, string.format("%s/%s", nProgress, nAllProgress))
|
||||
else
|
||||
self._mapNode.imgBar.sizeDelta = Vector2(self.nAllWidth, self._mapNode.imgBar.sizeDelta.y)
|
||||
|
||||
@@ -45,7 +45,7 @@ function StarTowerBookCtrl:RefreshPanel()
|
||||
self._mapNode.EventRoot.gameObject:SetActive(self._panel.nPanelType == AllEnum.StarTowerBookPanelType.Event)
|
||||
self._mapNode.AffinityRoot.gameObject:SetActive(self._panel.nPanelType == AllEnum.StarTowerBookPanelType.Affinity)
|
||||
self._mapNode.goBg.gameObject:SetActive(true)
|
||||
if self.nLastPanelType ~= nil and self.nLastPanelType == AllEnum.StarTowerBookPanelType.Event or self.nLastPanelType == AllEnum.StarTowerBookPanelType.Affinity or self._panel.nPanelType == AllEnum.StarTowerBookPanelType.Event or self._panel.nPanelType == AllEnum.StarTowerBookPanelType.Affinity then
|
||||
if self.nLastPanelType ~= nil and (self.nLastPanelType == AllEnum.StarTowerBookPanelType.Event or self.nLastPanelType == AllEnum.StarTowerBookPanelType.Affinity) or self._panel.nPanelType == AllEnum.StarTowerBookPanelType.Event or self._panel.nPanelType == AllEnum.StarTowerBookPanelType.Affinity then
|
||||
self._mapNode.goBg.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
@@ -90,11 +90,9 @@ function StarTowerBookCtrl:OnDestroy()
|
||||
end
|
||||
function StarTowerBookCtrl:OnRelease()
|
||||
end
|
||||
function StarTowerBookCtrl:OnBtnClick_AAA()
|
||||
end
|
||||
function StarTowerBookCtrl:OnEvent_ChangeStarTowerBookPanel(nPanelType)
|
||||
self._panel.nPanelType = nPanelType
|
||||
self.nLastPanelType = self._panel.nPanelType
|
||||
self._panel.nPanelType = nPanelType
|
||||
if self._panel.nPanelType == AllEnum.StarTowerBookPanelType.Potential then
|
||||
self:RefreshPanel()
|
||||
self._mapNode.PotentialRoot:Init()
|
||||
|
||||
Reference in New Issue
Block a user