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,157 @@
|
||||
local ScoreBossClearBDCtrl = class("ScoreBossClearBDCtrl", BaseCtrl)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
ScoreBossClearBDCtrl._mapNodeConfig = {
|
||||
aniBlur = {},
|
||||
clearTips = {},
|
||||
txtWindowTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MessageBox_Title"
|
||||
},
|
||||
gridTemp = {},
|
||||
goMessageBoxAni = {
|
||||
sNodeName = "goMessageBox",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
ContentTemp = {sComponentName = "Transform"},
|
||||
txtContentMain = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_CelarOtherLvTips"
|
||||
},
|
||||
btnSnapShot = {
|
||||
sNodeName = "snapshot",
|
||||
sComponentName = "Button",
|
||||
callback = "OnClickCancel"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickCancel"
|
||||
},
|
||||
btnCancel = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnClickCancel",
|
||||
sAction = "Giveup"
|
||||
},
|
||||
txtBtnCancel = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MessageBox_Cancel"
|
||||
},
|
||||
btnConfirm1 = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnClickConfirm",
|
||||
sAction = "Confirm"
|
||||
},
|
||||
txtConfirm1_ = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MessageBox_Confirm"
|
||||
}
|
||||
}
|
||||
function ScoreBossClearBDCtrl:Awake()
|
||||
self._mapNode.clearTips:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
end
|
||||
function ScoreBossClearBDCtrl:OnEnable()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
local tbParam = self:GetPanelParam()
|
||||
self.tabOtherLv = tbParam[1]
|
||||
self.ConfirmCallBack = tbParam[2]
|
||||
self.CancelCallBack = tbParam[3]
|
||||
self:AddTimer(1, 0.1, function()
|
||||
self:RefreshLevelMsg()
|
||||
self._mapNode.goMessageBoxAni:Play("t_window_04_t_in")
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.3)
|
||||
if GamepadUIManager.GetInputState() then
|
||||
GamepadUIManager.EnableGamepadUI("ScoreBossClearBDCtrl", self.tbGamepadUINode)
|
||||
else
|
||||
for _, v in pairs(self.tbGamepadUINode) do
|
||||
if v.sComponentName == "NaviButton" then
|
||||
NovaAPI.SetNaviButtonAction(v.mapNode, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function ScoreBossClearBDCtrl:OnDisable()
|
||||
if GamepadUIManager.GetInputState() then
|
||||
GamepadUIManager.DisableGamepadUI("ScoreBossClearBDCtrl")
|
||||
end
|
||||
end
|
||||
function ScoreBossClearBDCtrl:RefreshLevelMsg()
|
||||
self._mapNode.clearTips:SetActive(true)
|
||||
for i, v in pairs(self.tabOtherLv) do
|
||||
local objItem = instantiate(self._mapNode.gridTemp, self._mapNode.ContentTemp)
|
||||
local trans = objItem.transform:Find("AnimRoot")
|
||||
local TMPBossName = trans:Find("TMPBossName"):GetComponent("TMP_Text")
|
||||
local imgIcon = trans:Find("goMonsterHead/--Basic--/mask/imgIcon"):GetComponent("Image")
|
||||
local texCountEnd = trans:Find("goNodeItem/texCountEnd"):GetComponent("TMP_Text")
|
||||
local ScoreCount = trans:Find("goNodeItem/ScoreCount"):GetComponent("TMP_Text")
|
||||
local texLockChar = trans:Find("LockCharBg/texLockChar"):GetComponent("TMP_Text")
|
||||
local rtElements1 = trans:Find("goElements/rtElements1")
|
||||
local levelId = v
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", levelId)
|
||||
local mData = ConfigTable.GetData("Monster", bossLevelData.MonsterId)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
local Adjust = ConfigTable.GetData("MonsterValueTempleteAdjust", mData.Templete)
|
||||
NovaAPI.SetTMPText(TMPBossName, mManual.Name)
|
||||
self:SetPngSprite(imgIcon, mManual.Icon)
|
||||
local levelData = PlayerData.ScoreBoss:GetLevelData(levelId)
|
||||
NovaAPI.SetTMPText(texCountEnd, ConfigTable.GetUIText("ScoreBoss_EndScore"))
|
||||
NovaAPI.SetTMPText(ScoreCount, levelData.Score)
|
||||
NovaAPI.SetTMPText(texLockChar, ConfigTable.GetUIText("ScoreBoss_Lock_Char"))
|
||||
for i = 1, 7 do
|
||||
local tmpStar = trans:Find("goNodeItem/rt_Targets/ScoreStar" .. i):GetComponent("Button")
|
||||
tmpStar.interactable = i <= levelData.Star
|
||||
end
|
||||
for i = 1, rtElements1.childCount do
|
||||
local imgElement = rtElements1:GetChild(i - 1):GetComponent("Image")
|
||||
if Adjust.WeakEET[i] ~= nil then
|
||||
self:SetAtlasSprite(imgElement, "12_rare", AllEnum.ElementIconType.Icon .. Adjust.WeakEET[i])
|
||||
end
|
||||
imgElement.gameObject:SetActive(Adjust.WeakEET[i] ~= nil)
|
||||
end
|
||||
local tmpCharId = levelData.CharId
|
||||
for j = 1, 3 do
|
||||
local char = trans:Find("LockCharBg/lockChar_" .. j)
|
||||
local imgItemIcon = char:Find("t_char_head/imgIconBg/imgItemIcon"):GetComponent("Image")
|
||||
local imgItemRare = char:Find("t_char_head/imgItemRare"):GetComponent("Image")
|
||||
local mapChar = ConfigTable.GetData_Character(tmpCharId[j])
|
||||
local mapCharData = PlayerData.Char:GetCharDataByTid(tmpCharId[j])
|
||||
local nCharSkinId = mapCharData.nSkinId
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(imgItemIcon, mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.XXL)
|
||||
local nRarity = mapChar.Grade
|
||||
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapChar.Grade]
|
||||
self:SetAtlasSprite(imgItemRare, "12_rare", sFrame, true)
|
||||
local charLeader = char:Find("charLeader")
|
||||
local charSub = char:Find("charSub")
|
||||
local txtLeader = charLeader:Find("imgLeader/txtLeader"):GetComponent("TMP_Text")
|
||||
local txtSub1 = charSub:Find("imgSub/txtSub1"):GetComponent("TMP_Text")
|
||||
charLeader.gameObject:SetActive(j == 1)
|
||||
charSub.gameObject:SetActive(j ~= 1)
|
||||
NovaAPI.SetTMPText(txtLeader, ConfigTable.GetUIText("Build_Leader"))
|
||||
NovaAPI.SetTMPText(txtSub1, ConfigTable.GetUIText("Build_Sub"))
|
||||
end
|
||||
objItem:SetActive(true)
|
||||
end
|
||||
end
|
||||
function ScoreBossClearBDCtrl:OnClickCancel()
|
||||
self._mapNode.goMessageBoxAni:Play("t_window_04_t_out")
|
||||
self:AddTimer(1, 0.2, function()
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.ScoreBossClearBD)
|
||||
if self.CancelCallBack ~= nil then
|
||||
self.CancelCallBack()
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function ScoreBossClearBDCtrl:OnClickConfirm()
|
||||
self._mapNode.goMessageBoxAni:Play("t_window_04_t_out")
|
||||
self:AddTimer(1, 0.2, function()
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.ScoreBossClearBD)
|
||||
if self.ConfirmCallBack ~= nil then
|
||||
self.ConfirmCallBack()
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
return ScoreBossClearBDCtrl
|
||||
@@ -0,0 +1,19 @@
|
||||
local ScoreBossClearBDPanel = class("ScoreBossClearBDPanel", BasePanel)
|
||||
ScoreBossClearBDPanel._bIsMainPanel = false
|
||||
ScoreBossClearBDPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "Play_ScoreBoss/ScoreBossClearBDPanel.prefab",
|
||||
sCtrlName = "Game.UI.ScoreBoss.ScoreBossClearBDCtrl"
|
||||
}
|
||||
}
|
||||
function ScoreBossClearBDPanel:Awake()
|
||||
end
|
||||
function ScoreBossClearBDPanel:OnEnable()
|
||||
end
|
||||
function ScoreBossClearBDPanel:OnDisable()
|
||||
end
|
||||
function ScoreBossClearBDPanel:OnDestroy()
|
||||
end
|
||||
function ScoreBossClearBDPanel:OnRelease()
|
||||
end
|
||||
return ScoreBossClearBDPanel
|
||||
@@ -0,0 +1,117 @@
|
||||
local ScoreBossLevelInfoCtrl = class("ScoreBossLevelInfoCtrl", BaseCtrl)
|
||||
local colorWhite = Color(1, 1, 1, 1)
|
||||
local colorRed = Color(0.8470588235294118, 0.3137254901960784, 0.32941176470588235)
|
||||
local texCurScoreText = "{0}/<size=28>{1}</size>"
|
||||
ScoreBossLevelInfoCtrl._mapNodeConfig = {
|
||||
TMPChallengeTime = {sComponentName = "TMP_Text"},
|
||||
texStarCount = {sComponentName = "TMP_Text"},
|
||||
curScoreTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Cur_Score"
|
||||
},
|
||||
texCurScore = {sComponentName = "TMP_Text"},
|
||||
texSkillScore = {sComponentName = "TMP_Text"},
|
||||
cgRoot = {
|
||||
sNodeName = "----SafeAreaRoot----",
|
||||
sComponentName = "CanvasGroup"
|
||||
},
|
||||
animatorTime = {
|
||||
sNodeName = "rtChallengeTime",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
texCurSkill = {sComponentName = "TMP_Text"},
|
||||
skillAni = {
|
||||
sNodeName = "texCurSkillDb",
|
||||
sComponentName = "Animator"
|
||||
}
|
||||
}
|
||||
ScoreBossLevelInfoCtrl._mapEventConfig = {
|
||||
ScoreBoss_Gameplay_Time = "OnEvent_Time",
|
||||
ScoreBoss_Score_Change = "OnEvent_ScoreChange",
|
||||
ScoreBoss_Score_SkillChange = "OnEvent_SkillScoreChange",
|
||||
InputEnable = "OnEvent_InputEnable"
|
||||
}
|
||||
function ScoreBossLevelInfoCtrl:Awake()
|
||||
self.isPlaySkillAni = false
|
||||
self.curTotal = 0
|
||||
self.maxStarCount = #PlayerData.ScoreBoss.tabScoreNeed
|
||||
NovaAPI.SetTMPText(self._mapNode.texStarCount, self.curTotal)
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", PlayerData.ScoreBoss.entryLevelId)
|
||||
self.getControl = ConfigTable.GetData("ScoreBossGetControl", bossLevelData.NonDamageScoreGet)
|
||||
self.OnceControlScore = self.getControl.OnceScore
|
||||
self.MaxSkillScore = math.floor(self.getControl.MaxLimit / self.getControl.OnceScore)
|
||||
NovaAPI.SetTMPText(self._mapNode.texSkillScore, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Info_SkillScore"), 0, self.OnceControlScore))
|
||||
local nTime = ConfigTable.GetConfigNumber("ScoreBossTimeLimit")
|
||||
self:OnEvent_Time(nTime)
|
||||
local needData = ConfigTable.GetData("ScoreBossStar", 1)
|
||||
NovaAPI.SetTMPText(self._mapNode.texCurScore, orderedFormat(texCurScoreText, 0, needData.ScoreNeed))
|
||||
NovaAPI.SetTMPText(self._mapNode.texCurSkill, self.getControl.Name .. "+0")
|
||||
self._mapNode.skillAni.gameObject:SetActive(false)
|
||||
end
|
||||
function ScoreBossLevelInfoCtrl:OnEvent_Time(nTime)
|
||||
local nMin = math.floor(nTime / 60)
|
||||
local nSec = math.fmod(nTime, 60)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPChallengeTime, string.format("%02d:%02d", nMin, nSec))
|
||||
if nTime <= 15 then
|
||||
NovaAPI.SetTMPColor(self._mapNode.TMPChallengeTime, colorRed)
|
||||
self._mapNode.animatorTime:Play("BossChallengeTime_show")
|
||||
end
|
||||
end
|
||||
function ScoreBossLevelInfoCtrl:OnEvent_ScoreChange()
|
||||
local totalStar = PlayerData.ScoreBoss:ScoreToStar()
|
||||
local totalScore = PlayerData.ScoreBoss:GetTotalScore()
|
||||
local tmpLv = totalStar == self.maxStarCount and self.maxStarCount or totalStar + 1
|
||||
local needData = ConfigTable.GetData("ScoreBossStar", tmpLv)
|
||||
NovaAPI.SetTMPText(self._mapNode.texCurScore, orderedFormat(texCurScoreText, totalScore, needData.ScoreNeed))
|
||||
if totalStar > self.curTotal then
|
||||
self.curTotal = totalStar
|
||||
NovaAPI.SetTMPText(self._mapNode.texStarCount, self.curTotal)
|
||||
end
|
||||
end
|
||||
function ScoreBossLevelInfoCtrl:OnEvent_SkillScoreChange()
|
||||
local bScore, bScoreCount = PlayerData.ScoreBoss:GetBehaviorScore()
|
||||
NovaAPI.SetTMPText(self._mapNode.texCurSkill, self.getControl.Name .. "+" .. self.OnceControlScore)
|
||||
if bScoreCount < self.MaxSkillScore then
|
||||
NovaAPI.SetTMPText(self._mapNode.texSkillScore, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Info_SkillScore"), bScoreCount, self.OnceControlScore))
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.texSkillScore, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Info_SkillScoreMax"), bScoreCount, self.OnceControlScore))
|
||||
end
|
||||
if self.isPlaySkillAni then
|
||||
if self.timeAni then
|
||||
self.timeAni:Cancel()
|
||||
self.timeAni = nil
|
||||
end
|
||||
if self.timeAniObj then
|
||||
self.timeAniObj:Cancel()
|
||||
self.timeAniObj = nil
|
||||
end
|
||||
self._mapNode.skillAni.gameObject:SetActive(true)
|
||||
self._mapNode.skillAni:Play("ScoreBossLevel_score_out")
|
||||
self:AddTimer(1, 0.167, function()
|
||||
self._mapNode.skillAni:Play("ScoreBossLevel_score_in")
|
||||
self.timeAniObj = self:AddTimer(1, 0.6, function()
|
||||
self._mapNode.skillAni:Play("ScoreBossLevel_score_out")
|
||||
self.timeAniObj = nil
|
||||
end, true, true, true)
|
||||
end, true, true, true)
|
||||
else
|
||||
self._mapNode.skillAni.gameObject:SetActive(true)
|
||||
self._mapNode.skillAni:Play("ScoreBossLevel_score_in")
|
||||
self.timeAniObj = self:AddTimer(1, 0.6, function()
|
||||
self._mapNode.skillAni:Play("ScoreBossLevel_score_out")
|
||||
self.timeAniObj = nil
|
||||
end, true, true, true)
|
||||
end
|
||||
self.isPlaySkillAni = true
|
||||
self.timeAni = self:AddTimer(1, 0.767, function()
|
||||
self._mapNode.skillAni.gameObject:SetActive(false)
|
||||
self.isPlaySkillAni = false
|
||||
self.timeAni = nil
|
||||
end, true, true, true)
|
||||
end
|
||||
function ScoreBossLevelInfoCtrl:OnEvent_InputEnable(bEnable)
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.cgRoot, bEnable == true and 1 or 0)
|
||||
NovaAPI.SetCanvasGroupBlocksRaycasts(self._mapNode.cgRoot, bEnable == true)
|
||||
NovaAPI.SetCanvasGroupInteractable(self._mapNode.cgRoot, bEnable == true)
|
||||
end
|
||||
return ScoreBossLevelInfoCtrl
|
||||
@@ -0,0 +1,233 @@
|
||||
local ScoreBossPauseCtrl = class("ScoreBossPauseCtrl", BaseCtrl)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
ScoreBossPauseCtrl._mapNodeConfig = {
|
||||
goBlur = {
|
||||
sNodeName = "t_fullscreen_blur_01"
|
||||
},
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_01",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
safeAreaRoot = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
imgBlocker = {},
|
||||
btnBgClose = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
aniWindow = {
|
||||
sNodeName = "PauseWindow",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
txtWindowTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MainBattle_Pause"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
btnGiveUp = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_GiveUp",
|
||||
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"
|
||||
},
|
||||
goChar = {
|
||||
nCount = 3,
|
||||
sNodeName = "btnChar",
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateCharCtrl"
|
||||
},
|
||||
txtSubTitle1 = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_ReminTime"
|
||||
},
|
||||
txtSubTitle2 = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MainBattle_Task"
|
||||
},
|
||||
txtTime = {sComponentName = "TMP_Text"},
|
||||
txtLeader = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Build_Leader"
|
||||
},
|
||||
txtSub = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Build_Sub"
|
||||
},
|
||||
ScoreStar = {nCount = 7, sComponentName = "Button"},
|
||||
texTotalScore = {sComponentName = "TMP_Text"},
|
||||
texDamageScore = {sComponentName = "TMP_Text"},
|
||||
texSkillScore = {sComponentName = "TMP_Text"},
|
||||
texTotalTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_TotalScore"
|
||||
},
|
||||
texDamageTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_DamageScore"
|
||||
},
|
||||
texSkillTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_SkillScore"
|
||||
},
|
||||
skillInfoName1 = {sComponentName = "TMP_Text"},
|
||||
skillInfoDes1 = {sComponentName = "TMP_Text"},
|
||||
skillInfoName2 = {sComponentName = "TMP_Text"},
|
||||
skillInfoDes2 = {sComponentName = "TMP_Text"}
|
||||
}
|
||||
ScoreBossPauseCtrl._mapEventConfig = {
|
||||
ScoreBoss_Gameplay_Time = "OnEvent_Time",
|
||||
OpenScoreBossPause = "Pause",
|
||||
GamepadUIReopen = "OnEvent_Reopen"
|
||||
}
|
||||
function ScoreBossPauseCtrl:Awake()
|
||||
self._mapNode.safeAreaRoot:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
NovaAPI.SetTMPText(self._mapNode.txtTime, string.format("%02d:%02d", 3, 0))
|
||||
local tbConfig = {
|
||||
{
|
||||
sAction = "Skill",
|
||||
sLang = "StarTowerMap_Btn_Skill"
|
||||
},
|
||||
{
|
||||
sAction = "Settings",
|
||||
sLang = "StarTowerMap_Btn_Settings"
|
||||
}
|
||||
}
|
||||
self._mapNode.ActionBar:InitActionBar(tbConfig)
|
||||
end
|
||||
function ScoreBossPauseCtrl:Pause(nLevelId, tbCharId)
|
||||
self.tbChar = tbCharId
|
||||
self.nLevelId = nLevelId
|
||||
EventManager.Hit(EventId.BattleDashboardVisible, false)
|
||||
PanelManager.InputDisable()
|
||||
self:PlayInAni()
|
||||
self:Refresh()
|
||||
GamepadUIManager.EnableGamepadUI("ScoreBossPauseCtrl", self.tbGamepadUINode)
|
||||
end
|
||||
function ScoreBossPauseCtrl:OnEvent_Time(nTime)
|
||||
local nMin = math.floor(nTime / 60)
|
||||
local nSec = math.fmod(nTime, 60)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtTime, string.format("%02d:%02d", nMin, nSec))
|
||||
end
|
||||
function ScoreBossPauseCtrl:Refresh()
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", self.nLevelId)
|
||||
local getControl = ConfigTable.GetData("ScoreBossGetControl", bossLevelData.NonDamageScoreGet)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoName1, getControl.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoDes1, getControl.BehaviorDes)
|
||||
local bossAbility = ConfigTable.GetData("ScoreBossAbility", bossLevelData.ScoreBossAbility)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoName2, bossAbility.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoDes2, UTILS.ParseDesc(bossAbility))
|
||||
NovaAPI.SetTMPText(self._mapNode.texTotalScore, PlayerData.ScoreBoss:GetTotalScore())
|
||||
NovaAPI.SetTMPText(self._mapNode.texDamageScore, PlayerData.ScoreBoss:GetDamageScore())
|
||||
local bScore, bScoreCount = PlayerData.ScoreBoss:GetBehaviorScore()
|
||||
NovaAPI.SetTMPText(self._mapNode.texSkillScore, bScore)
|
||||
local totalStar = PlayerData.ScoreBoss:ScoreToStar()
|
||||
for i = 1, 7 do
|
||||
self._mapNode.ScoreStar[i].interactable = i <= totalStar
|
||||
end
|
||||
for i = 1, 3 do
|
||||
self._mapNode.goChar[i]:SetChar(self.tbChar[i])
|
||||
end
|
||||
end
|
||||
function ScoreBossPauseCtrl:PlayInAni()
|
||||
self._mapNode.goBlur: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 ScoreBossPauseCtrl:OnBtnClick_GiveUp(btn)
|
||||
local sTip = ""
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", self.nLevelId)
|
||||
local mData = ConfigTable.GetData("Monster", bossLevelData.MonsterId)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
local sAlert = orderedFormat(ConfigTable.GetUIText("ScoreBoss_GiveUpTips"), mManual.Name)
|
||||
sTip = sAlert
|
||||
local confirmCallback = function()
|
||||
self:PlayCloseAni(true)
|
||||
self._mapNode.imgBlocker:SetActive(true)
|
||||
end
|
||||
local msg = {
|
||||
nType = AllEnum.MessageBox.Confirm,
|
||||
sContent = sTip,
|
||||
callbackConfirm = confirmCallback,
|
||||
bBlur = false
|
||||
}
|
||||
EventManager.Hit(EventId.OpenMessageBox, msg)
|
||||
end
|
||||
function ScoreBossPauseCtrl:OnBtnClick_Close(btn)
|
||||
self:PlayCloseAni(false)
|
||||
end
|
||||
function ScoreBossPauseCtrl:OnBtnClick_Settings(btn)
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.BattleSettings)
|
||||
self._mapNode.ActionBar.gameObject:SetActive(false)
|
||||
end
|
||||
function ScoreBossPauseCtrl:OnBtnClick_Skill(btn)
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.PopupSkillPanel, self.tbChar)
|
||||
self._mapNode.ActionBar.gameObject:SetActive(false)
|
||||
end
|
||||
function ScoreBossPauseCtrl:OnEvent_Reopen(sName)
|
||||
if sName ~= "ScoreBossPauseCtrl" then
|
||||
return
|
||||
end
|
||||
self._mapNode.ActionBar.gameObject:SetActive(true)
|
||||
end
|
||||
function ScoreBossPauseCtrl: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 ScoreBossPauseCtrl:OnPanelClose(_, bGiveUp)
|
||||
PanelManager.InputEnable()
|
||||
GamepadUIManager.DisableGamepadUI("ScoreBossPauseCtrl")
|
||||
EventManager.Hit(EventId.BattleDashboardVisible, true)
|
||||
self._mapNode.safeAreaRoot:SetActive(false)
|
||||
self._mapNode.goBlur:SetActive(false)
|
||||
self._mapNode.imgBlocker:SetActive(false)
|
||||
if bGiveUp then
|
||||
EventManager.Hit(EventId.AbandonBattle)
|
||||
end
|
||||
end
|
||||
return ScoreBossPauseCtrl
|
||||
@@ -0,0 +1,250 @@
|
||||
local ScoreBossRankingCtrl = class("ScoreBossRankingCtrl", BaseCtrl)
|
||||
ScoreBossRankingCtrl._mapNodeConfig = {
|
||||
TopBarPanel = {
|
||||
sCtrlName = "Game.UI.TopBarEx.TopBarCtrl"
|
||||
},
|
||||
imgBlurBG = {},
|
||||
txtLoading = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScorebossRanking_Loading"
|
||||
},
|
||||
txtRankingListRankTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "STRanking_Rank"
|
||||
},
|
||||
txtRankingListPlayerTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBossRankingPlayerName"
|
||||
},
|
||||
txtRankingListScoreTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "JointDrill_Rank_Score"
|
||||
},
|
||||
txtRankingListDetailTitle = {sComponentName = "TMP_Text", sLanguageId = "MoreInfo"},
|
||||
txtRefreshTime = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "STRanking_Refresh_Tips"
|
||||
},
|
||||
txtRefreshTimeReward = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "STRanking_Refresh_Tips"
|
||||
},
|
||||
rtPlayerInfo = {
|
||||
sCtrlName = "Game.UI.ScoreBoss.ScoreBossRanking.ScoreBossRankingGridCtrl"
|
||||
},
|
||||
svRankingInfo = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
goLoading = {},
|
||||
goMainContent = {},
|
||||
goSafeArea = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
svRankingReward = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
btnCloseReward = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_CloseReward"
|
||||
},
|
||||
btnRewardClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_CloseReward"
|
||||
},
|
||||
btnReward = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_ShowReward"
|
||||
},
|
||||
txtBtnReward = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "STRanking_Reward_Btn"
|
||||
},
|
||||
goRewardView = {},
|
||||
t_window_04 = {sComponentName = "Animator"},
|
||||
goTeamDetail = {
|
||||
sCtrlName = "Game.UI.ScoreBoss.ScoreBossRanking.ScoreBossRankingTeamDetailCtrl"
|
||||
},
|
||||
txtEndTime = {sComponentName = "TMP_Text"},
|
||||
txt_Reward_Title = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "StarTower_Ranking_Reward"
|
||||
}
|
||||
}
|
||||
ScoreBossRankingCtrl._mapEventConfig = {
|
||||
ShowTeamDetail = "OnEvent_ShowTeamDetail",
|
||||
[EventId.UIHomeConfirm] = "OnEvent_Home",
|
||||
[EventId.UIBackConfirm] = "OnEvent_Back"
|
||||
}
|
||||
function ScoreBossRankingCtrl:Awake()
|
||||
self._mapRankingGrid = {}
|
||||
self._mapRewardGrid = {}
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnDisable()
|
||||
for go, mapCtrl in pairs(self._mapRankingGrid) do
|
||||
self:UnbindCtrlByNode(mapCtrl)
|
||||
end
|
||||
for go, mapCtrl in pairs(self._mapRewardGrid) do
|
||||
self:UnbindCtrlByNode(mapCtrl)
|
||||
end
|
||||
self._mapRankingGrid = {}
|
||||
self._mapRewardGrid = {}
|
||||
if self.timerRefreshRanking ~= nil then
|
||||
self.timerRefreshRanking:Cancel()
|
||||
self.timerRefreshRanking = nil
|
||||
end
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnEnable()
|
||||
self._mapNode.goSafeArea:SetActive(false)
|
||||
self._mapNode.imgBlurBG:SetActive(true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.goSafeArea.gameObject:SetActive(true)
|
||||
self._mapNode.goLoading.gameObject:SetActive(true)
|
||||
self._mapNode.goMainContent.gameObject:SetActive(false)
|
||||
PlayerData.ScoreBoss:SendScoreBossApplyReq(function()
|
||||
local rankPlayerCount = PlayerData.ScoreBoss:GetRankPlayerCount()
|
||||
if 0 < rankPlayerCount then
|
||||
self:OpenPanel()
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.txtLoading, ConfigTable.GetUIText("STRanking_Empty"))
|
||||
end
|
||||
end)
|
||||
self.timerRefreshRanking = self:AddTimer(0, 600, function()
|
||||
PlayerData.ScoreBoss:SendScoreBossApplyReq(function()
|
||||
local rankPlayerCount = PlayerData.ScoreBoss:GetRankPlayerCount()
|
||||
if 0 < rankPlayerCount then
|
||||
self:OpenPanel()
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.txtLoading, ConfigTable.GetUIText("STRanking_Empty"))
|
||||
end
|
||||
end)
|
||||
end, true, true, true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function ScoreBossRankingCtrl:OpenPanel()
|
||||
self._mapNode.goLoading:SetActive(false)
|
||||
self._mapNode.goMainContent:SetActive(true)
|
||||
local mapSelfRankingData = PlayerData.ScoreBoss:GetRankSelfMsg()
|
||||
self.mapSelfRankingData = mapSelfRankingData
|
||||
self._mapNode.rtPlayerInfo:Refresh(0, true)
|
||||
local rankTable = PlayerData.ScoreBoss:GetRankTableCount()
|
||||
if 0 < rankTable then
|
||||
self._mapNode.svRankingInfo.gameObject:SetActive(true)
|
||||
self._mapNode.svRankingInfo:Init(rankTable, self, self.OnGridRankingRefresh)
|
||||
self:PlayGridItemAnim()
|
||||
else
|
||||
self._mapNode.svRankingInfo.gameObject:SetActive(false)
|
||||
end
|
||||
self._mapNode.svRankingReward:Init(PlayerData.ScoreBoss.maxRankCount, self, self.OnGridRankingRewardRefresh)
|
||||
self._mapNode.goTeamDetail.gameObject:SetActive(false)
|
||||
local endTime = PlayerData.ScoreBoss.EndTime + ConfigTable.GetConfigNumber("SeasonEndThreshold")
|
||||
local sTime = os.date("%m/%d %H:%M", endTime)
|
||||
local sEndTimeTitle = ConfigTable.GetUIText("ScoreBossRankingEndTime")
|
||||
NovaAPI.SetTMPText(self._mapNode.txtEndTime, sEndTimeTitle .. " " .. sTime)
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnGridRankingRefresh(grid)
|
||||
if self._mapRankingGrid[grid] == nil then
|
||||
local mapCtrl = self:BindCtrlByNode(grid, "Game.UI.ScoreBoss.ScoreBossRanking.ScoreBossRankingGridCtrl")
|
||||
self._mapRankingGrid[grid] = mapCtrl
|
||||
end
|
||||
local nIdx = tonumber(grid.name)
|
||||
if nIdx == nil then
|
||||
return
|
||||
end
|
||||
nIdx = nIdx + 1
|
||||
self._mapRankingGrid[grid]:Refresh(nIdx)
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnGridRankingRewardRefresh(grid)
|
||||
if self._mapRewardGrid[grid] == nil then
|
||||
local mapCtrl = self:BindCtrlByNode(grid, "Game.UI.ScoreBoss.ScoreBossRanking.ScoreBossRewardGridCtrl")
|
||||
self._mapRewardGrid[grid] = mapCtrl
|
||||
end
|
||||
local nIdx = tonumber(grid.name)
|
||||
if nIdx == nil then
|
||||
return
|
||||
end
|
||||
nIdx = nIdx + 1
|
||||
local rankPlayerCount = 0
|
||||
local nSelfIdx = -1.0
|
||||
if self.mapSelfRankingData ~= nil then
|
||||
rankPlayerCount = PlayerData.ScoreBoss:GetRankPlayerCount()
|
||||
if 0 < rankPlayerCount and rankPlayerCount <= 100 then
|
||||
nSelfIdx = self.mapSelfRankingData.Rank / 100
|
||||
elseif 100 < rankPlayerCount then
|
||||
nSelfIdx = self.mapSelfRankingData.Rank / rankPlayerCount
|
||||
end
|
||||
nSelfIdx = nSelfIdx * 10000
|
||||
end
|
||||
self._mapRewardGrid[grid]:Refresh(nIdx, nSelfIdx)
|
||||
end
|
||||
function ScoreBossRankingCtrl:PlayGridItemAnim()
|
||||
local sv = self._mapNode.svRankingInfo
|
||||
local sAnim = "go"
|
||||
local nAnimTime = 0.1
|
||||
local nItemAnimLen = 0
|
||||
local listInUse = sv:GetInUseGridIndex()
|
||||
self.tbGridInUse = {}
|
||||
for i = 0, listInUse.Count - 1 do
|
||||
table.insert(self.tbGridInUse, listInUse[i])
|
||||
end
|
||||
if self.gridItemAnimTimer ~= nil then
|
||||
self.gridItemAnimTimer:Cancel()
|
||||
self.gridItemAnimTimer = nil
|
||||
end
|
||||
for k, v in ipairs(self.tbGridInUse) do
|
||||
local goGrid = sv.transform:Find("Viewport/Content/" .. v)
|
||||
local animRoot = goGrid:GetComponent("Animator")
|
||||
if animRoot ~= nil then
|
||||
animRoot.gameObject:SetActive(false)
|
||||
end
|
||||
if k == 1 and animRoot ~= nil then
|
||||
animRoot.gameObject:SetActive(true)
|
||||
nItemAnimLen = NovaAPI.GetAnimClipLength(animRoot, {sAnim})
|
||||
animRoot:Play(sAnim, 0, 0)
|
||||
end
|
||||
end
|
||||
local nCurIndex = 1
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
self.gridItemAnimTimer = self:AddTimer(0, nAnimTime, function()
|
||||
nCurIndex = nCurIndex + 1
|
||||
if nCurIndex > #self.tbGridInUse and self.gridItemAnimTimer ~= nil then
|
||||
self.gridItemAnimTimer:Cancel()
|
||||
self.gridItemAnimTimer = nil
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
return
|
||||
end
|
||||
local goGrid = sv.transform:Find("Viewport/Content/" .. self.tbGridInUse[nCurIndex])
|
||||
if goGrid ~= nil then
|
||||
local animRoot = goGrid:GetComponent("Animator")
|
||||
animRoot.gameObject:SetActive(true)
|
||||
animRoot:Play(sAnim, 0, 0)
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnEvent_ShowTeamDetail(mapRanking)
|
||||
self._mapNode.goTeamDetail.gameObject:SetActive(true)
|
||||
self._mapNode.goTeamDetail:Refresh(mapRanking)
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnBtnClick_ShowReward()
|
||||
self._mapNode.goRewardView:SetActive(true)
|
||||
self._mapNode.t_window_04:Play("t_window_04_t_in")
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnBtnClick_CloseReward()
|
||||
self._mapNode.t_window_04:Play("t_window_04_t_out")
|
||||
local close = function()
|
||||
self._mapNode.goRewardView:SetActive(false)
|
||||
end
|
||||
self:AddTimer(1, 0.2, close, true, true, true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.2)
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnEvent_Back(nPanelId)
|
||||
EventManager.Hit(EventId.CloesCurPanel)
|
||||
end
|
||||
function ScoreBossRankingCtrl:OnEvent_Home(nPanelId)
|
||||
if self._panel._nPanelId ~= nPanelId then
|
||||
return
|
||||
end
|
||||
PanelManager.Home()
|
||||
end
|
||||
return ScoreBossRankingCtrl
|
||||
@@ -0,0 +1,122 @@
|
||||
local ScoreBossRankingGridCtrl = class("ScoreBossRankingGridCtrl", BaseCtrl)
|
||||
ScoreBossRankingGridCtrl._mapNodeConfig = {
|
||||
imgRankIcon = {sComponentName = "Image"},
|
||||
TMPRank = {sComponentName = "TMP_Text"},
|
||||
TMPScore = {sComponentName = "TMP_Text"},
|
||||
imgHead = {sComponentName = "Image"},
|
||||
TMPPlayerName = {sComponentName = "TMP_Text"},
|
||||
TMPPlayerTitle = {sComponentName = "TMP_Text"},
|
||||
TMPTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Friend_TitleTag"
|
||||
},
|
||||
goHonorTitle = {
|
||||
nCount = 3,
|
||||
sCtrlName = "Game.UI.FriendEx.HonorTitleCtrl"
|
||||
},
|
||||
btnTeamDetail = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_TeamDetail"
|
||||
},
|
||||
TMPScoreEmpty = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "InfinityTower_EnemyInfo_None"
|
||||
},
|
||||
TMPRankEmpty = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBossRankingEmpty"
|
||||
},
|
||||
imgScoreBgEmpty = {},
|
||||
imgScoreBg = {},
|
||||
imgBtnMask = {}
|
||||
}
|
||||
ScoreBossRankingGridCtrl._mapEventConfig = {}
|
||||
ScoreBossRankingGridCtrl._mapRedDotConfig = {}
|
||||
function ScoreBossRankingGridCtrl:RefreshHonorTitle(tbHonors)
|
||||
for i = 1, 3 do
|
||||
self._mapNode.goHonorTitle[i].gameObject:SetActive(false)
|
||||
end
|
||||
for k, v in pairs(tbHonors) do
|
||||
if v ~= nil and v.Id > 0 then
|
||||
local honorData = ConfigTable.GetData("Honor", v.Id)
|
||||
self._mapNode.goHonorTitle[k]:SetHonotTitle(honorData.Id, k == 1, v.AffinityLV)
|
||||
self._mapNode.goHonorTitle[k].gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
function ScoreBossRankingGridCtrl:Refresh(nIdx, bFixed)
|
||||
local mapRanking = PlayerData.ScoreBoss:GetPlayerRankMsg(nIdx)
|
||||
self.nIdx = nIdx
|
||||
if bFixed then
|
||||
mapRanking = PlayerData.ScoreBoss:GetRankSelfMsg()
|
||||
self.bSelf = true
|
||||
if mapRanking ~= nil then
|
||||
self.nIdx = mapRanking.Rank
|
||||
end
|
||||
end
|
||||
if mapRanking == nil and not bFixed then
|
||||
self.gameObject:SetActive(false)
|
||||
return
|
||||
elseif mapRanking == nil and bFixed then
|
||||
self._mapNode.imgRankIcon.gameObject:SetActive(false)
|
||||
self._mapNode.TMPRankEmpty.gameObject:SetActive(true)
|
||||
self._mapNode.TMPRank.gameObject:SetActive(false)
|
||||
self._mapNode.imgScoreBgEmpty:SetActive(true)
|
||||
self._mapNode.imgScoreBg:SetActive(false)
|
||||
self._mapNode.imgBtnMask:SetActive(true)
|
||||
local curHononData = PlayerData.Base:GetPlayerHonorTitle() or {}
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerName, PlayerData.Base:GetPlayerNickName())
|
||||
local mapHeadCfg = ConfigTable.GetData("PlayerHead", PlayerData.Base:GetPlayerHeadId())
|
||||
if mapHeadCfg ~= nil then
|
||||
self:SetPngSprite(self._mapNode.imgHead, mapHeadCfg.Icon)
|
||||
end
|
||||
local nPre, nSuf = PlayerData.Base:GetPlayerTitle()
|
||||
if nPre == 0 or nSuf == 0 then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerTitle, "")
|
||||
else
|
||||
local sTitle = orderedFormat(ConfigTable.GetUIText("FriendPanel_PlayerTitle") or "", ConfigTable.GetData("Title", nPre).Desc, ConfigTable.GetData("Title", nSuf).Desc)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerTitle, sTitle)
|
||||
end
|
||||
self:RefreshHonorTitle(curHononData)
|
||||
return
|
||||
end
|
||||
self._mapNode.imgScoreBgEmpty:SetActive(false)
|
||||
self._mapNode.imgScoreBg:SetActive(true)
|
||||
self._mapNode.TMPRankEmpty.gameObject:SetActive(false)
|
||||
self._mapNode.TMPRank.gameObject:SetActive(true)
|
||||
self._mapNode.imgBtnMask:SetActive(false)
|
||||
if mapRanking.Rank <= 3 then
|
||||
self:SetPngSprite(self._mapNode.imgRankIcon, "Icon/ZZZOther/bossrush_rank_" .. mapRanking.Rank)
|
||||
self._mapNode.imgRankIcon.gameObject:SetActive(true)
|
||||
self._mapNode.TMPRank.gameObject:SetActive(false)
|
||||
else
|
||||
self._mapNode.imgRankIcon.gameObject:SetActive(false)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRank, mapRanking.Rank)
|
||||
self._mapNode.TMPRank.gameObject:SetActive(true)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPScore, string.formatnumberthousands(mapRanking.Score))
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerName, mapRanking.NickName)
|
||||
if mapRanking.TitlePrefix == 0 or mapRanking.TitleSuffix == 0 then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerTitle, "")
|
||||
else
|
||||
local sTitle = orderedFormat(ConfigTable.GetUIText("FriendPanel_PlayerTitle") or "", ConfigTable.GetData("Title", mapRanking.TitlePrefix).Desc, ConfigTable.GetData("Title", mapRanking.TitleSuffix).Desc)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerTitle, sTitle)
|
||||
end
|
||||
local mapCfg = ConfigTable.GetData("PlayerHead", mapRanking.HeadIcon)
|
||||
if mapCfg ~= nil then
|
||||
self:SetPngSprite(self._mapNode.imgHead, mapCfg.Icon)
|
||||
end
|
||||
self:RefreshHonorTitle(mapRanking.Honors)
|
||||
end
|
||||
function ScoreBossRankingGridCtrl:OnBtnClick_TeamDetail()
|
||||
local mapRanking = PlayerData.ScoreBoss:GetPlayerRankMsg(self.nIdx)
|
||||
if self.bSelf then
|
||||
mapRanking = PlayerData.ScoreBoss:GetRankSelfMsg()
|
||||
end
|
||||
if mapRanking == nil then
|
||||
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_Rank_Detail_Empty"))
|
||||
return
|
||||
end
|
||||
EventManager.Hit("ShowTeamDetail", mapRanking)
|
||||
end
|
||||
return ScoreBossRankingGridCtrl
|
||||
@@ -0,0 +1,18 @@
|
||||
local ScoreBossRankingPanel = class("ScoreBossRankingPanel", BasePanel)
|
||||
ScoreBossRankingPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "Play_ScoreBoss/ScoreBossRankingPanel.prefab",
|
||||
sCtrlName = "Game.UI.ScoreBoss.ScoreBossRanking.ScoreBossRankingCtrl"
|
||||
}
|
||||
}
|
||||
function ScoreBossRankingPanel:Awake()
|
||||
end
|
||||
function ScoreBossRankingPanel:OnEnable()
|
||||
end
|
||||
function ScoreBossRankingPanel:OnDisable()
|
||||
end
|
||||
function ScoreBossRankingPanel:OnDestroy()
|
||||
end
|
||||
function ScoreBossRankingPanel:OnRelease()
|
||||
end
|
||||
return ScoreBossRankingPanel
|
||||
@@ -0,0 +1,75 @@
|
||||
local ScoreBossRankingPlayerInfoCtrl = class("ScoreBossRankingPlayerInfoCtrl", BaseCtrl)
|
||||
ScoreBossRankingPlayerInfoCtrl._mapNodeConfig = {
|
||||
imgHead = {sComponentName = "Image"},
|
||||
imgIconRank = {sComponentName = "Image"},
|
||||
TMPPlayerLevel = {sComponentName = "TMP_Text"},
|
||||
TMPPlayerLevelTitle = {sComponentName = "TMP_Text"},
|
||||
TMPPlayerName = {sComponentName = "TMP_Text"},
|
||||
TMPPlayerTitle = {sComponentName = "TMP_Text"},
|
||||
TMPRank = {sComponentName = "TMP_Text"},
|
||||
TMPScore = {sComponentName = "TMP_Text"},
|
||||
TMPScoreTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Rank_Score"
|
||||
},
|
||||
rtEmpty = {},
|
||||
rtRankingInfo = {}
|
||||
}
|
||||
ScoreBossRankingPlayerInfoCtrl._mapEventConfig = {}
|
||||
ScoreBossRankingPlayerInfoCtrl._mapRedDotConfig = {}
|
||||
function ScoreBossRankingPlayerInfoCtrl:Awake()
|
||||
end
|
||||
function ScoreBossRankingPlayerInfoCtrl:FadeIn()
|
||||
end
|
||||
function ScoreBossRankingPlayerInfoCtrl:FadeOut()
|
||||
end
|
||||
function ScoreBossRankingPlayerInfoCtrl:OnEnable()
|
||||
end
|
||||
function ScoreBossRankingPlayerInfoCtrl:OnDisable()
|
||||
end
|
||||
function ScoreBossRankingPlayerInfoCtrl:OnDestroy()
|
||||
end
|
||||
function ScoreBossRankingPlayerInfoCtrl:OnRelease()
|
||||
end
|
||||
function ScoreBossRankingPlayerInfoCtrl:Refresh(mapSelfRanking)
|
||||
self.gameObject:SetActive(true)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerName, PlayerData.Base:GetPlayerNickName())
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerLevel, tostring(PlayerData.Base:GetWorldClass()))
|
||||
local nPre, nSuf = PlayerData.Base:GetPlayerTitle()
|
||||
if nPre == 0 or nSuf == 0 then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerTitle, "")
|
||||
return
|
||||
end
|
||||
local sTitle = orderedFormat(ConfigTable.GetUIText("FriendPanel_PlayerTitle") or "", ConfigTable.GetData("Title", nPre).Desc, ConfigTable.GetData("Title", nSuf).Desc)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPlayerTitle, sTitle)
|
||||
local nHeadId = PlayerData.Base:GetPlayerHeadId()
|
||||
local mapCfg = ConfigTable.GetData("PlayerHead", nHeadId)
|
||||
self:SetPngSprite(self._mapNode.imgHead, mapCfg.Icon)
|
||||
if mapSelfRanking == nil then
|
||||
self._mapNode.rtEmpty:SetActive(true)
|
||||
self._mapNode.rtRankingInfo:SetActive(false)
|
||||
return
|
||||
end
|
||||
self._mapNode.rtEmpty:SetActive(false)
|
||||
self._mapNode.rtRankingInfo:SetActive(true)
|
||||
local nRewardIdx = PlayerData.ScoreBoss:GetSelfBorderIndex()
|
||||
self:SetAtlasSprite(self._mapNode.imgIconRank, "12_rare", "bossrush_rank_" .. nRewardIdx)
|
||||
local mapRewardCfgData = ConfigTable.GetData("ScoreBossRank", nRewardIdx)
|
||||
if mapRewardCfgData == nil then
|
||||
return
|
||||
end
|
||||
local nRankingHigher = mapRewardCfgData.RankLower
|
||||
local nRankLower = 0
|
||||
if nRewardIdx ~= 1 and ConfigTable.GetData("ScoreBossRank", nRewardIdx - 1) ~= nil then
|
||||
nRankLower = ConfigTable.GetData("ScoreBossRank", nRewardIdx - 1).RankLower
|
||||
end
|
||||
if nRewardIdx == 1 then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRank, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Rank_CurSelf"), math.floor(nRankingHigher / 100)))
|
||||
elseif nRewardIdx == PlayerData.ScoreBoss.maxRankCount then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRank, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Rank_Lv_1Self"), math.floor(nRankLower / 100)))
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRank, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Rank_LvSelf"), math.floor(nRankLower / 100), math.floor(nRankingHigher / 100)))
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPScore, mapSelfRanking.Score)
|
||||
end
|
||||
return ScoreBossRankingPlayerInfoCtrl
|
||||
@@ -0,0 +1,141 @@
|
||||
local ScoreBossRankingTeamDetailCtrl = class("ScoreBossRankingTeamDetailCtrl", BaseCtrl)
|
||||
ScoreBossRankingTeamDetailCtrl._mapNodeConfig = {
|
||||
AnimRootTeamDetail = {sComponentName = "Animator"},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
btnScreenClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
txtTeam1 = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBossRankingTeamOne"
|
||||
},
|
||||
txtTeam2 = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBossRankingTeamTwo"
|
||||
},
|
||||
tcChar1_ = {nCount = 3},
|
||||
imgItemIcon1_ = {nCount = 3, sComponentName = "Image"},
|
||||
imgItemRare1_ = {nCount = 3, sComponentName = "Image"},
|
||||
txtRank1_ = {nCount = 3, sComponentName = "TMP_Text"},
|
||||
imgScoreIcon_1 = {sComponentName = "Image"},
|
||||
tcChar2_ = {nCount = 3},
|
||||
imgItemIcon2_ = {nCount = 3, sComponentName = "Image"},
|
||||
imgItemRare2_ = {nCount = 3, sComponentName = "Image"},
|
||||
txtRank2_ = {nCount = 3, sComponentName = "TMP_Text"},
|
||||
imgScoreIcon_2 = {sComponentName = "Image"},
|
||||
txtLeaderCn_ = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Build_Leader"
|
||||
},
|
||||
txtSubCn1_ = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Build_Sub"
|
||||
},
|
||||
txtSubCn2_ = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Build_Sub"
|
||||
},
|
||||
TMPBuildTitle_ = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Template_Score"
|
||||
},
|
||||
txtScore = {nCount = 2, sComponentName = "TMP_Text"},
|
||||
txtWindowTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBossRankingDetail"
|
||||
},
|
||||
txtHighScore = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBossRankingHighScore"
|
||||
},
|
||||
txtHighScoreNum = {sComponentName = "TMP_Text"},
|
||||
imgTeamBG = {nCount = 2}
|
||||
}
|
||||
function ScoreBossRankingTeamDetailCtrl:OnEnable()
|
||||
end
|
||||
function ScoreBossRankingTeamDetailCtrl:Refresh(mapRanking)
|
||||
self._mapNode.AnimRootTeamDetail:Play("t_window_04_t_in")
|
||||
self._mapNode.txtScore[1].gameObject:SetActive(false)
|
||||
self._mapNode.imgScoreIcon_1.gameObject:SetActive(false)
|
||||
self._mapNode.txtScore[2].gameObject:SetActive(false)
|
||||
self._mapNode.imgScoreIcon_2.gameObject:SetActive(false)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtHighScoreNum, string.formatnumberthousands(mapRanking.Score))
|
||||
for k = 1, 3 do
|
||||
self._mapNode.tcChar1_[k]:SetActive(false)
|
||||
end
|
||||
if mapRanking.Teams ~= nil and mapRanking.Teams[1] ~= nil then
|
||||
self._mapNode.imgTeamBG[1]:SetActive(true)
|
||||
local rank = PlayerData.Build:CalBuildRank(mapRanking.Teams[1].BuildScore)
|
||||
local sScore = "Icon/BuildRank/BuildRank_" .. rank.Id
|
||||
self:SetPngSprite(self._mapNode.imgScoreIcon_1, sScore)
|
||||
local txtLevelScore = string.formatnumberthousands(mapRanking.Teams[1].LevelScore)
|
||||
local txtLevelScoreTitle = ConfigTable.GetUIText("Vampire_Score_Title")
|
||||
NovaAPI.SetTMPText(self._mapNode.txtScore[1], txtLevelScoreTitle .. ":" .. txtLevelScore)
|
||||
self._mapNode.txtScore[1].gameObject:SetActive(true)
|
||||
self._mapNode.imgScoreIcon_1.gameObject:SetActive(true)
|
||||
if mapRanking.Teams[1].Chars ~= nil then
|
||||
for k = 1, 3 do
|
||||
if mapRanking.Teams[1].Chars[k] ~= nil then
|
||||
self._mapNode.tcChar1_[k]:SetActive(true)
|
||||
local nCharId = mapRanking.Teams[1].Chars[k].Id
|
||||
local mapChar = ConfigTable.GetData_Character(nCharId)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtRank1_[k], mapRanking.Teams[1].Chars[k].Level)
|
||||
local nCharSkinId = mapChar.DefaultSkinId
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(self._mapNode.imgItemIcon1_[k], mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.XXL)
|
||||
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapChar.Grade]
|
||||
self:SetAtlasSprite(self._mapNode.imgItemRare1_[k], "12_rare", sFrame, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
self._mapNode.imgTeamBG[1]:SetActive(false)
|
||||
end
|
||||
for k = 1, 3 do
|
||||
self._mapNode.tcChar2_[k]:SetActive(false)
|
||||
end
|
||||
if mapRanking.Teams ~= nil and mapRanking.Teams[2] ~= nil then
|
||||
self._mapNode.imgTeamBG[2]:SetActive(true)
|
||||
local rank = PlayerData.Build:CalBuildRank(mapRanking.Teams[2].BuildScore)
|
||||
local sScore = "Icon/BuildRank/BuildRank_" .. rank.Id
|
||||
self:SetPngSprite(self._mapNode.imgScoreIcon_2, sScore)
|
||||
local txtLevelScore = string.formatnumberthousands(mapRanking.Teams[2].LevelScore)
|
||||
local txtLevelScoreTitle = ConfigTable.GetUIText("Vampire_Score_Title")
|
||||
NovaAPI.SetTMPText(self._mapNode.txtScore[2], txtLevelScoreTitle .. ":" .. txtLevelScore)
|
||||
self._mapNode.txtScore[2].gameObject:SetActive(true)
|
||||
self._mapNode.imgScoreIcon_2.gameObject:SetActive(true)
|
||||
if mapRanking.Teams[2].Chars ~= nil then
|
||||
for k = 1, 3 do
|
||||
if mapRanking.Teams[2].Chars[k] ~= nil then
|
||||
self._mapNode.tcChar2_[k]:SetActive(true)
|
||||
local nCharId = mapRanking.Teams[2].Chars[k].Id
|
||||
local mapChar = ConfigTable.GetData_Character(nCharId)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtRank2_[k], mapRanking.Teams[2].Chars[k].Level)
|
||||
local nCharSkinId = mapChar.DefaultSkinId
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(self._mapNode.imgItemIcon2_[k], mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.XXL)
|
||||
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapChar.Grade]
|
||||
self:SetAtlasSprite(self._mapNode.imgItemRare2_[k], "12_rare", sFrame, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
self._mapNode.imgTeamBG[2]:SetActive(false)
|
||||
end
|
||||
end
|
||||
function ScoreBossRankingTeamDetailCtrl:OnBtnClick_Close()
|
||||
self._mapNode.AnimRootTeamDetail:Play("t_window_04_t_out")
|
||||
local close = function()
|
||||
self.gameObject:SetActive(false)
|
||||
end
|
||||
self:AddTimer(1, 0.2, close, true, true, true)
|
||||
end
|
||||
return ScoreBossRankingTeamDetailCtrl
|
||||
@@ -0,0 +1,71 @@
|
||||
local ScoreBossRewardGridCtrl = class("ScoreBossRewardGridCtrl", BaseCtrl)
|
||||
ScoreBossRewardGridCtrl._mapNodeConfig = {
|
||||
imgBg1 = {},
|
||||
imgBg2 = {},
|
||||
TMPRanking = {sComponentName = "TMP_Text"},
|
||||
tcItem = {
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateItemCtrl",
|
||||
nCount = 3
|
||||
},
|
||||
btnItem = {sComponentName = "UIButton", nCount = 3}
|
||||
}
|
||||
ScoreBossRewardGridCtrl._mapEventConfig = {}
|
||||
ScoreBossRewardGridCtrl._mapRedDotConfig = {}
|
||||
function ScoreBossRewardGridCtrl:Awake()
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:FadeIn()
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:FadeOut()
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:OnEnable()
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:OnDisable()
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:OnDestroy()
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:OnRelease()
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:Refresh(nIdx, nSelfIdx)
|
||||
local mapRewardCfgData = {}
|
||||
local nControlId = PlayerData.ScoreBoss.ControlId or 1
|
||||
local foreachItem = function(mapData)
|
||||
if mapData.SeasonId == nControlId then
|
||||
table.insert(mapRewardCfgData, mapData)
|
||||
end
|
||||
end
|
||||
ForEachTableLine(ConfigTable.Get("ScoreBossRank"), foreachItem)
|
||||
if mapRewardCfgData == nil or mapRewardCfgData[nIdx] == nil then
|
||||
return
|
||||
end
|
||||
local nRankingHigher = mapRewardCfgData[nIdx].RankLower
|
||||
local nRankLower = 0
|
||||
if nIdx ~= 1 and mapRewardCfgData[nIdx - 1] ~= nil then
|
||||
nRankLower = mapRewardCfgData[nIdx - 1].RankLower
|
||||
end
|
||||
self._mapNode.imgBg1:SetActive(nSelfIdx <= nRankingHigher and nSelfIdx > nRankLower)
|
||||
self._mapNode.imgBg2:SetActive(nSelfIdx > nRankingHigher or nSelfIdx <= nRankLower)
|
||||
if nIdx == 1 then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRanking, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Rank_Cur"), math.floor(nRankingHigher / 100)))
|
||||
elseif nIdx == PlayerData.ScoreBoss.maxRankCount then
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRanking, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Rank_Lv_1"), math.floor(nRankLower / 100)))
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRanking, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Rank_Lv"), math.floor(nRankLower / 100), math.floor(nRankingHigher / 100)))
|
||||
end
|
||||
local indexBorder = PlayerData.ScoreBoss:GetRankBorderCount(nIdx)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPRankingCount, orderedFormat(ConfigTable.GetUIText("ScoreBoss_RankBorderScore"), indexBorder))
|
||||
for i = 1, 3 do
|
||||
if mapRewardCfgData[nIdx]["AwardItemTid" .. i] ~= nil and 0 < mapRewardCfgData[nIdx]["AwardItemNum" .. i] then
|
||||
self._mapNode.tcItem[i]:SetItem(mapRewardCfgData[nIdx]["AwardItemTid" .. i], nil, mapRewardCfgData[nIdx]["AwardItemNum" .. i], nil, false, false, false, true, false, false)
|
||||
self._mapNode.btnItem[i].onClick:RemoveAllListeners()
|
||||
self._mapNode.btnItem[i].onClick:AddListener(function()
|
||||
self:OnBtn_ClickItem(self._mapNode.btnItem[i], mapRewardCfgData[nIdx]["AwardItemTid" .. i])
|
||||
end)
|
||||
else
|
||||
self._mapNode.btnItem[i].gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
function ScoreBossRewardGridCtrl:OnBtn_ClickItem(btn, itemId)
|
||||
UTILS.ClickItemGridWithTips(itemId, btn.transform, true, true, false)
|
||||
end
|
||||
return ScoreBossRewardGridCtrl
|
||||
@@ -0,0 +1,207 @@
|
||||
local ScoreBossReplaceBDCtrl = class("ScoreBossReplaceBDCtrl", BaseCtrl)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
ScoreBossReplaceBDCtrl._mapNodeConfig = {
|
||||
aniBlur = {},
|
||||
clearTips = {},
|
||||
txtWindowTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_ReplaceTitle"
|
||||
},
|
||||
txtContentMain = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_ReplaceOtherLvTips"
|
||||
},
|
||||
oldTeam = {},
|
||||
newTeam = {},
|
||||
goMessageBoxAni = {
|
||||
sNodeName = "goMessageBox",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickCancel"
|
||||
},
|
||||
btnCancel = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnClickCancel",
|
||||
sAction = "Giveup"
|
||||
},
|
||||
txtBtnCancel = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Btn_Cancel"
|
||||
},
|
||||
btnConfirm1 = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnClickConfirm",
|
||||
sAction = "Confirm"
|
||||
},
|
||||
txtConfirm1_ = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Btn_Confirm"
|
||||
},
|
||||
texNewRecord = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_New_Record"
|
||||
}
|
||||
}
|
||||
function ScoreBossReplaceBDCtrl:Awake()
|
||||
self._mapNode.clearTips:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
end
|
||||
function ScoreBossReplaceBDCtrl:OnEnable()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
local tbParam = self:GetPanelParam()
|
||||
self.levelId = tbParam[1]
|
||||
self.ConfirmCallBack = tbParam[2]
|
||||
self.CancelCallBack = tbParam[3]
|
||||
self:AddTimer(1, 0.1, function()
|
||||
self:SetOldTeamMsg()
|
||||
self:SetNewTeamMsg()
|
||||
self._mapNode.clearTips:SetActive(true)
|
||||
self._mapNode.goMessageBoxAni:Play("t_window_04_t_in")
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.3)
|
||||
if GamepadUIManager.GetInputState() then
|
||||
GamepadUIManager.EnableGamepadUI("ScoreBossReplaceBDCtrl", self.tbGamepadUINode)
|
||||
else
|
||||
for _, v in pairs(self.tbGamepadUINode) do
|
||||
if v.sComponentName == "NaviButton" then
|
||||
NovaAPI.SetNaviButtonAction(v.mapNode, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function ScoreBossReplaceBDCtrl:OnDisable()
|
||||
if GamepadUIManager.GetInputState() then
|
||||
GamepadUIManager.DisableGamepadUI("ScoreBossReplaceBDCtrl")
|
||||
end
|
||||
end
|
||||
function ScoreBossReplaceBDCtrl:SetOldTeamMsg()
|
||||
local trans = self._mapNode.oldTeam.transform:Find("AnimRoot")
|
||||
local TMPBossName = trans:Find("TMPBossName"):GetComponent("TMP_Text")
|
||||
local imgIcon = trans:Find("goMonsterHead/--Basic--/mask/imgIcon"):GetComponent("Image")
|
||||
local texCountEnd = trans:Find("goNodeItem/texCountEnd"):GetComponent("TMP_Text")
|
||||
local ScoreCount = trans:Find("goNodeItem/ScoreCount"):GetComponent("TMP_Text")
|
||||
local texLockChar = trans:Find("LockCharBg/texLockChar"):GetComponent("TMP_Text")
|
||||
local rtElements1 = trans:Find("goElements/rtElements1")
|
||||
local levelId = self.levelId
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", levelId)
|
||||
local mData = ConfigTable.GetData("Monster", bossLevelData.MonsterId)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
local Adjust = ConfigTable.GetData("MonsterValueTempleteAdjust", mData.Templete)
|
||||
NovaAPI.SetTMPText(TMPBossName, mManual.Name)
|
||||
self:SetPngSprite(imgIcon, mManual.Icon)
|
||||
local levelData = PlayerData.ScoreBoss:GetLevelData(levelId)
|
||||
NovaAPI.SetTMPText(texCountEnd, ConfigTable.GetUIText("ScoreBoss_EndScore"))
|
||||
NovaAPI.SetTMPText(ScoreCount, levelData.Score)
|
||||
NovaAPI.SetTMPText(texLockChar, ConfigTable.GetUIText("ScoreBoss_Lock_Char"))
|
||||
for i = 1, 7 do
|
||||
local tmpStar = trans:Find("goNodeItem/rt_Targets/ScoreStar" .. i):GetComponent("Button")
|
||||
tmpStar.interactable = i <= levelData.Star
|
||||
end
|
||||
for i = 1, rtElements1.childCount do
|
||||
local imgElement = rtElements1:GetChild(i - 1):GetComponent("Image")
|
||||
if Adjust.WeakEET[i] ~= nil then
|
||||
self:SetAtlasSprite(imgElement, "12_rare", AllEnum.ElementIconType.Icon .. Adjust.WeakEET[i])
|
||||
end
|
||||
imgElement.gameObject:SetActive(Adjust.WeakEET[i] ~= nil)
|
||||
end
|
||||
local tmpCharId = levelData.CharId
|
||||
for j = 1, 3 do
|
||||
local char = trans:Find("LockCharBg/lockChar_" .. j)
|
||||
local imgItemIcon = char:Find("t_char_head/imgIconBg/imgItemIcon"):GetComponent("Image")
|
||||
local imgItemRare = char:Find("t_char_head/imgItemRare"):GetComponent("Image")
|
||||
local mapChar = ConfigTable.GetData_Character(tmpCharId[j])
|
||||
local mapCharData = PlayerData.Char:GetCharDataByTid(tmpCharId[j])
|
||||
local nCharSkinId = mapCharData.nSkinId
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(imgItemIcon, mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.XXL)
|
||||
local nRarity = mapChar.Grade
|
||||
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapChar.Grade]
|
||||
self:SetAtlasSprite(imgItemRare, "12_rare", sFrame, true)
|
||||
local charLeader = char:Find("charLeader")
|
||||
local charSub = char:Find("charSub")
|
||||
local txtLeader = charLeader:Find("imgLeader/txtLeader"):GetComponent("TMP_Text")
|
||||
local txtSub1 = charSub:Find("imgSub/txtSub1"):GetComponent("TMP_Text")
|
||||
charLeader.gameObject:SetActive(j == 1)
|
||||
charSub.gameObject:SetActive(j ~= 1)
|
||||
NovaAPI.SetTMPText(txtLeader, ConfigTable.GetUIText("Build_Leader"))
|
||||
NovaAPI.SetTMPText(txtSub1, ConfigTable.GetUIText("Build_Sub"))
|
||||
end
|
||||
end
|
||||
function ScoreBossReplaceBDCtrl:SetNewTeamMsg()
|
||||
local trans = self._mapNode.newTeam.transform:Find("AnimRoot")
|
||||
local TMPBossName = trans:Find("TMPBossName"):GetComponent("TMP_Text")
|
||||
local imgIcon = trans:Find("goMonsterHead/--Basic--/mask/imgIcon"):GetComponent("Image")
|
||||
local texCountEnd = trans:Find("goNodeItem/texCountEnd"):GetComponent("TMP_Text")
|
||||
local ScoreCount = trans:Find("goNodeItem/ScoreCount"):GetComponent("TMP_Text")
|
||||
local texLockChar = trans:Find("LockCharBg/texLockChar"):GetComponent("TMP_Text")
|
||||
local rtElements1 = trans:Find("goElements/rtElements1")
|
||||
local levelId = self.levelId
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", levelId)
|
||||
local mData = ConfigTable.GetData("Monster", bossLevelData.MonsterId)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
local Adjust = ConfigTable.GetData("MonsterValueTempleteAdjust", mData.Templete)
|
||||
NovaAPI.SetTMPText(TMPBossName, mManual.Name)
|
||||
self:SetPngSprite(imgIcon, mManual.Icon)
|
||||
NovaAPI.SetTMPText(ScoreCount, PlayerData.ScoreBoss:GetTotalScore())
|
||||
NovaAPI.SetTMPText(texCountEnd, ConfigTable.GetUIText("ScoreBoss_EndScore"))
|
||||
NovaAPI.SetTMPText(texLockChar, ConfigTable.GetUIText("ScoreBoss_Lock_Char"))
|
||||
local tmpStarCount = PlayerData.ScoreBoss:ScoreToStar()
|
||||
for i = 1, 7 do
|
||||
local tmpStar = trans:Find("goNodeItem/rt_Targets/ScoreStar" .. i):GetComponent("Button")
|
||||
tmpStar.interactable = i <= tmpStarCount
|
||||
end
|
||||
for i = 1, rtElements1.childCount do
|
||||
local imgElement = rtElements1:GetChild(i - 1):GetComponent("Image")
|
||||
if Adjust.WeakEET[i] ~= nil then
|
||||
self:SetAtlasSprite(imgElement, "12_rare", AllEnum.ElementIconType.Icon .. Adjust.WeakEET[i])
|
||||
end
|
||||
imgElement.gameObject:SetActive(Adjust.WeakEET[i] ~= nil)
|
||||
end
|
||||
local tbCharId = PlayerData.ScoreBoss:GetEntryBuildCharTid()
|
||||
for j = 1, 3 do
|
||||
local char = trans:Find("LockCharBg/lockChar_" .. j)
|
||||
local imgItemIcon = char:Find("t_char_head/imgIconBg/imgItemIcon"):GetComponent("Image")
|
||||
local imgItemRare = char:Find("t_char_head/imgItemRare"):GetComponent("Image")
|
||||
local mapChar = ConfigTable.GetData_Character(tbCharId[j])
|
||||
local mapCharData = PlayerData.Char:GetCharDataByTid(tbCharId[j])
|
||||
local nCharSkinId = mapCharData.nSkinId
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(imgItemIcon, mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.XXL)
|
||||
local nRarity = mapChar.Grade
|
||||
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapChar.Grade]
|
||||
self:SetAtlasSprite(imgItemRare, "12_rare", sFrame, true)
|
||||
local charLeader = char:Find("charLeader")
|
||||
local charSub = char:Find("charSub")
|
||||
local txtLeader = charLeader:Find("imgLeader/txtLeader"):GetComponent("TMP_Text")
|
||||
local txtSub1 = charSub:Find("imgSub/txtSub1"):GetComponent("TMP_Text")
|
||||
charLeader.gameObject:SetActive(j == 1)
|
||||
charSub.gameObject:SetActive(j ~= 1)
|
||||
NovaAPI.SetTMPText(txtLeader, ConfigTable.GetUIText("Build_Leader"))
|
||||
NovaAPI.SetTMPText(txtSub1, ConfigTable.GetUIText("Build_Sub"))
|
||||
end
|
||||
end
|
||||
function ScoreBossReplaceBDCtrl:OnClickCancel()
|
||||
self._mapNode.goMessageBoxAni:Play("t_window_04_t_out")
|
||||
self:AddTimer(1, 0.2, function()
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.ScoreBossReplaceBD)
|
||||
if self.CancelCallBack ~= nil then
|
||||
self.CancelCallBack()
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function ScoreBossReplaceBDCtrl:OnClickConfirm()
|
||||
self._mapNode.goMessageBoxAni:Play("t_window_04_t_out")
|
||||
self:AddTimer(1, 0.2, function()
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.ScoreBossReplaceBD)
|
||||
if self.ConfirmCallBack ~= nil then
|
||||
self.ConfirmCallBack()
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
return ScoreBossReplaceBDCtrl
|
||||
@@ -0,0 +1,19 @@
|
||||
local ScoreBossReplaceBDPanel = class("ScoreBossReplaceBDPanel", BasePanel)
|
||||
ScoreBossReplaceBDPanel._bIsMainPanel = false
|
||||
ScoreBossReplaceBDPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "Play_ScoreBoss/ScoreBossReplaceBDPanel.prefab",
|
||||
sCtrlName = "Game.UI.ScoreBoss.ScoreBossReplaceBDCtrl"
|
||||
}
|
||||
}
|
||||
function ScoreBossReplaceBDPanel:Awake()
|
||||
end
|
||||
function ScoreBossReplaceBDPanel:OnEnable()
|
||||
end
|
||||
function ScoreBossReplaceBDPanel:OnDisable()
|
||||
end
|
||||
function ScoreBossReplaceBDPanel:OnDestroy()
|
||||
end
|
||||
function ScoreBossReplaceBDPanel:OnRelease()
|
||||
end
|
||||
return ScoreBossReplaceBDPanel
|
||||
@@ -0,0 +1,86 @@
|
||||
local ScoreBossResultCtrl = class("ScoreBossResultCtrl", BaseCtrl)
|
||||
local WwiseManger = CS.WwiseAudioManager.Instance
|
||||
ScoreBossResultCtrl._mapNodeConfig = {
|
||||
txtLevelName1 = {sComponentName = "TMP_Text"},
|
||||
ScoreStar = {nCount = 7, sComponentName = "Button"},
|
||||
texTotalScore = {sComponentName = "TMP_Text"},
|
||||
texDamageScore = {sComponentName = "TMP_Text"},
|
||||
texSkillScore = {sComponentName = "TMP_Text"},
|
||||
texTotalTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_EndScore"
|
||||
},
|
||||
texDamageTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_DamageScore"
|
||||
},
|
||||
texSkillTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_SkillScore"
|
||||
},
|
||||
ButtonClose = {
|
||||
nCount = 2,
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
btnDamageResult1 = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_DamageResult"
|
||||
},
|
||||
txtClickToContinue1 = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tips_Continue"
|
||||
}
|
||||
}
|
||||
ScoreBossResultCtrl._mapEventConfig = {}
|
||||
function ScoreBossResultCtrl:Awake()
|
||||
end
|
||||
function ScoreBossResultCtrl:OnEnable()
|
||||
local tbParam = self:GetPanelParam()
|
||||
self.entryLevelId = tbParam[1]
|
||||
self.totalScore = tbParam[2]
|
||||
self.totalStar = tbParam[3]
|
||||
self.tbCharDamage = tbParam[4]
|
||||
self.callback = tbParam[5]
|
||||
self._mapNode.btnDamageResult1.gameObject:SetActive(self.tbCharDamage ~= nil and #self.tbCharDamage > 0)
|
||||
self:SetMsg()
|
||||
WwiseManger:PostEvent("ui_loading_combatSFX_mute", nil, false)
|
||||
WwiseManger:PlaySound("ui_roguelike_victory")
|
||||
WwiseManger:SetState("system", "victory2")
|
||||
self:AddTimer(1, 7.5, function()
|
||||
for i = 1, #self._mapNode.ButtonClose do
|
||||
self._mapNode.ButtonClose[i].gameObject:SetActive(true)
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function ScoreBossResultCtrl:SetMsg()
|
||||
local levelId = self.entryLevelId
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", levelId)
|
||||
local mData = ConfigTable.GetData("Monster", bossLevelData.MonsterId)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
local str = "Lv" .. PlayerData.ScoreBoss.BattleLv .. " " .. mManual.Name
|
||||
NovaAPI.SetTMPText(self._mapNode.txtLevelName1, str)
|
||||
for i = 1, 7 do
|
||||
self._mapNode.ScoreStar[i].interactable = i <= self.totalStar
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.texTotalScore, FormatWithCommas(self.totalScore))
|
||||
NovaAPI.SetTMPText(self._mapNode.texDamageScore, PlayerData.ScoreBoss:GetDamageScore())
|
||||
local bScore, bScoreCount = PlayerData.ScoreBoss:GetBehaviorScore()
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", PlayerData.ScoreBoss.entryLevelId)
|
||||
local getControl = ConfigTable.GetData("ScoreBossGetControl", bossLevelData.NonDamageScoreGet)
|
||||
NovaAPI.SetTMPText(self._mapNode.texSkillScore, getControl.OnceScore .. "x" .. bScoreCount)
|
||||
end
|
||||
function ScoreBossResultCtrl:OnBtnClick_Close()
|
||||
if self.callback ~= nil then
|
||||
self.callback()
|
||||
else
|
||||
NovaAPI.EnterModule("MainMenuModuleScene", true)
|
||||
end
|
||||
end
|
||||
function ScoreBossResultCtrl:OnBtnClick_DamageResult()
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.BattleDamage, self.tbCharDamage)
|
||||
end
|
||||
function ScoreBossResultCtrl:OnDestroy()
|
||||
end
|
||||
return ScoreBossResultCtrl
|
||||
@@ -0,0 +1,17 @@
|
||||
local ScoreBossResultPanel = class("ScoreBossResultPanel", BasePanel)
|
||||
ScoreBossResultPanel._bAddToBackHistory = false
|
||||
ScoreBossResultPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "Play_ScoreBoss/ScoreBossResultPanel.prefab",
|
||||
sCtrlName = "Game.UI.ScoreBoss.ScoreBossResultCtrl"
|
||||
}
|
||||
}
|
||||
function ScoreBossResultPanel:Awake()
|
||||
end
|
||||
function ScoreBossResultPanel:OnEnable()
|
||||
end
|
||||
function ScoreBossResultPanel:OnDisable()
|
||||
end
|
||||
function ScoreBossResultPanel:OnDestroy()
|
||||
end
|
||||
return ScoreBossResultPanel
|
||||
@@ -0,0 +1,702 @@
|
||||
local ScoreBossSelectCtrl = class("ScoreBossSelectCtrl", BaseCtrl)
|
||||
local Actor2DManager = require("Game.Actor2D.Actor2DManager")
|
||||
local WwiseAudioMgr = CS.WwiseAudioManager.Instance
|
||||
local BubbleVoiceManager = require("Game.Actor2D.BubbleVoiceManager")
|
||||
local LocalSettingData = require("GameCore.Data.LocalSettingData")
|
||||
local totalNodeLength = 800
|
||||
local totalHeight = 20
|
||||
local totalProLength = 659
|
||||
local totalProHeight = 22
|
||||
local bgPath = "Image/UIBG/bg_bossrush"
|
||||
local NpcId = 9159
|
||||
ScoreBossSelectCtrl._mapNodeConfig = {
|
||||
btnActor = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_Actor"
|
||||
},
|
||||
goBubbleRoot = {
|
||||
sNodeName = "----fixed_bubble----"
|
||||
},
|
||||
bgImageCover = {},
|
||||
rawImgActor2D = {
|
||||
sNodeName = "----Actor2D----",
|
||||
sComponentName = "RawImage"
|
||||
},
|
||||
trActor2D_PNG = {
|
||||
sNodeName = "----Actor2D_PNG----",
|
||||
sComponentName = "Transform"
|
||||
},
|
||||
objBg = {sNodeName = "----Bg----"},
|
||||
bgImage = {sNodeName = "----Bg----", sComponentName = "Image"},
|
||||
InfoBgObj = {
|
||||
sNodeName = "----InfoBg----"
|
||||
},
|
||||
InfoBg = {sComponentName = "Image"},
|
||||
SCBossList = {},
|
||||
gridTemp = {},
|
||||
ContentTemp = {sComponentName = "Transform"},
|
||||
goRefresh = {},
|
||||
texRefreshCn = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Remain_Time"
|
||||
},
|
||||
texRefreshTime = {sComponentName = "TMP_Text"},
|
||||
goSettlement = {},
|
||||
txtSettlement = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Settlement"
|
||||
},
|
||||
btnRank = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickRank"
|
||||
},
|
||||
texBtnRank = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Rank_Title"
|
||||
},
|
||||
btnStar = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickStar"
|
||||
},
|
||||
texBtnStar = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Cur_Star"
|
||||
},
|
||||
texBtnStarCount = {sComponentName = "TMP_Text"},
|
||||
redStar = {},
|
||||
SCBossInfo = {},
|
||||
card = {},
|
||||
btnGo = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickBtnGo"
|
||||
},
|
||||
txtBtnGo = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Maninline_Btn_Go"
|
||||
},
|
||||
btnGoSettlement = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickBtnSettlement"
|
||||
},
|
||||
txtBtnSettlement = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Settlement_Btn"
|
||||
},
|
||||
info_ImgBoss = {sComponentName = "Image"},
|
||||
imgLevelInfo = {sComponentName = "Image"},
|
||||
info_BossName = {sComponentName = "TMP_Text"},
|
||||
rtElements = {sComponentName = "Transform"},
|
||||
info_rtAntiElements = {sComponentName = "Transform"},
|
||||
rtAntiElements = {sComponentName = "Transform"},
|
||||
info_texCurRecord = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Cur_Record"
|
||||
},
|
||||
info_texScore = {sComponentName = "TMP_Text"},
|
||||
infoRecordProgress = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
FullPower = {},
|
||||
btnNodeItem = {nCount = 7, sComponentName = "Button"},
|
||||
schedule = {nCount = 7},
|
||||
notSchedule = {nCount = 7},
|
||||
txtRecordScore = {nCount = 7, sComponentName = "TMP_Text"},
|
||||
skillInfoIcon1 = {sComponentName = "Image"},
|
||||
skillInfoName1 = {sComponentName = "TMP_Text"},
|
||||
skillInfoDes1 = {sComponentName = "TMP_Text"},
|
||||
info_texDamageScore = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_DamageScore"
|
||||
},
|
||||
info_texSkillScore = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_SkillScore"
|
||||
},
|
||||
info_texDamageScoreCount = {sComponentName = "TMP_Text"},
|
||||
info_texSkillScoreCount = {sComponentName = "TMP_Text"},
|
||||
skillInfoIcon2 = {sComponentName = "Image"},
|
||||
skillInfoName2 = {sComponentName = "TMP_Text"},
|
||||
skillInfoDes2 = {sComponentName = "TMP_Text"},
|
||||
texLockChar = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Lock_Char"
|
||||
},
|
||||
char = {nCount = 3},
|
||||
charTeam = {nCount = 3},
|
||||
charTeamEmpty = {nCount = 3},
|
||||
imgItemIcon_ = {nCount = 3, sComponentName = "Image"},
|
||||
imgItemRare_ = {nCount = 3, sComponentName = "Image"},
|
||||
txtLeader = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Build_Leader"
|
||||
},
|
||||
txtSub = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Build_Sub"
|
||||
},
|
||||
TopBarPanel = {
|
||||
sCtrlName = "Game.UI.TopBarEx.TopBarCtrl"
|
||||
},
|
||||
goRewardView = {},
|
||||
t_window_04 = {},
|
||||
txt_Reward_Title = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Reward_Title"
|
||||
},
|
||||
RewardSc = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
btnCloseReward = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "CloseRewardView"
|
||||
},
|
||||
RewardMaskClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "CloseRewardView"
|
||||
},
|
||||
texRewardStarTotal = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "ScoreBoss_Reward_TotalStar"
|
||||
},
|
||||
texOneKeyReceive = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Mail_OneKeyReceive"
|
||||
},
|
||||
texRewardStar = {sComponentName = "TMP_Text"},
|
||||
btnRewardOneKey = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnClickRewardOneKey"
|
||||
}
|
||||
}
|
||||
ScoreBossSelectCtrl._mapEventConfig = {
|
||||
[EventId.UIHomeConfirm] = "OnEvent_Home",
|
||||
[EventId.UIBackConfirm] = "OnEvent_Back",
|
||||
Get_ScoreBoss_InfoReq = "OnEvent_GetScoreBossInfoReq",
|
||||
[EventId.ShowBubbleVoiceText] = "OnEvent_ShowBubbleVoiceText"
|
||||
}
|
||||
ScoreBossSelectCtrl._mapRedDotConfig = {
|
||||
[RedDotDefine.Map_ScoreBossStar] = {sNodeName = "redStar"}
|
||||
}
|
||||
function ScoreBossSelectCtrl:Awake()
|
||||
self.infoAni = self.gameObject:GetComponent("Animator")
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnEnable()
|
||||
if PlayerData.ScoreBoss:GetInitInfoState() then
|
||||
self:OnInitPanelInfo()
|
||||
end
|
||||
self.isPlayNPCVoice = false
|
||||
self:RefreshNPC2D()
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnEvent_GetScoreBossInfoReq()
|
||||
self:OnInitPanelInfo()
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnInitPanelInfo()
|
||||
local openLevelGroup = PlayerData.ScoreBoss.OpenLevelGroup
|
||||
self.tabGridAni = {}
|
||||
for i = 1, #openLevelGroup do
|
||||
local objItem
|
||||
if i > self._mapNode.ContentTemp.childCount then
|
||||
objItem = instantiate(self._mapNode.gridTemp, self._mapNode.ContentTemp)
|
||||
else
|
||||
objItem = self._mapNode.ContentTemp:GetChild(i - 1).gameObject
|
||||
end
|
||||
objItem:SetActive(true)
|
||||
self:OnRefreshGrid(objItem, openLevelGroup[i], i)
|
||||
end
|
||||
self:SetTimes()
|
||||
self:SetRewardStar()
|
||||
if self.pageType == nil or self.pageType == 1 then
|
||||
self._mapNode.SCBossList:SetActive(true)
|
||||
self._mapNode.SCBossInfo:SetActive(false)
|
||||
self:SetBgActive(1)
|
||||
else
|
||||
self._mapNode.SCBossList:SetActive(false)
|
||||
self._mapNode.SCBossInfo:SetActive(true)
|
||||
self:SetBgActive(2)
|
||||
if self.ChooseLevelId then
|
||||
self:SetBossInfo(self.ChooseLevelId, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:FadeIn()
|
||||
if self.pageType == nil or self.pageType == 1 then
|
||||
EventManager.Hit(EventId.SetTransition)
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:SetRewardStar()
|
||||
self._mapNode.texBtnStarCount.text = PlayerData.ScoreBoss.Star .. "/" .. PlayerData.ScoreBoss.maxStarNeed
|
||||
end
|
||||
function ScoreBossSelectCtrl:SetTimes()
|
||||
self.nRemainTime = PlayerData.ScoreBoss.EndTime == 0 and 0 or PlayerData.ScoreBoss.EndTime - CS.ClientManager.Instance.serverTimeStamp
|
||||
if self.timerCountDown then
|
||||
self.timerCountDown = nil
|
||||
end
|
||||
if self.timerCountDown == nil then
|
||||
self.timerCountDown = self:AddTimer(0, 1, "RefreshTime", false, true, false)
|
||||
end
|
||||
if self.nRemainTime > 0 then
|
||||
self._mapNode.goRefresh:SetActive(true)
|
||||
self._mapNode.goSettlement:SetActive(false)
|
||||
self:RefreshTime()
|
||||
self.timerCountDown:Pause(false)
|
||||
else
|
||||
self._mapNode.goRefresh:SetActive(false)
|
||||
self.timerCountDown:Pause(true)
|
||||
self._mapNode.goSettlement:SetActive(true)
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:RefreshTime()
|
||||
self.nRemainTime = self.nRemainTime - 1
|
||||
if self.nRemainTime > 0 then
|
||||
local sTime = ""
|
||||
if self.nRemainTime <= 60 then
|
||||
local sec = math.floor(self.nRemainTime)
|
||||
sTime = orderedFormat(ConfigTable.GetUIText("Shop_NextRefresh_Sec"), sec)
|
||||
elseif self.nRemainTime > 60 and self.nRemainTime <= 3600 then
|
||||
local min = math.floor(self.nRemainTime / 60)
|
||||
local sec = math.floor(self.nRemainTime - min * 60)
|
||||
if sec == 0 then
|
||||
min = min - 1
|
||||
sec = 60
|
||||
end
|
||||
sTime = orderedFormat(ConfigTable.GetUIText("Shop_NextRefresh_Min"), min, sec)
|
||||
elseif self.nRemainTime > 3600 and self.nRemainTime <= 86400 then
|
||||
local hour = math.floor(self.nRemainTime / 3600)
|
||||
local min = math.floor((self.nRemainTime - hour * 3600) / 60)
|
||||
if min == 0 then
|
||||
hour = hour - 1
|
||||
min = 60
|
||||
end
|
||||
sTime = orderedFormat(ConfigTable.GetUIText("Shop_NextRefresh_Hour"), hour, min)
|
||||
elseif self.nRemainTime > 86400 then
|
||||
local day = math.floor(self.nRemainTime / 86400)
|
||||
local hour = math.floor((self.nRemainTime - day * 86400) / 3600)
|
||||
if hour == 0 then
|
||||
day = day - 1
|
||||
hour = 24
|
||||
end
|
||||
sTime = orderedFormat(ConfigTable.GetUIText("Shop_NextRefresh_Day"), day, hour)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.texRefreshTime, sTime)
|
||||
else
|
||||
self.timerCountDown:Pause(true)
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnDisable()
|
||||
Actor2DManager.UnsetBoardNPC2D()
|
||||
PlayerData.Voice:ClearTimer()
|
||||
BubbleVoiceManager.StopBubbleAnim()
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnRefreshGrid(goGrid, levelId, index)
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", levelId)
|
||||
local trans = goGrid.transform:Find("AnimRoot")
|
||||
self.tabGridAni[index] = trans:GetComponent("Animator")
|
||||
local goUnlock = trans:Find("goUnlock")
|
||||
local imgLevel = goUnlock:Find("imgLevel"):GetComponent("Image")
|
||||
local imgLevel_add = goUnlock:Find("imgLevel/imgLevel_add"):GetComponent("Image")
|
||||
local TMPBossName = goUnlock:Find("TMPBossName"):GetComponent("TMP_Text")
|
||||
local rtElements1 = goUnlock:Find("goElements/rtElements1")
|
||||
local mData = ConfigTable.GetData("Monster", bossLevelData.MonsterId)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
local Adjust = ConfigTable.GetData("MonsterValueTempleteAdjust", mData.Templete)
|
||||
NovaAPI.SetTMPText(TMPBossName, mManual.Name)
|
||||
self:SetPngSprite(imgLevel, bossLevelData.Episode)
|
||||
self:SetPngSprite(imgLevel_add, bossLevelData.Episode)
|
||||
for i = 1, rtElements1.childCount do
|
||||
local imgElement = rtElements1:GetChild(i - 1):GetComponent("Image")
|
||||
if Adjust.WeakEET[i] ~= nil then
|
||||
self:SetAtlasSprite(imgElement, "12_rare", AllEnum.ElementIconType.Icon .. Adjust.WeakEET[i])
|
||||
end
|
||||
imgElement.gameObject:SetActive(Adjust.WeakEET[i] ~= nil)
|
||||
end
|
||||
local levelData = PlayerData.ScoreBoss:GetLevelData(levelId)
|
||||
local _star = levelData.Star
|
||||
for i = 1, 7 do
|
||||
local tmpBtn = trans:Find("rt_Targets/star" .. i):GetComponent("Button")
|
||||
tmpBtn.interactable = i <= _star
|
||||
end
|
||||
self.tabGridAni[index]:Play("ScoreBossSelect_Card_in")
|
||||
local btnGrid = trans:Find("btnGrid"):GetComponent("UIButton")
|
||||
btnGrid.onClick:RemoveAllListeners()
|
||||
btnGrid.onClick:AddListener(function()
|
||||
WwiseAudioMgr:PlaySound("ui_bossRush_boss_select")
|
||||
self.ChooseLevelId = levelId
|
||||
self._mapNode.SCBossInfo:SetActive(true)
|
||||
self.pageType = 2
|
||||
self:SetBgActive(2)
|
||||
self:SetBossInfo(levelId, true)
|
||||
for i, v in pairs(self.tabGridAni) do
|
||||
if i ~= index then
|
||||
v:Play("ScoreBossSelect_Card_out")
|
||||
else
|
||||
trans.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
self:AddTimer(1, 1.667, function()
|
||||
trans.gameObject:SetActive(true)
|
||||
end, true, true, true)
|
||||
end)
|
||||
end
|
||||
function ScoreBossSelectCtrl:SetBossInfo(levelId, isPlayAin)
|
||||
local bossLevelData = ConfigTable.GetData("ScoreBossLevel", levelId)
|
||||
local getControlData = ConfigTable.GetData("ScoreBossGetControl", bossLevelData.NonDamageScoreGet)
|
||||
local mData = ConfigTable.GetData("Monster", bossLevelData.MonsterId)
|
||||
local mSkin = ConfigTable.GetData("MonsterSkin", mData.FAId)
|
||||
local mManual = ConfigTable.GetData("MonsterManual", mSkin.MonsterManual)
|
||||
local Adjust = ConfigTable.GetData("MonsterValueTempleteAdjust", mData.Templete)
|
||||
NovaAPI.SetTMPText(self._mapNode.info_BossName, mManual.Name)
|
||||
self:SetPngSprite(self._mapNode.info_ImgBoss, bossLevelData.Image)
|
||||
self:SetPngSprite(self._mapNode.imgLevelInfo, bossLevelData.Episode)
|
||||
self:SetPngSprite(self._mapNode.InfoBg, bossLevelData.BG)
|
||||
for i = 1, self._mapNode.rtElements.childCount do
|
||||
local imgElement = self._mapNode.rtElements:GetChild(i - 1):GetComponent("Image")
|
||||
if Adjust.WeakEET[i] ~= nil then
|
||||
self:SetAtlasSprite(imgElement, "12_rare", AllEnum.ElementIconType.Icon .. Adjust.WeakEET[i])
|
||||
end
|
||||
imgElement.gameObject:SetActive(Adjust.WeakEET[i] ~= nil)
|
||||
end
|
||||
local tbEET = {
|
||||
Adjust.EET
|
||||
}
|
||||
if tbEET == nil or #tbEET == 0 then
|
||||
self._mapNode.info_rtAntiElements.gameObject:SetActive(false)
|
||||
else
|
||||
for i = 1, self._mapNode.rtAntiElements.childCount do
|
||||
local imgElement = self._mapNode.rtAntiElements:GetChild(i - 1):GetComponent("Image")
|
||||
if tbEET[i] ~= nil then
|
||||
self:SetAtlasSprite(imgElement, "12_rare", AllEnum.ElementIconType.Icon .. tbEET[i])
|
||||
end
|
||||
imgElement.gameObject:SetActive(tbEET[i] ~= nil)
|
||||
end
|
||||
self._mapNode.info_rtAntiElements.gameObject:SetActive(true)
|
||||
end
|
||||
local levelData = PlayerData.ScoreBoss:GetLevelData(levelId)
|
||||
local _Score = levelData.Score
|
||||
local _skillCount = levelData.SkillScore
|
||||
NovaAPI.SetTMPText(self._mapNode.info_texScore, _Score)
|
||||
NovaAPI.SetTMPText(self._mapNode.info_texDamageScoreCount, _Score - _skillCount)
|
||||
local OnceControlScore = getControlData.OnceScore
|
||||
local OnceControlScoreCount = math.floor(_skillCount / OnceControlScore)
|
||||
NovaAPI.SetTMPText(self._mapNode.info_texSkillScoreCount, string.format("%sx%s", OnceControlScore, OnceControlScoreCount))
|
||||
local tmpL = 0
|
||||
local tmpPre = 0
|
||||
local isThanMaxNeed = true
|
||||
local tmpLastScore = 0
|
||||
for i, v in pairs(PlayerData.ScoreBoss.tabScoreNeed) do
|
||||
if isThanMaxNeed then
|
||||
if _Score >= v then
|
||||
tmpLastScore = v
|
||||
tmpPre = tmpPre + 0.125
|
||||
else
|
||||
local tmpScore = _Score - tmpLastScore
|
||||
tmpPre = tmpPre + tmpScore / (v - tmpLastScore) * 0.125
|
||||
isThanMaxNeed = false
|
||||
end
|
||||
end
|
||||
self._mapNode.btnNodeItem[i].interactable = _Score >= v
|
||||
self._mapNode.schedule[i]:SetActive(_Score >= v)
|
||||
self._mapNode.notSchedule[i]:SetActive(_Score < v)
|
||||
local result = v / 1000
|
||||
if result == math.floor(result) then
|
||||
result = math.floor(result)
|
||||
else
|
||||
result = string.format("%.1f", result)
|
||||
end
|
||||
local tmpK = result .. "k"
|
||||
NovaAPI.SetTMPText(self._mapNode.txtRecordScore[i], tmpK)
|
||||
end
|
||||
if isThanMaxNeed then
|
||||
tmpPre = 1
|
||||
end
|
||||
tmpL = math.floor(tmpPre * totalNodeLength)
|
||||
self._mapNode.infoRecordProgress.sizeDelta = Vector2(tmpL, totalHeight)
|
||||
self._mapNode.FullPower:SetActive(isThanMaxNeed)
|
||||
local getControl = ConfigTable.GetData("ScoreBossGetControl", bossLevelData.NonDamageScoreGet)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoName1, getControl.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoDes1, getControl.BehaviorDes)
|
||||
self:SetPngSprite(self._mapNode.skillInfoIcon1, getControl.IconSource)
|
||||
local bossAbility = ConfigTable.GetData("ScoreBossAbility", bossLevelData.ScoreBossAbility)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoName2, bossAbility.Name)
|
||||
NovaAPI.SetTMPText(self._mapNode.skillInfoDes2, UTILS.ParseDesc(bossAbility))
|
||||
self:SetPngSprite(self._mapNode.skillInfoIcon2, bossAbility.IconSource)
|
||||
local tmpCharId = levelData.CharId
|
||||
if tmpCharId[1] == 0 then
|
||||
for i = 1, 3 do
|
||||
self._mapNode.char[i]:SetActive(false)
|
||||
self._mapNode.charTeam[i]:SetActive(false)
|
||||
self._mapNode.charTeamEmpty[i]:SetActive(true)
|
||||
end
|
||||
else
|
||||
for i = 1, 3 do
|
||||
self._mapNode.char[i]:SetActive(true)
|
||||
self._mapNode.charTeam[i]:SetActive(true)
|
||||
self._mapNode.charTeamEmpty[i]:SetActive(false)
|
||||
local mapChar = ConfigTable.GetData_Character(tmpCharId[i])
|
||||
local mapCharData = PlayerData.Char:GetCharDataByTid(tmpCharId[i])
|
||||
local nCharSkinId = mapCharData.nSkinId
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(self._mapNode.imgItemIcon_[i], mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.XXL)
|
||||
local nRarity = mapChar.Grade
|
||||
local sFrame = AllEnum.FrameType_New.BoardFrame .. AllEnum.BoardFrameColor[mapChar.Grade]
|
||||
self:SetAtlasSprite(self._mapNode.imgItemRare_[i], "12_rare", sFrame, true)
|
||||
end
|
||||
end
|
||||
if isPlayAin then
|
||||
self.infoAni:Play("ScoreBossSelect_Info_in")
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 1.5)
|
||||
self:AddTimer(1, 1.667, function()
|
||||
self._mapNode.SCBossList:SetActive(false)
|
||||
end, true, true, true)
|
||||
end
|
||||
local nCurTime = CS.ClientManager.Instance.serverTimeStamp
|
||||
if nCurTime > PlayerData.ScoreBoss.EndTime then
|
||||
self._mapNode.btnGo.gameObject:SetActive(false)
|
||||
self._mapNode.btnGoSettlement.gameObject:SetActive(true)
|
||||
else
|
||||
self._mapNode.btnGo.gameObject:SetActive(true)
|
||||
self._mapNode.btnGoSettlement.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnClickRank()
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.ScoreBossRankingPanel)
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnClickStar()
|
||||
self._mapNode.t_window_04:SetActive(false)
|
||||
NovaAPI.SetTMPText(self._mapNode.texRewardStar, orderedFormat("{0}/{1}", PlayerData.ScoreBoss.Star, PlayerData.ScoreBoss.maxStarNeed))
|
||||
self._mapNode.goRewardView:SetActive(true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.t_window_04:SetActive(true)
|
||||
self._mapNode.RewardSc:SetAnim(0.1)
|
||||
self._mapNode.RewardSc:Init(#PlayerData.ScoreBoss.tabScoreBossReward, self, self.RefreshRewardGrid)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function ScoreBossSelectCtrl:CloseRewardView()
|
||||
self._mapNode.t_window_04:SetActive(false)
|
||||
self._mapNode.goRewardView:SetActive(false)
|
||||
end
|
||||
function ScoreBossSelectCtrl:RefreshRewardGrid(goGrid, gridIndex)
|
||||
local texTitle = goGrid.transform:Find("AnimRoot/texTitle"):GetComponent("TMP_Text")
|
||||
local itemCtrl = self:BindCtrlByNode(goGrid.transform:Find("AnimRoot/item1/AniRoot/item").gameObject, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
local btnGetReward = goGrid.transform:Find("AnimRoot/btnGetReward"):GetComponent("UIButton")
|
||||
local txt_GetReward = btnGetReward.transform:Find("AnimRoot/txt_GetReward"):GetComponent("TMP_Text")
|
||||
local txt_RewardDontComplete = goGrid.transform:Find("AnimRoot/txt_RewardDontComplete"):GetComponent("TMP_Text")
|
||||
local obj_RewardGet = goGrid.transform:Find("AnimRoot/obj_RewardGet")
|
||||
local txtProgress = goGrid.transform:Find("AnimRoot/imgProgressBar/txtProgress"):GetComponent("TMP_Text")
|
||||
local imgProgress = goGrid.transform:Find("AnimRoot/imgProgressBar/rtProgressFill/imgProgress"):GetComponent("RectTransform")
|
||||
local nIndex = gridIndex + 1
|
||||
local scoreBossReward = self.SortScoreBossRewardData()
|
||||
local scRewardData = scoreBossReward[nIndex]
|
||||
local scStarNeed = scRewardData.StarNeed
|
||||
local totalTmpStar = PlayerData.ScoreBoss.Star
|
||||
NovaAPI.SetTMPText(txt_GetReward, ConfigTable.GetUIText("Mail_Receive"))
|
||||
NovaAPI.SetTMPText(txt_RewardDontComplete, ConfigTable.GetUIText("PerActivity_Quest_UnComplete"))
|
||||
NovaAPI.SetTMPText(texTitle, orderedFormat(ConfigTable.GetUIText("ScoreBoss_Reward_Star"), scStarNeed))
|
||||
local isGet = table.indexof(PlayerData.ScoreBoss.tabStarRewards, scStarNeed) ~= 0
|
||||
local isComplete = scStarNeed <= totalTmpStar
|
||||
itemCtrl:SetItem(scRewardData.RewardItemId1, nil, scRewardData.RewardNum1, nil, isGet, false, false, true)
|
||||
local btnItem = goGrid.transform:Find("AnimRoot/item1"):GetComponent("UIButton")
|
||||
btnItem.onClick:RemoveAllListeners()
|
||||
btnItem.onClick:AddListener(function()
|
||||
local mapData = {
|
||||
nTid = scRewardData.RewardItemId1,
|
||||
bShowDepot = true
|
||||
}
|
||||
if self.bStartSnap ~= true then
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.ItemTips, btnItem, mapData)
|
||||
end
|
||||
end)
|
||||
btnGetReward.gameObject:SetActive(isComplete and not isGet)
|
||||
obj_RewardGet.gameObject:SetActive(isGet)
|
||||
txt_RewardDontComplete.gameObject:SetActive(not isComplete and not isGet)
|
||||
if not isGet then
|
||||
NovaAPI.SetTMPText(txtProgress, orderedFormat("{0}/{1}", scStarNeed <= totalTmpStar and scStarNeed or totalTmpStar, scStarNeed))
|
||||
else
|
||||
NovaAPI.SetTMPText(txtProgress, orderedFormat("{0}/{1}", scStarNeed, scStarNeed))
|
||||
end
|
||||
local lengthPre = 0
|
||||
if scStarNeed < totalTmpStar or isGet then
|
||||
lengthPre = 1
|
||||
else
|
||||
lengthPre = totalTmpStar / scStarNeed
|
||||
end
|
||||
imgProgress.sizeDelta = Vector2(lengthPre * totalProLength, totalProHeight)
|
||||
btnGetReward.onClick:RemoveAllListeners()
|
||||
local cbRead = function()
|
||||
self:OnClickGetAward(scStarNeed)
|
||||
end
|
||||
btnGetReward.onClick:AddListener(cbRead)
|
||||
end
|
||||
function ScoreBossSelectCtrl:SortScoreBossRewardData()
|
||||
local scoreReward = {}
|
||||
local totalTmpStar = PlayerData.ScoreBoss.Star
|
||||
local SortRewardData = function(a, b)
|
||||
local aAchieved = a.StarNeed <= totalTmpStar
|
||||
local bAchieved = b.StarNeed <= totalTmpStar
|
||||
local isGet_a = table.indexof(PlayerData.ScoreBoss.tabStarRewards, a.StarNeed) ~= 0
|
||||
local isGet_b = table.indexof(PlayerData.ScoreBoss.tabStarRewards, b.StarNeed) ~= 0
|
||||
local aTop = aAchieved and not isGet_a
|
||||
local bTop = bAchieved and not isGet_b
|
||||
if aTop and not bTop then
|
||||
return true
|
||||
elseif not aTop and bTop then
|
||||
return false
|
||||
elseif aTop and bTop then
|
||||
return a.StarNeed < b.StarNeed
|
||||
end
|
||||
if aAchieved ~= bAchieved then
|
||||
return not aAchieved
|
||||
end
|
||||
return a.StarNeed < b.StarNeed
|
||||
end
|
||||
if PlayerData.ScoreBoss.tabScoreBossReward ~= nil then
|
||||
for _, scoreBossReward in pairs(PlayerData.ScoreBoss.tabScoreBossReward) do
|
||||
table.insert(scoreReward, scoreBossReward)
|
||||
end
|
||||
if 0 < #scoreReward then
|
||||
table.sort(scoreReward, SortRewardData)
|
||||
end
|
||||
end
|
||||
return scoreReward
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnClickGetAward(star)
|
||||
local cb = function()
|
||||
self._mapNode.RewardSc:SetAnim(0.1)
|
||||
self._mapNode.RewardSc:Init(#PlayerData.ScoreBoss.tabScoreBossReward, self, self.RefreshRewardGrid)
|
||||
end
|
||||
PlayerData.ScoreBoss:SendScoreBossStarRewardReceiveReq(cb, star)
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnClickRewardOneKey()
|
||||
if not PlayerData.ScoreBoss.isHave then
|
||||
local sTip = ConfigTable.GetUIText("InfinityTower_Reward_Tips")
|
||||
EventManager.Hit(EventId.OpenMessageBox, sTip)
|
||||
return
|
||||
end
|
||||
self:OnClickGetAward(0)
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnClickBtnGo()
|
||||
local nCurTime = CS.ClientManager.Instance.serverTimeStamp
|
||||
if nCurTime > PlayerData.ScoreBoss.EndTime then
|
||||
local sTip = ConfigTable.GetUIText("ScoreBoss_Settlement_Tips")
|
||||
EventManager.Hit(EventId.OpenMessageBox, sTip)
|
||||
return
|
||||
end
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.RegionBossFormation, AllEnum.RegionBossFormationType.ScoreBoss, self.ChooseLevelId, {})
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnClickBtnSettlement()
|
||||
local sTip = ConfigTable.GetUIText("ScoreBoss_Settlement_Tips")
|
||||
EventManager.Hit(EventId.OpenMessageBox, sTip)
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnEvent_Home(nPanelId)
|
||||
if self._panel._nPanelId ~= nPanelId then
|
||||
return
|
||||
end
|
||||
self.pageType = 1
|
||||
PanelManager.Home()
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnEvent_Back(nPanelId)
|
||||
if self._panel._nPanelId ~= nPanelId then
|
||||
return
|
||||
end
|
||||
if self.pageType == 2 then
|
||||
local func = function()
|
||||
EventManager.Hit(EventId.SetTransition)
|
||||
self._mapNode.SCBossList:SetActive(true)
|
||||
self._mapNode.SCBossInfo:SetActive(false)
|
||||
self:SetRewardStar()
|
||||
self:SetBgActive(1)
|
||||
for i, v in pairs(self.tabGridAni) do
|
||||
v.gameObject:SetActive(true)
|
||||
v:Play("ScoreBossSelect_Card_in")
|
||||
end
|
||||
end
|
||||
EventManager.Hit(EventId.SetTransition, 25, func)
|
||||
self.pageType = 1
|
||||
if not self.isPlayNPCVoice then
|
||||
self.isPlayNPCVoice = true
|
||||
self:PlayGreetVoice()
|
||||
end
|
||||
else
|
||||
EventManager.Hit(EventId.CloesCurPanel)
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:SetBgActive(index)
|
||||
self._mapNode.bgImageCover:SetActive(index == 1)
|
||||
self._mapNode.rawImgActor2D.gameObject:SetActive(index == 1)
|
||||
self._mapNode.InfoBgObj:SetActive(index ~= 1)
|
||||
if index == 1 then
|
||||
self:SetPngSprite(self._mapNode.bgImage, bgPath)
|
||||
self.nRemainTime = PlayerData.ScoreBoss.EndTime == 0 and 0 or PlayerData.ScoreBoss.EndTime - CS.ClientManager.Instance.serverTimeStamp
|
||||
if self.nRemainTime > 0 then
|
||||
self._mapNode.goRefresh:SetActive(true)
|
||||
self._mapNode.goSettlement:SetActive(false)
|
||||
else
|
||||
self._mapNode.goRefresh:SetActive(false)
|
||||
self._mapNode.goSettlement:SetActive(true)
|
||||
end
|
||||
self._mapNode.btnStar.gameObject:SetActive(true)
|
||||
self._mapNode.btnRank.gameObject:SetActive(true)
|
||||
self:ChangeBtnActorState(true)
|
||||
else
|
||||
self._mapNode.goRefresh:SetActive(false)
|
||||
self._mapNode.goSettlement:SetActive(false)
|
||||
self._mapNode.btnStar.gameObject:SetActive(false)
|
||||
self._mapNode.btnRank.gameObject:SetActive(false)
|
||||
self:ChangeBtnActorState(false)
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:RefreshNPC2D()
|
||||
local bUseL2D = LocalSettingData.mapData.UseLive2D
|
||||
self._mapNode.rawImgActor2D.transform.localScale = bUseL2D == true and Vector3.one or Vector3.zero
|
||||
self._mapNode.trActor2D_PNG.localScale = bUseL2D == true and Vector3.zero or Vector3.one
|
||||
if bUseL2D == true then
|
||||
Actor2DManager.SetBoardNPC2D(self:GetPanelId(), self._mapNode.rawImgActor2D, NpcId)
|
||||
else
|
||||
Actor2DManager.SetBoardNPC2D_PNG(self._mapNode.trActor2D_PNG, self:GetPanelId(), NpcId)
|
||||
end
|
||||
if self.pageType == nil or self.pageType == 1 then
|
||||
self.isPlayNPCVoice = true
|
||||
self:PlayGreetVoice()
|
||||
end
|
||||
end
|
||||
function ScoreBossSelectCtrl:PlayGreetVoice()
|
||||
local isFirst, sKey = PlayerData.ScoreBoss:GetVoiceKey()
|
||||
if isFirst then
|
||||
PlayerData.Voice:StopCharVoice()
|
||||
local sVoiceRes = PlayerData.Voice:PlayCharVoice(sKey, NpcId, nil, true)
|
||||
else
|
||||
local tab = {"greet_npc", sKey}
|
||||
if PlayerData.ScoreBoss.isLevelClear then
|
||||
tab = {"clear"}
|
||||
PlayerData.ScoreBoss.isLevelClear = false
|
||||
end
|
||||
PlayerData.Voice:PlayCharVoice(tab, NpcId, nil, true)
|
||||
end
|
||||
PlayerData.Voice:StartBoardFreeTimer(NpcId)
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnBtnClick_Actor()
|
||||
PlayerData.Voice:PlayBoardNPCClickVoice(NpcId)
|
||||
end
|
||||
function ScoreBossSelectCtrl:OnEvent_ShowBubbleVoiceText(nNpcId, nId)
|
||||
if nNpcId ~= NpcId then
|
||||
return
|
||||
end
|
||||
local mapVoDirectoryData = ConfigTable.GetData("VoDirectory", nId)
|
||||
if mapVoDirectoryData == nil then
|
||||
printError("VoDirectory未找到数据id:" .. nId)
|
||||
return
|
||||
end
|
||||
BubbleVoiceManager.PlayFixedBubbleAnim(self._mapNode.goBubbleRoot, mapVoDirectoryData.voResource)
|
||||
end
|
||||
function ScoreBossSelectCtrl:ChangeBtnActorState(isShow)
|
||||
self._mapNode.btnActor.gameObject:SetActive(isShow)
|
||||
if not isShow then
|
||||
PlayerData.Voice:StopCharVoice()
|
||||
BubbleVoiceManager.StopBubbleAnim()
|
||||
PlayerData.Voice:ClearTimer()
|
||||
end
|
||||
end
|
||||
return ScoreBossSelectCtrl
|
||||
@@ -0,0 +1,18 @@
|
||||
local ScoreBossSelectPanel = class("ScoreBossSelectPanel", BasePanel)
|
||||
ScoreBossSelectPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "Play_ScoreBoss/ScoreBossSelectPanel.prefab",
|
||||
sCtrlName = "Game.UI.ScoreBoss.ScoreBossSelectCtrl"
|
||||
}
|
||||
}
|
||||
function ScoreBossSelectPanel:Awake()
|
||||
end
|
||||
function ScoreBossSelectPanel:OnEnable()
|
||||
end
|
||||
function ScoreBossSelectPanel:OnDisable()
|
||||
end
|
||||
function ScoreBossSelectPanel:OnDestroy()
|
||||
end
|
||||
function ScoreBossSelectPanel:OnRelease()
|
||||
end
|
||||
return ScoreBossSelectPanel
|
||||
Reference in New Issue
Block a user