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
This commit is contained in:
SL1900
2026-04-18 00:15:00 +09:00
parent 35fe1f046d
commit e0549005e1
1150 changed files with 941124 additions and 19847 deletions
@@ -0,0 +1,126 @@
local RankBuildDetailCtrl = class("RankBuildDetailCtrl", BaseCtrl)
RankBuildDetailCtrl._mapNodeConfig = {
TopBar = {
sNodeName = "TopBarPanel",
sCtrlName = "Game.UI.TopBarEx.TopBarCtrl"
},
TMPBuildSaveTime = {sComponentName = "TMP_Text"},
ani_root = {
sNodeName = "----SafeAreaRoot----",
sComponentName = "Animator"
},
BuildDetail = {
sCtrlName = "Game.UI.StarTower.Build.StarTowerBuildDetailItemCtrl"
},
ContentList = {
sCtrlName = "Game.UI.StarTower.Build.StarTowerBuildContentCtrl"
},
btnSave = {
sComponentName = "UIButton",
callback = "OnBtnClick_Save"
},
txtBtnSave = {
sComponentName = "TMP_Text",
sLanguageId = "Rank_Build_Save_Preselection"
}
}
RankBuildDetailCtrl._mapEventConfig = {}
function RankBuildDetailCtrl:InitPanel()
if self.mapBuild == nil then
return
end
local mapBuildData = {
sName = ConfigTable.GetUIText("Rank_Build_Detail_Name"),
tbChar = {},
nScore = self.mapBuild.BuildScore,
mapRank = PlayerData.Build:CalBuildRank(self.mapBuild.BuildScore),
bLock = false,
bPreference = false,
bDetail = false,
tbDisc = {},
tbSecondarySkill = {},
tbPotentials = {},
tbNotes = {},
bRankPreview = true
}
for i = 1, 3 do
local nCharId = self.mapBuild.Chars[i].Id
local nPotentialCount = 0
for _, v in ipairs(self.mapBuild.Potentials) do
local mapPotentialCfg = ConfigTable.GetData("Potential", v.PotentialId)
if mapPotentialCfg ~= nil and mapPotentialCfg.CharId == nCharId then
nPotentialCount = nPotentialCount + v.Level
end
end
table.insert(mapBuildData.tbChar, {
nTid = self.mapBuild.Chars[i].Id,
nPotentialCount = nPotentialCount
})
end
for _, v in ipairs(self.mapBuild.Potentials) do
local potentialCfg = ConfigTable.GetData("Potential", v.PotentialId)
if potentialCfg then
local nCharId = potentialCfg.CharId
if nil == mapBuildData.tbPotentials[nCharId] then
mapBuildData.tbPotentials[nCharId] = {}
end
table.insert(mapBuildData.tbPotentials[nCharId], {
nPotentialId = v.PotentialId,
nLevel = v.Level
})
end
end
local tbNotes = {}
for _, v in pairs(self.mapBuild.Notes) do
tbNotes[v.Tid] = v.Qty
end
mapBuildData.tbNotes = tbNotes
mapBuildData.tbDisc = self.mapBuild.Discs
mapBuildData.tbSecondarySkill = self.mapBuild.ActiveSecondaryIds
self._mapNode.BuildDetail:Refresh(mapBuildData)
self._mapNode.ContentList:Refresh(mapBuildData)
end
function RankBuildDetailCtrl:Awake()
local tbParam = self:GetPanelParam()
if type(tbParam) == "table" then
self.mapBuild = tbParam[1]
end
end
function RankBuildDetailCtrl:OnEnable()
self:InitPanel()
end
function RankBuildDetailCtrl:OnDisable()
end
function RankBuildDetailCtrl:OnDestroy()
end
function RankBuildDetailCtrl:OnRelease()
end
function RankBuildDetailCtrl:OnBtnClick_Save()
local tbAllPreselectionList = PlayerData.PotentialPreselection:GetPreselectionList()
local nAllCount = ConfigTable.GetConfigNumber("PotentialPreselectionMaxCount")
if nAllCount <= #tbAllPreselectionList then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Potential_Preselection_Build_Max"))
return
end
local tbCharPotential = {}
for k, v in ipairs(self.mapBuild.Chars) do
local nCharId = v.Id
local tbPotential = {}
for _, data in ipairs(self.mapBuild.Potentials) do
local mapPotentialCfg = ConfigTable.GetData("Potential", data.PotentialId)
if mapPotentialCfg ~= nil and mapPotentialCfg.CharId == nCharId then
table.insert(tbPotential, {
Id = data.PotentialId,
Level = data.Level
})
end
end
table.insert(tbCharPotential, {CharId = nCharId, Potentials = tbPotential})
end
local sName = ConfigTable.GetUIText("Potential_Preselection_Name_Init")
local callback = function()
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Potential_Preselection_Save_Form_Rank"))
end
PlayerData.PotentialPreselection:SavePreselectionFromRank(sName, false, tbCharPotential, callback)
end
return RankBuildDetailCtrl
@@ -0,0 +1,18 @@
local RankBuildDetailPanel = class("RankBuildDetailPanel", BasePanel)
RankBuildDetailPanel._tbDefine = {
{
sPrefabPath = "StarTowerBuild/RankBuildDetailPanel.prefab",
sCtrlName = "Game.UI.StarTower.Build.RankBuildDetailCtrl"
}
}
function RankBuildDetailPanel:Awake()
end
function RankBuildDetailPanel:OnEnable()
end
function RankBuildDetailPanel:OnDisable()
end
function RankBuildDetailPanel:OnDestroy()
end
function RankBuildDetailPanel:OnRelease()
end
return RankBuildDetailPanel
@@ -20,6 +20,7 @@ StarTowerBuildBriefCtrl._mapNodeConfig = {
sComponentName = "UIButton",
callback = "OnBtnClick_OpenFilter"
},
imgFilterChoose = {},
btn_DeleteBuild = {
sComponentName = "UIButton",
callback = "OnBtnClick_SelectDelete"
@@ -134,7 +135,9 @@ StarTowerBuildBriefCtrl._mapNodeConfig = {
sComponentName = "Animator"
}
}
StarTowerBuildBriefCtrl._mapEventConfig = {}
StarTowerBuildBriefCtrl._mapEventConfig = {
[EventId.FilterConfirm] = "OnEvent_RefreshByFilter"
}
local SortType = {Time = 1, Score = 2}
local SortOrder = {Descending = true, Ascending = false}
local PanelState = {
@@ -153,6 +156,8 @@ local FilterGradeIdx = {
btn_FilterGradeC = 0
}
function StarTowerBuildBriefCtrl:RefreshList()
local isDirty = PlayerData.Filter:IsDirty(AllEnum.OptionType.Char)
self._mapNode.imgFilterChoose:SetActive(isDirty)
if #self._tbAllBuild == 0 then
self._mapNode.ExistContent:SetActive(false)
self._mapNode.EmptyContent:SetActive(true)
@@ -198,7 +203,11 @@ function StarTowerBuildBriefCtrl:FilterAndSortBuildData()
if self.FilterPass ~= self.FilterUnpass and (not (not self.FilterPass or mapBuild.bPass) or self.FilterUnpass and mapBuild.bPass) then
return
end
table.insert(ret, mapBuild)
local nCharId = mapBuild.tbChar[1].nTid
local isFilter = PlayerData.Filter:CheckFilterByChar(nCharId)
if isFilter then
table.insert(ret, mapBuild)
end
end
for _, mapBuild in ipairs(self._tbAllBuild) do
filterBuild(mapBuild)
@@ -473,6 +482,10 @@ function StarTowerBuildBriefCtrl:Awake()
self.nSortype = SortType.Score
self.nSortOrder = SortOrder.Descending
self.nPanelState = PanelState.Normal
self.mapCacheFilter = {}
self.tbOption = {
AllEnum.ChooseOption.Char_Element
}
self:InitSort()
self.mapListItemCtrl = {}
self.tbCoinRate = ConfigTable.GetConfigArray("StarTowerBuildTransformParas")
@@ -485,6 +498,14 @@ function StarTowerBuildBriefCtrl:Awake()
self._mapNode.DD_selectDelect:SetList(tbLanguageId, 3)
end
function StarTowerBuildBriefCtrl:OnEnable()
if next(self.mapCacheFilter) ~= nil then
for fKey, data in pairs(self.mapCacheFilter) do
for sKey, value in pairs(data) do
PlayerData.Filter:SetCacheFilterByKey(fKey, sKey, value)
end
end
PlayerData.Filter:SyncFilterByCache()
end
local GetDataCallback = function(tbBuildData, mapAllBuild)
self._mapAllBuild = mapAllBuild
self._tbAllBuild = tbBuildData
@@ -502,6 +523,19 @@ function StarTowerBuildBriefCtrl:OnDisable()
self.mapListItemCtrl[nInstanceId] = nil
end
self.mapListItemCtrl = {}
self.mapCacheFilter = {}
for _, fKey in ipairs(self.tbOption) do
if self.mapCacheFilter[fKey] == nil then
self.mapCacheFilter[fKey] = {}
end
local data = PlayerData.Filter:GetCacheFilter(fKey)
if data ~= nil then
for sKey, value in pairs(data) do
self.mapCacheFilter[fKey][sKey] = value
end
end
end
PlayerData.Filter:Reset(self.tbOption)
end
function StarTowerBuildBriefCtrl:OnDestroy()
end
@@ -642,6 +676,7 @@ function StarTowerBuildBriefCtrl:OnBtnClick_OpenDeleteHint(btn)
self:OpenConfirmHint()
end
function StarTowerBuildBriefCtrl:OnBtnClick_OpenFilter(btn)
EventManager.Hit(EventId.OpenPanel, PanelId.FilterPopupPanel, self.tbOption)
end
function StarTowerBuildBriefCtrl:OnBtnClick_Result1(btn)
local mapData = {
@@ -651,4 +686,29 @@ function StarTowerBuildBriefCtrl:OnBtnClick_Result1(btn)
}
EventManager.Hit(EventId.OpenPanel, PanelId.ItemTips, btn.transform, mapData)
end
function StarTowerBuildBriefCtrl:OnEvent_RefreshByFilter()
local bChange = false
local tbTemp = clone(self.mapCacheFilter)
self.mapCacheFilter = {}
for _, fKey in ipairs(self.tbOption) do
if self.mapCacheFilter[fKey] == nil then
self.mapCacheFilter[fKey] = {}
end
local data = PlayerData.Filter:GetCacheFilter(fKey)
if data ~= nil then
if tbTemp[fKey] == nil then
bChange = true
end
for sKey, value in pairs(data) do
if not bChange and (tbTemp[fKey][sKey] == nil or tbTemp[fKey][sKey] ~= value) then
bChange = true
end
self.mapCacheFilter[fKey][sKey] = value
end
end
end
if bChange then
self:RefreshList()
end
end
return StarTowerBuildBriefCtrl
@@ -127,14 +127,16 @@ function StarTowerBuildContentCtrl:InitPotential()
self._mapNode.goPotentialList.gameObject:SetActive(not bEmpty)
end
function StarTowerBuildContentCtrl:InitDisc()
local mapTowerCfg = ConfigTable.GetData("StarTower", self.mapBuild.nTowerId)
local tbNote = {}
if mapTowerCfg ~= nil then
local nDropGroup = mapTowerCfg.SubNoteSkillDropGroupId
local tbNoteDrop = CacheTable.GetData("_SubNoteSkillDropGroup", nDropGroup)
if tbNoteDrop ~= nil then
for _, v in ipairs(tbNoteDrop) do
table.insert(tbNote, v.SubNoteSkillId)
if self.mapBuild.nTowerId ~= nil then
local mapTowerCfg = ConfigTable.GetData("StarTower", self.mapBuild.nTowerId)
if mapTowerCfg ~= nil then
local nDropGroup = mapTowerCfg.SubNoteSkillDropGroupId
local tbNoteDrop = CacheTable.GetData("_SubNoteSkillDropGroup", nDropGroup)
if tbNoteDrop ~= nil then
for _, v in ipairs(tbNoteDrop) do
table.insert(tbNote, v.SubNoteSkillId)
end
end
end
end
@@ -170,6 +172,9 @@ function StarTowerBuildContentCtrl:InitDisc()
if mapDisc == nil then
mapDisc = PlayerData.Disc:GetTrialDiscById(nId)
end
if mapDisc == nil then
mapDisc = PlayerData.Disc:GetRankDetailDisc(nId)
end
if mapDisc ~= nil then
local tbSubSkill = mapDisc:GetAllSubSkill(self.mapBuild.tbNotes)
for nSkillIndex, v in ipairs(tbSubSkill) do
@@ -90,14 +90,19 @@ end
function StarTowerBuildDetailItemCtrl:RefreshChar()
for i = 1, 3 do
local nCharTid = self.mapBuild.tbChar[i].nTid
local nCharSkinId = PlayerData.Char:GetCharSkinId(nCharTid)
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
local mapCharCfg = ConfigTable.GetData_Character(nCharTid)
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapCharCfg.Grade]
self:SetPngSprite(self._mapNode.imgCharIcon[i], mapCharSkin.Icon, AllEnum.CharHeadIconSurfix.XXL)
self:SetAtlasSprite(self._mapNode.imgCharFrame[i], "12_rare", sFrame, true)
NovaAPI.SetTMPText(self._mapNode.txtPotentialCount[i], self.mapBuild.tbChar[i].nPotentialCount)
self:SetAtlasSprite(self._mapNode.imgCharElement[i], "12_rare", AllEnum.Char_Element[mapCharCfg.EET].icon)
if mapCharCfg ~= nil then
local nCharSkinId = PlayerData.Char:GetCharSkinId(nCharTid)
if self.mapBuild.bRankPreview then
nCharSkinId = mapCharCfg.DefaultSkinId
end
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapCharCfg.Grade]
self:SetPngSprite(self._mapNode.imgCharIcon[i], mapCharSkin.Icon, AllEnum.CharHeadIconSurfix.XXL)
self:SetAtlasSprite(self._mapNode.imgCharFrame[i], "12_rare", sFrame, true)
NovaAPI.SetTMPText(self._mapNode.txtPotentialCount[i], self.mapBuild.tbChar[i].nPotentialCount)
self:SetAtlasSprite(self._mapNode.imgCharElement[i], "12_rare", AllEnum.Char_Element[mapCharCfg.EET].icon)
end
end
end
function StarTowerBuildDetailItemCtrl:RefreshDisc()
@@ -108,7 +113,7 @@ function StarTowerBuildDetailItemCtrl:RefreshDisc()
end
nIndex = nIndex + 1
end
self._mapNode.btnDiscDetail.gameObject:SetActive(self.mapBuild.bTrial ~= true)
self._mapNode.btnDiscDetail.gameObject:SetActive(self.mapBuild.bTrial ~= true and not self.mapBuild.bRankPreview)
end
function StarTowerBuildDetailItemCtrl:SetName(sName)
NovaAPI.SetTMPText(self._mapNode.txtBuildName, sName)
@@ -131,66 +136,72 @@ function StarTowerBuildDetailItemCtrl:OnBtnClick_Attr()
EventManager.Hit(EventId.OpenPanel, PanelId.BuildAttrPreview, self.mapBuild.mapRank.Id, self.mapBuild.nScore)
end
function StarTowerBuildDetailItemCtrl:OnBtnClick_Disc(btn, nIndex)
if self.mapBuild.bTrial == true then
local nDiscId = self.mapBuild.tbDisc[nIndex]
local nDiscId = self.mapBuild.tbDisc[nIndex]
if self.mapBuild.bRankPreview == true then
EventManager.Hit(EventId.OpenPanel, PanelId.DiscSample, nDiscId)
elseif self.mapBuild.bTrial == true then
local mapDiscData = PlayerData.Disc:GetDiscById(nDiscId)
if mapDiscData == nil then
EventManager.Hit(EventId.OpenPanel, PanelId.DiscSample, nDiscId)
else
EventManager.Hit(EventId.OpenPanel, PanelId.Disc, nDiscId, {nDiscId})
end
return
end
local nIdx = 0
local nDiscId = 0
local tbAllDisc = {}
for _, nId in ipairs(self.mapBuild.tbDisc) do
nIdx = nIdx + 1
if nIdx == nIndex then
nDiscId = nId
else
local nIdx = 0
local nDiscId = 0
local tbAllDisc = {}
for _, nId in ipairs(self.mapBuild.tbDisc) do
nIdx = nIdx + 1
if nIdx == nIndex then
nDiscId = nId
end
table.insert(tbAllDisc, nId)
end
table.insert(tbAllDisc, nId)
end
if nDiscId ~= 0 then
local mapDisc = PlayerData.Disc:GetDiscById(nDiscId)
if mapDisc ~= nil then
EventManager.Hit(EventId.OpenPanel, PanelId.Disc, nDiscId, tbAllDisc)
if nDiscId ~= 0 then
local mapDisc = PlayerData.Disc:GetDiscById(nDiscId)
if mapDisc ~= nil then
EventManager.Hit(EventId.OpenPanel, PanelId.Disc, nDiscId, tbAllDisc)
end
end
end
end
function StarTowerBuildDetailItemCtrl:OnBtnClick_Leader()
if self.mapBuild.bTrial == true then
local nCharTid = self.mapBuild.tbChar[1].nTid
local nCharTid = self.mapBuild.tbChar[1].nTid
if self.mapBuild.bRankPreview == true then
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgTrialPanel, PanelId.CharInfoTrial, nCharTid)
elseif self.mapBuild.bTrial == true then
local mapCharCfg = PlayerData.Char:GetCharDataByTid(nCharTid)
if mapCharCfg == nil then
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgTrialPanel, PanelId.CharInfoTrial, nCharTid)
else
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgPanel, PanelId.CharInfo, nCharTid, {nCharTid})
end
return
else
local tbCharId = {}
for _, v in ipairs(self.mapBuild.tbChar) do
table.insert(tbCharId, v.nTid)
end
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgPanel, PanelId.CharInfo, tbCharId[1], tbCharId, true)
end
local tbCharId = {}
for _, v in ipairs(self.mapBuild.tbChar) do
table.insert(tbCharId, v.nTid)
end
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgPanel, PanelId.CharInfo, tbCharId[1], tbCharId, true)
end
function StarTowerBuildDetailItemCtrl:OnBtnClick_Sub(btn, nIndex)
if self.mapBuild.bTrial == true then
local nCharTid = self.mapBuild.tbChar[nIndex + 1].nTid
local nCharTid = self.mapBuild.tbChar[nIndex + 1].nTid
if self.mapBuild.bRankPreview == true then
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgTrialPanel, PanelId.CharInfoTrial, nCharTid)
elseif self.mapBuild.bTrial == true then
local mapCharCfg = PlayerData.Char:GetCharDataByTid(nCharTid)
if mapCharCfg == nil then
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgTrialPanel, PanelId.CharInfoTrial, nCharTid)
else
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgPanel, PanelId.CharInfo, nCharTid, {nCharTid})
end
return
else
local tbCharId = {}
for _, v in ipairs(self.mapBuild.tbChar) do
table.insert(tbCharId, v.nTid)
end
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgPanel, PanelId.CharInfo, tbCharId[nIndex + 1], tbCharId, true)
end
local tbCharId = {}
for _, v in ipairs(self.mapBuild.tbChar) do
table.insert(tbCharId, v.nTid)
end
EventManager.Hit(EventId.OpenPanel, PanelId.CharBgPanel, PanelId.CharInfo, tbCharId[nIndex + 1], tbCharId, true)
end
function StarTowerBuildDetailItemCtrl:OnBtnClick_DiscDetail(btn, nIndex)
if self.mapBuild.bTrial == true then
@@ -207,6 +218,9 @@ function StarTowerBuildDetailItemCtrl:OnBtnClick_DiscDetail(btn, nIndex)
if mapDisc == nil then
mapDisc = PlayerData.Disc:GetTrialDiscById(tbDisc[i])
end
if mapDisc == nil then
mapDisc = PlayerData.Disc:GetRankDetailDisc(tbDisc[i])
end
mapDiscData[tbDisc[i]] = mapDisc
end
end
@@ -1,6 +1,7 @@
local DepotCharInfoCtrl = class("DepotCharInfoCtrl", BaseCtrl)
local AdventureModuleHelper = CS.AdventureModuleHelper
local CharacterAttrData = require("GameCore.Data.DataClass.CharacterAttrData")
local GameResourceLoader = require("Game.Common.Resource.GameResourceLoader")
DepotCharInfoCtrl._mapNodeConfig = {
goProperty = {
nCount = 5,
@@ -48,7 +49,7 @@ DepotCharInfoCtrl._mapNodeConfig = {
sComponentName = "UIButton",
callback = "OnBtnClick_Equipment"
},
imgEquipment = {nCount = 3, sComponentName = "Image"},
imgEquipment = {nCount = 3, sComponentName = "Transform"},
goEquipment = {nCount = 3},
txtEquipmentLock = {nCount = 3, sComponentName = "TMP_Text"}
}
@@ -213,7 +214,16 @@ function DepotCharInfoCtrl:RefreshEquipment(mapChar)
NovaAPI.SetTMPText(self._mapNode.txtEquipmentLock[i], ConfigTable.GetUIText("CharEquipment_UnEquip"))
end
else
self:SetPngSprite(self._mapNode.imgEquipment[i], mapEquipment.sIcon)
delChildren(self._mapNode.imgEquipment[i])
local equipPrefab
local sPrefab = mapEquipment.sIcon .. ".prefab"
if GameResourceLoader.ExistsAsset(Settings.AB_ROOT_PATH .. sPrefab) == true then
equipPrefab = self:LoadAsset(sPrefab)
end
if equipPrefab then
local goEquip = instantiate(equipPrefab, self._mapNode.imgEquipment[i])
goEquip.transform:Find("goFx").gameObject:SetActive(mapEquipment:GetUpgradeCount() > 0)
end
end
end
end
@@ -75,6 +75,12 @@ function DepotPotentialItemCtrl:SetSpecialPotential(itemCfg, potentialCfg)
NovaAPI.SetTMPText(self._mapNode.txtSpName, itemCfg.Title)
self:SetPngSprite(self._mapNode.imgSpIcon, itemCfg.Icon .. AllEnum.PotentialIconSurfix.A)
end
function DepotPotentialItemCtrl:RefreshPreselectionLevel(nLevel)
self.nLevel = nLevel
self._mapNode.imgLock.gameObject:SetActive(nLevel <= 0)
self._mapNode.imgMask.gameObject:SetActive(nLevel <= 0)
NovaAPI.SetTMPText(self._mapNode.txtLevelValue, self.nLevel)
end
function DepotPotentialItemCtrl:OnBtnClick_Item()
EventManager.Hit("SelectDepotPotential", self.nPotentialId, self.nLevel, self.nPotentialAdd, self._mapNode.btnItem)
end
@@ -43,11 +43,13 @@ PotentialCardItemCtrl._mapNodeConfig = {
},
animCtrl = {sComponentName = "Animator", sNodeName = "AnimRoot"},
imgReommend = {},
imgNew = {},
goNew = {},
txtNew = {
sComponentName = "TMP_Text",
sLanguageId = "StarTower_Book_New_Text"
},
imgPreselection = {},
txtPreselection = {sComponentName = "TMP_Text"},
N = {},
SR = {},
SSR = {},
@@ -68,7 +70,7 @@ function PotentialCardItemCtrl:SetPotentialItem(nTid, nLevel, nNextLevel, bSimpl
self.nShowType = nShowType or AllEnum.PotentialCardType.CharInfo
self.nPotentialAddLevel = nPotentialAddLevel or 0
self.bLucky = bLucky
self._mapNode.imgNew.gameObject:SetActive(bNew)
self._mapNode.goNew.gameObject:SetActive(bNew)
self._mapNode.ArrowEffect:SetActive(self.bLucky)
local itemCfg = ConfigTable.GetData_Item(nTid)
if nil == itemCfg then
@@ -91,6 +93,7 @@ function PotentialCardItemCtrl:SetPotentialItem(nTid, nLevel, nNextLevel, bSimpl
else
self:SetSpecialCard(itemCfg, potentialCfg, bShowChar)
end
self.bSpecial = bSpecial
self:ChangeDesc(bSimpleDesc)
self:ChangeWordRaycast(false)
return bSpecial
@@ -219,7 +222,19 @@ function PotentialCardItemCtrl:ChangeWordRaycast(bEnable)
NovaAPI.SetTMPRaycastTarget(self._mapNode.txtDesc, bEnable)
NovaAPI.SetTMPRaycastTarget(self._mapNode.txtSpDesc, bEnable)
end
function PotentialCardItemCtrl:SetRecommend(bEnable)
self._mapNode.imgReommend:SetActive(bEnable)
function PotentialCardItemCtrl:SetRecommend(bEnable, nLevel)
self._mapNode.imgReommend:SetActive(bEnable and nLevel == nil)
local bShow = bEnable and nLevel ~= nil
if self.nNextLevel ~= self.nLevel or not true then
bShow = bShow and bShow
end
self._mapNode.imgPreselection:SetActive(bShow)
if nLevel ~= nil then
if self.bSpecial then
NovaAPI.SetTMPText(self._mapNode.txtPreselection, ConfigTable.GetUIText("Potential_Preselection_Recommend"))
else
NovaAPI.SetTMPText(self._mapNode.txtPreselection, orderedFormat(ConfigTable.GetUIText("Potential_Preselection_Recommend_Level"), nLevel))
end
end
end
return PotentialCardItemCtrl
@@ -204,11 +204,15 @@ end
function PotentialSelectCtrl:RefreshPotentialList(tbPotential, mapPotential, tbNewIds, tbLuckyIds, bAfterRoll, tbRecommendParam)
local tbRecommend = {}
if 0 < #tbRecommendParam then
table.insert(tbRecommend, tbRecommendParam[1])
if tbRecommendParam[1].nLevel == nil then
table.insert(tbRecommend, tbRecommendParam[1])
else
tbRecommend = clone(tbRecommendParam)
end
end
self.bSpecialPotential = false
self.tbPotential = {}
self.nRecommendIdx = 1
self.nRecommendIdx = 0
for _, v in ipairs(tbPotential) do
local bNew, bLucky = false, false
local nCurLevel = mapPotential[v.Id]
@@ -258,9 +262,16 @@ function PotentialSelectCtrl:RefreshPotentialList(tbPotential, mapPotential, tbN
local nPotentialAddLv = self._panel.mapPotentialAddLevel[nCharId][nTid] or 0
local data = self.tbPotential[k]
local bSpecial = v:SetPotentialItem(nTid, data.nLevel, data.nNextLevel, self.bSimple, true, nPotentialAddLv, AllEnum.PotentialCardType.StarTower, data.bNew, data.bLucky)
local bRec = 0 < table.indexof(tbRecommend, nTid)
v:SetRecommend(bRec)
if bRec then
local bRec = false
v:SetRecommend(false)
for _, data in ipairs(tbRecommend) do
if data.nId == nTid then
bRec = true
v:SetRecommend(true, data.nLevel)
break
end
end
if bRec and self.nRecommendIdx == 0 then
self.nRecommendIdx = k
end
v:ChangeWordRaycast(false)
@@ -270,6 +281,7 @@ function PotentialSelectCtrl:RefreshPotentialList(tbPotential, mapPotential, tbN
end
end
end
self.nRecommendIdx = math.max(self.nRecommendIdx, 1)
self:ResetSelect(tbBtnObj)
local nCardAnimTime = NovaAPI.GetAnimClipLength(self._mapNode.potentialCard[1].animCtrl, {
"tc_newperk_card_in"
@@ -651,8 +663,7 @@ function PotentialSelectCtrl:OnEvent_SetCoin(nCount)
end
function PotentialSelectCtrl:ResetSelect(tbUI)
self.nSelectIdx = 0
local nRecommendedIdx = 0
self.bRecommended = nRecommendedIdx ~= 0
self.bRecommended = self.nRecommendIdx ~= 0
GamepadUIManager.SetNavigation(tbUI)
local nCardAnimTime = NovaAPI.GetAnimClipLength(self._mapNode.potentialCard[1].animCtrl, {
"tc_newperk_card_in"
@@ -664,7 +675,7 @@ function PotentialSelectCtrl:ResetSelect(tbUI)
nAnimTime = nAnimTime + 0.4
self:AddTimer(1, nAnimTime, function()
if self.nSelectIdx == 0 then
local nSelect = nRecommendedIdx == 0 and 1 or nRecommendedIdx
local nSelect = self.nRecommendIdx == 0 and 1 or self.nRecommendIdx
GamepadUIManager.ClearSelectedUI()
GamepadUIManager.SetSelectedUI(self._mapNode.btnPotential[nSelect].gameObject)
if GamepadUIManager.GetCurUIType() == AllEnum.GamepadUIType.Mouse then
@@ -146,7 +146,7 @@ function StarTowerResultCtrl:Refresh(teamMemberid, mapResult)
if self.bSweep then
self._mapNode.imgSweepResultTitle.gameObject:SetActive(self.bSuccess)
if self.bSuccess then
self:SetAtlasSprite(self._mapNode.imgSweepResult, "05_language", "zs_battle_result_2")
self:SetAtlasSprite(self._mapNode.imgSweepResult, "05_language", "zs_result_win_2")
self._mapNode.UIParticle_Sweep:SetActive(true)
WwiseAudioMgr:SetState("system", "victory2")
else