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
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
local InfinityTowerBattleMsgCtrl = class("InfinityTowerBattleMsgCtrl", BaseCtrl)
|
||||
local BarHeight = 40
|
||||
local BarWidth = 816
|
||||
InfinityTowerBattleMsgCtrl._mapNodeConfig = {
|
||||
TimeRoot = {},
|
||||
EscapeRoot = {},
|
||||
TMPChallengeTime = {sComponentName = "TMP_Text"},
|
||||
TMPTitle = {sComponentName = "TMP_Text"},
|
||||
TMPDesc = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Task_Target"
|
||||
},
|
||||
animatorTime = {
|
||||
sNodeName = "rtChallengeTime",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
canvasGroup = {
|
||||
sNodeName = "----SafeAreaRoot----",
|
||||
sComponentName = "CanvasGroup"
|
||||
},
|
||||
rtMonsterCount = {},
|
||||
imgMonsterCountFill = {
|
||||
sComponentName = "HpBarRectTransform"
|
||||
},
|
||||
texMonsterRemaining = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_MonsterRemaining"
|
||||
},
|
||||
imgMonsterCountRecoverLight = {}
|
||||
}
|
||||
InfinityTowerBattleMsgCtrl._mapEventConfig = {
|
||||
Infinity_Tower_RunTime = "OnEvent_RunTime",
|
||||
Infinity_Tower_StartTime = "OnEvent_StartTime",
|
||||
Infinity_Hide_Time = "OnEvent_HideTime",
|
||||
Infinity_Refresh_Msg = "OnEvent_RefreshMsg",
|
||||
InputEnable = "OnEvent_InputEnable",
|
||||
Infinity_RefreshCountRemaining = "OnEvent_RefreshMonsterCountFill",
|
||||
InteractiveBtnClick = "OnEvent_InteractiveBtnClick"
|
||||
}
|
||||
function InfinityTowerBattleMsgCtrl:Awake()
|
||||
self.str_1 = "<color=#ffffff>%s:%s</color>"
|
||||
self.str_2 = "<color=#D85054>%s:%s</color>"
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:FadeIn()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:FadeOut()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEnable()
|
||||
self._mapNode.TimeRoot:SetActive(false)
|
||||
self._mapNode.rtMonsterCount:SetActive(false)
|
||||
self._mapNode.EscapeRoot:SetActive(true)
|
||||
self:InitMsg()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnDisable()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnDestroy()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnRelease()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:InitMsg()
|
||||
local lvId = PlayerData.InfinityTower:GetCurrentLv()
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", lvId)
|
||||
local diffData = ConfigTable.GetData("InfinityTowerDifficulty", lvData.DifficultyId)
|
||||
local towerId = diffData.TowerId
|
||||
local diffSort = diffData.Sort
|
||||
local data = PlayerData.InfinityTower:GetTowerDiffData(towerId, diffSort)
|
||||
local dataLv = data.level
|
||||
local firstFloor = data.firstFloor
|
||||
local endFloor = data.endFloor
|
||||
local indexlvCount = 0
|
||||
for i = firstFloor, endFloor do
|
||||
local tmpData = dataLv[i]
|
||||
indexlvCount = indexlvCount + 1
|
||||
if tmpData.Id == lvId then
|
||||
break
|
||||
end
|
||||
end
|
||||
local strIndex = indexlvCount
|
||||
if indexlvCount < 10 then
|
||||
strIndex = "0" .. indexlvCount
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPTitle, string.format(ConfigTable.GetUIText("Infinity_Diff_Lv"), diffSort, strIndex))
|
||||
self:InitMonsterCountFill()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEvent_StartTime()
|
||||
self._mapNode.TimeRoot:SetActive(true)
|
||||
local lvId = PlayerData.InfinityTower:GetCurrentLv()
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", lvId)
|
||||
local floorId = lvData.FloorId
|
||||
local floorData = ConfigTable.GetData("InfinityTowerFloor", floorId)
|
||||
self.totalTime = floorData.LimitTime
|
||||
self:OnEvent_RunTime(0)
|
||||
self._mapNode.rtMonsterCount:SetActive(floorData.FloorFunc == GameEnum.fixedRoguelikeFunc0.Battle)
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEvent_RunTime(rTime)
|
||||
local remainingT = self.totalTime - rTime
|
||||
local min = math.floor(remainingT / 60)
|
||||
local sec = remainingT - min * 60
|
||||
local strMin = tostring(min)
|
||||
if min < 10 then
|
||||
strMin = "0" .. strMin
|
||||
end
|
||||
local strSec = tostring(sec)
|
||||
if sec < 10 then
|
||||
strSec = "0" .. strSec
|
||||
end
|
||||
if 10 < remainingT then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPChallengeTime, string.format(self.str_1, strMin, strSec))
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPChallengeTime, string.format(self.str_2, strMin, strSec))
|
||||
self._mapNode.animatorTime:Play("BossChallengeTime_show")
|
||||
end
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEvent_HideTime()
|
||||
self._mapNode.TimeRoot:SetActive(false)
|
||||
self._mapNode.rtMonsterCount:SetActive(false)
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEvent_RefreshMsg()
|
||||
self:InitMsg()
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEvent_InputEnable(bEnable)
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.canvasGroup, bEnable == true and 1 or 0)
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:InitMonsterCountFill()
|
||||
self._mapNode.imgMonsterCountFill:SetTarget(Vector2(BarWidth, BarHeight), 0)
|
||||
self._mapNode.imgMonsterCountRecoverLight:SetActive(false)
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEvent_RefreshMonsterCountFill(count, maxCount)
|
||||
self._mapNode.imgMonsterCountRecoverLight:SetActive(true)
|
||||
local nWidth = 1 <= count / maxCount and BarWidth or count / maxCount * BarWidth
|
||||
self._mapNode.imgMonsterCountFill:SetTarget(Vector2(nWidth, BarHeight), 0)
|
||||
end
|
||||
function InfinityTowerBattleMsgCtrl:OnEvent_InteractiveBtnClick()
|
||||
PlayerData.InfinityTower:OnEvent_PlayTwinEffect()
|
||||
end
|
||||
return InfinityTowerBattleMsgCtrl
|
||||
@@ -0,0 +1,644 @@
|
||||
local InfinityTowerBattleResultCtrl = class("InfinityTowerBattleResultCtrl", BaseCtrl)
|
||||
local AdventureModuleHelper = CS.AdventureModuleHelper
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
local LocalData = require("GameCore.Data.LocalData")
|
||||
local WwiseAudioMgr = CS.WwiseAudioManager.Instance
|
||||
local newDayTime = UTILS.GetDayRefreshTimeOffset()
|
||||
InfinityTowerBattleResultCtrl._mapNodeConfig = {
|
||||
imgBlurredBg = {},
|
||||
safeAreaRoot = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
animRoot = {
|
||||
sNodeName = "----SafeAreaRoot----",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
bgComplete = {},
|
||||
goComplete = {},
|
||||
texLvCountTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Battle_LvCount"
|
||||
},
|
||||
texLvCount = {sComponentName = "TMP_Text"},
|
||||
texTimeCountTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Battle_Time"
|
||||
},
|
||||
texTimeCount = {sComponentName = "TMP_Text"},
|
||||
btn_Complete_Quit = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Quite"
|
||||
},
|
||||
txtCompleteQuit = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Quit"
|
||||
},
|
||||
btn_NextLv = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_NextLv"
|
||||
},
|
||||
txtNextLv = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_NextLv"
|
||||
},
|
||||
btn_NextMsg = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_NextMsg"
|
||||
},
|
||||
tex_NextMsg = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Next_LvMsg"
|
||||
},
|
||||
auto_lv = {},
|
||||
auto_lvTime = {sComponentName = "TMP_Text"},
|
||||
bgFail = {},
|
||||
goFail = {},
|
||||
btn_Fail_Quit = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Quite"
|
||||
},
|
||||
txtFailQuit = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Quit"
|
||||
},
|
||||
btn_Again = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Again"
|
||||
},
|
||||
btnDamageResult = {
|
||||
nCount = 2,
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_DamageResult"
|
||||
},
|
||||
txtAgain = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Again"
|
||||
},
|
||||
txtTip = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Battle_Result_Fail_Tip"
|
||||
},
|
||||
txtTipShadow = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Battle_Result_Fail_Tip"
|
||||
},
|
||||
texTowerNameSuccess = {sComponentName = "TMP_Text"},
|
||||
texTowerNameFail = {sComponentName = "TMP_Text"},
|
||||
goNextMsg = {},
|
||||
anit_window = {
|
||||
sNodeName = "t_window_04",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
goNextMsg_blur = {},
|
||||
t_window_04 = {},
|
||||
MaskClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickCloseNextMsgRoot"
|
||||
},
|
||||
btnCloseBV = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickCloseNextMsgRoot"
|
||||
},
|
||||
txt_goNextMsgTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Next_LvMsg"
|
||||
},
|
||||
tex_goNextMsg_lvIndex = {sComponentName = "TMP_Text"},
|
||||
tex_goNextMsg_lvName = {sComponentName = "TMP_Text"},
|
||||
tex_goNextMsg_ReLv = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Recommend_Lv"
|
||||
},
|
||||
tex_goNextMsg_ReLvCount = {sComponentName = "TMP_Text"},
|
||||
img_goNextMsg_ReCon = {sComponentName = "Image"},
|
||||
tex_goNextMsg_ReCon = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Recommend_Construct"
|
||||
},
|
||||
btn_goNextMsg_MonInfo = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickMonsterInfo"
|
||||
},
|
||||
tex_lvmsgBot_MonInfo = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MonsterInfo"
|
||||
},
|
||||
tex_goNextMsg_Affix = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Affix"
|
||||
},
|
||||
goNextMsg_affixSCRoot = {sComponentName = "Transform"},
|
||||
goNextMsg_affix_Item = {},
|
||||
tex_goNextMsg_Reward = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MessageBox_Reward"
|
||||
},
|
||||
goNextMsg_RewardRoot = {sComponentName = "Transform"},
|
||||
goNextMsg_RewardItem = {},
|
||||
goEnemyInfo = {
|
||||
sCtrlName = "Game.UI.MainlineEx.MainlineMonsterInfoCtrl"
|
||||
}
|
||||
}
|
||||
InfinityTowerBattleResultCtrl._mapEventConfig = {
|
||||
Infinity_Tower_SettleSuccess = "SettleSuccess",
|
||||
Infinity_Tower_AgainOrNext = "InfinityTowerAgainOrNext",
|
||||
[EventId.ClosePanel] = "OnEvent_ClosePanel",
|
||||
Close_Infinity_BountyUp = "OnEvent_CloseInfinityBountyUp",
|
||||
Stop_InfinityTowerAutoNextLv = "StopAutoNextLv"
|
||||
}
|
||||
function InfinityTowerBattleResultCtrl:Awake()
|
||||
self.rewardItem = {}
|
||||
self._mapNode.safeAreaRoot:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:FadeIn()
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:FadeOut()
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnEnable()
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnDisable()
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnDestroy()
|
||||
for go, ctrl in ipairs(self.rewardItem) do
|
||||
self:UnbindCtrlByNode(ctrl)
|
||||
end
|
||||
self.rewardItem = {}
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnRelease()
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnBtnClick_Quite()
|
||||
EventManager.Hit(EventId.BattleDashboardVisible, true)
|
||||
PlayerData.InfinityTower:SetAutoNextLv(false)
|
||||
self:StopAutoNextLv()
|
||||
PlayerData.InfinityTower:LevelEnd()
|
||||
local function levelEndCallback()
|
||||
EventManager.Remove("ADVENTURE_LEVEL_UNLOAD_COMPLETE", self, levelEndCallback)
|
||||
NovaAPI.EnterModule("MainMenuModuleScene", true)
|
||||
end
|
||||
EventManager.Add("ADVENTURE_LEVEL_UNLOAD_COMPLETE", self, levelEndCallback)
|
||||
CS.AdventureModuleHelper.LevelStateChanged(true, 0, true)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnBtnClick_NextLv()
|
||||
self:StopAutoNextLv()
|
||||
if self.haveReward or self.isBountyUp or self.isPlot then
|
||||
return
|
||||
end
|
||||
local isCan, tmpLv = self:CheckGoNextLv(true)
|
||||
if not isCan then
|
||||
return
|
||||
end
|
||||
self:CheckRecommend(tmpLv)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:CheckGoNextLv(isTips)
|
||||
local isCan, tmpLv = PlayerData.InfinityTower:AnginOrNextLv(false)
|
||||
if not self:CheckCanGo(tmpLv, isTips) then
|
||||
return false, tmpLv
|
||||
end
|
||||
local tmpCharTid = PlayerData.InfinityTower.cacheCharTid
|
||||
if not PlayerData.InfinityTower:JudgeInfinityTowerBuildCanUse(tmpCharTid, tmpLv) then
|
||||
if isTips then
|
||||
local strTips = ConfigTable.GetUIText("InfinityTower_Build_NotMeetingCond")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
end
|
||||
return false, tmpLv
|
||||
end
|
||||
local _isLockWorldClass = PlayerData.InfinityTower:CheckLockWorldClass(tmpLv)
|
||||
if _isLockWorldClass then
|
||||
if isTips then
|
||||
local strTips = ConfigTable.GetUIText("InfinityTower_Lock_WorldClass")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
end
|
||||
return false, tmpLv
|
||||
end
|
||||
return true, tmpLv
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnBtnClick_Again()
|
||||
local isCan, tmpLv = PlayerData.InfinityTower:AnginOrNextLv(true)
|
||||
if not self:CheckCanGo(tmpLv, true) then
|
||||
return
|
||||
end
|
||||
self:CheckRecommend(tmpLv)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:GoAgainOrNext()
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.BattleDamage)
|
||||
PlayerData.InfinityTower:GoAnginOrNextLv()
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:InfinityTowerAgainOrNext()
|
||||
GamepadUIManager.DisableGamepadUI("InfinityTowerBattleResultCtrl")
|
||||
EventManager.Hit(EventId.BattleDashboardVisible, true)
|
||||
PanelManager.InputEnable(true)
|
||||
self._mapNode.imgBlurredBg:SetActive(false)
|
||||
self._mapNode.safeAreaRoot:SetActive(false)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:CheckCanGo(tmpLv, isTips)
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", tmpLv)
|
||||
if lvData == nil then
|
||||
return false
|
||||
end
|
||||
local diff = lvData.DifficultyId
|
||||
local diffData = ConfigTable.GetData("InfinityTowerDifficulty", diff)
|
||||
local towerId = diffData.TowerId
|
||||
local _isOpenDay = PlayerData.InfinityTower:CheckOpenDay(towerId)
|
||||
if not _isOpenDay then
|
||||
if isTips then
|
||||
local strTips = ConfigTable.GetUIText("RegionBoss_Unlock_OpenDay")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:CheckRecommend(tmpLv)
|
||||
local TipsTime = LocalData.GetPlayerLocalData("IntinityT_Tips_Time")
|
||||
local _tipDay = 0
|
||||
if TipsTime ~= nil then
|
||||
_tipDay = tonumber(TipsTime)
|
||||
end
|
||||
local curTimeStamp = CS.ClientManager.Instance.serverTimeStampWithTimeZone
|
||||
local fixedTimeStamp = curTimeStamp - newDayTime * 3600
|
||||
local nYear = tonumber(os.date("!%Y", fixedTimeStamp))
|
||||
local nMonth = tonumber(os.date("!%m", fixedTimeStamp))
|
||||
local nDay = tonumber(os.date("!%d", fixedTimeStamp))
|
||||
local nowD = nYear * 366 + nMonth * 31 + nDay
|
||||
if nowD == _tipDay then
|
||||
self:GoAgainOrNext()
|
||||
EventManager.Hit("MainBattleMenuBtnPauseActive", false)
|
||||
else
|
||||
local GetBuildCallback = function(mapBuildData)
|
||||
local recLv = ConfigTable.GetData("InfinityTowerLevel", tmpLv).RecommendLv
|
||||
local recRank = ConfigTable.GetData("InfinityTowerLevel", tmpLv).RecommendBuildRank
|
||||
local charTid = mapBuildData.tbChar[1].nTid
|
||||
local charData = PlayerData.Char:GetCharDataByTid(charTid)
|
||||
if charData ~= nil then
|
||||
if recLv <= charData.nLevel and recRank <= PlayerData.Build:CalBuildRank(mapBuildData.nScore).Id then
|
||||
self:GoAgainOrNext()
|
||||
EventManager.Hit("MainBattleMenuBtnPauseActive", false)
|
||||
else
|
||||
local isSelectAgain = false
|
||||
local confirmCallback = function()
|
||||
if isSelectAgain then
|
||||
local _curTimeStamp = CS.ClientManager.Instance.serverTimeStampWithTimeZone
|
||||
local _fixedTimeStamp = _curTimeStamp - newDayTime * 3600
|
||||
local _nYear = tonumber(os.date("!%Y", _fixedTimeStamp))
|
||||
local _nMonth = tonumber(os.date("!%m", _fixedTimeStamp))
|
||||
local _nDay = tonumber(os.date("!%d", _fixedTimeStamp))
|
||||
local _nowD = _nYear * 366 + _nMonth * 31 + _nDay
|
||||
LocalData.SetPlayerLocalData("IntinityT_Tips_Time", tostring(_nowD))
|
||||
end
|
||||
self:GoAgainOrNext()
|
||||
EventManager.Hit("MainBattleMenuBtnPauseActive", false)
|
||||
end
|
||||
local againCallback = function(isSelect)
|
||||
isSelectAgain = isSelect
|
||||
end
|
||||
local msg = {
|
||||
nType = AllEnum.MessageBox.Confirm,
|
||||
sContent = ConfigTable.GetUIText("InfinityTower_Recommend_Tips"),
|
||||
callbackConfirm = confirmCallback,
|
||||
callbackAgain = againCallback,
|
||||
bBlur = false
|
||||
}
|
||||
EventManager.Hit(EventId.OpenMessageBox, msg)
|
||||
end
|
||||
else
|
||||
self:GoAgainOrNext()
|
||||
EventManager.Hit("MainBattleMenuBtnPauseActive", false)
|
||||
end
|
||||
end
|
||||
local nBuildId = PlayerData.InfinityTower:GetCachedBuildId(tmpLv)
|
||||
PlayerData.Build:GetBuildDetailData(GetBuildCallback, nBuildId)
|
||||
end
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:SettleSuccess(isSuccess, time, tabItem, Change, tmpPlotId, tbCharDamage)
|
||||
self._mapNode.imgBlurredBg:SetActive(true)
|
||||
EventManager.Hit(EventId.BattleDashboardVisible, false)
|
||||
PanelManager.InputDisable()
|
||||
GamepadUIManager.EnableGamepadUI("InfinityTowerBattleResultCtrl", self.tbGamepadUINode, nil, true)
|
||||
local lvId = PlayerData.InfinityTower:GetCurrentLv()
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", lvId)
|
||||
local diff = lvData.DifficultyId
|
||||
local diffData = ConfigTable.GetData("InfinityTowerDifficulty", diff)
|
||||
local towerId = diffData.TowerId
|
||||
local towerData = ConfigTable.GetData("InfinityTower", towerId)
|
||||
self.LvSuccess = isSuccess
|
||||
self.tbCharDamage = tbCharDamage
|
||||
for i = 1, 2 do
|
||||
self._mapNode.btnDamageResult[i].gameObject:SetActive(self.tbCharDamage ~= nil and #self.tbCharDamage > 0)
|
||||
end
|
||||
if isSuccess then
|
||||
self.isAuto = false
|
||||
if PlayerData.InfinityTower:GetAutoNextLv() then
|
||||
self.isAuto = true
|
||||
end
|
||||
if self.isAuto then
|
||||
local isCanAuto, tmpNextLv = self:CheckGoNextLv(false)
|
||||
if not isCanAuto then
|
||||
self.isAuto = false
|
||||
end
|
||||
end
|
||||
WwiseAudioMgr:PostEvent("ui_loading_combatSFX_mute", nil, false)
|
||||
WwiseAudioMgr:PlaySound("ui_infinity_victory")
|
||||
self.tmpPlotId = tmpPlotId
|
||||
self.haveReward = false
|
||||
self.isBountyUp = false
|
||||
self.isPlot = tmpPlotId ~= 0 and not self.isAuto
|
||||
if 0 < #tabItem then
|
||||
self.haveReward = true
|
||||
end
|
||||
if PlayerData.InfinityTower.LastBountyLevel < PlayerData.InfinityTower.BountyLevel then
|
||||
self.isBountyUp = true
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.texTowerNameSuccess, towerData.Name)
|
||||
self._mapNode.bgComplete:SetActive(true)
|
||||
self._mapNode.goComplete:SetActive(true)
|
||||
self._mapNode.goFail:SetActive(false)
|
||||
self._mapNode.bgFail:SetActive(false)
|
||||
local _diffSort = diffData.Sort
|
||||
local _data = PlayerData.InfinityTower:GetTowerDiffData(towerId, _diffSort)
|
||||
local _dataLv = _data.level
|
||||
local firstFloor = _data.firstFloor
|
||||
local endFloor = _data.endFloor
|
||||
local indexlvCount = 0
|
||||
for i = firstFloor, endFloor do
|
||||
local tmpData = _dataLv[i]
|
||||
indexlvCount = indexlvCount + 1
|
||||
if tmpData.Id == lvId then
|
||||
break
|
||||
end
|
||||
end
|
||||
local strIndex = indexlvCount
|
||||
if indexlvCount < 10 then
|
||||
strIndex = "0" .. indexlvCount
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.texLvCount, string.format(ConfigTable.GetUIText("Infinity_Diff_Lv"), _diffSort, strIndex))
|
||||
NovaAPI.SetTMPText(self._mapNode.texTimeCount, time .. ConfigTable.GetUIText("Talent_Sec"))
|
||||
local isCan, tmpLv = PlayerData.InfinityTower:AnginOrNextLv(false)
|
||||
if isCan then
|
||||
self._mapNode.btn_NextLv.gameObject:SetActive(true)
|
||||
self._mapNode.btn_NextMsg.gameObject:SetActive(true)
|
||||
else
|
||||
self._mapNode.btn_NextLv.gameObject:SetActive(false)
|
||||
self._mapNode.btn_NextMsg.gameObject:SetActive(false)
|
||||
end
|
||||
if not self.isAuto then
|
||||
self._mapNode.auto_lv:SetActive(false)
|
||||
self:AddTimer(1, 1, function()
|
||||
PlayerData.SideBanner:TryOpenSideBanner()
|
||||
if self.haveReward then
|
||||
UTILS.OpenReceiveByDisplayItem(tabItem, Change)
|
||||
elseif self.isBountyUp then
|
||||
EventManager.Hit("Show_Infinity_BountyUp")
|
||||
elseif self.isPlot then
|
||||
PlayerData.InfinityTower:PlayPlot(self.tmpPlotId)
|
||||
end
|
||||
end, true, true, true)
|
||||
else
|
||||
self:AutoNextLv(tabItem, Change)
|
||||
end
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 2)
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.texTowerNameFail, towerData.Name)
|
||||
self._mapNode.bgComplete:SetActive(false)
|
||||
self._mapNode.goComplete:SetActive(false)
|
||||
self._mapNode.bgFail:SetActive(true)
|
||||
self._mapNode.goFail:SetActive(true)
|
||||
end
|
||||
self._mapNode.safeAreaRoot:SetActive(true)
|
||||
self:PlayAni(isSuccess)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:PlayAni(isSuccess)
|
||||
if isSuccess then
|
||||
self._mapNode.animRoot:Play("InfinityTowerBattleResult_Complete")
|
||||
else
|
||||
self._mapNode.animRoot:Play("InfinityTowerBattleResult_Fail")
|
||||
end
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnBtnClick_NextMsg()
|
||||
self:StopAutoNextLv()
|
||||
self._mapNode.goNextMsg:SetActive(true)
|
||||
self._mapNode.goNextMsg_blur:SetActive(true)
|
||||
self:ShowNextLvInfo(PlayerData.InfinityTower.NextLevelId)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.t_window_04:SetActive(true)
|
||||
self._mapNode.anit_window:Play("t_window_04_t_in")
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnBtnClick_DamageResult()
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.BattleDamage, self.tbCharDamage)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:ShowNextLvInfo(levelId)
|
||||
self.ChooseLevelId = levelId
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", levelId)
|
||||
local diffData = ConfigTable.GetData("InfinityTowerDifficulty", lvData.DifficultyId)
|
||||
local towerId = diffData.TowerId
|
||||
local diffSort = diffData.Sort
|
||||
local data = PlayerData.InfinityTower:GetTowerDiffData(towerId, diffSort)
|
||||
local dataLv = data.level
|
||||
local firstFloor = data.firstFloor
|
||||
local endFloor = data.endFloor
|
||||
local indexlvCount = 0
|
||||
for i = firstFloor, endFloor do
|
||||
local tmpData = dataLv[i]
|
||||
indexlvCount = indexlvCount + 1
|
||||
if tmpData.Id == levelId then
|
||||
break
|
||||
end
|
||||
end
|
||||
local strIndex = indexlvCount
|
||||
if indexlvCount < 10 then
|
||||
strIndex = "0" .. indexlvCount
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_goNextMsg_lvIndex, orderedFormat(ConfigTable.GetUIText("InfinityTower_Lv_IndexSpace"), strIndex))
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_goNextMsg_lvName, lvData.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_goNextMsg_ReLvCount, lvData.RecommendLv)
|
||||
local sScore = "Icon/BuildRank/BuildRank_" .. lvData.RecommendBuildRank
|
||||
self:SetPngSprite(self._mapNode.img_goNextMsg_ReCon, sScore)
|
||||
local childRewardCount = self._mapNode.goNextMsg_RewardRoot.childCount
|
||||
for i = 1, childRewardCount do
|
||||
self._mapNode.goNextMsg_RewardRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local tbItem = {}
|
||||
local _base = decodeJson(lvData.BaseAwardPreview)
|
||||
for k, v in ipairs(_base) do
|
||||
table.insert(tbItem, {
|
||||
id = v[1],
|
||||
count = UTILS.ParseRewardItemCount(v)
|
||||
})
|
||||
end
|
||||
local index = 1
|
||||
for i, v in pairs(tbItem) do
|
||||
local objItem
|
||||
if index > self._mapNode.goNextMsg_RewardRoot.childCount then
|
||||
objItem = instantiate(self._mapNode.goNextMsg_RewardItem, self._mapNode.goNextMsg_RewardRoot)
|
||||
else
|
||||
objItem = self._mapNode.goNextMsg_RewardRoot:GetChild(index - 1).gameObject
|
||||
end
|
||||
local btn = objItem:GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local clickCb = function()
|
||||
self:ShowItemTips(v.id, btn.gameObject)
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
objItem:SetActive(true)
|
||||
local isGet = false
|
||||
local _objR = objItem.transform:Find("AniRoot/_RewardItem").gameObject
|
||||
self.rewardItem[_objR] = self:BindCtrlByNode(_objR, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
self.rewardItem[_objR]:SetItem(v.id, nil, v.count, nil, isGet, nil, nil, true)
|
||||
index = index + 1
|
||||
end
|
||||
local childAffixCount = self._mapNode.goNextMsg_affixSCRoot.childCount
|
||||
for i = 1, childAffixCount do
|
||||
self._mapNode.goNextMsg_affixSCRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local flData = ConfigTable.GetData("InfinityTowerFloor", lvData.FloorId)
|
||||
local tabAffixId = flData.AffixId
|
||||
local indexAffix = 1
|
||||
if lvData.EntryCond ~= 0 then
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.goNextMsg_affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.goNextMsg_affix_Item, self._mapNode.goNextMsg_affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.goNextMsg_affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, 0, false, lvData.EntryCond, lvData.EntryCondParam)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
for i = 1, #tabAffixId do
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.goNextMsg_affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.goNextMsg_affix_Item, self._mapNode.goNextMsg_affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.goNextMsg_affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
local affixId = 0
|
||||
if tabAffixId[i] ~= nil then
|
||||
affixId = tabAffixId[i]
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, affixId, true, nil, nil)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:ShowItemTips(nTid, rtBtn)
|
||||
UTILS.ClickItemGridWithTips(nTid, rtBtn, false, true, false)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:ShowAffixItemMsg(obj, affixId, isAffix, entryCond, entryCondParam)
|
||||
obj:SetActive(true)
|
||||
local goNextMsg_affix_Item_1 = obj.transform:Find("goNextMsg_affix_Item_1").gameObject
|
||||
local goNextMsg_affix_Item_2 = obj.transform:Find("goNextMsg_affix_Item_2").gameObject
|
||||
local goNextMsg_affix_Item_3 = obj.transform:Find("goNextMsg_affix_Item_3").gameObject
|
||||
goNextMsg_affix_Item_1:SetActive(isAffix)
|
||||
goNextMsg_affix_Item_2:SetActive(not isAffix)
|
||||
goNextMsg_affix_Item_3:SetActive(false)
|
||||
if isAffix then
|
||||
local tex_1 = goNextMsg_affix_Item_1.transform:Find("texgoNextMsg_affix_Item_1"):GetComponent("TMP_Text")
|
||||
local dataAffix = ConfigTable.GetData("InfinityTowerAffix", affixId)
|
||||
local sDesc = orderedFormat(ConfigTable.GetUIText("InfinityTowerAffix_Desc"), dataAffix.Name, dataAffix.Desc)
|
||||
NovaAPI.SetTMPText(tex_1, UTILS.ParseParamDesc(sDesc, dataAffix))
|
||||
else
|
||||
local tex_2Title = goNextMsg_affix_Item_2.transform:Find("texgoNextMsg_affix_Item_2/Image/texgoNextMsg_affix_Item_2Title"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(tex_2Title, ConfigTable.GetUIText("InfinityTower_Limit_March"))
|
||||
local tex_2 = goNextMsg_affix_Item_2.transform:Find("texgoNextMsg_affix_Item_2"):GetComponent("TMP_Text")
|
||||
local strElement = ConfigTable.GetUIText("ELEMENT_" .. entryCondParam[1])
|
||||
if entryCond == GameEnum.InfinityTowerCond.MasterCharactersWithSpecificElementType then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificElementType"), strElement))
|
||||
elseif entryCond == GameEnum.InfinityTowerCond.ElementTypeWithSpecificQuantityNoLessThanQuantity then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificQuantityNoLessThanQuantity"), strElement, entryCondParam[2]))
|
||||
elseif entryCond == GameEnum.InfinityTowerCond.ElementTypeWithSpecificQuantityNoMoreThanQuantity then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificQuantityNoMoreThanQuantity"), strElement, entryCondParam[2]))
|
||||
end
|
||||
end
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnClickMonsterInfo()
|
||||
EventManager.Hit("OpenInfinityTowerMonsterInfo", self.ChooseLevelId)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnClickCloseNextMsgRoot()
|
||||
self._mapNode.goNextMsg_blur:SetActive(false)
|
||||
self._mapNode.anit_window:Play("t_window_04_t_out")
|
||||
self:AddTimer(1, 0.3, function()
|
||||
self._mapNode.t_window_04:SetActive(false)
|
||||
self._mapNode.goNextMsg:SetActive(false)
|
||||
end, true, true, true)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnEvent_ClosePanel(nPanelId)
|
||||
if type(nPanelId) == "number" and nPanelId == PanelId.ReceivePropsTips then
|
||||
if self.haveReward then
|
||||
self.haveReward = false
|
||||
if self.isBountyUp then
|
||||
EventManager.Hit("Show_Infinity_BountyUp")
|
||||
elseif self.isPlot then
|
||||
if self.isAuto and self.LvSuccess then
|
||||
self.isPlot = false
|
||||
return
|
||||
end
|
||||
PlayerData.InfinityTower:PlayPlot(self.tmpPlotId)
|
||||
end
|
||||
elseif self.isPlot then
|
||||
self.isPlot = false
|
||||
end
|
||||
end
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:OnEvent_CloseInfinityBountyUp()
|
||||
self:StopAutoNextLv()
|
||||
self.isBountyUp = false
|
||||
if self.isPlot then
|
||||
PlayerData.InfinityTower:PlayPlot(self.tmpPlotId)
|
||||
end
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:AutoNextLv(tabItem, Change)
|
||||
local callback = function()
|
||||
self:StopAutoNextLv()
|
||||
end
|
||||
self:AddTimer(1, 0.1, function()
|
||||
self._mapNode.auto_lv:SetActive(true)
|
||||
end, true, true, true)
|
||||
self:SetAutoLvTime(5)
|
||||
local nCount = 0
|
||||
self.AutoNextLvCor = self:AddTimer(5, 1, function()
|
||||
nCount = nCount + 1
|
||||
self:SetAutoLvTime(5 - nCount)
|
||||
if nCount == 1 then
|
||||
UTILS.OpenReceiveByDisplayItem(tabItem, Change, callback)
|
||||
elseif nCount == 2 then
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.ReceivePropsTips)
|
||||
if self.isBountyUp then
|
||||
EventManager.Hit("Show_Infinity_BountyUp")
|
||||
end
|
||||
elseif nCount == 3 then
|
||||
if self.isBountyUp then
|
||||
EventManager.Hit("Close_BountyUp_Auto")
|
||||
self.isBountyUp = false
|
||||
if self.isPlot then
|
||||
self.isPlot = false
|
||||
end
|
||||
end
|
||||
elseif nCount == 5 then
|
||||
local isCan, tmpLv = self:CheckGoNextLv(true)
|
||||
if not isCan then
|
||||
return
|
||||
end
|
||||
self._mapNode.auto_lv:SetActive(false)
|
||||
self:GoAgainOrNext()
|
||||
EventManager.Hit("MainBattleMenuBtnPauseActive", false)
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:StopAutoNextLv()
|
||||
if nil ~= self.AutoNextLvCor and self.isAuto and self.LvSuccess then
|
||||
self.isAuto = false
|
||||
PlayerData.InfinityTower:SetAutoNextLv(false)
|
||||
self.AutoNextLvCor:Cancel(false)
|
||||
self.haveReward = false
|
||||
self.isBountyUp = false
|
||||
self.isPlot = false
|
||||
end
|
||||
EventManager.Hit("ChangeAutoBattleStateClose")
|
||||
self.AutoNextLvCor = nil
|
||||
self._mapNode.auto_lv:SetActive(false)
|
||||
end
|
||||
function InfinityTowerBattleResultCtrl:SetAutoLvTime(tSec)
|
||||
NovaAPI.SetTMPText(self._mapNode.auto_lvTime, orderedFormat(ConfigTable.GetUIText("InfinityTower_AutoLevel_Time"), tSec))
|
||||
end
|
||||
return InfinityTowerBattleResultCtrl
|
||||
@@ -0,0 +1,356 @@
|
||||
local InfinityTowerBounty = class("InfinityTowerBounty", BaseCtrl)
|
||||
InfinityTowerBounty._mapNodeConfig = {
|
||||
goBounty = {
|
||||
sNodeName = "t_window_04"
|
||||
},
|
||||
txt_BV_Title = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Bounty_Level"
|
||||
},
|
||||
btnLevel = {
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateToggleCtrl"
|
||||
},
|
||||
btnPreview = {
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateToggleCtrl"
|
||||
},
|
||||
btnLevelTog = {
|
||||
sNodeName = "btnLevel",
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_LevelTog"
|
||||
},
|
||||
btnPreviewTog = {
|
||||
sNodeName = "btnPreview",
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_PreviewTog"
|
||||
},
|
||||
bv_obj_Bounty = {},
|
||||
bv_tex_currentLv = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Current_Level"
|
||||
},
|
||||
bv_tex_BountyLv = {sComponentName = "TMP_Text"},
|
||||
bv_tex_promotion = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Promotion_Conditions"
|
||||
},
|
||||
pr_CondList = {sNodeName = "pr_Cond", nCount = 3},
|
||||
bv_PromotionRewardTop = {},
|
||||
tex_PromotionRewardTop = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Bounty_TopGrade"
|
||||
},
|
||||
bv_tex_daily = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Daily_Bounty"
|
||||
},
|
||||
bv_objRewardItem = {},
|
||||
bv_rewardItemRoot = {sComponentName = "Transform"},
|
||||
bv_tex_RewardNone = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Get_RewardNone"
|
||||
},
|
||||
btnGetDaily = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_GetDaily"
|
||||
},
|
||||
bv_txt_GetReward = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Get_Reward"
|
||||
},
|
||||
btnGetDailyGray = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_GetDaily"
|
||||
},
|
||||
bv_txt_GetRewardGray = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "LoginReward_Received"
|
||||
},
|
||||
bv_obj_Preview = {},
|
||||
bv_tex_PreviewLv = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Bounty_Level"
|
||||
},
|
||||
bv_tex_PreviewDaily = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Daily_Bounty"
|
||||
},
|
||||
bv_tex_PreviewConditions = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Promotion_Conditions"
|
||||
},
|
||||
previewList = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
btnCloseBV = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
MaskClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
}
|
||||
}
|
||||
InfinityTowerBounty._mapEventConfig = {
|
||||
InfinityTower_DailyCallback = "OnEvent_InfinityTowerDailyCallback"
|
||||
}
|
||||
function InfinityTowerBounty:Awake()
|
||||
self.goAni = self.gameObject:GetComponent("Animator")
|
||||
self.rewardItem = {}
|
||||
self.previewRewardItem = {}
|
||||
self.isOpen = false
|
||||
end
|
||||
function InfinityTowerBounty:OnEnable()
|
||||
self:SetPageBtnText()
|
||||
end
|
||||
function InfinityTowerBounty:SetPageBtnText()
|
||||
self._mapNode.btnLevel:SetText(ConfigTable.GetUIText("InfinityTower_Bounty_Level"))
|
||||
self._mapNode.btnPreview:SetText(ConfigTable.GetUIText("InfinityTower_Bounty_Preview"))
|
||||
end
|
||||
function InfinityTowerBounty:InitView()
|
||||
self.isOpen = true
|
||||
self._mapNode.goBounty.gameObject:SetActive(false)
|
||||
self.gameObject:SetActive(true)
|
||||
self.bountycount = 0
|
||||
self.tabBountyData = {}
|
||||
local foreach_Base = function(baseData)
|
||||
self.bountycount = self.bountycount + 1
|
||||
self.tabBountyData[baseData.Level] = baseData
|
||||
end
|
||||
ForEachTableLine(DataTable.InfinityTowerBountyLevel, foreach_Base)
|
||||
self:InitBountyMsg()
|
||||
self:InitPreviewMsg()
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.goBounty.gameObject:SetActive(true)
|
||||
self:OnBtnClick_LevelTog()
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function InfinityTowerBounty:OnEvent_InfinityTowerDailyCallback()
|
||||
if self.isOpen then
|
||||
self:InitBountyMsg()
|
||||
end
|
||||
end
|
||||
function InfinityTowerBounty:InitBountyMsg()
|
||||
local currentLv = PlayerData.InfinityTower.BountyLevel
|
||||
NovaAPI.SetTMPText(self._mapNode.bv_tex_BountyLv, tostring(currentLv))
|
||||
local nextData = self.tabBountyData[currentLv + 1]
|
||||
for i = 1, 3 do
|
||||
self:InitConditionsList(self._mapNode.pr_CondList[i], i, nextData)
|
||||
end
|
||||
self._mapNode.bv_PromotionRewardTop:SetActive(nextData == nil)
|
||||
local curData = self.tabBountyData[currentLv]
|
||||
local tbItem = {}
|
||||
local _base = decodeJson(curData.RewardShow)
|
||||
for k, v in ipairs(_base) do
|
||||
table.insert(tbItem, {
|
||||
id = v[1],
|
||||
count = v[2]
|
||||
})
|
||||
end
|
||||
local isGet = not PlayerData.InfinityTower.isHaveDailyReward
|
||||
self:SetRewardItem(tbItem, isGet)
|
||||
self._mapNode.bv_tex_RewardNone.gameObject:SetActive(#tbItem == 0)
|
||||
if #tbItem == 0 then
|
||||
self._mapNode.btnGetDaily.gameObject:SetActive(false)
|
||||
self._mapNode.btnGetDailyGray.gameObject:SetActive(true)
|
||||
NovaAPI.SetTMPText(self._mapNode.bv_txt_GetRewardGray, ConfigTable.GetUIText("InfinityTower_Get_Reward"))
|
||||
else
|
||||
self._mapNode.btnGetDaily.gameObject:SetActive(PlayerData.InfinityTower.isHaveDailyReward)
|
||||
self._mapNode.btnGetDailyGray.gameObject:SetActive(not PlayerData.InfinityTower.isHaveDailyReward)
|
||||
NovaAPI.SetTMPText(self._mapNode.bv_txt_GetRewardGray, ConfigTable.GetUIText("LoginReward_Received"))
|
||||
end
|
||||
end
|
||||
function InfinityTowerBounty:InitConditionsList(goGrid, index, data)
|
||||
if data == nil then
|
||||
goGrid:SetActive(false)
|
||||
return
|
||||
end
|
||||
local _cond = data["Cond" .. index]
|
||||
if _cond ~= 0 then
|
||||
local bv_obj_Conditions_1 = goGrid.transform:Find("bv_obj_Conditions_1").gameObject
|
||||
local bv_obj_Conditions_2 = goGrid.transform:Find("bv_obj_Conditions_2").gameObject
|
||||
local bv_tex_Conditions = goGrid.gameObject:GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(bv_tex_Conditions, data["CondDesc" .. index])
|
||||
local isPass = PlayerData.InfinityTower:JudgeInfinityTowerCond(_cond, data["CondParam" .. index])
|
||||
bv_obj_Conditions_1:SetActive(isPass)
|
||||
bv_obj_Conditions_2:SetActive(not isPass)
|
||||
goGrid:SetActive(true)
|
||||
else
|
||||
goGrid:SetActive(false)
|
||||
end
|
||||
end
|
||||
function InfinityTowerBounty:SetRewardItem(tabItem, isGet)
|
||||
local childCount = self._mapNode.bv_rewardItemRoot.childCount
|
||||
for i = 1, childCount do
|
||||
self._mapNode.bv_rewardItemRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local index = 1
|
||||
for i, v in pairs(tabItem) do
|
||||
local objItem
|
||||
if index > self._mapNode.bv_rewardItemRoot.childCount then
|
||||
objItem = instantiate(self._mapNode.bv_objRewardItem, self._mapNode.bv_rewardItemRoot)
|
||||
else
|
||||
objItem = self._mapNode.bv_rewardItemRoot:GetChild(index - 1).gameObject
|
||||
end
|
||||
local btn = objItem:GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local clickCb = function()
|
||||
self:ShowItemTips(v.id, btn.gameObject)
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
objItem:SetActive(true)
|
||||
self.rewardItem[objItem] = self:BindCtrlByNode(objItem, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
self.rewardItem[objItem]:SetItem(v.id, nil, v.count, nil, isGet, nil, nil, true)
|
||||
index = index + 1
|
||||
end
|
||||
end
|
||||
function InfinityTowerBounty:InitPreviewMsg()
|
||||
self._mapNode.previewList:Init(self.bountycount, self, self.InitPreviewList)
|
||||
end
|
||||
function InfinityTowerBounty:InitPreviewList(goGrid, gridIndex)
|
||||
local index = gridIndex + 1
|
||||
local tex_PreviewCond_Lv = goGrid.transform:Find("gridRt/tex_PreviewCond_Lv"):GetComponent("TMP_Text")
|
||||
local obj_PCond_RewardItem = goGrid.transform:Find("gridRt/obj_PCond_RewardItem").gameObject
|
||||
local obj_PCond_RewardRoot = goGrid.transform:Find("gridRt/obj_PCond_Reward/Viewport/obj_PCond_RewardRoot").transform
|
||||
local obj_PCond_CondItem = goGrid.transform:Find("gridRt/obj_PCond_CondItem").gameObject
|
||||
local obj_PCond_CondRoot = goGrid.transform:Find("gridRt/obj_PCond_CondRoot").transform
|
||||
local obj_PCond_CurrentLv = goGrid.transform:Find("gridRt/obj_PCond_CurrentLv").gameObject
|
||||
local tex_PCond_CurrentLv = goGrid.transform:Find("gridRt/obj_PCond_CurrentLv/tex_PCond_CurrentLv"):GetComponent("TMP_Text")
|
||||
local tex_PCond_RewardNone = goGrid.transform:Find("gridRt/tex_PCond_RewardNone"):GetComponent("TMP_Text")
|
||||
local obj_PCond_CondTop = goGrid.transform:Find("gridRt/obj_PCond_CondTop").gameObject
|
||||
local tex_PCond_CondTop = goGrid.transform:Find("gridRt/obj_PCond_CondTop/tex_PCond_CondTop"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(tex_PCond_RewardNone, ConfigTable.GetUIText("InfinityTower_Get_RewardNone"))
|
||||
NovaAPI.SetTMPText(tex_PCond_CondTop, ConfigTable.GetUIText("InfinityTower_Bounty_TopGrade"))
|
||||
NovaAPI.SetTMPText(tex_PCond_CurrentLv, ConfigTable.GetUIText("InfinityTower_Current_Level"))
|
||||
local childItemCount = obj_PCond_RewardRoot.childCount
|
||||
for i = 1, childItemCount do
|
||||
obj_PCond_RewardRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local childCondCount = obj_PCond_CondRoot.childCount
|
||||
for i = 1, childCondCount do
|
||||
obj_PCond_CondRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
if self.previewRewardItem[index] ~= nil then
|
||||
for go, ctrl in ipairs(self.previewRewardItem[index]) do
|
||||
self:UnbindCtrlByNode(ctrl)
|
||||
end
|
||||
end
|
||||
self.previewRewardItem[index] = {}
|
||||
NovaAPI.SetTMPText(tex_PreviewCond_Lv, index)
|
||||
obj_PCond_CurrentLv:SetActive(PlayerData.InfinityTower.BountyLevel == index)
|
||||
local bountyData = self.tabBountyData[index]
|
||||
local tabItem = {}
|
||||
local _base = decodeJson(bountyData.RewardShow)
|
||||
for k, v in ipairs(_base) do
|
||||
table.insert(tabItem, {
|
||||
id = v[1],
|
||||
count = v[2]
|
||||
})
|
||||
end
|
||||
local indexCount = 1
|
||||
for i, v in pairs(tabItem) do
|
||||
local objItem
|
||||
if indexCount > obj_PCond_RewardRoot.childCount then
|
||||
objItem = instantiate(obj_PCond_RewardItem, obj_PCond_RewardRoot)
|
||||
else
|
||||
objItem = obj_PCond_RewardRoot:GetChild(indexCount - 1).gameObject
|
||||
end
|
||||
local btn = objItem:GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local clickCb = function()
|
||||
self:ShowItemTips(v.id, btn.gameObject)
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
objItem:SetActive(true)
|
||||
local _objR = objItem.transform:Find("AniRoot/_PCond_RewardItem").gameObject
|
||||
self.previewRewardItem[index][_objR] = self:BindCtrlByNode(_objR, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
self.previewRewardItem[index][_objR]:SetItem(v.id, nil, v.count, nil, false, nil, nil, true)
|
||||
indexCount = indexCount + 1
|
||||
end
|
||||
tex_PCond_RewardNone.gameObject:SetActive(#tabItem == 0)
|
||||
local bountyDataNext = self.tabBountyData[index + 1]
|
||||
if bountyDataNext ~= nil then
|
||||
obj_PCond_CondTop:SetActive(false)
|
||||
for i = 1, 3 do
|
||||
local objItem
|
||||
if i > obj_PCond_CondRoot.childCount then
|
||||
objItem = instantiate(obj_PCond_CondItem, obj_PCond_CondRoot)
|
||||
else
|
||||
objItem = obj_PCond_CondRoot:GetChild(i - 1).gameObject
|
||||
end
|
||||
local _cond = bountyDataNext["Cond" .. i]
|
||||
if _cond ~= 0 then
|
||||
local tex = objItem.transform:Find("tex_PCond_CondItem"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(tex, bountyDataNext["CondDesc" .. i])
|
||||
objItem:SetActive(true)
|
||||
else
|
||||
objItem:SetActive(false)
|
||||
end
|
||||
end
|
||||
else
|
||||
obj_PCond_CondTop:SetActive(true)
|
||||
end
|
||||
end
|
||||
function InfinityTowerBounty:ShowItemTips(nTid, rtBtn)
|
||||
UTILS.ClickItemGridWithTips(nTid, rtBtn, false, true, false)
|
||||
end
|
||||
function InfinityTowerBounty:OnBtnClick_LevelTog()
|
||||
self._mapNode.bv_obj_Bounty:SetActive(true)
|
||||
self._mapNode.bv_obj_Preview:SetActive(false)
|
||||
self.nSelectType = 1
|
||||
self:SetTogSelect()
|
||||
self.goAni:Play("goBountyView_Bounty")
|
||||
end
|
||||
function InfinityTowerBounty:OnBtnClick_PreviewTog()
|
||||
self._mapNode.bv_obj_Bounty:SetActive(false)
|
||||
self._mapNode.bv_obj_Preview:SetActive(true)
|
||||
local currentLv = PlayerData.InfinityTower.BountyLevel
|
||||
self._mapNode.previewList:SetScrollGridPos(currentLv, 0.1, 0)
|
||||
self.nSelectType = 2
|
||||
self:SetTogSelect()
|
||||
self.goAni:Play("goBountyView_Preview")
|
||||
end
|
||||
function InfinityTowerBounty:SetTogSelect()
|
||||
self._mapNode.btnLevel:SetDefault(self.nSelectType == 1)
|
||||
self._mapNode.btnPreview:SetDefault(self.nSelectType == 2)
|
||||
end
|
||||
function InfinityTowerBounty:OnBtnClick_GetDaily()
|
||||
if not PlayerData.InfinityTower.isHaveDailyReward then
|
||||
local currentLv = PlayerData.InfinityTower.BountyLevel
|
||||
local curData = self.tabBountyData[currentLv]
|
||||
local tbItem = {}
|
||||
local _base = decodeJson(curData.RewardShow)
|
||||
for k, v in ipairs(_base) do
|
||||
table.insert(tbItem, {
|
||||
id = v[1],
|
||||
count = v[2]
|
||||
})
|
||||
end
|
||||
if 0 < #tbItem then
|
||||
local strTips = ConfigTable.GetUIText("InfinityTower_Get_RewardTips")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
else
|
||||
local strTips = ConfigTable.GetUIText("InfinityTower_Get_RewardNone")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
end
|
||||
return
|
||||
end
|
||||
PlayerData.InfinityTower:ITDailyRewardReq()
|
||||
end
|
||||
function InfinityTowerBounty:OnBtnClick_Close()
|
||||
self.isOpen = false
|
||||
self._mapNode.goBounty.gameObject:SetActive(false)
|
||||
self.gameObject:SetActive(false)
|
||||
end
|
||||
function InfinityTowerBounty:UnbindAllGrids()
|
||||
for go, ctrl in ipairs(self.rewardItem) do
|
||||
self:UnbindCtrlByNode(ctrl)
|
||||
end
|
||||
self.rewardItem = {}
|
||||
end
|
||||
function InfinityTowerBounty:OnDisable()
|
||||
self:UnbindAllGrids()
|
||||
end
|
||||
return InfinityTowerBounty
|
||||
@@ -0,0 +1,68 @@
|
||||
local InfinityTowerBountyUp = class("InfinityTowerBountyUp", BaseCtrl)
|
||||
InfinityTowerBountyUp._mapNodeConfig = {
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_blue",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
imgFrameBgAni = {sNodeName = "imgFrameBg", sComponentName = "Animator"},
|
||||
texBountyUp = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Daily_BountyUp"
|
||||
},
|
||||
texLastLv = {sComponentName = "TMP_Text"},
|
||||
texCurrentLv = {sComponentName = "TMP_Text"},
|
||||
auto_lv = {},
|
||||
auto_lvTime = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_AutoLevel"
|
||||
},
|
||||
SuccessBar = {}
|
||||
}
|
||||
InfinityTowerBountyUp._mapEventConfig = {
|
||||
Show_Infinity_BountyUp = "OnEvent_ShowInfinityBountyUp",
|
||||
Close_BountyUp_Auto = "OnEvent_CloseInfinityBountyUp"
|
||||
}
|
||||
function InfinityTowerBountyUp:Awake()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(false)
|
||||
self._mapNode.btnClose.gameObject:SetActive(false)
|
||||
self._mapNode.SuccessBar.gameObject:SetActive(false)
|
||||
end
|
||||
function InfinityTowerBountyUp:OnEvent_ShowInfinityBountyUp()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
self:Open()
|
||||
end
|
||||
function InfinityTowerBountyUp:Open()
|
||||
if PlayerData.InfinityTower:GetAutoNextLv() then
|
||||
self._mapNode.auto_lv:SetActive(true)
|
||||
else
|
||||
self._mapNode.auto_lv:SetActive(false)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.texLastLv, PlayerData.InfinityTower.LastBountyLevel)
|
||||
NovaAPI.SetTMPText(self._mapNode.texCurrentLv, PlayerData.InfinityTower.BountyLevel)
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
self._mapNode.btnClose.gameObject:SetActive(true)
|
||||
self._mapNode.SuccessBar.gameObject:SetActive(true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.8)
|
||||
end
|
||||
function InfinityTowerBountyUp:OnBtnClick_Close(btn)
|
||||
self._mapNode.aniBlur.gameObject:SetActive(false)
|
||||
self._mapNode.imgFrameBgAni:Play("InfinityTowerBountyUp_out")
|
||||
self:AddTimer(1, 0.2, function()
|
||||
self._mapNode.btnClose.gameObject:SetActive(false)
|
||||
self._mapNode.SuccessBar.gameObject:SetActive(false)
|
||||
end, true, true, true)
|
||||
EventManager.Hit("Close_Infinity_BountyUp")
|
||||
end
|
||||
function InfinityTowerBountyUp:OnEvent_CloseInfinityBountyUp()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(false)
|
||||
self._mapNode.btnClose.gameObject:SetActive(false)
|
||||
self._mapNode.imgFrameBgAni:Play("InfinityTowerBountyUp_out")
|
||||
self:AddTimer(1, 0.2, function()
|
||||
self._mapNode.SuccessBar.gameObject:SetActive(false)
|
||||
end, true, true, true)
|
||||
end
|
||||
return InfinityTowerBountyUp
|
||||
@@ -0,0 +1,83 @@
|
||||
local GameResourceLoader = require("Game.Common.Resource.GameResourceLoader")
|
||||
local ResType = GameResourceLoader.ResType
|
||||
local InfinityTowerDifficultyItem = class("InfinityTowerDifficultyItem", BaseCtrl)
|
||||
InfinityTowerDifficultyItem._mapNodeConfig = {
|
||||
diff_Bg = {sComponentName = "Image"},
|
||||
diff_Pass_All = {},
|
||||
diff_Name = {sComponentName = "TMP_Text"},
|
||||
diff_NameSpecial = {sComponentName = "TMP_Text"},
|
||||
diff_Special = {},
|
||||
diff_SpecialTex = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_SpecialLv"
|
||||
},
|
||||
diff_lv_txtReLv = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Recommend_Lv"
|
||||
},
|
||||
diff_lv_txtReLvCount = {sComponentName = "TMP_Text"},
|
||||
diff_lv_txtConstructLv = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Recommend_Construct"
|
||||
},
|
||||
diff_img_rank = {sComponentName = "Image"},
|
||||
diff_Lock_Bg = {},
|
||||
diff_Tex_Lock = {sComponentName = "TMP_Text"},
|
||||
diff_btn = {sComponentName = "UIButton", callback = "OnBtnDiff"}
|
||||
}
|
||||
InfinityTowerDifficultyItem._mapEventConfig = {}
|
||||
function InfinityTowerDifficultyItem:InitDiffList(towerId, diffSort, parent)
|
||||
self.parent = parent
|
||||
local data = PlayerData.InfinityTower:GetTowerDiffData(towerId, diffSort)
|
||||
self.towerId = towerId
|
||||
self.diffSort = diffSort
|
||||
NovaAPI.SetTMPText(self._mapNode.diff_Name, data.diff.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.diff_NameSpecial, data.diff.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.diff_lv_txtReLvCount, data.diff.RecommendLevel)
|
||||
local sRank = "Icon/BuildRank/BuildRank_" .. data.diff.RecommendBuildRank
|
||||
self:SetPngSprite(self._mapNode.diff_img_rank, sRank)
|
||||
local nWorldClass = PlayerData.Base:GetWorldClass()
|
||||
local firstLvId = 0
|
||||
if data.level[data.firstFloor] then
|
||||
firstLvId = data.level[data.firstFloor].Id
|
||||
end
|
||||
self.isFirstLvCanChallenge = PlayerData.InfinityTower:JudgeLevelCanChallenge(towerId, firstLvId)
|
||||
self.isFirstLvPass = PlayerData.InfinityTower:JudgeLevelPass(towerId, firstLvId)
|
||||
self.isLock = nWorldClass < data.diff.UnlockWorldClass
|
||||
self._mapNode.diff_Lock_Bg:SetActive(false)
|
||||
if self.isLock then
|
||||
self._mapNode.diff_Lock_Bg:SetActive(true)
|
||||
NovaAPI.SetTMPText(self._mapNode.diff_Tex_Lock, data.diff.UnlockTips)
|
||||
elseif not self.isFirstLvCanChallenge and not self.isFirstLvPass then
|
||||
self._mapNode.diff_Lock_Bg:SetActive(true)
|
||||
NovaAPI.SetTMPText(self._mapNode.diff_Tex_Lock, ConfigTable.GetUIText("InfinityTower_Bounty_Last_NotPass"))
|
||||
end
|
||||
self._mapNode.diff_Special:SetActive(data.diff.IsChallenge)
|
||||
self._mapNode.diff_Name.gameObject:SetActive(not data.diff.IsChallenge)
|
||||
self._mapNode.diff_NameSpecial.gameObject:SetActive(data.diff.IsChallenge)
|
||||
local diffPassAll = PlayerData.InfinityTower:GetTowerDiffPassAll(towerId, diffSort)
|
||||
self._mapNode.diff_Pass_All:SetActive(diffPassAll)
|
||||
local sPath = "Icon/MapChallenge/zs_infinitytower_rank_0" .. towerId - 1
|
||||
NovaAPI.SetImageSprite(self._mapNode.diff_Bg, Settings.AB_ROOT_PATH .. sPath .. ".png")
|
||||
end
|
||||
function InfinityTowerDifficultyItem:OnBtnDiff()
|
||||
if self.isLock then
|
||||
local data = PlayerData.InfinityTower:GetTowerDiffData(self.towerId, self.diffSort)
|
||||
local strTips = data.diff.UnlockTips
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
end
|
||||
if not self.isFirstLvCanChallenge and not self.isFirstLvPass then
|
||||
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("InfinityTower_Bounty_Last_NotPass"))
|
||||
return
|
||||
end
|
||||
self.parent:InfinitySelectTower(self.towerId, self.diffSort)
|
||||
local func = function()
|
||||
EventManager.Hit(EventId.SetTransition)
|
||||
end
|
||||
EventManager.Hit(EventId.SetTransition, 9, func)
|
||||
end
|
||||
function InfinityTowerDifficultyItem:OnDestroy()
|
||||
self.parent = nil
|
||||
end
|
||||
return InfinityTowerDifficultyItem
|
||||
@@ -0,0 +1,570 @@
|
||||
local InfinityTowerLvList = class("InfinityTowerLvList", BaseCtrl)
|
||||
local LayoutRebuilder = CS.UnityEngine.UI.LayoutRebuilder
|
||||
InfinityTowerLvList._mapNodeConfig = {
|
||||
lv_firstTemp = {},
|
||||
lv_firstTemp_1 = {},
|
||||
lv_firstTemp_2 = {},
|
||||
lv_endTemp = {},
|
||||
lv_endTemp_1 = {},
|
||||
lv_endTemp_2 = {},
|
||||
lvListMsgView = {},
|
||||
lvListMsgTrans = {sComponentName = "Transform"},
|
||||
lv_Temp = {},
|
||||
lvmsgRoot = {},
|
||||
tex_lvmsgTop_LvIndex = {sComponentName = "TMP_Text"},
|
||||
tex_lvmsgTop_LvName = {sComponentName = "TMP_Text"},
|
||||
tex_lvmsgTop_ReLv = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Recommend_Lv"
|
||||
},
|
||||
tex_lvmsgTop_ReLvCount = {sComponentName = "TMP_Text"},
|
||||
img_lvmsgTop_ReCon = {sComponentName = "Image"},
|
||||
tex_lvmsgTop_ReCon = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Recommend_Construct"
|
||||
},
|
||||
tex_lvmsgBot_Affix = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Affix"
|
||||
},
|
||||
lvmsgBot_affixSCRoot = {sComponentName = "Transform"},
|
||||
lvmsgBot_affix_Item = {},
|
||||
tex_lvmsgBot_Reward = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MessageBox_Reward"
|
||||
},
|
||||
lvmsgBot_RewardRoot = {sComponentName = "Transform"},
|
||||
lvmsgBot_RewardItem = {},
|
||||
tex_lvmsgBot_MonInfo = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MonsterInfo"
|
||||
},
|
||||
btn_lvmsgBot_MonInfo = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickMonsterInfo"
|
||||
},
|
||||
btn_go = {sComponentName = "UIButton", callback = "OnClickGo"},
|
||||
txtBtnGo = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_GoWar"
|
||||
},
|
||||
obj_lvMsgPass = {},
|
||||
tex_lvMsgPass = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Pass_Level"
|
||||
},
|
||||
obj_lvMsgLock = {},
|
||||
tex_lvMsgLock = {sComponentName = "TMP_Text"},
|
||||
obj_lvMsgDontOpen = {},
|
||||
tex_lvMsgDontOpen = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Last_NotPass"
|
||||
},
|
||||
obj_lvMsgDontOpenDay = {},
|
||||
tex_lvMsgDontOpenDay = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Dont_Open"
|
||||
},
|
||||
btn_Close_lvmsgRoot = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickCloseLvMsgRoot"
|
||||
}
|
||||
}
|
||||
function InfinityTowerLvList:Awake()
|
||||
self.rewardItem = {}
|
||||
end
|
||||
function InfinityTowerLvList:InitLvList(towerId, diffSort, parent)
|
||||
self.tmpChooseObj = nil
|
||||
self.tmpCloseObj = nil
|
||||
self._mapNode.lvmsgRoot:SetActive(false)
|
||||
NovaAPI.SetRectMaskPadding(self._mapNode.lvListMsgView, 0, 0, 0, 0)
|
||||
NovaAPI.SetLayoutGroupPadding(self._mapNode.lvListMsgTrans.gameObject, 0, 0, -2, 0)
|
||||
self.parent = parent
|
||||
self.selectTowerId = towerId
|
||||
self.diffSort = diffSort
|
||||
for i = 1, self._mapNode.lvListMsgTrans.childCount do
|
||||
self._mapNode.lvListMsgTrans:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
self._mapNode.lvListMsgTrans.localPosition = Vector3(0, 0, 0)
|
||||
local towerPassFloor = PlayerData.InfinityTower:GetTowerPassFloor(towerId)
|
||||
local data = PlayerData.InfinityTower:GetTowerDiffData(towerId, diffSort)
|
||||
local dataLv = data.level
|
||||
local diffLevelCount = data.diffLevelCount
|
||||
local firstFloor = data.firstFloor
|
||||
local endFloor = data.endFloor
|
||||
local firstPass = towerPassFloor >= firstFloor
|
||||
local endPass = towerPassFloor >= endFloor
|
||||
self._mapNode.lv_firstTemp_1:SetActive(not firstPass)
|
||||
self._mapNode.lv_firstTemp_2:SetActive(firstPass)
|
||||
self._mapNode.lv_endTemp_1:SetActive(not endPass)
|
||||
self._mapNode.lv_endTemp_2:SetActive(endPass)
|
||||
local indexlvCount = 0
|
||||
local indexSpecialCount = 0
|
||||
local currentLvIndex = 0
|
||||
local xPre = 2340 / math.floor(Settings.CURRENT_CANVAS_FULL_RECT_WIDTH)
|
||||
local diffPassAll = PlayerData.InfinityTower:GetTowerDiffPassAll(towerId, diffSort)
|
||||
local CurrentClick
|
||||
for i = firstFloor, endFloor do
|
||||
local tmpData = dataLv[i]
|
||||
if tmpData.LevelType == GameEnum.InfinityTowerLevelType.Challenge then
|
||||
indexSpecialCount = indexSpecialCount + 1
|
||||
end
|
||||
indexlvCount = indexlvCount + 1
|
||||
local objItem
|
||||
if self._mapNode.lvListMsgTrans:Find("objItem_" .. indexlvCount) ~= nil then
|
||||
objItem = self._mapNode.lvListMsgTrans:Find("objItem_" .. indexlvCount).gameObject
|
||||
else
|
||||
objItem = instantiate(self._mapNode.lv_Temp, self._mapNode.lvListMsgTrans)
|
||||
objItem.name = "objItem_" .. indexlvCount
|
||||
end
|
||||
local lv_commom_Pass = objItem.transform:Find("lv_commom_Pass").gameObject
|
||||
local lv_commom_Current = objItem.transform:Find("lv_commom_Current").gameObject
|
||||
local lv_commom_Lock = objItem.transform:Find("lv_commom_Lock").gameObject
|
||||
local lv_challenge_Pass = objItem.transform:Find("lv_challenge_Pass").gameObject
|
||||
local lv_challenge_Current = objItem.transform:Find("lv_challenge_Current").gameObject
|
||||
local lv_challenge_Lock = objItem.transform:Find("lv_challenge_Lock").gameObject
|
||||
local lv_commom_ChoosePass = objItem.transform:Find("lv_commom_ChoosePass").gameObject
|
||||
local lv_commom_ChooseCurrent = objItem.transform:Find("lv_commom_ChooseCurrent").gameObject
|
||||
local lv_commom_ChooseLock = objItem.transform:Find("lv_commom_ChooseLock").gameObject
|
||||
local lv_challenge_ChoosePass = objItem.transform:Find("lv_challenge_ChoosePass").gameObject
|
||||
local lv_challenge_ChooseCurrent = objItem.transform:Find("lv_challenge_ChooseCurrent").gameObject
|
||||
local lv_challenge_ChooseLock = objItem.transform:Find("lv_challenge_ChooseLock").gameObject
|
||||
if lv_commom_Pass ~= nil then
|
||||
lv_commom_Pass:SetActive(false)
|
||||
lv_commom_Current:SetActive(false)
|
||||
lv_commom_Lock:SetActive(false)
|
||||
lv_challenge_Pass:SetActive(false)
|
||||
lv_challenge_Current:SetActive(false)
|
||||
lv_challenge_Lock:SetActive(false)
|
||||
lv_commom_ChoosePass:SetActive(false)
|
||||
lv_commom_ChooseCurrent:SetActive(false)
|
||||
lv_commom_ChooseLock:SetActive(false)
|
||||
lv_challenge_ChoosePass:SetActive(false)
|
||||
lv_challenge_ChooseCurrent:SetActive(false)
|
||||
lv_challenge_ChooseLock:SetActive(false)
|
||||
do
|
||||
local pass = PlayerData.InfinityTower:JudgeLevelPass(self.selectTowerId, tmpData.Id)
|
||||
local current = PlayerData.InfinityTower:JudgeLevelCanChallenge(self.selectTowerId, tmpData.Id)
|
||||
local lock = PlayerData.InfinityTower:JudgeLevelLock(self.selectTowerId, tmpData.Id)
|
||||
if current then
|
||||
currentLvIndex = i
|
||||
end
|
||||
local clickCb = function(closeObj, txt, _index)
|
||||
self:ShowLvInfo(tmpData.Id, _index)
|
||||
if diffLevelCount == 5 then
|
||||
NovaAPI.SetLayoutGroupPadding(self._mapNode.lvListMsgTrans.gameObject, 0, math.floor(200 * xPre) + 40, -2, 0)
|
||||
elseif diffLevelCount == 6 then
|
||||
NovaAPI.SetLayoutGroupPadding(self._mapNode.lvListMsgTrans.gameObject, 0, math.floor(400 * xPre) + 40, -2, 0)
|
||||
elseif 6 < diffLevelCount then
|
||||
NovaAPI.SetLayoutGroupPadding(self._mapNode.lvListMsgTrans.gameObject, 0, math.floor(600 * xPre) + 40, -2, 0)
|
||||
end
|
||||
if self.tmpChooseObj ~= nil then
|
||||
self.tmpChooseObj:SetActive(false)
|
||||
end
|
||||
if self.tmpCloseObj ~= nil then
|
||||
self.tmpCloseObj:SetActive(true)
|
||||
end
|
||||
local _choosePass = PlayerData.InfinityTower:JudgeLevelPass(self.selectTowerId, tmpData.Id)
|
||||
local _chooseCurrent = PlayerData.InfinityTower:JudgeLevelCanChallenge(self.selectTowerId, tmpData.Id)
|
||||
local _chooseLock = PlayerData.InfinityTower:JudgeLevelLock(self.selectTowerId, tmpData.Id)
|
||||
if tmpData.LevelType ~= GameEnum.InfinityTowerLevelType.Challenge then
|
||||
if _choosePass then
|
||||
local _tex = lv_commom_ChoosePass.transform:Find("btn/lv_tex_commom_Pass_Choose"):GetComponent("TMP_Text")
|
||||
local _boss = lv_commom_ChoosePass.transform:Find("btn/lv_commom_Pass_Boss_Choose").gameObject
|
||||
_tex.gameObject:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Normal)
|
||||
_boss:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Boss)
|
||||
NovaAPI.SetTMPText(_tex, txt)
|
||||
lv_commom_ChoosePass:SetActive(true)
|
||||
self.tmpChooseObj = lv_commom_ChoosePass
|
||||
elseif _chooseCurrent then
|
||||
local _PNoPass = lv_commom_ChooseCurrent.transform:Find("lv_commom_Current_PNoPass_Choose").gameObject
|
||||
local _nextLineChoose = lv_commom_ChooseCurrent.transform:Find("lv_commom_Current_NextLine_Choose").gameObject
|
||||
local _tex = lv_commom_ChooseCurrent.transform:Find("btn/lv_tex_commom_Current_Choose"):GetComponent("TMP_Text")
|
||||
local _boss = lv_commom_ChooseCurrent.transform:Find("btn/lv_commom_Current_Boss_Choose").gameObject
|
||||
_PNoPass:SetActive(not firstPass)
|
||||
_tex.gameObject:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Normal)
|
||||
_boss:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Boss)
|
||||
NovaAPI.SetTMPText(_tex, txt)
|
||||
lv_commom_ChooseCurrent:SetActive(true)
|
||||
self.tmpChooseObj = lv_commom_ChooseCurrent
|
||||
if _choosePass then
|
||||
_nextLineChoose:SetActive(false)
|
||||
elseif _chooseLock then
|
||||
_PNoPass:SetActive(true)
|
||||
end
|
||||
elseif _chooseLock then
|
||||
local _tex = lv_commom_ChooseLock.transform:Find("btn/lv_tex_commom_Lock_Choose"):GetComponent("TMP_Text")
|
||||
local _boss = lv_commom_ChooseLock.transform:Find("btn/lv_commom_Lock_Boss_Choose").gameObject
|
||||
_tex.gameObject:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Normal)
|
||||
_boss:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Boss)
|
||||
NovaAPI.SetTMPText(_tex, txt)
|
||||
lv_commom_ChooseLock:SetActive(true)
|
||||
self.tmpChooseObj = lv_commom_ChooseLock
|
||||
end
|
||||
elseif _choosePass then
|
||||
local _tex = lv_challenge_ChoosePass.transform:Find("btn/lv_tex_challenge_Pass_Choose"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(_tex, txt)
|
||||
lv_challenge_ChoosePass:SetActive(true)
|
||||
self.tmpChooseObj = lv_challenge_ChoosePass
|
||||
elseif _chooseCurrent then
|
||||
local _PNoPass = lv_challenge_ChooseCurrent.transform:Find("lv_challenge_Current_PNoPass_Choose").gameObject
|
||||
local _nextLineChoose = lv_challenge_ChooseCurrent.transform:Find("lv_challenge_Current_NextLine_Choose").gameObject
|
||||
local _tex = lv_challenge_ChooseCurrent.transform:Find("btn/lv_tex_challenge_Current_Choose"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(_tex, txt)
|
||||
_PNoPass:SetActive(not firstPass)
|
||||
lv_challenge_ChooseCurrent:SetActive(true)
|
||||
self.tmpChooseObj = lv_challenge_ChooseCurrent
|
||||
if _choosePass then
|
||||
_nextLineChoose:SetActive(false)
|
||||
elseif _chooseLock then
|
||||
_PNoPass:SetActive(true)
|
||||
end
|
||||
elseif _chooseLock then
|
||||
local _tex = lv_challenge_ChooseLock.transform:Find("btn/lv_tex_challenge_Lock_Choose"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(_tex, txt)
|
||||
lv_challenge_ChooseLock:SetActive(true)
|
||||
self.tmpChooseObj = lv_challenge_ChooseLock
|
||||
end
|
||||
self.tmpCloseObj = closeObj
|
||||
closeObj:SetActive(false)
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(self._mapNode.lvListMsgTrans.gameObject:GetComponent("RectTransform"))
|
||||
if 4 < diffLevelCount and tmpData.Floor - firstFloor < 2 and endFloor - tmpData.Floor >= 2 then
|
||||
local waitOneFrame = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.lvListMsgTrans:DOLocalMoveX(0, 0.2)
|
||||
end
|
||||
cs_coroutine.start(waitOneFrame)
|
||||
elseif 4 < diffLevelCount and tmpData.Floor - firstFloor >= 2 and endFloor - tmpData.Floor >= 2 then
|
||||
local waitOneFrame = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.lvListMsgTrans:DOLocalMoveX(-(tmpData.Floor - firstFloor - 1) * 310 + 210, 0.2)
|
||||
end
|
||||
cs_coroutine.start(waitOneFrame)
|
||||
elseif 4 < diffLevelCount and endFloor - tmpData.Floor == 1 then
|
||||
local waitOneFrame = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.lvListMsgTrans:DOLocalMoveX(-(tmpData.Floor - firstFloor - 1) * 310 + 210, 0.2)
|
||||
end
|
||||
cs_coroutine.start(waitOneFrame)
|
||||
elseif 4 < diffLevelCount and endFloor - tmpData.Floor == 0 then
|
||||
local waitOneFrame = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.lvListMsgTrans:DOLocalMoveX(-(tmpData.Floor - firstFloor - 1) * 310 + 410, 0.2)
|
||||
end
|
||||
cs_coroutine.start(waitOneFrame)
|
||||
end
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.2)
|
||||
end
|
||||
if tmpData.LevelType ~= GameEnum.InfinityTowerLevelType.Challenge then
|
||||
local strIndex = indexlvCount
|
||||
if indexlvCount < 10 then
|
||||
strIndex = "0" .. indexlvCount
|
||||
end
|
||||
if current == true then
|
||||
local lv_commom_Current_PNoPass = lv_commom_Current.transform:Find("lv_commom_Current_PNoPass").gameObject
|
||||
local lv_tex_commom_Current = lv_commom_Current.transform:Find("btn/lv_tex_commom_Current"):GetComponent("TMP_Text")
|
||||
local lv_commom_Current_Boss = lv_commom_Current.transform:Find("btn/lv_commom_Current_Boss").gameObject
|
||||
lv_commom_Current_PNoPass:SetActive(not firstPass)
|
||||
lv_tex_commom_Current.gameObject:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Normal)
|
||||
lv_commom_Current_Boss:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Boss)
|
||||
NovaAPI.SetTMPText(lv_tex_commom_Current, orderedFormat(ConfigTable.GetUIText("InfinityTower_Lv_Index"), strIndex))
|
||||
lv_commom_Current:SetActive(true)
|
||||
local btn = lv_commom_Current.transform:Find("btn"):GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local tmpClick = function()
|
||||
clickCb(lv_commom_Current, NovaAPI.GetTMPText(lv_tex_commom_Current), strIndex)
|
||||
end
|
||||
CurrentClick = tmpClick
|
||||
btn.onClick:AddListener(tmpClick)
|
||||
end
|
||||
if pass == true then
|
||||
local lv_tex_commom_Pass = lv_commom_Pass.transform:Find("btn/lv_tex_commom_Pass"):GetComponent("TMP_Text")
|
||||
local lv_commom_Pass_Boss = lv_commom_Pass.transform:Find("btn/lv_commom_Pass_Boss").gameObject
|
||||
lv_tex_commom_Pass.gameObject:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Normal)
|
||||
lv_commom_Pass_Boss:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Boss)
|
||||
NovaAPI.SetTMPText(lv_tex_commom_Pass, orderedFormat(ConfigTable.GetUIText("InfinityTower_Lv_Index"), strIndex))
|
||||
lv_commom_Pass:SetActive(true)
|
||||
local btn = lv_commom_Pass.transform:Find("btn"):GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local tmpClick = function()
|
||||
clickCb(lv_commom_Pass, NovaAPI.GetTMPText(lv_tex_commom_Pass), strIndex)
|
||||
end
|
||||
if diffPassAll and tmpData.Floor == endFloor then
|
||||
CurrentClick = tmpClick
|
||||
end
|
||||
btn.onClick:AddListener(tmpClick)
|
||||
end
|
||||
if lock == true then
|
||||
do
|
||||
local lv_commom_Lock_Boss = lv_commom_Lock.transform:Find("btn/lv_commom_Lock_Boss").gameObject
|
||||
local lv_tex_commom_Lock = lv_commom_Lock.transform:Find("btn/lv_tex_commom_Lock"):GetComponent("TMP_Text")
|
||||
lv_tex_commom_Lock.gameObject:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Normal)
|
||||
lv_commom_Lock_Boss:SetActive(tmpData.LevelType == GameEnum.InfinityTowerLevelType.Boss)
|
||||
NovaAPI.SetTMPText(lv_tex_commom_Lock, orderedFormat(ConfigTable.GetUIText("InfinityTower_Lv_Index"), strIndex))
|
||||
lv_commom_Lock:SetActive(true)
|
||||
local btn = lv_commom_Lock.transform:Find("btn"):GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local tmpClick = function()
|
||||
clickCb(lv_commom_Lock, NovaAPI.GetTMPText(lv_tex_commom_Lock), strIndex)
|
||||
end
|
||||
btn.onClick:AddListener(tmpClick)
|
||||
end
|
||||
end
|
||||
else
|
||||
local strIndex = indexlvCount
|
||||
if indexSpecialCount < 10 then
|
||||
strIndex = "0" .. indexSpecialCount
|
||||
end
|
||||
if current == true then
|
||||
local lv_challenge_Current_PNoPass = lv_challenge_Current.transform:Find("lv_challenge_Current_PNoPass").gameObject
|
||||
local lv_tex_challenge_Current = lv_challenge_Current.transform:Find("btn/lv_tex_challenge_Current"):GetComponent("TMP_Text")
|
||||
lv_challenge_Current_PNoPass:SetActive(not firstPass)
|
||||
NovaAPI.SetTMPText(lv_tex_challenge_Current, orderedFormat(ConfigTable.GetUIText("InfinityTower_SpecialLv_Index"), strIndex))
|
||||
lv_challenge_Current:SetActive(true)
|
||||
local btn = lv_challenge_Current.transform:Find("btn"):GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local tmpClick = function()
|
||||
clickCb(lv_challenge_Current, NovaAPI.GetTMPText(lv_tex_challenge_Current), strIndex)
|
||||
end
|
||||
CurrentClick = tmpClick
|
||||
btn.onClick:AddListener(tmpClick)
|
||||
end
|
||||
if pass == true then
|
||||
local lv_tex_challenge_Pass = lv_challenge_Pass.transform:Find("btn/lv_tex_challenge_Pass"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(lv_tex_challenge_Pass, orderedFormat(ConfigTable.GetUIText("InfinityTower_SpecialLv_Index"), strIndex))
|
||||
lv_challenge_Pass:SetActive(true)
|
||||
local btn = lv_challenge_Pass.transform:Find("btn"):GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local tmpClick = function()
|
||||
clickCb(lv_challenge_Pass, NovaAPI.GetTMPText(lv_tex_challenge_Pass), strIndex)
|
||||
end
|
||||
if diffPassAll and tmpData.Floor == endFloor then
|
||||
CurrentClick = tmpClick
|
||||
end
|
||||
btn.onClick:AddListener(tmpClick)
|
||||
end
|
||||
if lock == true then
|
||||
do
|
||||
local lv_tex_challenge_Lock = lv_challenge_Lock.transform:Find("btn/lv_tex_challenge_Lock"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(lv_tex_challenge_Lock, orderedFormat(ConfigTable.GetUIText("InfinityTower_SpecialLv_Index"), strIndex))
|
||||
lv_challenge_Lock:SetActive(true)
|
||||
local btn = lv_challenge_Lock.transform:Find("btn"):GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local tmpClick = function()
|
||||
clickCb(lv_challenge_Lock, NovaAPI.GetTMPText(lv_tex_challenge_Lock), strIndex)
|
||||
end
|
||||
btn.onClick:AddListener(tmpClick)
|
||||
end
|
||||
end
|
||||
end
|
||||
objItem:SetActive(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
self._mapNode.lv_firstTemp:SetActive(true)
|
||||
self._mapNode.lv_endTemp:SetActive(true)
|
||||
self._mapNode.lv_endTemp.transform:SetAsLastSibling()
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(self._mapNode.lvListMsgTrans.gameObject:GetComponent("RectTransform"))
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
if CurrentClick then
|
||||
CurrentClick()
|
||||
end
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function InfinityTowerLvList:ShowLvInfo(levelId, index)
|
||||
self.ChooseLevelId = levelId
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", levelId)
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_lvmsgTop_LvIndex, orderedFormat(ConfigTable.GetUIText("InfinityTower_Lv_IndexSpace"), index))
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_lvmsgTop_LvName, lvData.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_lvmsgTop_ReLvCount, lvData.RecommendLv)
|
||||
local sScore = "Icon/BuildRank/BuildRank_" .. lvData.RecommendBuildRank
|
||||
self:SetPngSprite(self._mapNode.img_lvmsgTop_ReCon, sScore)
|
||||
local childRewardCount = self._mapNode.lvmsgBot_RewardRoot.childCount
|
||||
for i = 1, childRewardCount do
|
||||
self._mapNode.lvmsgBot_RewardRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local tbItem = {}
|
||||
local _base = decodeJson(lvData.BaseAwardPreview)
|
||||
for k, v in ipairs(_base) do
|
||||
table.insert(tbItem, {
|
||||
id = v[1],
|
||||
count = UTILS.ParseRewardItemCount(v)
|
||||
})
|
||||
end
|
||||
local index = 1
|
||||
for i, v in pairs(tbItem) do
|
||||
local objItem
|
||||
if index > self._mapNode.lvmsgBot_RewardRoot.childCount then
|
||||
objItem = instantiate(self._mapNode.lvmsgBot_RewardItem, self._mapNode.lvmsgBot_RewardRoot)
|
||||
else
|
||||
objItem = self._mapNode.lvmsgBot_RewardRoot:GetChild(index - 1).gameObject
|
||||
end
|
||||
local btn = objItem:GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local clickCb = function()
|
||||
self:ShowItemTips(v.id, btn.gameObject)
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
objItem:SetActive(true)
|
||||
local isGet = PlayerData.InfinityTower:JudgeLevelPass(self.selectTowerId, levelId)
|
||||
local _objR = objItem.transform:Find("AniRoot/RewardItem").gameObject
|
||||
self.rewardItem[_objR] = self:BindCtrlByNode(_objR, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
self.rewardItem[_objR]:SetItem(v.id, nil, v.count, nil, isGet, nil, nil, true)
|
||||
index = index + 1
|
||||
end
|
||||
local childAffixCount = self._mapNode.lvmsgBot_affixSCRoot.childCount
|
||||
for i = 1, childAffixCount do
|
||||
self._mapNode.lvmsgBot_affixSCRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local flData = ConfigTable.GetData("InfinityTowerFloor", lvData.FloorId)
|
||||
local tabAffixId = flData.AffixId
|
||||
local indexAffix = 1
|
||||
if lvData.EntryCond ~= 0 then
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.lvmsgBot_affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.lvmsgBot_affix_Item, self._mapNode.lvmsgBot_affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.lvmsgBot_affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, 0, false, false, lvData.EntryCond, lvData.EntryCondParam)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
for i = 1, #tabAffixId do
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.lvmsgBot_affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.lvmsgBot_affix_Item, self._mapNode.lvmsgBot_affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.lvmsgBot_affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
local affixId = 0
|
||||
if tabAffixId[i] ~= nil then
|
||||
affixId = tabAffixId[i]
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, affixId, true, false, nil, nil)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
if indexAffix < 5 then
|
||||
local tmpIndex = indexAffix + 1
|
||||
for i = tmpIndex, 5 do
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.lvmsgBot_affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.lvmsgBot_affix_Item, self._mapNode.lvmsgBot_affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.lvmsgBot_affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, 0, false, true, nil, nil)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
end
|
||||
self._mapNode.lvmsgRoot:SetActive(true)
|
||||
local zPos = 700
|
||||
if self.gameObject:GetComponent("RectTransform").rect.width == 2160 then
|
||||
zPos = 780
|
||||
end
|
||||
NovaAPI.SetRectMaskPadding(self._mapNode.lvListMsgView, 0, 0, zPos, 0)
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(self._mapNode.lvmsgBot_affixSCRoot.gameObject:GetComponent("RectTransform"))
|
||||
local _isPass = PlayerData.InfinityTower:JudgeLevelPass(self.selectTowerId, self.ChooseLevelId)
|
||||
local _isOpenDay = PlayerData.InfinityTower:CheckOpenDay(self.selectTowerId)
|
||||
local _isNextLvNext = PlayerData.InfinityTower:JudgeLevelLock(self.selectTowerId, self.ChooseLevelId)
|
||||
self._mapNode.obj_lvMsgPass:SetActive(_isPass)
|
||||
self._mapNode.obj_lvMsgDontOpen:SetActive(_isNextLvNext)
|
||||
self._mapNode.btn_go.gameObject:SetActive(false)
|
||||
self._mapNode.obj_lvMsgDontOpenDay:SetActive(false)
|
||||
if _isOpenDay then
|
||||
self._mapNode.btn_go.gameObject:SetActive(not _isPass and not _isNextLvNext)
|
||||
elseif not _isNextLvNext and not _isPass then
|
||||
self._mapNode.obj_lvMsgDontOpenDay:SetActive(true)
|
||||
end
|
||||
end
|
||||
function InfinityTowerLvList:ShowItemTips(nTid, rtBtn)
|
||||
UTILS.ClickItemGridWithTips(nTid, rtBtn, false, true, false)
|
||||
end
|
||||
function InfinityTowerLvList:ShowAffixItemMsg(obj, affixId, isAffix, isEmpty, entryCond, entryCondParam)
|
||||
obj:SetActive(true)
|
||||
local lvmsgBot_affix_Item_1 = obj.transform:Find("lvmsgBot_affix_Item_1").gameObject
|
||||
local lvmsgBot_affix_Item_2 = obj.transform:Find("lvmsgBot_affix_Item_2").gameObject
|
||||
local lvmsgBot_affix_Item_3 = obj.transform:Find("lvmsgBot_affix_Item_3").gameObject
|
||||
local lvmsgBot_affix_Item_4 = obj.transform:Find("lvmsgBot_affix_Item_4").gameObject
|
||||
lvmsgBot_affix_Item_1:SetActive(false)
|
||||
lvmsgBot_affix_Item_2:SetActive(false)
|
||||
lvmsgBot_affix_Item_3:SetActive(false)
|
||||
lvmsgBot_affix_Item_4:SetActive(false)
|
||||
if isAffix then
|
||||
lvmsgBot_affix_Item_1:SetActive(true)
|
||||
local tex_1 = lvmsgBot_affix_Item_1.transform:Find("tex_lvmsgBot_affix_Item_1"):GetComponent("TMP_Text")
|
||||
local dataAffix = ConfigTable.GetData("InfinityTowerAffix", affixId)
|
||||
local sDesc = orderedFormat(ConfigTable.GetUIText("InfinityTowerAffix_Desc"), dataAffix.Name, dataAffix.Desc)
|
||||
NovaAPI.SetTMPText(tex_1, UTILS.ParseParamDesc(sDesc, dataAffix))
|
||||
elseif isEmpty then
|
||||
lvmsgBot_affix_Item_4:SetActive(true)
|
||||
else
|
||||
lvmsgBot_affix_Item_2:SetActive(true)
|
||||
local tex_2Title = lvmsgBot_affix_Item_2.transform:Find("tex_lvmsgBot_affix_Item_2/Image/tex_lvmsgBot_affix_Item_2Title"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(tex_2Title, ConfigTable.GetUIText("InfinityTower_Limit_March"))
|
||||
local tex_2 = lvmsgBot_affix_Item_2.transform:Find("tex_lvmsgBot_affix_Item_2"):GetComponent("TMP_Text")
|
||||
local strElement = ConfigTable.GetUIText("ELEMENT_" .. entryCondParam[1])
|
||||
if entryCond == GameEnum.InfinityTowerCond.MasterCharactersWithSpecificElementType then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificElementType"), strElement))
|
||||
elseif entryCond == GameEnum.InfinityTowerCond.ElementTypeWithSpecificQuantityNoLessThanQuantity then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificQuantityNoLessThanQuantity"), strElement, entryCondParam[2]))
|
||||
elseif entryCond == GameEnum.InfinityTowerCond.ElementTypeWithSpecificQuantityNoMoreThanQuantity then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificQuantityNoMoreThanQuantity"), strElement, entryCondParam[2]))
|
||||
end
|
||||
end
|
||||
end
|
||||
function InfinityTowerLvList:OnClickMonsterInfo()
|
||||
EventManager.Hit("OpenInfinityTowerMonsterInfo", self.ChooseLevelId)
|
||||
end
|
||||
function InfinityTowerLvList:OnClickCloseLvMsgRoot()
|
||||
self._mapNode.lvmsgRoot:SetActive(false)
|
||||
NovaAPI.SetRectMaskPadding(self._mapNode.lvListMsgView, 0, 0, 0, 0)
|
||||
end
|
||||
function InfinityTowerLvList:OnClickGo()
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", self.ChooseLevelId)
|
||||
local _isPass = PlayerData.InfinityTower:JudgeLevelPass(self.selectTowerId, self.ChooseLevelId)
|
||||
local _isOpenDay = PlayerData.InfinityTower:CheckOpenDay(self.selectTowerId)
|
||||
local _isNextLvNext = PlayerData.InfinityTower:JudgeLevelLock(self.selectTowerId, self.ChooseLevelId)
|
||||
local _isLockWorldClass = PlayerData.InfinityTower:CheckLockWorldClass(self.ChooseLevelId)
|
||||
local towerData = ConfigTable.GetData("InfinityTower", self.selectTowerId)
|
||||
local isUnLock = PlayerData.InfinityTower:CheckTowerUnLock(self.selectTowerId, towerData.PreTowerLevelId)
|
||||
if _isPass then
|
||||
local strTips = ConfigTable.GetUIText("RoguelikeBuild_Manage_FilterPass")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
elseif not _isOpenDay then
|
||||
local strTips = ConfigTable.GetUIText("RegionBoss_Unlock_OpenDay")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
elseif _isNextLvNext then
|
||||
local strTips = ConfigTable.GetUIText("InfinityTower_Lock_Level")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
elseif _isLockWorldClass then
|
||||
local strTips = ConfigTable.GetUIText("InfinityTower_Lock_WorldClass")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
elseif not isUnLock then
|
||||
local strTips = orderedFormat(ConfigTable.GetUIText("InfinityTower_LockTips"), towerData.Name)
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
end
|
||||
PlayerData.InfinityTower:SetAutoNextLv(false)
|
||||
self._mapNode.lvmsgRoot:SetActive(false)
|
||||
NovaAPI.SetRectMaskPadding(self._mapNode.lvListMsgView, 0, 0, 0, 0)
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.RegionBossFormation, AllEnum.RegionBossFormationType.InfinityTower, lvData.Id, {})
|
||||
end
|
||||
function InfinityTowerLvList:CloseLvList()
|
||||
self.gameObject:SetActive(false)
|
||||
end
|
||||
function InfinityTowerLvList:OnDestroy()
|
||||
for go, ctrl in ipairs(self.rewardItem) do
|
||||
self:UnbindCtrlByNode(ctrl)
|
||||
end
|
||||
self.rewardItem = {}
|
||||
self.parent = nil
|
||||
end
|
||||
return InfinityTowerLvList
|
||||
@@ -0,0 +1,355 @@
|
||||
local InfinityTowerPauseCtrl = class("InfinityTowerPauseCtrl", BaseCtrl)
|
||||
local AdventureModuleHelper = CS.AdventureModuleHelper
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
local LayoutRebuilder = CS.UnityEngine.UI.LayoutRebuilder
|
||||
InfinityTowerPauseCtrl._mapNodeConfig = {
|
||||
aniBlur = {sComponentName = "Animator"},
|
||||
btnBlur = {
|
||||
sNodeName = "snapshot",
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
safeAreaRoot = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
aniWindow = {sNodeName = "--Window--", sComponentName = "Animator"},
|
||||
txtWindowTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MainBattle_Pause"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
btnGiveUp = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_End",
|
||||
sAction = "Giveup"
|
||||
},
|
||||
btnBack = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Close",
|
||||
sAction = "Back"
|
||||
},
|
||||
btnSettings = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Settings"
|
||||
},
|
||||
btnPopSkill = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Skill"
|
||||
},
|
||||
ActionBar = {
|
||||
sCtrlName = "Game.UI.ActionBar.ActionBarCtrl"
|
||||
},
|
||||
txtGiveUp = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Pause_Btn_EndBattle"
|
||||
},
|
||||
txtBack = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Pause_Btn_ContinueBattle"
|
||||
},
|
||||
txtBtnSkill = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "StarTowerMap_Btn_Skill"
|
||||
},
|
||||
txtBtnSettings = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "StarTowerMap_Btn_Settings"
|
||||
},
|
||||
txtTime = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MainBattle_Time"
|
||||
},
|
||||
txtTarget = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MainBattle_Task"
|
||||
},
|
||||
texAffix = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Affix"
|
||||
},
|
||||
texMonsterPre = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Monster_Preview"
|
||||
},
|
||||
texTask1 = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Task_Target"
|
||||
},
|
||||
texNone = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_EnemyInfo_None"
|
||||
},
|
||||
texTimeCount = {sComponentName = "TMP_Text"},
|
||||
affixSCRoot = {sComponentName = "Transform"},
|
||||
affix_ItemList = {},
|
||||
monSV = {
|
||||
sComponentName = "LoopScrollView"
|
||||
}
|
||||
}
|
||||
InfinityTowerPauseCtrl._mapEventConfig = {
|
||||
show_Infinity_Pause = "OnEvent_ShowInfinityPause",
|
||||
GamepadUIReopen = "OnEvent_Reopen"
|
||||
}
|
||||
function InfinityTowerPauseCtrl:Awake()
|
||||
self._mapNode.safeAreaRoot:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
local tbConfig = {
|
||||
{
|
||||
sAction = "Skill",
|
||||
sLang = "StarTowerMap_Btn_Skill"
|
||||
},
|
||||
{
|
||||
sAction = "Settings",
|
||||
sLang = "StarTowerMap_Btn_Settings"
|
||||
}
|
||||
}
|
||||
self._mapNode.ActionBar:InitActionBar(tbConfig)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:FadeIn()
|
||||
end
|
||||
function InfinityTowerPauseCtrl:FadeOut()
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnEnable()
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnDisable()
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnDestroy()
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnRelease()
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnEvent_ShowInfinityPause(runTime, tbChar)
|
||||
self.tbChar = tbChar
|
||||
EventManager.Hit(EventId.BattleDashboardVisible, false)
|
||||
PanelManager.InputDisable()
|
||||
local lvId = PlayerData.InfinityTower:GetCurrentLv()
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", lvId)
|
||||
local flId = lvData.FloorId
|
||||
local flData = ConfigTable.GetData("InfinityTowerFloor", flId)
|
||||
self:ShowPanelMonsterList(flData.PreviewMonsterGroupId)
|
||||
self:ShowAffixItem(lvId)
|
||||
self:PlayInAni()
|
||||
self:ShowRunTime(runTime)
|
||||
GamepadUIManager.EnableGamepadUI("InfinityTowerPauseCtrl", self.tbGamepadUINode)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:ShowRunTime(runTime)
|
||||
local min = math.floor(runTime / 60)
|
||||
local sec = runTime - min * 60
|
||||
local strMin = tostring(min)
|
||||
if min < 10 then
|
||||
strMin = "0" .. strMin
|
||||
end
|
||||
local strSec = tostring(sec)
|
||||
if sec < 10 then
|
||||
strSec = "0" .. strSec
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.texTimeCount, string.format("%s:%s", strMin, strSec))
|
||||
end
|
||||
function InfinityTowerPauseCtrl:PlayInAni()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.safeAreaRoot:SetActive(true)
|
||||
self._mapNode.aniWindow:Play("t_window_04_t_in")
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.3)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:ShowAffixItem(levelId)
|
||||
local childCount = self._mapNode.affixSCRoot.childCount
|
||||
for i = 1, childCount do
|
||||
self._mapNode.affixSCRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", levelId)
|
||||
local flData = ConfigTable.GetData("InfinityTowerFloor", lvData.FloorId)
|
||||
local tabAffixId = flData.AffixId
|
||||
local indexAffix = 1
|
||||
if lvData.EntryCond ~= 0 then
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.affix_ItemList, self._mapNode.affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, 0, false, false, lvData.EntryCond, lvData.EntryCondParam)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
for i = 1, #tabAffixId do
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.affix_ItemList, self._mapNode.affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
local affixId = 0
|
||||
if tabAffixId[i] ~= nil then
|
||||
affixId = tabAffixId[i]
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, affixId, true, false, nil, nil)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
if indexAffix < 5 then
|
||||
local tmpIndex = indexAffix + 1
|
||||
for i = tmpIndex, 5 do
|
||||
local obj
|
||||
if indexAffix + 1 > self._mapNode.affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.affix_ItemList, self._mapNode.affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.affixSCRoot:GetChild(indexAffix).gameObject
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, 0, false, true, nil, nil)
|
||||
indexAffix = indexAffix + 1
|
||||
end
|
||||
end
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(self._mapNode.affixSCRoot.gameObject:GetComponent("RectTransform"))
|
||||
end
|
||||
function InfinityTowerPauseCtrl:ShowAffixItemMsg(obj, affixId, isAffix, isEmpty, entryCond, entryCondParam)
|
||||
obj:SetActive(true)
|
||||
local goNextMsg_affix_Item_1 = obj.transform:Find("lvmsgBot_affix_Item_1").gameObject
|
||||
local goNextMsg_affix_Item_2 = obj.transform:Find("lvmsgBot_affix_Item_2").gameObject
|
||||
local goNextMsg_affix_Item_3 = obj.transform:Find("lvmsgBot_affix_Item_3").gameObject
|
||||
local goNextMsg_affix_Item_4 = obj.transform:Find("lvmsgBot_affix_Item_4").gameObject
|
||||
goNextMsg_affix_Item_1:SetActive(false)
|
||||
goNextMsg_affix_Item_2:SetActive(false)
|
||||
goNextMsg_affix_Item_3:SetActive(false)
|
||||
goNextMsg_affix_Item_4:SetActive(false)
|
||||
if isAffix then
|
||||
goNextMsg_affix_Item_1:SetActive(true)
|
||||
local tex_1 = goNextMsg_affix_Item_1.transform:Find("tex_lvmsgBot_affix_Item_1"):GetComponent("TMP_Text")
|
||||
local dataAffix = ConfigTable.GetData("InfinityTowerAffix", affixId)
|
||||
local sDesc = orderedFormat(ConfigTable.GetUIText("InfinityTowerAffix_Desc"), dataAffix.Name, dataAffix.Desc)
|
||||
NovaAPI.SetTMPText(tex_1, UTILS.ParseParamDesc(sDesc, dataAffix))
|
||||
elseif isEmpty then
|
||||
goNextMsg_affix_Item_4:SetActive(true)
|
||||
else
|
||||
goNextMsg_affix_Item_2:SetActive(true)
|
||||
local tex_2Title = goNextMsg_affix_Item_2.transform:Find("tex_lvmsgBot_affix_Item_2/Image/tex_lvmsgBot_affix_Item_2Title"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(tex_2Title, ConfigTable.GetUIText("InfinityTower_Limit_March"))
|
||||
local tex_2 = goNextMsg_affix_Item_2.transform:Find("tex_lvmsgBot_affix_Item_2"):GetComponent("TMP_Text")
|
||||
local strElement = ConfigTable.GetUIText("ELEMENT_" .. entryCondParam[1])
|
||||
if entryCond == GameEnum.InfinityTowerCond.MasterCharactersWithSpecificElementType then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificElementType"), strElement))
|
||||
elseif entryCond == GameEnum.InfinityTowerCond.ElementTypeWithSpecificQuantityNoLessThanQuantity then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificQuantityNoLessThanQuantity"), strElement, entryCondParam[2]))
|
||||
elseif entryCond == GameEnum.InfinityTowerCond.ElementTypeWithSpecificQuantityNoMoreThanQuantity then
|
||||
NovaAPI.SetTMPText(tex_2, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_SpecificQuantityNoMoreThanQuantity"), strElement, entryCondParam[2]))
|
||||
end
|
||||
end
|
||||
end
|
||||
function InfinityTowerPauseCtrl:ShowPanelMonsterList(nPreviewMonsterGroupId)
|
||||
local tbMonsterGroup = ConfigTable.GetData("PreviewMonsterGroup", nPreviewMonsterGroupId)
|
||||
if tbMonsterGroup == nil then
|
||||
return
|
||||
end
|
||||
self.tbMonster = tbMonsterGroup.MonsterIds
|
||||
if self.tbMonster == nil or #self.tbMonster == 0 then
|
||||
return
|
||||
end
|
||||
local bOpen = true
|
||||
for _, v in ipairs(self.tbMonster) do
|
||||
local monsterCfg = ConfigTable.GetData("Monster", v)
|
||||
if nil == monsterCfg then
|
||||
printError("读取PreviewMonsterList配置失败!!!monsterId = " .. v.PreviewMonsterListId)
|
||||
bOpen = false
|
||||
end
|
||||
end
|
||||
if not bOpen then
|
||||
return
|
||||
end
|
||||
local comp = function(a, b)
|
||||
local monsterA = ConfigTable.GetData("Monster", a)
|
||||
local monsterB = ConfigTable.GetData("Monster", b)
|
||||
if monsterA == nil or monsterB == nil then
|
||||
return
|
||||
end
|
||||
if monsterA.EpicLv ~= monsterB.EpicLv then
|
||||
return monsterA.EpicLv < monsterB.EpicLv
|
||||
else
|
||||
return a < b
|
||||
end
|
||||
end
|
||||
table.sort(self.tbMonster, comp)
|
||||
if #self.tbMonster > 0 then
|
||||
self._mapNode.monSV:Init(#self.tbMonster, self, self.RefreshMonsterGrid)
|
||||
end
|
||||
self._mapNode.texNone.gameObject:SetActive(#self.tbMonster == 0)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:RefreshMonsterGrid(goGrid, gridIndex)
|
||||
local index = gridIndex + 1
|
||||
local nMonsterId = self.tbMonster[index]
|
||||
if nMonsterId == 0 then
|
||||
return
|
||||
end
|
||||
local imgIcon = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Basic--/imgIcon"):GetComponent("Image")
|
||||
local goSelect = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Common--").gameObject
|
||||
local goBoss = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Monster--/goBoss").gameObject
|
||||
local goLeader = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Monster--/goLeader").gameObject
|
||||
local goElite = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Monster--/goElite").gameObject
|
||||
local btn = goGrid.transform:Find("btnGrid"):GetComponent("UIButton")
|
||||
local mData = ConfigTable.GetData("Monster", nMonsterId)
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local _strLv = ""
|
||||
local clickCb = function()
|
||||
local mapData = {nTid = nMonsterId, strLv = _strLv}
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MonsterTips, btn.gameObject, mapData)
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
if nil == mSkin then
|
||||
printError("读取MonsterSkin配置失败!!!skinId = " .. mData.FAId)
|
||||
return
|
||||
end
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
if nil == mManual then
|
||||
printError("读取MonsterSkin配置失败!!!MonsterManualId = " .. mSkin.MonsterManual)
|
||||
return
|
||||
end
|
||||
if nil ~= mData then
|
||||
self:SetPngSprite(imgIcon, mManual.Icon)
|
||||
goSelect:SetActive(self.curSelect == index)
|
||||
goBoss:SetActive(mData.EpicLv == GameEnum.monsterEpicType.LORD)
|
||||
goLeader:SetActive(mData.EpicLv == GameEnum.monsterEpicType.LEADER)
|
||||
goElite:SetActive(mData.EpicLv == GameEnum.monsterEpicType.ELITE)
|
||||
end
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnBtnClick_End()
|
||||
self:PlayCloseAni(true)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnBtnClick_Close()
|
||||
self:PlayCloseAni(false)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:PlayCloseAni(bGiveUp)
|
||||
self._mapNode.aniWindow:Play("t_window_04_t_out")
|
||||
self._mapNode.aniBlur:SetTrigger("tOut")
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.2)
|
||||
self:AddTimer(1, 0.2, "OnPanelClose", true, true, true, bGiveUp)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnPanelClose(_, bGiveUp)
|
||||
PanelManager.InputEnable()
|
||||
GamepadUIManager.DisableGamepadUI("InfinityTowerPauseCtrl")
|
||||
EventManager.Hit(EventId.BattleDashboardVisible, true)
|
||||
self._mapNode.aniBlur.gameObject:SetActive(false)
|
||||
self._mapNode.safeAreaRoot:SetActive(false)
|
||||
if bGiveUp then
|
||||
EventManager.Hit(EventId.AbandonBattle)
|
||||
end
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnBtnClick_Skill(btn)
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.PopupSkillPanel, self.tbChar, true)
|
||||
self._mapNode.ActionBar.gameObject:SetActive(false)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnBtnClick_Settings(btn)
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.BattleSettings)
|
||||
self._mapNode.ActionBar.gameObject:SetActive(false)
|
||||
end
|
||||
function InfinityTowerPauseCtrl:OnEvent_Reopen(sName)
|
||||
if sName ~= "InfinityTowerPauseCtrl" then
|
||||
return
|
||||
end
|
||||
self._mapNode.ActionBar.gameObject:SetActive(true)
|
||||
end
|
||||
return InfinityTowerPauseCtrl
|
||||
@@ -0,0 +1,184 @@
|
||||
local InfinityTowerPlot = class("InfinityTowerPlot", BaseCtrl)
|
||||
InfinityTowerPlot._mapNodeConfig = {
|
||||
goPlot = {},
|
||||
tex_plot_Title = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Plot_Review"
|
||||
},
|
||||
plotList = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
goPlotRoot = {},
|
||||
rtWindowAni = {sNodeName = "rtWindow", sComponentName = "Animator"},
|
||||
txtGoPlotTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Plot_Review"
|
||||
},
|
||||
cancelPlotAvgBtnTex = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MessageBox_Cancel"
|
||||
},
|
||||
goPlotAvgBtnTex = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "WorldMap_MainLine_Avg_Btn"
|
||||
},
|
||||
txtGoPlotReward = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "STRanking_Reward_Btn"
|
||||
},
|
||||
goPlotRootMask = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtn_ClickCloseGoPlotPanel"
|
||||
},
|
||||
btnGoPlotClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtn_ClickCloseGoPlotPanel"
|
||||
},
|
||||
btnCancelGoPlot = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtn_ClickCloseGoPlotPanel"
|
||||
},
|
||||
btnSureGoPlot = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtn_ClickPlayPlot"
|
||||
},
|
||||
goRewardInfo = {},
|
||||
goPlotLvNum = {sComponentName = "TMP_Text"},
|
||||
goPlotLvName = {sComponentName = "TMP_Text"},
|
||||
goPlotLvDes = {sComponentName = "TMP_Text"},
|
||||
imgGoPlotReward = {sComponentName = "Image"},
|
||||
txtGoPlotRewardCount = {sComponentName = "TMP_Text"}
|
||||
}
|
||||
InfinityTowerPlot._mapEventConfig = {
|
||||
Refresh_Infinity_PlotList = "OnEvent_RefreshInfinityPlotList"
|
||||
}
|
||||
function InfinityTowerPlot:OpenPlotView()
|
||||
self.AniRoot = self.gameObject:GetComponent("Animator")
|
||||
self._mapNode.goPlot.gameObject:SetActive(false)
|
||||
local wait = function()
|
||||
self:InitPlotMsg()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self.AniRoot.enabled = true
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.goPlot.gameObject:SetActive(true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
self.gameObject:SetActive(true)
|
||||
end
|
||||
function InfinityTowerPlot:InitPlotMsg()
|
||||
local count = 0
|
||||
self.tabPlot = {}
|
||||
local foreach_Base = function(baseData)
|
||||
count = count + 1
|
||||
self.tabPlot[count] = baseData
|
||||
end
|
||||
ForEachTableLine(DataTable.InfinityTowerPlot, foreach_Base)
|
||||
self._mapNode.plotList:Init(count, self, self.InitPlotList)
|
||||
local tmpCount = 1
|
||||
for i = 1, count do
|
||||
if PlayerData.InfinityTower:GetPlotUnLock(self.tabPlot[i].Id) and not PlayerData.InfinityTower:GetPlotGetReward(self.tabPlot[i].Id) then
|
||||
tmpCount = i
|
||||
break
|
||||
end
|
||||
end
|
||||
if 0 < count then
|
||||
self._mapNode.plotList:SetScrollGridPos(tmpCount, 0.1, 0)
|
||||
end
|
||||
end
|
||||
function InfinityTowerPlot:OnEvent_RefreshInfinityPlotList()
|
||||
self:InitPlotMsg()
|
||||
end
|
||||
function InfinityTowerPlot:InitPlotList(goGrid, gridIndex)
|
||||
local index = gridIndex + 1
|
||||
local plotData = self.tabPlot[index]
|
||||
local isUnLock = PlayerData.InfinityTower:GetPlotUnLock(plotData.Id)
|
||||
local plot_item_bg = goGrid.transform:Find("gridRt/plot_item_bg"):GetComponent("Image")
|
||||
local unlock = goGrid.transform:Find("gridRt/unlock").gameObject
|
||||
local lock = goGrid.transform:Find("gridRt/lock").gameObject
|
||||
if isUnLock then
|
||||
NovaAPI.SetImageColor(plot_item_bg, Color(1, 1, 1, 1))
|
||||
unlock:SetActive(true)
|
||||
lock:SetActive(false)
|
||||
local plot_item_Index = unlock.transform:Find("plot_item_Index"):GetComponent("TMP_Text")
|
||||
local plot_item_Name = unlock.transform:Find("plot_item_Name"):GetComponent("TMP_Text")
|
||||
local plot_item_Reward = unlock.transform:Find("plot_item_Reward").gameObject
|
||||
local plot_item_RewardReview = unlock.transform:Find("plot_item_RewardReview"):GetComponent("UIButton")
|
||||
local redDot = unlock.transform:Find("redDot").gameObject
|
||||
local isGet = PlayerData.InfinityTower:GetPlotGetReward(plotData.Id)
|
||||
if isGet then
|
||||
plot_item_Reward:SetActive(false)
|
||||
redDot:SetActive(false)
|
||||
else
|
||||
local plot_item_RewardIcon = unlock.transform:Find("plot_item_Reward/plot_item_RewardIcon"):GetComponent("Image")
|
||||
local plot_item_RewardCount = unlock.transform:Find("plot_item_Reward/plot_item_RewardCount"):GetComponent("TMP_Text")
|
||||
self:SetPngSprite(plot_item_RewardIcon, ConfigTable.GetData_Item(plotData.RewardItemId).Icon2)
|
||||
NovaAPI.SetTMPText(plot_item_RewardCount, "×" .. plotData.RewardItemQty)
|
||||
plot_item_Reward:SetActive(true)
|
||||
redDot:SetActive(true)
|
||||
end
|
||||
NovaAPI.SetTMPText(plot_item_Index, plotData.Name)
|
||||
NovaAPI.SetTMPText(plot_item_Name, plotData.Desc)
|
||||
plot_item_RewardReview.onClick:RemoveAllListeners()
|
||||
local clickCb = function()
|
||||
self:ShowGoPlotPanel(plotData)
|
||||
end
|
||||
plot_item_RewardReview.onClick:AddListener(clickCb)
|
||||
else
|
||||
NovaAPI.SetImageColor(plot_item_bg, Color(1, 1, 1, 0.6))
|
||||
unlock:SetActive(false)
|
||||
lock:SetActive(true)
|
||||
local plot_item_LockMsg = lock.transform:Find("plot_item_LockMsg"):GetComponent("TMP_Text")
|
||||
local _cond = plotData.UnlockCond
|
||||
if _cond ~= 0 then
|
||||
if _cond == GameEnum.InfinityTowerCond.LevelClearWithSpecificId then
|
||||
local lvId = plotData.CondParam[1]
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", lvId)
|
||||
NovaAPI.SetTMPText(plot_item_LockMsg, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_WithSpecificId"), lvData.Name))
|
||||
elseif _cond == GameEnum.InfinityTowerCond.InfinityTowerWithSpecificLevelTotal then
|
||||
NovaAPI.SetTMPText(plot_item_LockMsg, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_WithSpecificLevelTotal"), plotData.CondParam[1]))
|
||||
elseif _cond == GameEnum.InfinityTowerCond.AnyTowerWithSpecificTotalLevel then
|
||||
NovaAPI.SetTMPText(plot_item_LockMsg, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_TotalLevel"), plotData.CondParam[1], plotData.CondParam[2]))
|
||||
elseif _cond == GameEnum.InfinityTowerCond.BountyLevelSpecific then
|
||||
NovaAPI.SetTMPText(plot_item_LockMsg, orderedFormat(ConfigTable.GetUIText("InfinityTower_Cond_LevelSpecific"), plotData.CondParam[1]))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function InfinityTowerPlot:OnBtnClick_Close()
|
||||
local ClosePanel = function()
|
||||
self._mapNode.goPlot.gameObject:SetActive(false)
|
||||
self.gameObject:SetActive(false)
|
||||
self.AniRoot.enabled = false
|
||||
end
|
||||
self:AddTimer(1, 0.12, ClosePanel, true, true)
|
||||
self.AniRoot:Play("MatList_out")
|
||||
end
|
||||
function InfinityTowerPlot:ShowGoPlotPanel(plotData)
|
||||
self.SelectPlotData = plotData
|
||||
local isGet = PlayerData.InfinityTower:GetPlotGetReward(plotData.Id)
|
||||
if isGet then
|
||||
self._mapNode.goRewardInfo:SetActive(false)
|
||||
else
|
||||
self:SetPngSprite(self._mapNode.imgGoPlotReward, ConfigTable.GetData_Item(plotData.RewardItemId).Icon2)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtGoPlotRewardCount, "×" .. plotData.RewardItemQty)
|
||||
self._mapNode.goRewardInfo:SetActive(true)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.goPlotLvNum, plotData.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.goPlotLvName, plotData.Desc)
|
||||
NovaAPI.SetTMPText(self._mapNode.goPlotLvDes, plotData.PlotSum)
|
||||
self._mapNode.goPlotRoot.gameObject:SetActive(true)
|
||||
self._mapNode.goPlotRootMask.gameObject:SetActive(true)
|
||||
self._mapNode.rtWindowAni:Play("t_window_04_t_in")
|
||||
end
|
||||
function InfinityTowerPlot:OnBtn_ClickPlayPlot()
|
||||
PlayerData.InfinityTower:PlayPlot(self.SelectPlotData.Id)
|
||||
self:OnBtn_ClickCloseGoPlotPanel()
|
||||
end
|
||||
function InfinityTowerPlot:OnBtn_ClickCloseGoPlotPanel()
|
||||
self._mapNode.goPlotRootMask.gameObject:SetActive(false)
|
||||
self._mapNode.rtWindowAni:Play("t_window_04_t_out")
|
||||
self:AddTimer(1, 0.3, function()
|
||||
self._mapNode.goPlotRoot:SetActive(false)
|
||||
end, true, true, true)
|
||||
end
|
||||
return InfinityTowerPlot
|
||||
@@ -0,0 +1,109 @@
|
||||
local InfinityTowerRewardList = class("InfinityTowerRewardList", BaseCtrl)
|
||||
local texNameColor = {
|
||||
Color(0.6980392156862745, 0.6588235294117647, 0.7647058823529411, 1),
|
||||
Color(0.4196078431372549, 0.2901960784313726, 0.6627450980392157, 1),
|
||||
Color(0.4196078431372549, 0.2901960784313726, 0.6627450980392157, 0.6980392156862745)
|
||||
}
|
||||
InfinityTowerRewardList._mapNodeConfig = {
|
||||
obj_rewardPoint_1 = {},
|
||||
obj_rewardPoint_2 = {},
|
||||
obj_RewardDone_1 = {},
|
||||
obj_RewardDone_2 = {},
|
||||
obj_RewardDone_3 = {},
|
||||
tex_RewardLayerCount = {sComponentName = "TMP_Text"},
|
||||
tex_RewardLayer = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Layer"
|
||||
},
|
||||
rewardItemRoot = {sComponentName = "Transform"},
|
||||
objRewardItem = {}
|
||||
}
|
||||
InfinityTowerRewardList._mapEventConfig = {}
|
||||
function InfinityTowerRewardList:Awake()
|
||||
self.rewardItem = {}
|
||||
end
|
||||
function InfinityTowerRewardList:UnbindAllGrids()
|
||||
for go, ctrl in ipairs(self.rewardItem) do
|
||||
self:UnbindCtrlByNode(ctrl)
|
||||
end
|
||||
self.rewardItem = {}
|
||||
end
|
||||
function InfinityTowerRewardList:OnDestroy()
|
||||
end
|
||||
function InfinityTowerRewardList:InitRewardList(towerId, floor, passLv, rewardLv)
|
||||
local isGet = floor <= rewardLv
|
||||
local isCan = floor <= passLv and rewardLv < floor
|
||||
local isDont = passLv < floor
|
||||
local cg = self.gameObject:GetComponent("CanvasGroup")
|
||||
if isGet then
|
||||
NovaAPI.SetCanvasGroupAlpha(cg, 0.6)
|
||||
else
|
||||
NovaAPI.SetCanvasGroupAlpha(cg, 1)
|
||||
end
|
||||
self._mapNode.obj_RewardDone_1:SetActive(isGet)
|
||||
self._mapNode.obj_RewardDone_2:SetActive(isCan)
|
||||
self._mapNode.obj_RewardDone_3:SetActive(isDont)
|
||||
if isGet then
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_RewardLayerCount, texNameColor[1])
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_RewardLayer, texNameColor[1])
|
||||
elseif isCan then
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_RewardLayerCount, texNameColor[2])
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_RewardLayer, texNameColor[2])
|
||||
else
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_RewardLayerCount, texNameColor[3])
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_RewardLayer, texNameColor[3])
|
||||
end
|
||||
local tmpLv = "0"
|
||||
if floor < 10 then
|
||||
tmpLv = "00" .. floor
|
||||
elseif 10 <= floor and floor < 100 then
|
||||
tmpLv = "0" .. floor
|
||||
else
|
||||
tmpLv = tostring(floor)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_RewardLayerCount, tmpLv)
|
||||
local lvData = PlayerData.InfinityTower:GetTowerLayerData(towerId, floor)
|
||||
local tbItem = {}
|
||||
local _base = decodeJson(lvData.BaseAwardPreview)
|
||||
for k, v in ipairs(_base) do
|
||||
table.insert(tbItem, {
|
||||
id = v[1],
|
||||
count = UTILS.ParseRewardItemCount(v)
|
||||
})
|
||||
end
|
||||
self:SetRewardItem(tbItem, isGet)
|
||||
self._mapNode.obj_rewardPoint_1:SetActive(lvData.LevelFunc ~= GameEnum.fixedRoguelikeFunc0.Boss)
|
||||
self._mapNode.obj_rewardPoint_2:SetActive(lvData.LevelFunc == GameEnum.fixedRoguelikeFunc0.Boss)
|
||||
end
|
||||
function InfinityTowerRewardList:SetRewardItem(tabItem, isGet)
|
||||
local childCount = self._mapNode.rewardItemRoot.childCount
|
||||
for i = 1, childCount do
|
||||
self._mapNode.rewardItemRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local index = 1
|
||||
for i, v in pairs(tabItem) do
|
||||
local objItem
|
||||
if index > self._mapNode.rewardItemRoot.childCount then
|
||||
objItem = instantiate(self._mapNode.objRewardItem, self._mapNode.rewardItemRoot)
|
||||
else
|
||||
objItem = self._mapNode.rewardItemRoot:GetChild(index - 1).gameObject
|
||||
end
|
||||
local btn = objItem:GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local clickCb = function()
|
||||
self:ShowItemTips(v.id, btn.gameObject)
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
objItem:SetActive(true)
|
||||
self.rewardItem[objItem] = self:BindCtrlByNode(objItem, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
self.rewardItem[objItem]:SetItem(v.id, nil, v.count, nil, isGet, nil, nil, true)
|
||||
index = index + 1
|
||||
end
|
||||
end
|
||||
function InfinityTowerRewardList:ShowItemTips(nTid, rtBtn)
|
||||
UTILS.ClickItemGridWithTips(nTid, rtBtn, false, true, false)
|
||||
end
|
||||
function InfinityTowerRewardList:OnDisable()
|
||||
self:UnbindAllGrids()
|
||||
end
|
||||
return InfinityTowerRewardList
|
||||
@@ -0,0 +1,26 @@
|
||||
local InfinityTowerRollMsg = class("InfinityTowerRollMsg", BaseCtrl)
|
||||
InfinityTowerRollMsg._mapNodeConfig = {
|
||||
texTitle = {sComponentName = "TMP_Text"},
|
||||
texMsg = {sComponentName = "TMP_Text"}
|
||||
}
|
||||
function InfinityTowerRollMsg:InitRoll(nType, nIndex)
|
||||
self.type = nType
|
||||
self.Index = nIndex
|
||||
if nType == 1 then
|
||||
NovaAPI.SetTMPText(self._mapNode.texTitle, ConfigTable.GetUIText("InfinityTower_Bottom_Tips_Title_Daily"))
|
||||
elseif nType == 2 then
|
||||
NovaAPI.SetTMPText(self._mapNode.texTitle, ConfigTable.GetUIText("InfinityTower_Bottom_Tips_Title_Breakout"))
|
||||
elseif nType == 3 then
|
||||
NovaAPI.SetTMPText(self._mapNode.texTitle, ConfigTable.GetUIText("InfinityTower_Bottom_Tips_Title_News"))
|
||||
end
|
||||
end
|
||||
function InfinityTowerRollMsg:SetMsg()
|
||||
local mgsId = PlayerData.InfinityTower:GetBottomMsgId(self.type, self.Index)
|
||||
if mgsId then
|
||||
NovaAPI.SetTMPText(self._mapNode.texMsg, ConfigTable.GetData("InfinityTowerMsg", mgsId).Content)
|
||||
self.gameObject:SetActive(true)
|
||||
else
|
||||
self.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
return InfinityTowerRollMsg
|
||||
@@ -0,0 +1,658 @@
|
||||
local InfinityTowerSelectTowerCtrl = class("InfinityTowerSelectTowerCtrl", BaseCtrl)
|
||||
local Actor2DManager = require("Game.Actor2D.Actor2DManager")
|
||||
local LocalSettingData = require("GameCore.Data.LocalSettingData")
|
||||
local Path = require("path")
|
||||
local GameResourceLoader = require("Game.Common.Resource.GameResourceLoader")
|
||||
local ResTypeAny = GameResourceLoader.ResType.Any
|
||||
local typeof = typeof
|
||||
local BubbleVoiceManager = require("Game.Actor2D.BubbleVoiceManager")
|
||||
local tabItemIndex = {
|
||||
[1] = {
|
||||
"diffListView_in",
|
||||
"diffListView_out",
|
||||
"InfinitylvList_out"
|
||||
},
|
||||
[2] = {
|
||||
"diffListView_in_white",
|
||||
"diffListView_out_white",
|
||||
"InfinitylvList_out_white"
|
||||
},
|
||||
[3] = {
|
||||
"diffListView_in",
|
||||
"diffListView_out",
|
||||
"InfinitylvList_out"
|
||||
},
|
||||
[4] = {
|
||||
"diffListView_in",
|
||||
"diffListView_out",
|
||||
"InfinitylvList_out"
|
||||
},
|
||||
[5] = {
|
||||
"diffListView_in",
|
||||
"diffListView_out",
|
||||
"InfinitylvList_out"
|
||||
},
|
||||
[6] = {
|
||||
"diffListView_in_white",
|
||||
"diffListView_out_white",
|
||||
"InfinitylvList_out_white"
|
||||
},
|
||||
[7] = {
|
||||
"diffListView_in_white",
|
||||
"diffListView_out_white",
|
||||
"InfinitylvList_out_white"
|
||||
}
|
||||
}
|
||||
local rabbitRightId = 917302
|
||||
local rabbitLeftId = 917402
|
||||
local tabNPCTowerId = {
|
||||
[1] = rabbitRightId,
|
||||
[2] = rabbitLeftId,
|
||||
[3] = rabbitRightId,
|
||||
[4] = rabbitRightId,
|
||||
[5] = rabbitRightId,
|
||||
[6] = rabbitLeftId,
|
||||
[7] = rabbitLeftId
|
||||
}
|
||||
InfinityTowerSelectTowerCtrl._mapNodeConfig = {
|
||||
ImgBG = {sNodeName = "----BG----", sComponentName = "Image"},
|
||||
towerList = {},
|
||||
itemCtrl = {
|
||||
sNodeName = "item_",
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerSelectTowerItem",
|
||||
nCount = 7
|
||||
},
|
||||
btnBountyLevel = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickBountyLevel"
|
||||
},
|
||||
btnRedDotBounty = {
|
||||
sNodeName = "redDotBounty",
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickDotBounty"
|
||||
},
|
||||
btn_texBounty = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Bounty_Level"
|
||||
},
|
||||
btn_texBountyLevel = {sComponentName = "TMP_Text"},
|
||||
redDotBounty = {},
|
||||
btnPlot = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickPlot"
|
||||
},
|
||||
btn_texPlot = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Plot_Entry"
|
||||
},
|
||||
redDotPlot = {},
|
||||
diffListView = {},
|
||||
dlv_Diff_Select = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_Difficulty_Select"
|
||||
},
|
||||
diffList = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
tex_WeekTips = {sComponentName = "TMP_Text"},
|
||||
lvList = {},
|
||||
lvListInfo = {
|
||||
sNodeName = "lvList",
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerLvList"
|
||||
},
|
||||
bgLvList = {},
|
||||
tv = {},
|
||||
goEnemyInfo = {
|
||||
sCtrlName = "Game.UI.MainlineEx.MainlineMonsterInfoCtrl"
|
||||
},
|
||||
bottomBg = {},
|
||||
bottom_Daily = {
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerRollMsg"
|
||||
},
|
||||
bottom_Breakout = {
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerRollMsg"
|
||||
},
|
||||
bottom_News = {
|
||||
nCount = 3,
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerRollMsg"
|
||||
},
|
||||
bottomList = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
goBountyView = {
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerBounty"
|
||||
},
|
||||
goPlot_blur = {},
|
||||
goPlot_MaskClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickClosePlot"
|
||||
},
|
||||
goPlotView = {
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerPlot"
|
||||
},
|
||||
TopBarPanel = {
|
||||
sCtrlName = "Game.UI.TopBarEx.TopBarCtrl"
|
||||
},
|
||||
light = {},
|
||||
color = {},
|
||||
trRoot_L = {
|
||||
sNodeName = "----Actor2DLeft302----",
|
||||
sComponentName = "Transform"
|
||||
},
|
||||
trRoot_R = {
|
||||
sNodeName = "----Actor2DRight402----",
|
||||
sComponentName = "Transform"
|
||||
},
|
||||
Actor2DLeft = {
|
||||
sNodeName = "rawImg_L_302",
|
||||
sComponentName = "RawImage"
|
||||
},
|
||||
Actor2DPngL = {sNodeName = "png_L_302", sComponentName = "Transform"},
|
||||
Actor2DRight = {
|
||||
sNodeName = "rawImg_R_402",
|
||||
sComponentName = "RawImage"
|
||||
},
|
||||
Actor2DPngR = {sNodeName = "png_R_402", sComponentName = "Transform"},
|
||||
goBubbleRootLeft = {
|
||||
sNodeName = "----fixed_bubble302----"
|
||||
},
|
||||
goBubbleRootLeftCanvas = {
|
||||
sNodeName = "----fixed_bubble302----",
|
||||
sComponentName = "Canvas"
|
||||
},
|
||||
goBubbleRootRight = {
|
||||
sNodeName = "----fixed_bubble402----"
|
||||
},
|
||||
goBubbleRootRightCanvas = {
|
||||
sNodeName = "----fixed_bubble402----",
|
||||
sComponentName = "Canvas"
|
||||
},
|
||||
btnActor = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_Actor"
|
||||
}
|
||||
}
|
||||
InfinityTowerSelectTowerCtrl._mapEventConfig = {
|
||||
[EventId.UIHomeConfirm] = "OnEvent_Home",
|
||||
[EventId.UIBackConfirm] = "OnEvent_Back",
|
||||
Infinity_Select_Tower = "OnEvent_InfinitySelectTower",
|
||||
Get_InfinityTower_InfoReq = "OnEvent_GetInfinityTowerInfoReq",
|
||||
Guide_DisableScrollView = "OnEvent_DisableScrollView",
|
||||
[EventId.ShowBubbleVoiceText] = "OnEvent_ShowBubbleVoiceText"
|
||||
}
|
||||
InfinityTowerSelectTowerCtrl._mapRedDotConfig = {
|
||||
[RedDotDefine.Map_InfinityTowerDaily] = {
|
||||
sNodeName = "redDotBounty"
|
||||
},
|
||||
[RedDotDefine.Map_InfinityTowerPlot] = {sNodeName = "redDotPlot"}
|
||||
}
|
||||
function InfinityTowerSelectTowerCtrl:Awake()
|
||||
self.AnimPanel = self.gameObject:GetComponent("Animator")
|
||||
self.npcHFCcounter = ConfigTable.GetConfigNumber("NpcHFCcounter")
|
||||
self.npcHFCtimer = ConfigTable.GetConfigNumber("NpcHFCtimer")
|
||||
self.npcHangtimer = ConfigTable.GetConfigNumber("NpcHangtimer")
|
||||
self.UseLive2D = LocalSettingData.mapData.UseLive2D
|
||||
self._mapNode.towerList:SetActive(false)
|
||||
self.pageType = PlayerData.InfinityTower:GetPageState()
|
||||
self.mapDiffGrid = {}
|
||||
if not PlayerData.InfinityTower:GetInitInfoState() then
|
||||
PlayerData.InfinityTower:GetITInfoReq()
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:FadeIn()
|
||||
if self.pageType == 1 and self._panel.openTowerId == nil then
|
||||
EventManager.Hit(EventId.SetTransition)
|
||||
local waitCallback = function()
|
||||
self.AnimPanel:Play("InfinityTowerList_in")
|
||||
end
|
||||
self:AddTimer(1, 0.5, waitCallback, true, true, true, nil)
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:FadeOut()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEnable()
|
||||
if self._panel.openTowerId == nil then
|
||||
if self.pageType == 3 and self.selectTowerId == nil then
|
||||
self.pageType = 1
|
||||
end
|
||||
if self.pageType <= 2 then
|
||||
self:LoadBG(0)
|
||||
else
|
||||
self:LoadBG(self.selectTowerId)
|
||||
end
|
||||
self:InitBottomRollMsg()
|
||||
if PlayerData.InfinityTower:GetInitInfoState() then
|
||||
self:OnInitPanelInfo()
|
||||
end
|
||||
else
|
||||
self:InitBottomRollMsg()
|
||||
if not PlayerData.InfinityTower:GetInitInfoState() then
|
||||
self.pageType = 2
|
||||
self.selectTowerId = self._panel.openTowerId
|
||||
self._panel.openTowerId = nil
|
||||
else
|
||||
self:OnEvent_InfinitySelectTower(self._panel.openTowerId, true, false)
|
||||
self._panel.openTowerId = nil
|
||||
self._mapNode.bgLvList:SetActive(false)
|
||||
end
|
||||
end
|
||||
self:AddTimer(1, 0.2, function()
|
||||
self:LoadRabbit()
|
||||
end, true, true, true, nil)
|
||||
local sortingOrder = NovaAPI.GetCanvasSortingOrder(self.gameObject:GetComponent("Canvas"))
|
||||
NovaAPI.SetCanvasSortingName(self._mapNode.goBubbleRootLeftCanvas, self._panel._sSortingLayerName)
|
||||
NovaAPI.SetCanvasSortingName(self._mapNode.goBubbleRootRightCanvas, self._panel._sSortingLayerName)
|
||||
NovaAPI.SetCanvasSortingOrder(self._mapNode.goBubbleRootLeftCanvas, sortingOrder + 2)
|
||||
NovaAPI.SetCanvasSortingOrder(self._mapNode.goBubbleRootRightCanvas, sortingOrder + 2)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnInitPanelInfo()
|
||||
self:InitTower()
|
||||
if self.pageType == 1 then
|
||||
self._mapNode.towerList:SetActive(true)
|
||||
self._mapNode.diffListView:SetActive(false)
|
||||
self._mapNode.lvList:SetActive(false)
|
||||
self._mapNode.tv:SetActive(false)
|
||||
self._mapNode.bgLvList:SetActive(false)
|
||||
self._mapNode.bottomBg:SetActive(true)
|
||||
self:AddTimer(1, 1, function()
|
||||
if PlayerData.Guide:CheckInGuideGroup(18) then
|
||||
EventManager.Hit("InfinityTowerPanelOpenFinish", self.pageType)
|
||||
end
|
||||
end, true, true, true)
|
||||
elseif self.pageType == 2 then
|
||||
self._mapNode.bgLvList:SetActive(false)
|
||||
self:OnEvent_InfinitySelectTower(self.selectTowerId, true, false)
|
||||
elseif self.pageType == 3 then
|
||||
self._mapNode.towerList:SetActive(false)
|
||||
self._mapNode.diffListView:SetActive(false)
|
||||
self._mapNode.lvList:SetActive(true)
|
||||
self._mapNode.tv:SetActive(true)
|
||||
self._mapNode.bgLvList:SetActive(true)
|
||||
self._mapNode.bottomBg:SetActive(false)
|
||||
local diffSort = PlayerData.InfinityTower:GetSelectLvSortId()
|
||||
self:InfinitySelectTower(self.selectTowerId, diffSort)
|
||||
self:AddTimer(1, 0.2, function()
|
||||
if PlayerData.Guide:CheckInGuideGroup(18) then
|
||||
EventManager.Hit("InfinityTowerPanelOpenFinish", self.pageType)
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEvent_GetInfinityTowerInfoReq()
|
||||
self:OnInitPanelInfo()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEvent_EntryInfinityTowerMap()
|
||||
BubbleVoiceManager.StopBubbleAnim()
|
||||
BubbleVoiceManager.StopBubbleAnim_EX()
|
||||
PlayerData.Voice:StopCharVoice()
|
||||
self.pageType = 1
|
||||
PlayerData.InfinityTower:SetPageState(1)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnDisable()
|
||||
self:UnbindAllGrids()
|
||||
self:UnLoadRabbit()
|
||||
if self.bottomListTweener ~= nil then
|
||||
self.bottomListTweener:Kill()
|
||||
end
|
||||
self.AutoCloseBubbleTimer = nil
|
||||
if self.twinTimer ~= nil then
|
||||
self.twinTimer:Cancel()
|
||||
end
|
||||
PlayerData.Voice:ClearTimer()
|
||||
BubbleVoiceManager.StopBubbleAnim()
|
||||
BubbleVoiceManager.StopBubbleAnim_EX()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnDestroy()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnRelease()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:LoadBG(towerId)
|
||||
local sFullPath = ""
|
||||
if self.pageType == 3 and towerId == 0 then
|
||||
return
|
||||
end
|
||||
if self.pageType <= 2 then
|
||||
sFullPath = string.format("Image/UIBG/%s", "bg_infinitytower_pk_08")
|
||||
else
|
||||
local towerData = ConfigTable.GetData("InfinityTower", towerId)
|
||||
sFullPath = string.format("Image/UIBG/%s", towerData.Bg)
|
||||
end
|
||||
if self._mapNode and self._mapNode.ImgBG then
|
||||
self:SetPngSprite(self._mapNode.ImgBG, sFullPath)
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:InitTower()
|
||||
for i = 1, 7 do
|
||||
self._mapNode.itemCtrl[i]:InitTowerMsg(i)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.btn_texBountyLevel, tostring(PlayerData.InfinityTower.BountyLevel))
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:InitBottomRollMsg()
|
||||
self._mapNode.bottom_Daily:InitRoll(GameEnum.InfinityTowerMsgType.Daily, 1)
|
||||
self._mapNode.bottom_Breakout:InitRoll(GameEnum.InfinityTowerMsgType.Breakout, 1)
|
||||
for i = 1, 3 do
|
||||
self._mapNode.bottom_News[i]:InitRoll(GameEnum.InfinityTowerMsgType.News, i)
|
||||
end
|
||||
self._mapNode.bottomList.anchoredPosition = Vector2(Settings.DESIGN_SCREEN_RESOLUTION_WIDTH, 25)
|
||||
self:RefreshBottomMsg()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:RefreshBottomMsg()
|
||||
if self.bottomListTweener ~= nil then
|
||||
self.bottomListTweener:Kill()
|
||||
end
|
||||
PlayerData.InfinityTower:RandomBottomMsg()
|
||||
self._mapNode.bottom_Daily:SetMsg()
|
||||
self._mapNode.bottom_Breakout:SetMsg()
|
||||
for i = 1, 3 do
|
||||
self._mapNode.bottom_News[i]:SetMsg()
|
||||
end
|
||||
local waitCall = function()
|
||||
if self._mapNode.bottomList and type(self._mapNode.bottomList) ~= "number" then
|
||||
self._mapNode.bottomList.gameObject:SetActive(true)
|
||||
self._mapNode.bottomList.anchoredPosition = Vector2(Settings.DESIGN_SCREEN_RESOLUTION_WIDTH, 25)
|
||||
local tmpWidth = self._mapNode.bottomList.rect.width + Settings.DESIGN_SCREEN_RESOLUTION_WIDTH * 0.5 + 100
|
||||
local moveDis = tmpWidth + Settings.DESIGN_SCREEN_RESOLUTION_WIDTH
|
||||
local tmpTime = math.ceil(moveDis / 250)
|
||||
self.bottomListTweener = Sequence()
|
||||
self.bottomListTweener:Append(self._mapNode.bottomList:DOLocalMoveX(-tmpWidth, tmpTime))
|
||||
self.bottomListTweener:OnComplete(function()
|
||||
self._mapNode.bottomList.gameObject:SetActive(false)
|
||||
self:RefreshBottomMsg()
|
||||
end)
|
||||
self.bottomListTweener:SetUpdate(true)
|
||||
end
|
||||
end
|
||||
self:AddTimer(1, 1.5, waitCall, true, true, true, nil)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEvent_InfinitySelectTower(towerId, isPlayAniViewIn, isNPCVoice)
|
||||
BubbleVoiceManager.StopBubbleAnim()
|
||||
BubbleVoiceManager.StopBubbleAnim_EX()
|
||||
PlayerData.Voice:StopCharVoice()
|
||||
self.pageType = 2
|
||||
PlayerData.InfinityTower:SetPageState(2)
|
||||
if isPlayAniViewIn then
|
||||
self._mapNode.diffList.gameObject:SetActive(false)
|
||||
end
|
||||
self._mapNode.diffListView:SetActive(true)
|
||||
self.selectTowerId = towerId
|
||||
local towerData = ConfigTable.GetData("InfinityTower", towerId)
|
||||
local texKey = towerData.OpenDayDesc
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_WeekTips, ConfigTable.GetUIText(texKey))
|
||||
local count = PlayerData.InfinityTower:GetTowerDiffCount(towerId)
|
||||
if isPlayAniViewIn then
|
||||
local waitShowItem = function()
|
||||
self._mapNode.diffList.gameObject:SetActive(true)
|
||||
self._mapNode.diffList:SetAnim(0.1)
|
||||
self._mapNode.diffList:Init(count, self, self.InitDiffList)
|
||||
end
|
||||
self:AddTimer(1, 0.65, waitShowItem, true, true, true, nil)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.75)
|
||||
else
|
||||
self._mapNode.diffList:SetAnim(0.1)
|
||||
self._mapNode.diffList:Init(count, self, self.InitDiffList)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.5)
|
||||
end
|
||||
local waitCallback = function()
|
||||
self._mapNode.towerList:SetActive(false)
|
||||
end
|
||||
self:AddTimer(1, 0.3, waitCallback, true, true, true, nil)
|
||||
if isPlayAniViewIn then
|
||||
local sAnim = tabItemIndex[towerId][1]
|
||||
local nAnimLen = NovaAPI.GetAnimClipLength(self.AnimPanel, {sAnim})
|
||||
self.AnimPanel:Play(sAnim)
|
||||
self:AddTimer(1, nAnimLen, function()
|
||||
if PlayerData.Guide:CheckInGuideGroup(18) then
|
||||
EventManager.Hit("InfinityTowerPanelOpenFinish", self.pageType)
|
||||
end
|
||||
end, true, true, true)
|
||||
else
|
||||
self.AnimPanel:Play(tabItemIndex[towerId][3])
|
||||
end
|
||||
if isNPCVoice then
|
||||
if self.twinTimer ~= nil then
|
||||
self.twinTimer:Cancel()
|
||||
end
|
||||
self:PlayOneNpcVoiceGreen()
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:InitDiffList(goGrid, gridIndex)
|
||||
if self.mapDiffGrid[goGrid] == nil then
|
||||
self.mapDiffGrid[goGrid] = self:BindCtrlByNode(goGrid, "Game.UI.InfinityTower.InfinityTowerDifficultyItem")
|
||||
end
|
||||
local nIdx = gridIndex + 1
|
||||
self.mapDiffGrid[goGrid]:InitDiffList(self.selectTowerId, nIdx, self)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:InfinitySelectTower(towerId, diffSort)
|
||||
BubbleVoiceManager.StopBubbleAnim()
|
||||
BubbleVoiceManager.StopBubbleAnim_EX()
|
||||
PlayerData.Voice:StopCharVoice()
|
||||
self.pageType = 3
|
||||
PlayerData.InfinityTower:SetPageState(3)
|
||||
self:SetLightActive(false)
|
||||
self:LoadBG(towerId)
|
||||
self._mapNode.towerList:SetActive(false)
|
||||
self._mapNode.diffListView:SetActive(false)
|
||||
self._mapNode.lvList:SetActive(true)
|
||||
self._mapNode.tv:SetActive(true)
|
||||
self._mapNode.bgLvList:SetActive(true)
|
||||
self._mapNode.bottomBg:SetActive(false)
|
||||
self.selectTowerId = towerId
|
||||
PlayerData.InfinityTower:SetSelectLvSortId(diffSort)
|
||||
self._mapNode.lvListInfo:InitLvList(towerId, diffSort, self)
|
||||
self.AnimPanel:Play("InfinityTowerlvList_in")
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:UnbindAllGrids()
|
||||
for go, ctrl in ipairs(self.mapDiffGrid) do
|
||||
self:UnbindCtrlByNode(ctrl)
|
||||
end
|
||||
self.mapDiffGrid = {}
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:InitSelectLvMsg(towerId, floor)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:ShowAffixItem(tabAffixId)
|
||||
local childCount = self._mapNode.affixSCRoot.childCount
|
||||
for i = 1, childCount do
|
||||
self._mapNode.affixSCRoot:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
local tmpCount = 3
|
||||
if 3 < #tabAffixId then
|
||||
tmpCount = #tmpCount
|
||||
end
|
||||
local index = 1
|
||||
for i = 1, tmpCount do
|
||||
local obj
|
||||
if index + 1 > self._mapNode.affixSCRoot.childCount then
|
||||
obj = instantiate(self._mapNode.affix_ItemList, self._mapNode.affixSCRoot)
|
||||
else
|
||||
obj = self._mapNode.affixSCRoot:GetChild(index).gameObject
|
||||
end
|
||||
local affixId = 0
|
||||
if tabAffixId[i] ~= nil then
|
||||
affixId = tabAffixId[i]
|
||||
end
|
||||
self:ShowAffixItemMsg(obj, affixId)
|
||||
index = index + 1
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:ShowAffixItemMsg(obj, affixId)
|
||||
local affix_texItem = obj.transform:Find("affix_texItem"):GetComponent("TMP_Text")
|
||||
local tmp_Affix = obj.transform:Find("tmp_Affix").gameObject
|
||||
if affixId == 0 then
|
||||
affix_texItem.gameObject:SetActive(false)
|
||||
tmp_Affix:SetActive(true)
|
||||
else
|
||||
affix_texItem.gameObject:SetActive(true)
|
||||
tmp_Affix:SetActive(false)
|
||||
local dataAffix = ConfigTable.GetData("InfinityTowerAffix", affixId)
|
||||
local sDesc = orderedFormat(ConfigTable.GetUIText("InfinityTowerAffix_Desc"), dataAffix.Name, dataAffix.Desc)
|
||||
NovaAPI.SetTMPText(affix_texItem, UTILS.ParseParamDesc(sDesc, dataAffix))
|
||||
end
|
||||
obj:SetActive(true)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:RefreshMonsterGrid(goGrid, gridIndex)
|
||||
local index = gridIndex + 1
|
||||
local mapMonster = self.tbMonster[index]
|
||||
if mapMonster == nil then
|
||||
return
|
||||
end
|
||||
local imgIcon = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Basic--/imgIcon"):GetComponent("Image")
|
||||
local goSelect = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Common--").gameObject
|
||||
local goBoss = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Monster--/goBoss").gameObject
|
||||
local goElite = goGrid.transform:Find("btnGrid/AnimRoot/tc_head_01/--Monster--/goElite").gameObject
|
||||
local btn = goGrid.transform:Find("btnGrid"):GetComponent("UIButton")
|
||||
local nMonsterId = mapMonster.PreviewMonsterListId
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local minLevel = self.tbMonster[index].MinLv
|
||||
local maxLevel = self.tbMonster[index].MaxLv
|
||||
local _strLv = ""
|
||||
if minLevel == maxLevel then
|
||||
_strLv = minLevel
|
||||
else
|
||||
_strLv = maxLevel
|
||||
end
|
||||
local clickCb = function()
|
||||
local mapData = {nTid = nMonsterId, strLv = _strLv}
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MonsterTips, btn.gameObject, mapData)
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
local cfgDataMonster = ConfigTable.GetData("PreviewMonsterList", nMonsterId)
|
||||
if nil ~= cfgDataMonster then
|
||||
self:SetPngSprite(imgIcon, cfgDataMonster.Icon)
|
||||
goSelect:SetActive(false)
|
||||
goBoss:SetActive(cfgDataMonster.EpicLv == GameEnum.monsterEpicType.LORD)
|
||||
goElite:SetActive(cfgDataMonster.EpicLv == GameEnum.monsterEpicType.LEADER or cfgDataMonster.EpicLv == GameEnum.monsterEpicType.ELITE)
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnClickBountyLevel()
|
||||
self._mapNode.goBountyView:InitView()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnClickDotBounty()
|
||||
if PlayerData.InfinityTower.isHaveDailyReward then
|
||||
PlayerData.InfinityTower:ITDailyRewardReq()
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnClickPlot()
|
||||
self._mapNode.goPlot_blur:SetActive(true)
|
||||
self._mapNode.goPlotView:OpenPlotView()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnClickClosePlot()
|
||||
self._mapNode.goPlot_blur:SetActive(false)
|
||||
self._mapNode.goPlotView:OnBtnClick_Close()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEvent_Home(nPanelId)
|
||||
if self._panel._nPanelId ~= nPanelId then
|
||||
return
|
||||
end
|
||||
PlayerData.InfinityTower:SetPageState(1)
|
||||
PanelManager.Home()
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEvent_Back(nPanelId)
|
||||
if self._panel._nPanelId ~= nPanelId then
|
||||
return
|
||||
end
|
||||
BubbleVoiceManager.StopBubbleAnim()
|
||||
BubbleVoiceManager.StopBubbleAnim_EX()
|
||||
PlayerData.Voice:StopCharVoice()
|
||||
if self.pageType == 3 then
|
||||
self.pageType = 2
|
||||
PlayerData.InfinityTower:SetPageState(2)
|
||||
self:SetLightActive(true)
|
||||
self:OnEvent_InfinitySelectTower(self.selectTowerId, false, true)
|
||||
self:LoadBG(0)
|
||||
self._mapNode.lvList:SetActive(false)
|
||||
self._mapNode.tv:SetActive(false)
|
||||
self._mapNode.bgLvList:SetActive(false)
|
||||
self._mapNode.bottomBg:SetActive(true)
|
||||
elseif self.pageType == 2 then
|
||||
self.pageType = 1
|
||||
PlayerData.InfinityTower:SetPageState(1)
|
||||
self._mapNode.towerList:SetActive(true)
|
||||
local waitCallback = function()
|
||||
self._mapNode.diffListView:SetActive(false)
|
||||
end
|
||||
self:AddTimer(1, 0.3, waitCallback, true, true, true, nil)
|
||||
self:InitTower()
|
||||
self.AnimPanel:Play(tabItemIndex[self.selectTowerId][2])
|
||||
else
|
||||
EventManager.Hit(EventId.CloesCurPanel)
|
||||
PlayerData.InfinityTower:SetPageState(1)
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:SetLightActive(isActive)
|
||||
self._mapNode.light:SetActive(isActive)
|
||||
self._mapNode.color:SetActive(isActive)
|
||||
self._mapNode.trRoot_L.localScale = isActive == true and Vector3.one or Vector3.zero
|
||||
self._mapNode.trRoot_R.localScale = isActive == true and Vector3.one or Vector3.zero
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:LoadRabbit()
|
||||
self._mapNode.Actor2DLeft.transform.localScale = self.UseLive2D == true and Vector3.one or Vector3.zero
|
||||
self._mapNode.Actor2DRight.transform.localScale = self.UseLive2D == true and Vector3.one or Vector3.zero
|
||||
self._mapNode.Actor2DPngL.localScale = self.UseLive2D == true and Vector3.zero or Vector3.one
|
||||
self._mapNode.Actor2DPngR.localScale = self.UseLive2D == true and Vector3.zero or Vector3.one
|
||||
if self.UseLive2D == true then
|
||||
Actor2DManager.SetBoardNPC2D(self:GetPanelId(), self._mapNode.Actor2DLeft, rabbitLeftId, nil, nil, 1)
|
||||
Actor2DManager.SetBoardNPC2D(self:GetPanelId(), self._mapNode.Actor2DRight, rabbitRightId, nil, nil, 2)
|
||||
else
|
||||
Actor2DManager.SetBoardNPC2D_PNG(self._mapNode.Actor2DPngL, self:GetPanelId(), rabbitLeftId)
|
||||
Actor2DManager.SetBoardNPC2D_PNG(self._mapNode.Actor2DPngR, self:GetPanelId(), rabbitRightId)
|
||||
end
|
||||
if self.pageType == 1 then
|
||||
self:PlayTwoNpcVoice()
|
||||
elseif self.pageType == 2 then
|
||||
self:PlayOneNpcVoiceGreen()
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:UnLoadRabbit()
|
||||
Actor2DManager.UnsetBoardNPC2D(1)
|
||||
Actor2DManager.UnsetBoardNPC2D(2)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEvent_DisableScrollView(bDisable)
|
||||
NovaAPI.SetScrollRectVertical(self._mapNode.diffList, not bDisable)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:PlayOneNpcVoiceGreen()
|
||||
local npcId = rabbitLeftId
|
||||
if self.pageType == 2 then
|
||||
npcId = tabNPCTowerId[self.selectTowerId]
|
||||
end
|
||||
local isFirst, sKey = PlayerData.InfinityTower:GetNPCVoiceKey(npcId)
|
||||
if isFirst then
|
||||
PlayerData.Voice:PlayCharVoice(sKey, npcId, nil, true)
|
||||
else
|
||||
local tab = {"greet_npc", sKey}
|
||||
if PlayerData.InfinityTower.isLevelClear then
|
||||
tab = {"clear"}
|
||||
PlayerData.InfinityTower.isLevelClear = false
|
||||
end
|
||||
PlayerData.Voice:PlayCharVoice(tab, npcId, nil, true)
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:PlayTwoNpcVoice()
|
||||
local key = PlayerData.Voice:PlayCharVoice("twin_greet", rabbitLeftId, nil, true)
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnEvent_ShowBubbleVoiceText(nNpcId, nId)
|
||||
local mapVoDirectoryData = ConfigTable.GetData("VoDirectory", nId)
|
||||
if mapVoDirectoryData == nil then
|
||||
printError("VoDirectory未找到数据id:" .. nId)
|
||||
return
|
||||
end
|
||||
if self.pageType == 1 then
|
||||
BubbleVoiceManager.PlayFixedBubbleAnim(self._mapNode.goBubbleRootLeft, mapVoDirectoryData.voResource, 1)
|
||||
BubbleVoiceManager.PlayFixedBubbleAnim_EX(self._mapNode.goBubbleRootRight, mapVoDirectoryData.voResource)
|
||||
elseif self.pageType == 2 then
|
||||
if nNpcId == rabbitLeftId then
|
||||
BubbleVoiceManager.PlayFixedBubbleAnim(self._mapNode.goBubbleRootLeft, mapVoDirectoryData.voResource, 1)
|
||||
else
|
||||
BubbleVoiceManager.PlayFixedBubbleAnim(self._mapNode.goBubbleRootRight, mapVoDirectoryData.voResource, 2)
|
||||
end
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerCtrl:OnBtnClick_Actor()
|
||||
if self.pageType == 3 then
|
||||
return
|
||||
elseif self.pageType == 2 then
|
||||
self:PlayOneNpcVoiceGreen()
|
||||
elseif self.pageType == 1 then
|
||||
self:PlayTwoNpcVoice()
|
||||
end
|
||||
end
|
||||
return InfinityTowerSelectTowerCtrl
|
||||
@@ -0,0 +1,196 @@
|
||||
local InfinityTowerSelectTowerItem = class("InfinityTowerSelectTowerItem", BaseCtrl)
|
||||
local texNameColor = {
|
||||
Color(0.8901960784313725, 0.8901960784313725, 0.8901960784313725, 1),
|
||||
Color(0.611764705882353, 0.611764705882353, 0.611764705882353, 1)
|
||||
}
|
||||
InfinityTowerSelectTowerItem._mapNodeConfig = {
|
||||
tex_Name = {sComponentName = "TMP_Text"},
|
||||
obj_Passed = {},
|
||||
bg_1 = {sComponentName = "Image"},
|
||||
obj_LockTime = {},
|
||||
obj_UnLock = {},
|
||||
tex_UnLock = {sComponentName = "TMP_Text"},
|
||||
obj_week = {},
|
||||
tex_Week = {sComponentName = "TMP_Text"},
|
||||
obj_Property = {},
|
||||
img_Property = {sComponentName = "Image"},
|
||||
tex_LevelCount = {sComponentName = "TMP_Text"},
|
||||
obj_PropertyBlock = {}
|
||||
}
|
||||
InfinityTowerSelectTowerItem._mapEventConfig = {}
|
||||
function InfinityTowerSelectTowerItem:InitTowerMsg(index)
|
||||
self.towerId = index
|
||||
self._mapNode.obj_Passed:SetActive(false)
|
||||
self._mapNode.obj_LockTime:SetActive(false)
|
||||
self._mapNode.obj_UnLock:SetActive(false)
|
||||
self._mapNode.obj_week:SetActive(false)
|
||||
local sPath = "Icon/MapChallenge/zs_infinitytower_lspic_0" .. index - 1
|
||||
NovaAPI.SetImageSprite(self._mapNode.bg_1, Settings.AB_ROOT_PATH .. sPath .. ".png")
|
||||
local towerData = ConfigTable.GetData("InfinityTower", index)
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_Name, towerData.Name)
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_Name, texNameColor[1])
|
||||
NovaAPI.SetImageColor(self._mapNode.bg_1, Color(1, 1, 1, 1))
|
||||
local isOpenDay = PlayerData.InfinityTower:CheckOpenDay(index)
|
||||
local openDayLength = #towerData.OpenDay
|
||||
local isUnLock = PlayerData.InfinityTower:CheckTowerUnLock(self.towerId, towerData.PreTowerLevelId)
|
||||
local passAll = PlayerData.InfinityTower:GetTowerPassAll(index)
|
||||
if index == 1 then
|
||||
local activityBg = self.gameObject.transform:Find("AnimRoot/activityBg").gameObject
|
||||
local openDayActivityId = ConfigTable.GetConfigNumber("InfinityOpenDayActivityId")
|
||||
local activityData = PlayerData.Activity:GetActivityDataById(openDayActivityId)
|
||||
if activityData ~= nil then
|
||||
local curTimeStamp = CS.ClientManager.Instance.serverTimeStamp
|
||||
if curTimeStamp > activityData.nOpenTime and curTimeStamp < activityData.nEndTime then
|
||||
self.activityRemainTime = activityData.nEndTime - curTimeStamp
|
||||
local tex_Activity = activityBg.transform:Find("imgActTipsBg/tex_Activity"):GetComponent("TMP_Text")
|
||||
local txtActTime = activityBg.transform:Find("imgActTimeBg/txtActTime"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(tex_Activity, ConfigTable.GetUIText("Infinity_OpenDay_Activity"))
|
||||
NovaAPI.SetTMPText(txtActTime, self:GetTimeStr(self.activityRemainTime))
|
||||
local refreshTime = function()
|
||||
self.activityRemainTime = self.activityRemainTime - 1
|
||||
NovaAPI.SetTMPText(txtActTime, self:GetTimeStr(self.activityRemainTime))
|
||||
if self.activityRemainTime <= 0 and self.timer ~= nil then
|
||||
self.timer:Cancel()
|
||||
self.timer = nil
|
||||
end
|
||||
end
|
||||
self.timer = self:AddTimer(0, 1, refreshTime, true, true, true)
|
||||
activityBg:SetActive(true)
|
||||
else
|
||||
activityBg:SetActive(false)
|
||||
end
|
||||
else
|
||||
activityBg:SetActive(false)
|
||||
end
|
||||
end
|
||||
if passAll then
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_LevelCount, ConfigTable.GetUIText("Infinity_Clear"))
|
||||
else
|
||||
local lastLv = PlayerData.InfinityTower:GetTowerPassLv(self.towerId)
|
||||
local diff = 0
|
||||
if lastLv == 0 then
|
||||
diff = 1
|
||||
else
|
||||
local nextLv = lastLv + 1
|
||||
local lvData = ConfigTable.GetData("InfinityTowerLevel", nextLv)
|
||||
if lvData then
|
||||
local diffData = ConfigTable.GetData("InfinityTowerDifficulty", lvData.DifficultyId)
|
||||
diff = diffData.Sort
|
||||
end
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_LevelCount, string.format(ConfigTable.GetUIText("Infinity_Diff"), diff))
|
||||
end
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_LevelCount, texNameColor[1])
|
||||
self._mapNode.obj_PropertyBlock:SetActive(false)
|
||||
self._mapNode.obj_Property:SetActive(isUnLock and towerData.ElementType ~= GameEnum.elementType.NONE)
|
||||
self._mapNode.tex_Name.gameObject:SetActive(isUnLock)
|
||||
self._mapNode.tex_LevelCount.gameObject:SetActive(isUnLock)
|
||||
self:SetAtlasSprite(self._mapNode.img_Property, "12_rare", AllEnum.ElementIconType.Icon .. towerData.ElementType)
|
||||
local btn = self.gameObject:GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
local clickCb = function()
|
||||
if not isUnLock then
|
||||
local strTips = orderedFormat(ConfigTable.GetUIText("InfinityTower_LockTips"), towerData.Name)
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
elseif openDayLength == 0 then
|
||||
local strTips = ConfigTable.GetUIText("InfinityTower_OpenNone")
|
||||
EventManager.Hit(EventId.OpenMessageBox, strTips)
|
||||
return
|
||||
elseif not isOpenDay then
|
||||
EventManager.Hit("Infinity_Select_Tower", self.towerId, true, true)
|
||||
else
|
||||
EventManager.Hit("Infinity_Select_Tower", self.towerId, true, true)
|
||||
end
|
||||
end
|
||||
btn.onClick:AddListener(clickCb)
|
||||
if not isUnLock then
|
||||
self._mapNode.obj_UnLock:SetActive(true)
|
||||
local towerLvDate = ConfigTable.GetData("InfinityTowerLevel", towerData.PreTowerLevelId)
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_UnLock, orderedFormat(ConfigTable.GetUIText("InfinityTower_Lock"), towerLvDate.Name))
|
||||
NovaAPI.SetImageColor(self._mapNode.bg_1, Color(1, 1, 1, 0.5))
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_Name, texNameColor[2])
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_LevelCount, texNameColor[2])
|
||||
else
|
||||
self._mapNode.tex_Name.gameObject:SetActive(true)
|
||||
if not isOpenDay then
|
||||
self._mapNode.obj_LockTime:SetActive(true)
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_Name, texNameColor[2])
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_LevelCount, texNameColor[2])
|
||||
self._mapNode.obj_week:SetActive(true)
|
||||
self.totalSec = PlayerData.InfinityTower:GetNextDaySec(self.towerId)
|
||||
if self.totalSec > 0 then
|
||||
if self.timerCountDown then
|
||||
self.timerCountDown = nil
|
||||
end
|
||||
if self.timerCountDown == nil then
|
||||
self.timerCountDown = self:AddTimer(0, 1, "SetCountdownOpen", false, true, false)
|
||||
end
|
||||
self:SetCountdownOpen()
|
||||
self.timerCountDown:Pause(false)
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_Week, "")
|
||||
end
|
||||
NovaAPI.SetImageColor(self._mapNode.bg_1, Color(1, 1, 1, 0.5))
|
||||
self._mapNode.obj_PropertyBlock:SetActive(true)
|
||||
return
|
||||
end
|
||||
if passAll then
|
||||
self._mapNode.obj_Passed:SetActive(true)
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_Name, texNameColor[2])
|
||||
NovaAPI.SetTMPColor(self._mapNode.tex_LevelCount, texNameColor[2])
|
||||
NovaAPI.SetImageColor(self._mapNode.bg_1, Color(1, 1, 1, 0.5))
|
||||
self._mapNode.obj_PropertyBlock:SetActive(true)
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerItem:SetCountdownOpen()
|
||||
self.totalSec = self.totalSec - 1
|
||||
if self.totalSec > 3600 then
|
||||
local nHour = math.floor(self.totalSec / 3600)
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_Week, string.format(ConfigTable.GetUIText("Infinity_Hour_Open"), nHour))
|
||||
elseif self.totalSec > 60 then
|
||||
local nMin = math.floor(self.totalSec / 60)
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_Week, string.format(ConfigTable.GetUIText("Infinity_Min_Open"), nMin))
|
||||
elseif self.totalSec > 0 then
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_Week, string.format(ConfigTable.GetUIText("Infinity_Sec_Open"), self.totalSec))
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.tex_Week, "")
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerItem:GetTimeStr(nRemainTime)
|
||||
local sTimeStr = ""
|
||||
if nRemainTime <= 60 then
|
||||
local sec = math.floor(nRemainTime)
|
||||
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Sec") or "", sec)
|
||||
elseif 60 < nRemainTime and nRemainTime <= 3600 then
|
||||
local min = math.floor(nRemainTime / 60)
|
||||
local sec = math.floor(nRemainTime - min * 60)
|
||||
if sec == 0 then
|
||||
min = min - 1
|
||||
sec = 60
|
||||
end
|
||||
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Min") or "", min, sec)
|
||||
elseif 3600 < nRemainTime and nRemainTime <= 86400 then
|
||||
local hour = math.floor(nRemainTime / 3600)
|
||||
local min = math.floor((nRemainTime - hour * 3600) / 60)
|
||||
if min == 0 then
|
||||
hour = hour - 1
|
||||
min = 60
|
||||
end
|
||||
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Hour") or "", hour, min)
|
||||
elseif 86400 < nRemainTime then
|
||||
local day = math.floor(nRemainTime / 86400)
|
||||
local hour = math.floor((nRemainTime - day * 86400) / 3600)
|
||||
if hour == 0 then
|
||||
day = day - 1
|
||||
hour = 24
|
||||
end
|
||||
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Day") or "", day, hour)
|
||||
end
|
||||
return sTimeStr
|
||||
end
|
||||
function InfinityTowerSelectTowerItem:OnDisable()
|
||||
end
|
||||
return InfinityTowerSelectTowerItem
|
||||
@@ -0,0 +1,23 @@
|
||||
local InfinityTowerSelectTowerPanel = class("InfinityTowerSelectTowerPanel", BasePanel)
|
||||
InfinityTowerSelectTowerPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "InfinityTower/InfinityTowerSelectT.prefab",
|
||||
sCtrlName = "Game.UI.InfinityTower.InfinityTowerSelectTowerCtrl"
|
||||
}
|
||||
}
|
||||
function InfinityTowerSelectTowerPanel:Awake()
|
||||
self.openTowerId = nil
|
||||
local tbParam = self:GetPanelParam()
|
||||
if tbParam[1] then
|
||||
self.openTowerId = tbParam[1]
|
||||
end
|
||||
end
|
||||
function InfinityTowerSelectTowerPanel:OnEnable()
|
||||
end
|
||||
function InfinityTowerSelectTowerPanel:OnDisable()
|
||||
end
|
||||
function InfinityTowerSelectTowerPanel:OnDestroy()
|
||||
end
|
||||
function InfinityTowerSelectTowerPanel:OnRelease()
|
||||
end
|
||||
return InfinityTowerSelectTowerPanel
|
||||
Reference in New Issue
Block a user