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,401 @@
|
||||
local TutorialDiscSkillActiveCtrl = class("TutorialDiscSkillActiveCtrl", BaseCtrl)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
local WwiseManger = CS.WwiseAudioManager.Instance
|
||||
TutorialDiscSkillActiveCtrl._mapNodeConfig = {
|
||||
blurBg = {},
|
||||
contentRoot = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
animRoot = {
|
||||
sNodeName = "----SafeAreaRoot----",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
btnBg = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_BtnBg"
|
||||
},
|
||||
btnShortcutBg = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_BtnBg",
|
||||
sAction = "Confirm"
|
||||
},
|
||||
cgSkillList = {
|
||||
sNodeName = "goSkillList",
|
||||
sComponentName = "CanvasGroup"
|
||||
},
|
||||
btnDepot = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Depot"
|
||||
},
|
||||
txtTitle = {sComponentName = "TMP_Text"},
|
||||
goAllNoteList = {},
|
||||
imgNote = {sComponentName = "Image", nCount = 9},
|
||||
goNoteList = {},
|
||||
goNoteItem = {},
|
||||
noteContent = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
btnNoteList = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_BtnBg"
|
||||
},
|
||||
goSkillList = {},
|
||||
goSkillItem = {},
|
||||
skillContent = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
btnSkillList = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_BtnBg"
|
||||
},
|
||||
goSkillCard = {},
|
||||
goNoteCardItem = {
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateDiscSkillCardCtrl"
|
||||
},
|
||||
imgIconBgEffect = {sComponentName = "Image"},
|
||||
imgIconEffect = {sComponentName = "Image"},
|
||||
imgCornerBgEffect = {sComponentName = "Image"},
|
||||
txtTips = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tips_Continue"
|
||||
},
|
||||
txtClickPre = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "StarTower_Click_Pre"
|
||||
},
|
||||
txtClickSuf = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "StarTower_Click_Suf"
|
||||
},
|
||||
Tips = {
|
||||
sCtrlName = "Game.UI.StarTower.DiscTips.StarTowerTipsCtrl"
|
||||
}
|
||||
}
|
||||
TutorialDiscSkillActiveCtrl._mapEventConfig = {
|
||||
StarTowerShowDiscSkill = "OnEvent_ShowDiscSkillActive",
|
||||
OpenNoteDepot = "OnEvent_OpenNoteDepot",
|
||||
GamepadUIReopen = "OnEvent_Reopen",
|
||||
StarTowerDiscTips = "OnEvent_StarTowerDiscTips"
|
||||
}
|
||||
TutorialDiscSkillActiveCtrl._mapRedDotConfig = {}
|
||||
local panel_stage_note = 1
|
||||
local panel_stage_skill = 2
|
||||
local panel_stage_skill_upgrade = 3
|
||||
function TutorialDiscSkillActiveCtrl:InitNoteSkillList(tbNoteList)
|
||||
if self.tbShowNote == nil then
|
||||
self.tbShowNote = {}
|
||||
for id, _ in pairs(tbNoteList) do
|
||||
table.insert(self.tbShowNote, id)
|
||||
end
|
||||
table.sort(self.tbShowNote, function(a, b)
|
||||
return a < b
|
||||
end)
|
||||
for k, v in ipairs(self._mapNode.imgNote) do
|
||||
v.gameObject:SetActive(self.tbShowNote[k] ~= nil)
|
||||
if self.tbShowNote[k] ~= nil then
|
||||
local mapNoteCfg = ConfigTable.GetData("SubNoteSkill", self.tbShowNote[k])
|
||||
if nil ~= mapNoteCfg then
|
||||
self:SetPngSprite(v, mapNoteCfg.Icon .. AllEnum.DiscSkillIconSurfix.Small)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:ShowNoteList(tbParam, callback)
|
||||
self._mapNode.Tips.gameObject:SetActive(true)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtTitle, ConfigTable.GetUIText("StarTower_Disc_Skill_Active_1"))
|
||||
self._panel:SetTop(self.canvas)
|
||||
local bCloseCamera = false
|
||||
if not self.bOpen then
|
||||
PanelManager.InputDisable()
|
||||
bCloseCamera = true
|
||||
GamepadUIManager.EnableGamepadUI("TutorialDiscSkillActiveCtrl", self.tbGamepadUINode)
|
||||
end
|
||||
self.bOpen = true
|
||||
EventManager.Hit("StarTowerSetButtonEnable", false, false)
|
||||
self.callback = callback
|
||||
self._mapNode.blurBg.gameObject:SetActive(true)
|
||||
self._mapNode.btnBg.gameObject:SetActive(true)
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
if bCloseCamera then
|
||||
CS.GameCameraStackManager.Instance:CloseMainCamera(0.1)
|
||||
end
|
||||
self._mapNode.contentRoot.gameObject:SetActive(true)
|
||||
self._mapNode.goNoteList.gameObject:SetActive(true)
|
||||
self._mapNode.goSkillList.gameObject:SetActive(false)
|
||||
self._mapNode.goSkillCard.gameObject:SetActive(false)
|
||||
self.nPanelStage = panel_stage_note
|
||||
self:RefreshAllNoteList(tbParam.tbNoteChange)
|
||||
self:RefreshNoteSkill(tbParam.tbNoteChange)
|
||||
WwiseManger:PlaySound("ui_roguelike_phonograph_mus")
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:RefreshAllNoteList(tbNoteChange)
|
||||
for k, v in ipairs(self._mapNode.imgNote) do
|
||||
local nNoteId = self.tbShowNote[k]
|
||||
v.gameObject:SetActive(nNoteId ~= nil)
|
||||
if nNoteId ~= nil then
|
||||
local tmpCount = v.gameObject.transform:Find("txtNoteCount"):GetComponent("TMP_Text")
|
||||
local imgArrow = v.gameObject.transform:Find("imgArrow")
|
||||
NovaAPI.SetTMPText(tmpCount, self.tbNoteList[nNoteId] or 0)
|
||||
imgArrow.gameObject:SetActive(tbNoteChange[nNoteId] ~= nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:RefreshNoteSkill(tbNoteChange)
|
||||
local tbNoteSkill = {}
|
||||
for nId, v in pairs(tbNoteChange) do
|
||||
table.insert(tbNoteSkill, {
|
||||
nNoteId = nId,
|
||||
nCount = v.nCount,
|
||||
bLucky = v.bLucky
|
||||
})
|
||||
end
|
||||
table.sort(tbNoteSkill, function(a, b)
|
||||
return a.nNoteId < b.nNoteId
|
||||
end)
|
||||
for _, v in ipairs(self.tbNoteSkillItemCtrl) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
local tbCtrl = {}
|
||||
for k, v in ipairs(tbNoteSkill) do
|
||||
local objCtrl = self.tbNoteSkillItemCtrl[k]
|
||||
if objCtrl == nil then
|
||||
local objItem = instantiate(self._mapNode.goNoteItem, self._mapNode.noteContent)
|
||||
objCtrl = self:BindCtrlByNode(objItem, "Game.UI.StarTower.DiscTips.DiscNoteSkillItemCtrl")
|
||||
table.insert(self.tbNoteSkillItemCtrl, objCtrl)
|
||||
end
|
||||
objCtrl.gameObject:SetActive(false)
|
||||
local nCurLevel = self.tbNoteList[v.nNoteId] or 0
|
||||
objCtrl:SetSkillItem(v.nNoteId, nCurLevel, nCurLevel - v.nCount, v.bLucky)
|
||||
table.insert(tbCtrl, objCtrl)
|
||||
end
|
||||
local nIndex = 1
|
||||
if 0 < #tbCtrl then
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
self:AddTimer(#tbCtrl, 0.08, function()
|
||||
local objCtrl = tbCtrl[nIndex]
|
||||
nIndex = nIndex + 1
|
||||
if objCtrl ~= nil then
|
||||
objCtrl.gameObject:SetActive(true)
|
||||
end
|
||||
if nIndex > #tbCtrl then
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
self._mapNode.txtTips[1].gameObject:SetActive(true)
|
||||
self._mapNode.txtTips[2].gameObject:SetActive(true)
|
||||
EventManager.Hit("Guide_PassiveCheck_Msg", "Guide_OpenDiscSkillActive_Tutorial")
|
||||
end
|
||||
end, true, true, true)
|
||||
else
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
end
|
||||
self._mapNode.txtTips[1].gameObject:SetActive(false)
|
||||
self._mapNode.txtTips[2].gameObject:SetActive(false)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:RefreshDiscSkill(tbSkillList)
|
||||
WwiseManger:PlaySound("ui_roguelike_phonograph_mus")
|
||||
self._mapNode.goNoteList.gameObject:SetActive(false)
|
||||
self._mapNode.goSkillList.gameObject:SetActive(true)
|
||||
self._mapNode.goSkillCard.gameObject:SetActive(false)
|
||||
local tbCtrl = {}
|
||||
if tbSkillList ~= nil then
|
||||
for _, v in ipairs(self.tbSkillItemCtrl) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
for k, v in ipairs(tbSkillList) do
|
||||
local objCtrl = self.tbSkillItemCtrl[k]
|
||||
if objCtrl == nil then
|
||||
local objItem = instantiate(self._mapNode.goSkillItem, self._mapNode.skillContent)
|
||||
objCtrl = self:BindCtrlByNode(objItem, "Game.UI.StarTower.DiscTips.DiscSkillItemCtrl")
|
||||
table.insert(self.tbSkillItemCtrl, objCtrl)
|
||||
end
|
||||
objCtrl.gameObject:SetActive(false)
|
||||
objCtrl:SetSkillItem(v.nSkillId, v.tbChangeNote, self.tbNoteList)
|
||||
table.insert(tbCtrl, objCtrl)
|
||||
end
|
||||
end
|
||||
local nIndex = 1
|
||||
if 0 < #tbCtrl then
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
self:AddTimer(#tbCtrl, 0.08, function()
|
||||
local objCtrl = tbCtrl[nIndex]
|
||||
nIndex = nIndex + 1
|
||||
if objCtrl ~= nil then
|
||||
objCtrl.gameObject:SetActive(true)
|
||||
objCtrl:PlayAnim()
|
||||
end
|
||||
if nIndex > #tbCtrl then
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
self._mapNode.txtTips[1].gameObject:SetActive(true)
|
||||
self._mapNode.txtTips[2].gameObject:SetActive(true)
|
||||
end
|
||||
end, true, true, true)
|
||||
self._mapNode.txtTips[1].gameObject:SetActive(false)
|
||||
self._mapNode.txtTips[2].gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:ShowDiscUpgradeCard()
|
||||
self._mapNode.txtTips[1].gameObject:SetActive(false)
|
||||
self._mapNode.txtTips[2].gameObject:SetActive(false)
|
||||
self._mapNode.animRoot:Play("DiscSkillActive_Card", 0, 0)
|
||||
local nAnimLen = NovaAPI.GetAnimClipLength(self._mapNode.animRoot, {
|
||||
"DiscSkillActive_Card"
|
||||
})
|
||||
self:AddTimer(1, nAnimLen, function()
|
||||
self._mapNode.txtTips[1].gameObject:SetActive(true)
|
||||
self._mapNode.txtTips[2].gameObject:SetActive(true)
|
||||
end, true, true, true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, nAnimLen)
|
||||
WwiseManger:PlaySound("ui_roguelike_outfit_select")
|
||||
NovaAPI.SetTMPText(self._mapNode.txtTitle, ConfigTable.GetUIText("StarTower_Disc_Skill_Active_2"))
|
||||
self._mapNode.goSkillCard.gameObject:SetActive(true)
|
||||
self._mapNode.goNoteList.gameObject:SetActive(false)
|
||||
self._mapNode.goSkillList.gameObject:SetActive(false)
|
||||
local mapData = table.remove(self.tbSkillActive, 1)
|
||||
if mapData ~= nil then
|
||||
self.nSkillId = mapData.nSkillId
|
||||
self._mapNode.goNoteCardItem:Refresh(mapData.nDiscId, nil, self.nSkillId)
|
||||
self._mapNode.goNoteCardItem:ChangeWordRaycast(true)
|
||||
local mapSkillCfg = ConfigTable.GetData("SecondarySkill", self.nSkillId)
|
||||
if mapSkillCfg ~= nil then
|
||||
self:SetPngSprite(self._mapNode.imgIconEffect, mapSkillCfg.Icon)
|
||||
self:SetPngSprite(self._mapNode.imgIconBgEffect, mapSkillCfg.IconBg)
|
||||
EventManager.Hit("Guide_PassiveCheck_Msg", "Guide_OpenStarTowerDepot_Tutorial")
|
||||
end
|
||||
end
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:HidePanel()
|
||||
self.bOpen = false
|
||||
GamepadUIManager.DisableGamepadUI("TutorialDiscSkillActiveCtrl")
|
||||
EventManager.Hit("StarTowerSetButtonEnable", true, true)
|
||||
PanelManager.InputEnable()
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
self._mapNode.blurBg.gameObject:SetActive(false)
|
||||
self._mapNode.btnBg.gameObject:SetActive(false)
|
||||
NovaAPI.SetCanvasSortingOrder(self.canvas, self.nInitSortingOrder)
|
||||
CS.GameCameraStackManager.Instance:OpenMainCamera()
|
||||
if nil ~= self.callback then
|
||||
self.callback()
|
||||
end
|
||||
CS.AdventureModuleHelper.ResumeLogic()
|
||||
PanelManager.InputEnable()
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:ReopenPanel()
|
||||
EventManager.Hit("StarTowerSetButtonEnable", false, false)
|
||||
self._mapNode.blurBg.gameObject:SetActive(true)
|
||||
self._mapNode.btnBg.gameObject:SetActive(true)
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
CS.GameCameraStackManager.Instance:CloseMainCamera(0.1)
|
||||
self._mapNode.contentRoot.gameObject:SetActive(true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:Awake()
|
||||
self.nType = 0
|
||||
self.bOpen = false
|
||||
self.tbNoteSkillItemCtrl = {}
|
||||
self.tbSkillItemCtrl = {}
|
||||
self.canvas = self.gameObject:GetComponent("Canvas")
|
||||
self.nInitSortingOrder = NovaAPI.GetCanvasSortingOrder(self.canvas)
|
||||
self._mapNode.blurBg.gameObject:SetActive(false)
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
self._mapNode.btnBg.gameObject:SetActive(false)
|
||||
self._mapNode.goSkillItem.gameObject:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
self._mapNode.btnDepot.gameObject:SetActive(false)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnEnable()
|
||||
self.nPanelStage = 0
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnDisable()
|
||||
for _, v in ipairs(self.tbNoteSkillItemCtrl) do
|
||||
self:UnbindCtrlByNode(v)
|
||||
end
|
||||
self.tbNoteSkillItemCtrl = {}
|
||||
for _, v in ipairs(self.tbSkillItemCtrl) do
|
||||
self:UnbindCtrlByNode(v)
|
||||
end
|
||||
self.tbSkillItemCtrl = {}
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnBtnClick_BtnBg()
|
||||
if self.nPanelStage == panel_stage_note then
|
||||
if self.tbParam.tbSkill ~= nil and next(self.tbParam.tbSkill) ~= nil then
|
||||
self.nPanelStage = panel_stage_skill
|
||||
self:RefreshDiscSkill(self.tbParam.tbSkill)
|
||||
return
|
||||
else
|
||||
self.nPanelStage = 0
|
||||
end
|
||||
elseif self.nPanelStage == panel_stage_skill then
|
||||
if 0 < #self.tbSkillActive then
|
||||
self.nPanelStage = panel_stage_skill_upgrade
|
||||
self:ShowDiscUpgradeCard()
|
||||
return
|
||||
else
|
||||
self.nPanelStage = 0
|
||||
end
|
||||
elseif self.nPanelStage == panel_stage_skill_upgrade then
|
||||
if #self.tbSkillActive == 0 then
|
||||
self.nPanelStage = 0
|
||||
else
|
||||
self:ShowDiscUpgradeCard()
|
||||
return
|
||||
end
|
||||
end
|
||||
if self.nPanelStage == 0 then
|
||||
self:HidePanel()
|
||||
end
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnBtnClick_Depot()
|
||||
self.bDepotOpen = true
|
||||
EventManager.Hit("StarTowerSetButtonEnable", false, false)
|
||||
CS.GameCameraStackManager.Instance:OpenMainCamera()
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
self._mapNode.blurBg.gameObject:SetActive(false)
|
||||
self._mapNode.btnBg.gameObject:SetActive(false)
|
||||
EventManager.Hit(EventId.StarTowerDepot, AllEnum.StarTowerDepotTog.DiscSkill)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnEvent_ShowDiscSkillActive(tbParam, tbNoteList, callback)
|
||||
CS.AdventureModuleHelper.PauseLogic()
|
||||
PanelManager.InputDisable()
|
||||
self:InitNoteSkillList(tbNoteList)
|
||||
self.tbParam = tbParam
|
||||
self.tbNoteList = tbNoteList
|
||||
self.tbSkillActive = tbParam.tbDiscSkillAct
|
||||
self:ShowNoteList(tbParam, callback)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnEvent_StarTowerDiscTips(tbTips)
|
||||
self._mapNode.Tips.gameObject:SetActive(true)
|
||||
self._mapNode.Tips:StartShowTips(tbTips)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnEvent_OpenNoteDepot()
|
||||
if self._mapNode.contentRoot.gameObject.activeSelf == false then
|
||||
return
|
||||
end
|
||||
self.bDepotOpen = true
|
||||
CS.GameCameraStackManager.Instance:OpenMainCamera()
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
self._mapNode.blurBg.gameObject:SetActive(false)
|
||||
self._mapNode.btnBg.gameObject:SetActive(false)
|
||||
end
|
||||
function TutorialDiscSkillActiveCtrl:OnEvent_Reopen(sName)
|
||||
if sName ~= "TutorialDiscSkillActiveCtrl" then
|
||||
return
|
||||
end
|
||||
if self.bDepotOpen then
|
||||
self.bDepotOpen = false
|
||||
self:ReopenPanel()
|
||||
end
|
||||
end
|
||||
return TutorialDiscSkillActiveCtrl
|
||||
@@ -0,0 +1,208 @@
|
||||
local TutorialInfoCtrl = class("TutorialInfoCtrl", BaseCtrl)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
local WwiseAudioMgr = CS.WwiseAudioManager.Instance
|
||||
TutorialInfoCtrl._mapNodeConfig = {
|
||||
Challenge = {},
|
||||
canvasGroup = {
|
||||
sNodeName = "----SafeAreaRoot----",
|
||||
sComponentName = "CanvasGroup"
|
||||
},
|
||||
rtList = {sComponentName = "Transform"},
|
||||
goQuest = {},
|
||||
aniQuest = {sNodeName = "goQuest", sComponentName = "Animator"},
|
||||
txt_tips = {sComponentName = "TMP_Text"},
|
||||
img_tips = {
|
||||
sComponentName = "RectTransform"
|
||||
}
|
||||
}
|
||||
TutorialInfoCtrl._mapEventConfig = {
|
||||
OpenTutorialInfo = "OnEvent_OpenUI",
|
||||
TutorialLevelEnd = "OnEvent_CloseUI",
|
||||
InputEnable = "OnEvent_InputEnable",
|
||||
TutorialBattleEnd = "OnEvent_BattleEnd",
|
||||
TaskLevel_InitTask = "RefreshQuest",
|
||||
TaskLevel_UpdateTaskTargetProcess = "UpdateTarget",
|
||||
TaskLevel_TaskFinish = "OnEvent_TaskFinish",
|
||||
Tutorial_UpdateTips = "OnEvent_UpdateTip",
|
||||
GamepadUIChange = "OnEvent_GamepadUIChange"
|
||||
}
|
||||
TutorialInfoCtrl._mapRedDotConfig = {}
|
||||
function TutorialInfoCtrl:Awake()
|
||||
self.nCurQuest = nil
|
||||
self.nNextQuest = nil
|
||||
self.tbTargetCount = {}
|
||||
self.tbTargetProcess = {}
|
||||
self.tipsKey = nil
|
||||
end
|
||||
function TutorialInfoCtrl:OnEnable()
|
||||
self._mapNode.img_tips.gameObject:SetActive(false)
|
||||
self.bBattleEnd = false
|
||||
end
|
||||
function TutorialInfoCtrl:OnDestroy()
|
||||
end
|
||||
function TutorialInfoCtrl:RefreshQuest(nQuestId)
|
||||
local mapQuest = ConfigTable.GetData("LevelQuest", nQuestId)
|
||||
if not mapQuest then
|
||||
return
|
||||
end
|
||||
self.bIsLastTask = false
|
||||
local tbTarget = mapQuest.LevelQuestTargetIds
|
||||
if not self.tbTargetCount[nQuestId] then
|
||||
self.tbTargetCount[nQuestId] = {
|
||||
nCur = 0,
|
||||
nMax = #tbTarget
|
||||
}
|
||||
end
|
||||
if not self.tbTargetProcess[nQuestId] then
|
||||
self.tbTargetProcess[nQuestId] = {}
|
||||
for _, v in ipairs(tbTarget) do
|
||||
self.tbTargetProcess[nQuestId][v] = {nCur = 0, nMax = 0}
|
||||
end
|
||||
end
|
||||
if self.nCurQuest then
|
||||
if self.nCurQuest ~= nQuestId then
|
||||
self.nNextQuest = nQuestId
|
||||
end
|
||||
return
|
||||
else
|
||||
self.nCurQuest = nQuestId
|
||||
end
|
||||
self.tbTagetNode = {}
|
||||
delChildren(self._mapNode.rtList)
|
||||
for _, v in ipairs(tbTarget) do
|
||||
local mapTarget = ConfigTable.GetData("LevelQuestTarget", v)
|
||||
if mapTarget then
|
||||
local goItemObj = instantiate(self._mapNode.goQuest, self._mapNode.rtList)
|
||||
goItemObj:SetActive(true)
|
||||
self.tbTagetNode[v] = {}
|
||||
self.tbTagetNode[v].imgOff = goItemObj.transform:Find("goReach/imgOff").gameObject
|
||||
self.tbTagetNode[v].imgOn = goItemObj.transform:Find("goReach/imgOn").gameObject
|
||||
self.tbTagetNode[v].txtDesc = goItemObj.transform:Find("txtDesc"):GetComponent("TMP_Text")
|
||||
self.tbTagetNode[v].ani = goItemObj.transform:GetComponent("Animator")
|
||||
self.tbTagetNode[v].sPrefix = UTILS.ParseLevelQuestTargetDesc(mapTarget.QuestDes, mapTarget)
|
||||
local sSuffix = ""
|
||||
if 0 < self.tbTargetProcess[nQuestId][v].nCur then
|
||||
sSuffix = "<color=#2be1f1>(" .. self.tbTargetProcess[nQuestId][v].nCur .. "/" .. self.tbTargetProcess[nQuestId][v].nMax .. ")</color>"
|
||||
else
|
||||
sSuffix = UTILS.GetLevelQuestTargetProcess(mapTarget)
|
||||
end
|
||||
self.tbTagetNode[v].imgOff:SetActive(true)
|
||||
self.tbTagetNode[v].imgOn:SetActive(false)
|
||||
NovaAPI.SetTMPText(self.tbTagetNode[v].txtDesc, self.tbTagetNode[v].sPrefix .. sSuffix)
|
||||
end
|
||||
end
|
||||
end
|
||||
function TutorialInfoCtrl:UpdateTarget(nQuestId, nTargetId, nCur, nMax)
|
||||
nCur = nCur:AsInt()
|
||||
nMax = nMax:AsInt()
|
||||
local bComplete = nCur >= nMax
|
||||
self.tbTargetProcess[nQuestId][nTargetId].nCur = nCur
|
||||
self.tbTargetProcess[nQuestId][nTargetId].nMax = nMax
|
||||
if bComplete then
|
||||
self.tbTargetCount[nQuestId].nCur = self.tbTargetCount[nQuestId].nCur + 1
|
||||
end
|
||||
if nQuestId ~= self.nCurQuest then
|
||||
return
|
||||
end
|
||||
if self.tbTargetCount[nQuestId].nCur == self.tbTargetCount[nQuestId].nMax then
|
||||
self:SetTimer()
|
||||
end
|
||||
if not self.tbTagetNode[nTargetId] then
|
||||
return
|
||||
end
|
||||
self.tbTagetNode[nTargetId].imgOff:SetActive(not bComplete)
|
||||
self.tbTagetNode[nTargetId].imgOn:SetActive(bComplete)
|
||||
local sSuffix = "<color=#2be1f1>(" .. nCur .. "/" .. nMax .. ")</color>"
|
||||
NovaAPI.SetTMPText(self.tbTagetNode[nTargetId].txtDesc, self.tbTagetNode[nTargetId].sPrefix .. sSuffix)
|
||||
if bComplete then
|
||||
self.tbTagetNode[nTargetId].ani:Play("TrialInfo_Quest_on")
|
||||
WwiseAudioMgr:PostEvent("ui_tip_complete")
|
||||
end
|
||||
end
|
||||
function TutorialInfoCtrl:SetTimer()
|
||||
if self.timer ~= nil then
|
||||
self.timer:Cancel()
|
||||
end
|
||||
local nAnimTime = NovaAPI.GetAnimClipLength(self._mapNode.aniQuest, {
|
||||
"TrialInfo_Quest_on"
|
||||
})
|
||||
local countdown = function()
|
||||
self.nCurQuest = nil
|
||||
if not self.bIsLastTask and self.nNextQuest then
|
||||
self:RefreshQuest(self.nNextQuest)
|
||||
self.nNextQuest = nil
|
||||
end
|
||||
end
|
||||
self.timer = self:AddTimer(1, nAnimTime + 0.5, countdown, true, true, false)
|
||||
end
|
||||
function TutorialInfoCtrl:ClearTimer()
|
||||
if self.timer ~= nil then
|
||||
self.timer:Cancel()
|
||||
end
|
||||
self.timer = nil
|
||||
end
|
||||
function TutorialInfoCtrl:OnEvent_OpenUI(nQuestId)
|
||||
self._mapNode.Challenge.gameObject:SetActive(true)
|
||||
if nQuestId then
|
||||
self:RefreshQuest(nQuestId)
|
||||
end
|
||||
end
|
||||
function TutorialInfoCtrl:OnEvent_CloseUI()
|
||||
end
|
||||
function TutorialInfoCtrl:OnEvent_InputEnable(bEnable)
|
||||
if self.bBattleEnd == true then
|
||||
return
|
||||
end
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.canvasGroup, bEnable == true and 1 or 0)
|
||||
NovaAPI.SetCanvasGroupInteractable(self._mapNode.canvasGroup, bEnable == true)
|
||||
NovaAPI.SetCanvasGroupBlocksRaycasts(self._mapNode.canvasGroup, bEnable == true)
|
||||
end
|
||||
function TutorialInfoCtrl:OnEvent_BattleEnd()
|
||||
self.bBattleEnd = true
|
||||
end
|
||||
function TutorialInfoCtrl:OnEvent_UpdateTip(tipsKey)
|
||||
self.tipsKey = tipsKey
|
||||
local tmpDest = ""
|
||||
local nUIType = GamepadUIManager.GetCurUIType()
|
||||
if nUIType == AllEnum.GamepadUIType.Other or nUIType == AllEnum.GamepadUIType.Keyboard or nUIType == AllEnum.GamepadUIType.Mouse then
|
||||
if NovaAPI.IsMobilePlatform() then
|
||||
tmpDest = tmpDest .. "_Mobile"
|
||||
else
|
||||
tmpDest = tmpDest .. "_PC"
|
||||
end
|
||||
elseif nUIType == AllEnum.GamepadUIType.PS then
|
||||
tmpDest = tmpDest .. "_PS"
|
||||
elseif nUIType == AllEnum.GamepadUIType.Xbox then
|
||||
tmpDest = tmpDest .. "_Xbox"
|
||||
end
|
||||
local sTips = ConfigTable.GetUIText(self.tipsKey .. tmpDest)
|
||||
NovaAPI.SetTMPText(self._mapNode.txt_tips, sTips)
|
||||
self._mapNode.img_tips.gameObject:SetActive(true)
|
||||
CS.UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(self._mapNode.img_tips)
|
||||
end
|
||||
function TutorialInfoCtrl:OnEvent_TaskFinish(isLastTask)
|
||||
self.bIsLastTask = isLastTask
|
||||
end
|
||||
function TutorialInfoCtrl:OnEvent_GamepadUIChange()
|
||||
if self.tipsKey == nil then
|
||||
return
|
||||
end
|
||||
local tmpDest = ""
|
||||
local nUIType = GamepadUIManager.GetCurUIType()
|
||||
if nUIType == AllEnum.GamepadUIType.Other or nUIType == AllEnum.GamepadUIType.Keyboard or nUIType == AllEnum.GamepadUIType.Mouse then
|
||||
if NovaAPI.IsMobilePlatform() then
|
||||
tmpDest = tmpDest .. "_Mobile"
|
||||
else
|
||||
tmpDest = tmpDest .. "_PC"
|
||||
end
|
||||
elseif nUIType == AllEnum.GamepadUIType.PS then
|
||||
tmpDest = tmpDest .. "_PS"
|
||||
elseif nUIType == AllEnum.GamepadUIType.Xbox then
|
||||
tmpDest = tmpDest .. "_Xbox"
|
||||
end
|
||||
local sTips = ConfigTable.GetUIText(self.tipsKey .. tmpDest)
|
||||
NovaAPI.SetTMPText(self._mapNode.txt_tips, sTips)
|
||||
self._mapNode.img_tips.gameObject:SetActive(true)
|
||||
CS.UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(self._mapNode.img_tips)
|
||||
end
|
||||
return TutorialInfoCtrl
|
||||
@@ -0,0 +1,91 @@
|
||||
local TutorialMenuCtrl = class("TutorialMenuCtrl", BaseCtrl)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
TutorialMenuCtrl._mapNodeConfig = {
|
||||
btnPause = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Pause"
|
||||
},
|
||||
btn_card = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_OpenCard",
|
||||
sAction = "Depot"
|
||||
},
|
||||
txt_dic = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_DicTitle"
|
||||
},
|
||||
canvasGroup = {
|
||||
sNodeName = "----SafeAreaRoot----",
|
||||
sComponentName = "CanvasGroup"
|
||||
}
|
||||
}
|
||||
TutorialMenuCtrl._mapEventConfig = {
|
||||
[EventId.ClosePanel] = "OnEvent_CloseDic",
|
||||
Tutorial_OpenCard = "OnEvent_OpenDic",
|
||||
TutorialLevel_Success = "OnEvent_Success",
|
||||
InputEnable = "OnEvent_InputEnable"
|
||||
}
|
||||
TutorialMenuCtrl._mapRedDotConfig = {}
|
||||
function TutorialMenuCtrl:Awake()
|
||||
self._mapNode.btn_card.gameObject:SetActive(false)
|
||||
end
|
||||
function TutorialMenuCtrl:OnEnable()
|
||||
GamepadUIManager.AddGamepadUINode("BattleMenu", self:GetGamepadUINode())
|
||||
end
|
||||
function TutorialMenuCtrl:OnDisable()
|
||||
end
|
||||
function TutorialMenuCtrl:OnDestroy()
|
||||
end
|
||||
function TutorialMenuCtrl:PauseLogic()
|
||||
EventManager.Hit("BattlePause")
|
||||
PanelManager.InputDisable()
|
||||
end
|
||||
function TutorialMenuCtrl:ResumeLogic()
|
||||
PanelManager.InputEnable()
|
||||
end
|
||||
function TutorialMenuCtrl:OpenDic()
|
||||
self:PauseLogic()
|
||||
local dicId = PlayerData.TutorialData:GetCurDicId()
|
||||
if dicId ~= 0 then
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.DictionaryEntry, dicId, true)
|
||||
end
|
||||
end
|
||||
function TutorialMenuCtrl:OnBtnClick_Pause()
|
||||
EventManager.Hit("TutorialPause")
|
||||
end
|
||||
function TutorialMenuCtrl:OnBtnClick_OpenCard()
|
||||
self:OpenDic()
|
||||
end
|
||||
function TutorialMenuCtrl:OnEvent_OpenDic(cardId, bIsLevelStart)
|
||||
if bIsLevelStart then
|
||||
PanelManager.InputDisable()
|
||||
self:AddTimer(1, 0.8, function()
|
||||
PanelManager.InputEnable()
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self:OpenDic()
|
||||
self._mapNode.btn_card.gameObject:SetActive(true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end, true, true, true)
|
||||
else
|
||||
self:OpenDic()
|
||||
self._mapNode.btn_card.gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
function TutorialMenuCtrl:OnEvent_CloseDic(panelId)
|
||||
if panelId == PanelId.DictionaryEntry then
|
||||
NovaAPI.DispatchEventWithData("Tutorial_CloseCard", nil, {})
|
||||
self:ResumeLogic()
|
||||
end
|
||||
end
|
||||
function TutorialMenuCtrl:OnEvent_Success()
|
||||
PlayerData.TutorialData:FinishLevel(true)
|
||||
end
|
||||
function TutorialMenuCtrl:OnEvent_InputEnable(bEnable)
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.canvasGroup, bEnable == true and 1 or 0)
|
||||
NovaAPI.SetCanvasGroupInteractable(self._mapNode.canvasGroup, bEnable == true)
|
||||
NovaAPI.SetCanvasGroupBlocksRaycasts(self._mapNode.canvasGroup, bEnable == true)
|
||||
end
|
||||
return TutorialMenuCtrl
|
||||
@@ -0,0 +1,172 @@
|
||||
local TutorialNoteCtrl = class("TutorialNoteCtrl", BaseCtrl)
|
||||
local WwiseAudioMgr = CS.WwiseAudioManager.Instance
|
||||
TutorialNoteCtrl._mapNodeConfig = {
|
||||
contentRoot = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
canvasGroup = {
|
||||
sNodeName = "----SafeAreaRoot----",
|
||||
sComponentName = "CanvasGroup"
|
||||
}
|
||||
}
|
||||
TutorialNoteCtrl._mapEventConfig = {
|
||||
RefreshNoteCount = "OnEvent_RefreshNoteCount"
|
||||
}
|
||||
TutorialNoteCtrl._mapRedDotConfig = {}
|
||||
function TutorialNoteCtrl:InitPanel()
|
||||
self.tbDiscSubSkill = {}
|
||||
if nil == self._panel.tbDisc then
|
||||
return
|
||||
end
|
||||
for k, nId in ipairs(self._panel.tbDisc) do
|
||||
if k <= 3 then
|
||||
local discData = self._panel.mapDiscData[nId]
|
||||
if 0 ~= nId and discData ~= nil then
|
||||
self.tbDiscSubSkill[nId] = {}
|
||||
local tbSubSkillId = discData:GetAllSubSkill(self.mapNoteCount)
|
||||
for _, nSubSkillId in ipairs(tbSubSkillId) do
|
||||
self.tbDiscSubSkill[nId][nSubSkillId] = {}
|
||||
local mapCfg = ConfigTable.GetData("SecondarySkill", nSubSkillId)
|
||||
if mapCfg ~= nil then
|
||||
local tbActiveNote = decodeJson(mapCfg.NeedSubNoteSkills)
|
||||
for k, v in pairs(tbActiveNote) do
|
||||
local nNoteId = tonumber(k)
|
||||
local nNoteCount = tonumber(v)
|
||||
self.tbDiscSubSkill[nId][nSubSkillId][nNoteId] = {nNeed = nNoteCount, nCur = 0}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function TutorialNoteCtrl:GetChangeDiscSkillList(mapNoteChange)
|
||||
local tbChangeDiscSkill = {}
|
||||
for nDiscId, discData in pairs(self.tbDiscSubSkill) do
|
||||
for nSkillId, v in pairs(discData) do
|
||||
local bChange = false
|
||||
local changeNoteList = {}
|
||||
for nNoteId, data in pairs(v) do
|
||||
if mapNoteChange[nNoteId] ~= nil then
|
||||
local nCount = mapNoteChange[nNoteId].nCount
|
||||
local bLucky = mapNoteChange[nNoteId].bLucky
|
||||
if data.nCur < data.nNeed then
|
||||
changeNoteList[nNoteId] = {
|
||||
nChangeCount = nCount,
|
||||
nNeed = data.nNeed,
|
||||
bLucky = bLucky
|
||||
}
|
||||
bChange = true
|
||||
end
|
||||
data.nCur = data.nCur + nCount
|
||||
end
|
||||
end
|
||||
if bChange then
|
||||
table.insert(tbChangeDiscSkill, {
|
||||
nDiscId = nDiscId,
|
||||
nSkillId = nSkillId,
|
||||
tbChangeNote = changeNoteList
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
return tbChangeDiscSkill
|
||||
end
|
||||
function TutorialNoteCtrl:Awake()
|
||||
self.canvas = self.gameObject:GetComponent("Canvas")
|
||||
self.mapNoteCount = {}
|
||||
end
|
||||
function TutorialNoteCtrl:OnEnable()
|
||||
self:InitPanel()
|
||||
end
|
||||
function TutorialNoteCtrl:OnEvent_RefreshNoteCount(mapNote, mapChange, mapChangeSecondarySkill, bManual)
|
||||
local tbChange = {}
|
||||
local tbLose = {}
|
||||
local bChange = false
|
||||
if next(self.mapNoteCount) == nil then
|
||||
for k, v in pairs(mapNote) do
|
||||
if 0 < v then
|
||||
bChange = true
|
||||
tbChange[k] = {nCount = v, bLucky = false}
|
||||
end
|
||||
end
|
||||
else
|
||||
for k, v in pairs(mapNote) do
|
||||
local nLastCount = self.mapNoteCount[k] or 0
|
||||
if v > nLastCount then
|
||||
local bLucky = false
|
||||
if mapChange ~= nil and 0 < mapChange[k].LuckyLevel then
|
||||
bLucky = true
|
||||
end
|
||||
bChange = true
|
||||
tbChange[k] = {
|
||||
nCount = v - nLastCount,
|
||||
bLucky = bLucky
|
||||
}
|
||||
elseif v < nLastCount then
|
||||
tbLose[k] = {
|
||||
nCount = v - nLastCount
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
local tbTips = {}
|
||||
if mapChangeSecondarySkill ~= nil then
|
||||
for _, v in ipairs(mapChangeSecondarySkill) do
|
||||
if v.Active == false then
|
||||
table.insert(tbTips, {
|
||||
nSkillId = v.SecondaryId,
|
||||
nTipType = AllEnum.StarTowerTipsType.DiscTip
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
if 0 < #tbTips then
|
||||
EventManager.Hit("StarTowerDiscTips", tbTips)
|
||||
end
|
||||
local tbNoteReduceTips = {}
|
||||
for nNoteId, data in pairs(tbLose) do
|
||||
local nCount = math.abs(data.nCount)
|
||||
table.insert(tbNoteReduceTips, {
|
||||
nNoteId = nNoteId,
|
||||
nCount = nCount,
|
||||
nTipType = AllEnum.StarTowerTipsType.NoteTip
|
||||
})
|
||||
end
|
||||
if 0 < #tbNoteReduceTips then
|
||||
EventManager.Hit("StarTowerDiscTips", tbNoteReduceTips)
|
||||
end
|
||||
local tbDiscSkillChange = self:GetChangeDiscSkillList(tbChange)
|
||||
local tbDiscSkillAct = {}
|
||||
for i = 1, 3 do
|
||||
local nDiscId = self._panel.tbDisc[i]
|
||||
local discData = self._panel.mapDiscData[nDiscId]
|
||||
if discData ~= nil and mapChangeSecondarySkill ~= nil then
|
||||
local tbSecondarySkills = discData:GetAllSubSkill(self.mapNoteCount)
|
||||
for _, v in ipairs(tbSecondarySkills) do
|
||||
for _, data in ipairs(mapChangeSecondarySkill) do
|
||||
if data.Active == true and data.SecondaryId == v then
|
||||
table.insert(tbDiscSkillAct, {
|
||||
nDiscId = nDiscId,
|
||||
nSkillId = data.SecondaryId
|
||||
})
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if bChange and not bManual then
|
||||
table.sort(tbDiscSkillChange, function(a, b)
|
||||
return a.nSkillId < b.nSkillId
|
||||
end)
|
||||
local tbParam = {
|
||||
tbSkill = tbDiscSkillChange,
|
||||
tbNoteChange = tbChange,
|
||||
tbDiscSkillAct = tbDiscSkillAct
|
||||
}
|
||||
EventManager.Hit("StarTowerShowDiscSkill", tbParam, clone(mapNote))
|
||||
end
|
||||
self.mapNoteCount = clone(mapNote)
|
||||
end
|
||||
return TutorialNoteCtrl
|
||||
@@ -0,0 +1,107 @@
|
||||
local TutorialPanel = class("TutorialPanel", BasePanel)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
TutorialPanel._bAddToBackHistory = false
|
||||
TutorialPanel.OpenMinMap = false
|
||||
TutorialPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "Battle/BattleDashboard.prefab",
|
||||
sCtrlName = "Game.UI.Battle.BattleDashboardCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "Tutorial/TutorialMenu.prefab",
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialMenuCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "Battle/AdventureMainUI/AdventureMainUI.prefab",
|
||||
sCtrlName = "Game.UI.Battle.MainBattleCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "Battle/SkillHintIndicators.prefab",
|
||||
sCtrlName = "Game.UI.Battle.SkillHintIndicator.HintIndicators"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "FixedRoguelikeEx/FRIndicators.prefab",
|
||||
sCtrlName = "Game.UI.FixedRoguelikeEx.FRIndicators"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "StarTower/PotentialSelectPanel.prefab",
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialPotentialSelectCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "StarTower/DiscSkillActivePanel.prefab",
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialDiscSkillActiveCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "StarTower/StarTowerNotePanel.prefab",
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialNoteCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "Tutorial/TutorialInfo.prefab",
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialInfoCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "Tutorial/TutorialPause.prefab",
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialPauseCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "GuideProloguel/GuideProloguelPanel.prefab",
|
||||
sCtrlName = "Game.UI.GuideProloguel.GuideProloguelCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "Battle/SubSkillDisplay.prefab",
|
||||
sCtrlName = "Game.UI.Battle.SubSkillDisplay.SubSkillDisplayCtrl"
|
||||
}
|
||||
}
|
||||
function TutorialPanel:Awake()
|
||||
self.trUIRoot = GameObject.Find("---- UI ----").transform
|
||||
self.tbTeam = self._tbParam[1]
|
||||
self.tbDisc = self._tbParam[2]
|
||||
self.mapCharData = self._tbParam[3]
|
||||
self.mapDiscData = self._tbParam[4]
|
||||
self.BattleType = GameEnum.worldLevelType.Dynamic
|
||||
self.DynamicType = GameEnum.dynamicLevelType.Tutorial
|
||||
GamepadUIManager.EnterAdventure()
|
||||
GamepadUIManager.EnableGamepadUI("BattleMenu", {})
|
||||
end
|
||||
function TutorialPanel:OnEnable()
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.Hud, false, true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function TutorialPanel:OnAfterEnter()
|
||||
EventManager.Hit(EventId.SubSkillDisplayInit, self._tbParam[1])
|
||||
end
|
||||
function TutorialPanel:OnDisable()
|
||||
GamepadUIManager.DisableGamepadUI("BattleMenu")
|
||||
GamepadUIManager.QuitAdventure()
|
||||
end
|
||||
function TutorialPanel:OnDestroy()
|
||||
end
|
||||
function TutorialPanel:OnRelease()
|
||||
end
|
||||
function TutorialPanel:SetTop(goCanvas)
|
||||
local nTopLayer = 0
|
||||
if nil ~= self.trUIRoot then
|
||||
local nChildCount = self.trUIRoot.childCount
|
||||
local trChild
|
||||
for i = 1, nChildCount do
|
||||
trChild = self.trUIRoot:GetChild(i - 1)
|
||||
nTopLayer = math.max(nTopLayer, NovaAPI.GetCanvasSortingOrder(trChild:GetComponent("Canvas")))
|
||||
end
|
||||
end
|
||||
if 0 < nTopLayer then
|
||||
NovaAPI.SetCanvasSortingOrder(goCanvas, nTopLayer + 1)
|
||||
end
|
||||
end
|
||||
function TutorialPanel:GetSkillLevel(nCharId)
|
||||
local mapChar = self.mapCharData[nCharId]
|
||||
local tbList = {}
|
||||
tbList[GameEnum.skillSlotType.NORMAL] = mapChar and mapChar.tbSkillLvs[1] or 1
|
||||
tbList[GameEnum.skillSlotType.B] = mapChar and mapChar.tbSkillLvs[2] or 1
|
||||
tbList[GameEnum.skillSlotType.C] = mapChar and mapChar.tbSkillLvs[3] or 1
|
||||
tbList[GameEnum.skillSlotType.D] = mapChar and mapChar.tbSkillLvs[4] or 1
|
||||
return tbList
|
||||
end
|
||||
return TutorialPanel
|
||||
@@ -0,0 +1,90 @@
|
||||
local TutorialPauseCtrl = class("TutorialPauseCtrl", BaseCtrl)
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
TutorialPauseCtrl._mapNodeConfig = {
|
||||
Blur = {
|
||||
sNodeName = "t_fullscreen_blur_black"
|
||||
},
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_black",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
PausePanel = {},
|
||||
Pause_animator = {sNodeName = "PausePanel", sComponentName = "Animator"},
|
||||
txtWindowTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "MessageBox_Title"
|
||||
},
|
||||
txtContent = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_ExitTips"
|
||||
},
|
||||
btnContinue = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Continue",
|
||||
sAction = "Back"
|
||||
},
|
||||
txtContinue = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_Continue"
|
||||
},
|
||||
btnExit = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Exit",
|
||||
sAction = "Giveup"
|
||||
},
|
||||
txtExit = {
|
||||
nCount = 2,
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_Exit"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Continue"
|
||||
}
|
||||
}
|
||||
TutorialPauseCtrl._mapEventConfig = {TutorialPause = "Pause"}
|
||||
TutorialPauseCtrl._mapRedDotConfig = {}
|
||||
function TutorialPauseCtrl:Awake()
|
||||
self._mapNode.Blur:SetActive(false)
|
||||
self._mapNode.PausePanel:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
end
|
||||
function TutorialPauseCtrl:PauseLogic()
|
||||
EventManager.Hit("BattlePause")
|
||||
PanelManager.InputDisable()
|
||||
end
|
||||
function TutorialPauseCtrl:ResumeLogic()
|
||||
PanelManager.InputEnable()
|
||||
end
|
||||
function TutorialPauseCtrl:Pause()
|
||||
self:PauseLogic()
|
||||
self._mapNode.Blur:SetActive(true)
|
||||
self._mapNode.PausePanel:SetActive(true)
|
||||
self._mapNode.Pause_animator:Play("t_window_04_t_in")
|
||||
self._mapNode.aniBlur:Play("t_in")
|
||||
GamepadUIManager.EnableGamepadUI("TutorialPauseCtrl", self.tbGamepadUINode)
|
||||
end
|
||||
function TutorialPauseCtrl:OnBtnClick_Continue()
|
||||
self._mapNode.Pause_animator:Play("t_window_04_t_out")
|
||||
self._mapNode.aniBlur:Play("t_out")
|
||||
self:AddTimer(1, 0.16, function()
|
||||
self:ResumeLogic()
|
||||
self._mapNode.Blur:SetActive(false)
|
||||
self._mapNode.PausePanel:SetActive(false)
|
||||
self.bIsPause = false
|
||||
GamepadUIManager.DisableGamepadUI("TutorialPauseCtrl")
|
||||
end, true, true, true)
|
||||
end
|
||||
function TutorialPauseCtrl:OnBtnClick_Exit()
|
||||
self._mapNode.Pause_animator:Play("t_window_04_t_out")
|
||||
self._mapNode.aniBlur:Play("t_out")
|
||||
self:AddTimer(1, 0.16, function()
|
||||
self:ResumeLogic()
|
||||
PlayerData.TutorialData:FinishLevel(false)
|
||||
self._mapNode.Blur:SetActive(false)
|
||||
self._mapNode.PausePanel:SetActive(false)
|
||||
GamepadUIManager.DisableGamepadUI("TutorialPauseCtrl")
|
||||
end, true, true, true)
|
||||
end
|
||||
return TutorialPauseCtrl
|
||||
@@ -0,0 +1,205 @@
|
||||
local TutorialPotentialCardItemCtrl = class("TutorialPotentialCardItemCtrl", BaseCtrl)
|
||||
TutorialPotentialCardItemCtrl._mapNodeConfig = {
|
||||
db_SSR = {},
|
||||
goPotentialNormal = {},
|
||||
imgRare_Gold = {},
|
||||
imgRare_RainBow = {},
|
||||
goIcon = {
|
||||
sCtrlName = "Game.UI.StarTower.Potential.PotentialIconCtrl"
|
||||
},
|
||||
txtName = {sComponentName = "TMP_Text"},
|
||||
imgCharBg = {},
|
||||
imgCharIcon = {sComponentName = "Image"},
|
||||
imgCharSpBg = {},
|
||||
imgCharSpIcon = {sComponentName = "Image"},
|
||||
Content = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
txtDesc = {sComponentName = "TMP_Text"},
|
||||
TMP_Link1 = {
|
||||
sNodeName = "txtDesc",
|
||||
sComponentName = "TMPHyperLink",
|
||||
callback = "OnBtnClick_Word"
|
||||
},
|
||||
txtLevelValue = {sComponentName = "TMP_Text"},
|
||||
txtLevel = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Potential_Level"
|
||||
},
|
||||
imgArrow = {},
|
||||
goUpgrade = {},
|
||||
txtUpLevelValue = {sComponentName = "TMP_Text"},
|
||||
goPotentialSpecial = {},
|
||||
imgSpIcon = {sComponentName = "Image"},
|
||||
txtSpName = {sComponentName = "TMP_Text"},
|
||||
SpContent = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
txtSpDesc = {sComponentName = "TMP_Text"},
|
||||
TMP_Link2 = {
|
||||
sNodeName = "txtSpDesc",
|
||||
sComponentName = "TMPHyperLink",
|
||||
callback = "OnBtnClick_Word"
|
||||
},
|
||||
animCtrl = {sComponentName = "Animator", sNodeName = "AnimRoot"},
|
||||
imgReommend = {},
|
||||
imgNew = {},
|
||||
txtNew = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "StarTower_Book_New_Text"
|
||||
},
|
||||
N = {},
|
||||
SR = {},
|
||||
SSR = {},
|
||||
BgEffect = {},
|
||||
ArrowEffect = {}
|
||||
}
|
||||
TutorialPotentialCardItemCtrl._mapEventConfig = {}
|
||||
TutorialPotentialCardItemCtrl._mapRedDotConfig = {}
|
||||
local level_txt_color = {
|
||||
[1] = "#44587f",
|
||||
[2] = "#4e76d4"
|
||||
}
|
||||
function TutorialPotentialCardItemCtrl:SetPotentialItem(nTid, bSimpleDesc, bShowChar, nShowType, nLevel, nNextLevel, nPotentialAddLevel)
|
||||
self.nTid = nTid
|
||||
self.nLevel = nLevel
|
||||
self.nNextLevel = nNextLevel
|
||||
self.nPotentialAddLevel = nPotentialAddLevel or 0
|
||||
self.nShowType = nShowType or AllEnum.PotentialCardType.CharInfo
|
||||
self._mapNode.imgNew.gameObject:SetActive(false)
|
||||
self._mapNode.ArrowEffect:SetActive(self.bLucky)
|
||||
local itemCfg = ConfigTable.GetData_Item(nTid)
|
||||
if nil == itemCfg then
|
||||
printError(string.format("获取道具表配置失败!!!id = [%s])", nTid))
|
||||
return
|
||||
end
|
||||
self.itemCfg = itemCfg
|
||||
local potentialCfg = ConfigTable.GetData("Potential", nTid)
|
||||
if nil == potentialCfg then
|
||||
return
|
||||
end
|
||||
self._mapNode.db_SSR:SetActive(itemCfg.Rarity == GameEnum.itemRarity.SSR)
|
||||
local bSpecial = itemCfg.Stype == GameEnum.itemStype.SpecificPotential
|
||||
self._mapNode.goPotentialNormal.gameObject:SetActive(not bSpecial)
|
||||
self._mapNode.goPotentialSpecial.gameObject:SetActive(bSpecial)
|
||||
if not bSpecial then
|
||||
self:SetNormalCard(itemCfg, potentialCfg, bShowChar)
|
||||
else
|
||||
self:SetSpecialCard(itemCfg, potentialCfg, bShowChar)
|
||||
end
|
||||
self:ChangeDesc(bSimpleDesc)
|
||||
self:ChangeWordRaycast(false)
|
||||
return bSpecial
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:SetNormalCard(itemCfg, potentialCfg, bShowChar)
|
||||
self._mapNode.imgCharBg.gameObject:SetActive(bShowChar)
|
||||
local nCharId = potentialCfg.CharId
|
||||
if bShowChar then
|
||||
local nCharSkinId = PlayerData.Char:GetCharSkinId(nCharId)
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(self._mapNode.imgCharIcon, mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.S)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.txtName, itemCfg.Title)
|
||||
local nColor = AllEnum.FrameColor_New[itemCfg.Rarity]
|
||||
if nColor == "4" then
|
||||
self._mapNode.imgRare_Gold.gameObject:SetActive(true)
|
||||
self._mapNode.imgRare_RainBow.gameObject:SetActive(false)
|
||||
elseif nColor == "5" then
|
||||
self._mapNode.imgRare_Gold.gameObject:SetActive(false)
|
||||
self._mapNode.imgRare_RainBow.gameObject:SetActive(true)
|
||||
else
|
||||
self._mapNode.imgRare_Gold.gameObject:SetActive(false)
|
||||
self._mapNode.imgRare_RainBow.gameObject:SetActive(false)
|
||||
end
|
||||
self._mapNode.goIcon:SetIcon(potentialCfg.Id)
|
||||
local bUpgrade = self.nNextLevel ~= nil and self.nLevel ~= self.nNextLevel
|
||||
self._mapNode.imgArrow.gameObject:SetActive(bUpgrade)
|
||||
self._mapNode.goUpgrade.gameObject:SetActive(bUpgrade)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtLevelValue, self.nLevel + self.nPotentialAddLevel)
|
||||
local sColor = self.nPotentialAddLevel == 0 and level_txt_color[1] or level_txt_color[2]
|
||||
local _, color = ColorUtility.TryParseHtmlString(sColor)
|
||||
NovaAPI.SetTMPColor(self._mapNode.txtLevelValue, color)
|
||||
if bUpgrade then
|
||||
NovaAPI.SetTMPText(self._mapNode.txtUpLevelValue, self.nNextLevel + self.nPotentialAddLevel)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:SetSpecialCard(itemCfg, potentialCfg, bShowChar)
|
||||
self._mapNode.imgCharSpBg.gameObject:SetActive(bShowChar)
|
||||
local nCharId = potentialCfg.CharId
|
||||
if bShowChar then
|
||||
local nCharSkinId = PlayerData.Char:GetCharSkinId(nCharId)
|
||||
local mapCharSkin = ConfigTable.GetData_CharacterSkin(nCharSkinId)
|
||||
self:SetPngSprite(self._mapNode.imgCharSpIcon, mapCharSkin.Icon .. AllEnum.CharHeadIconSurfix.S)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.txtSpName, itemCfg.Title)
|
||||
self:SetPngSprite(self._mapNode.imgSpIcon, itemCfg.Icon .. AllEnum.PotentialIconSurfix.A)
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:ChangeDesc(bSimpleDesc)
|
||||
local potentialCfg = ConfigTable.GetData("Potential", self.nTid)
|
||||
if nil == potentialCfg then
|
||||
printError(string.format("获取潜能表配置失败!!!id = [%s])", self.nTid))
|
||||
return
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.txtDesc, UTILS.ParseDesc(potentialCfg, GameEnum.levelTypeData.Exclusive, nil, bSimpleDesc, nil))
|
||||
NovaAPI.SetTMPText(self._mapNode.txtSpDesc, UTILS.ParseDesc(potentialCfg, GameEnum.levelTypeData.Exclusive, nil, bSimpleDesc, nil))
|
||||
self._mapNode.Content.anchoredPosition = Vector2(0, 0)
|
||||
self._mapNode.SpContent.anchoredPosition = Vector2(0, 0)
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:ActiveRollEffect()
|
||||
if not self.itemCfg then
|
||||
return
|
||||
end
|
||||
self._mapNode.SSR:SetActive(self.itemCfg.Rarity == GameEnum.itemRarity.SSR)
|
||||
self._mapNode.SR:SetActive(self.itemCfg.Rarity == GameEnum.itemRarity.SR)
|
||||
self._mapNode.N:SetActive(self.itemCfg.Rarity == GameEnum.itemRarity.N)
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:CloseBgEffect()
|
||||
self._mapNode.BgEffect:SetActive(false)
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:PlayAnim(sAnimName)
|
||||
self._mapNode.animCtrl:Play(sAnimName)
|
||||
self._mapNode.BgEffect:SetActive(self.bLucky and sAnimName == "tc_newperk_card_in")
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:OnEnable()
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:OnDisable()
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:OnDestroy()
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:OnBtnClick_Word(link, sWordId)
|
||||
local potentialCfg = ConfigTable.GetData("Potential", self.nTid)
|
||||
local nLevel = self.nLevel
|
||||
local nNextLevel = self.nNextLevel
|
||||
local nType = potentialCfg.BranchType
|
||||
local nCharId = potentialCfg.CharId
|
||||
local tbSkillLevel
|
||||
if self.nShowType == AllEnum.PotentialCardType.StarTower then
|
||||
tbSkillLevel = self._panel:GetSkillLevel(nCharId)
|
||||
elseif self.nShowType == AllEnum.PotentialCardType.CharInfo then
|
||||
tbSkillLevel = PlayerData.Char:GetSkillLevel(nCharId)
|
||||
end
|
||||
if nType == GameEnum.BranchType.Master then
|
||||
nLevel = tbSkillLevel[GameEnum.skillSlotType.B]
|
||||
nNextLevel = nil
|
||||
elseif nType == GameEnum.BranchType.Assist then
|
||||
nLevel = tbSkillLevel[GameEnum.skillSlotType.C]
|
||||
nNextLevel = nil
|
||||
end
|
||||
local mapData = {
|
||||
nPerkId = 0,
|
||||
nCount = 0,
|
||||
bWordTip = true,
|
||||
sWordId = sWordId,
|
||||
nLevel = nLevel,
|
||||
nNextLevel = nNextLevel
|
||||
}
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.PerkTips, link, mapData)
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:ChangeWordRaycast(bEnable)
|
||||
NovaAPI.SetTMPRaycastTarget(self._mapNode.txtDesc, bEnable)
|
||||
NovaAPI.SetTMPRaycastTarget(self._mapNode.txtSpDesc, bEnable)
|
||||
end
|
||||
function TutorialPotentialCardItemCtrl:SetRecommend(bEnable)
|
||||
self._mapNode.imgReommend:SetActive(bEnable)
|
||||
end
|
||||
return TutorialPotentialCardItemCtrl
|
||||
@@ -0,0 +1,468 @@
|
||||
local TutorialPotentialSelectCtrl = class("TutorialPotentialSelectCtrl", BaseCtrl)
|
||||
local WwiseAudioMgr = CS.WwiseAudioManager.Instance
|
||||
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
|
||||
TutorialPotentialSelectCtrl._mapNodeConfig = {
|
||||
blurBg = {},
|
||||
menuBg = {},
|
||||
contentRoot = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
animCtrl = {
|
||||
sComponentName = "Animator",
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
txtCloseTips = {},
|
||||
btnMask = {},
|
||||
imgCoinBg = {},
|
||||
imgCoin = {sComponentName = "Image"},
|
||||
txtCoinCount = {sComponentName = "TMP_Text"},
|
||||
btnDepot = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Depot"
|
||||
},
|
||||
imgUpgradeTitle = {},
|
||||
imgSelectTitle = {},
|
||||
txtUpgrade = {sComponentName = "TMP_Text"},
|
||||
txtTitle = {sComponentName = "TMP_Text"},
|
||||
goChangeDesc = {},
|
||||
txtChange = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Potential_Change_Desc"
|
||||
},
|
||||
btnChangeDesc = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_ChangeDesc"
|
||||
},
|
||||
goOpen = {},
|
||||
goOff = {},
|
||||
btnPotential = {
|
||||
sComponentName = "NaviButton",
|
||||
nCount = 3,
|
||||
callback = "OnBtnClick_PotentialItem"
|
||||
},
|
||||
rtBtnPotential = {
|
||||
sNodeName = "btnPotential",
|
||||
sComponentName = "RectTransform",
|
||||
nCount = 3
|
||||
},
|
||||
potentialCard = {
|
||||
nCount = 3,
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialPotentialCardItemCtrl"
|
||||
},
|
||||
ScrollView = {
|
||||
nCount = 3,
|
||||
sComponentName = "GamepadScroll"
|
||||
},
|
||||
SpScrollView = {
|
||||
nCount = 3,
|
||||
sComponentName = "GamepadScroll"
|
||||
},
|
||||
btnConfirm = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Confirm"
|
||||
},
|
||||
txtBtnConfirm = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Potential_Select_Confirm"
|
||||
},
|
||||
rtBtnConfirm = {
|
||||
sNodeName = "btnConfirm",
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
depotPoint = {},
|
||||
cardFinishParticle = {},
|
||||
RollButton = {},
|
||||
btnRoll = {
|
||||
sComponentName = "NaviButton",
|
||||
callback = "OnBtnClick_Roll"
|
||||
},
|
||||
imgRollCostIcon = {sComponentName = "Image"},
|
||||
txtRollCostCount = {sComponentName = "TMP_Text"},
|
||||
ActionBar = {
|
||||
sCtrlName = "Game.UI.ActionBar.ActionBarCtrl"
|
||||
}
|
||||
}
|
||||
TutorialPotentialSelectCtrl._mapEventConfig = {
|
||||
Tutorial_PotentialSelect = "OnEvent_TutorialPotentialSelect",
|
||||
GamepadUIChange = "OnEvent_GamepadUIChange",
|
||||
GamepadUIReopen = "OnEvent_Reopen"
|
||||
}
|
||||
TutorialPotentialSelectCtrl._mapRedDotConfig = {}
|
||||
function TutorialPotentialSelectCtrl:Refresh(tbPotential)
|
||||
if tbPotential == nil or #tbPotential == 0 then
|
||||
traceback("潜能卡选择列表为空!!!")
|
||||
return
|
||||
end
|
||||
self.nSelectIdx = 0
|
||||
self._mapNode.imgUpgradeTitle.gameObject:SetActive(false)
|
||||
self._mapNode.imgSelectTitle.gameObject:SetActive(false)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtTitle, ConfigTable.GetUIText("StarTower_Potential_Select_Title_1"))
|
||||
self._mapNode.RollButton:SetActive(false)
|
||||
self._mapNode.btnConfirm.gameObject:SetActive(false)
|
||||
self:RefreshPotentialList(tbPotential)
|
||||
self:SetSimpleState()
|
||||
self:PlayCharVoice(tbPotential)
|
||||
local tbConfig = {}
|
||||
tbConfig = {
|
||||
{
|
||||
sAction = "Confirm",
|
||||
sLang = "ActionBar_Confirm"
|
||||
},
|
||||
{
|
||||
sAction = "Scroll",
|
||||
sLang = "ActionBar_Scroll"
|
||||
},
|
||||
{
|
||||
sAction = "Switch",
|
||||
sLang = "ActionBar_ChangeDesc"
|
||||
}
|
||||
}
|
||||
self._mapNode.ActionBar:InitActionBar(tbConfig)
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:RefreshPotentialList(tbPotential)
|
||||
self.bSpecialPotential = false
|
||||
self.tbPotential = tbPotential
|
||||
local tbCardObj, tbBtnObj = {}, {}
|
||||
for k, v in ipairs(self._mapNode.potentialCard) do
|
||||
v.gameObject:SetActive(false)
|
||||
self._mapNode.btnPotential[k].gameObject:SetActive(self.tbPotential[k] ~= nil)
|
||||
if self.tbPotential[k] ~= nil then
|
||||
local nTid = self.tbPotential[k]
|
||||
local potentialCfg = ConfigTable.GetData("Potential", nTid)
|
||||
if nil ~= potentialCfg then
|
||||
local bSpecial = v:SetPotentialItem(nTid, self.bSimple, true, AllEnum.PotentialCardType.StarTower, 1, 1, 0)
|
||||
v:ChangeWordRaycast(false)
|
||||
table.insert(tbCardObj, v)
|
||||
table.insert(tbBtnObj, self._mapNode.btnPotential[k])
|
||||
self.bSpecialPotential = self.bSpecialPotential or bSpecial
|
||||
end
|
||||
end
|
||||
end
|
||||
self:ResetSelect(tbBtnObj)
|
||||
local animTime = NovaAPI.GetAnimClipLength(self._mapNode.animCtrl, {
|
||||
"PotentialSelectPanel_in"
|
||||
})
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, animTime)
|
||||
WwiseAudioMgr:PlaySound("ui_roguelike_xintiao_select")
|
||||
if 0 < #tbCardObj then
|
||||
local wait = function()
|
||||
local frameCount = 0
|
||||
while 0 < #tbCardObj do
|
||||
if 4 <= frameCount then
|
||||
local cardObj = table.remove(tbCardObj, 1)
|
||||
if cardObj ~= nil then
|
||||
cardObj.gameObject:SetActive(true)
|
||||
cardObj:PlayAnim("tc_newperk_card_in")
|
||||
end
|
||||
frameCount = 0
|
||||
else
|
||||
frameCount = frameCount + 1
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
end
|
||||
end
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:SetSimpleState()
|
||||
self._mapNode.goOff.gameObject:SetActive(not self.bSimple)
|
||||
self._mapNode.goOpen.gameObject:SetActive(self.bSimple)
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:PlayCharVoice(tbPotential)
|
||||
local nCharId = 0
|
||||
for k, v in ipairs(tbPotential) do
|
||||
local potentialCfg = ConfigTable.GetData("Potential", v)
|
||||
if nil == potentialCfg then
|
||||
printError(string.format("获取潜能表配置失败!!!id = [%s])", v))
|
||||
return
|
||||
end
|
||||
nCharId = potentialCfg.CharId
|
||||
break
|
||||
end
|
||||
local sVoiceKey = "perk"
|
||||
PlayerData.Voice:PlayCharVoice(sVoiceKey, nCharId)
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:SelectComplete()
|
||||
if self.bSkip then
|
||||
self:HidePanel()
|
||||
if nil ~= self.callback then
|
||||
self.callback(self.nSelectIdx)
|
||||
end
|
||||
return
|
||||
end
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
self._mapNode.blurBg.gameObject:SetActive(false)
|
||||
self._mapNode.menuBg.gameObject:SetActive(true)
|
||||
self._mapNode.btnConfirm.gameObject:SetActive(false)
|
||||
EventManager.Hit("StarTowerSetButtonEnable", true, false)
|
||||
CS.GameCameraStackManager.Instance:OpenMainCamera()
|
||||
for k, v in ipairs(self._mapNode.potentialCard) do
|
||||
if k == self.nSelectIdx then
|
||||
local animCtrl = v.gameObject:GetComponent("Animator")
|
||||
animCtrl:Play("tc_newperk_card_out")
|
||||
local fxRoot = v.gameObject.transform:Find("FX")
|
||||
local fx = v.gameObject.transform:Find("FX/glow")
|
||||
local OutAnimFinish = function()
|
||||
local beginPos = fxRoot.transform.position
|
||||
local controlPos = Vector3(3, 5, 0)
|
||||
local endPos = self._mapNode.depotPoint.transform.position
|
||||
local wait = function()
|
||||
WwiseAudioMgr:PlaySound("ui_roguelike_card_flyby")
|
||||
local totalMoveTime = 0.3
|
||||
local moveTime = 0
|
||||
local normalizedTime = 0
|
||||
while normalizedTime < 1 do
|
||||
moveTime = moveTime + CS.UnityEngine.Time.unscaledDeltaTime
|
||||
normalizedTime = moveTime / totalMoveTime
|
||||
normalizedTime = normalizedTime <= 1 and normalizedTime or 1
|
||||
local x, y, z = UTILS.GetBezierPointByT(beginPos, controlPos, endPos, normalizedTime)
|
||||
local angleZ = 100 * normalizedTime * 2
|
||||
angleZ = angleZ <= 100 and angleZ or 100
|
||||
fxRoot.transform.localEulerAngles = Vector3(0, 0, angleZ)
|
||||
fxRoot.transform.position = Vector3(x, y, z)
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
end
|
||||
self._mapNode.cardFinishParticle:SetActive(true)
|
||||
fx.gameObject:SetActive(false)
|
||||
coroutine.yield(CS.UnityEngine.WaitForSecondsRealtime(0.5))
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
self:HidePanel()
|
||||
fxRoot.transform.position = beginPos
|
||||
fxRoot.transform.localEulerAngles = Vector3(0, 0, 0)
|
||||
fx.gameObject:SetActive(true)
|
||||
if nil ~= self.callback then
|
||||
self.callback(self.nSelectIdx)
|
||||
end
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
self:SetAnimationCallback(animCtrl, OutAnimFinish)
|
||||
else
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
self._mapNode.animCtrl:Play("PotentialSelectPanel_out")
|
||||
EventManager.Hit("Guide_Potential_SelectComplete")
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:MoveConfirmButton(btnCard)
|
||||
local rtBtn = btnCard:GetComponent("RectTransform")
|
||||
self._mapNode.rtBtnConfirm.localPosition = Vector3(rtBtn.localPosition.x, self.btnConfirmPosY, 0)
|
||||
if self._mapNode.btnConfirm.gameObject.activeSelf == false then
|
||||
self._mapNode.btnConfirm.gameObject:SetActive(true)
|
||||
else
|
||||
local animCtrl = self._mapNode.btnConfirm.transform:Find("AnimRoot"):GetComponent("Animator")
|
||||
animCtrl:Play("btnConfirm_in", 0, 0)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:HidePanel()
|
||||
self.bOpen = false
|
||||
if not self.bSkip then
|
||||
PanelManager.InputEnable()
|
||||
EventManager.Hit("StarTowerSetButtonEnable", true, true)
|
||||
end
|
||||
self._mapNode.blurBg.gameObject:SetActive(false)
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
NovaAPI.SetCanvasSortingOrder(self.canvas, self.nInitSortingOrder)
|
||||
GamepadUIManager.DisableGamepadUI("TutorialPotentialSelectCtrl")
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:Awake()
|
||||
self.canvas = self.gameObject:GetComponent("Canvas")
|
||||
self.nInitSortingOrder = NovaAPI.GetCanvasSortingOrder(self.canvas)
|
||||
self.btnConfirmPosY = self._mapNode.rtBtnConfirm.localPosition.y
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
self._mapNode.blurBg.gameObject:SetActive(false)
|
||||
self._mapNode.menuBg.gameObject:SetActive(false)
|
||||
self._mapNode.btnDepot.gameObject:SetActive(false)
|
||||
self._mapNode.imgCoinBg.gameObject:SetActive(false)
|
||||
self._mapNode.txtCloseTips.gameObject:SetActive(false)
|
||||
self._mapNode.btnMask.gameObject:SetActive(false)
|
||||
self.tbGamepadUINode = self:GetGamepadUINode()
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnEnable()
|
||||
self.handler = {}
|
||||
for k, v in ipairs(self._mapNode.btnPotential) do
|
||||
self.handler[k] = ui_handler(self, self.OnBtnSelect_PotentialItem, v, k)
|
||||
v.onSelect:AddListener(self.handler[k])
|
||||
end
|
||||
self._mapNode.btnDepot.gameObject:SetActive(false)
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnDisable()
|
||||
for k, v in ipairs(self._mapNode.btnPotential) do
|
||||
v.onSelect:RemoveListener(self.handler[k])
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnBtnClick_Depot()
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnBtnClick_ChangeDesc()
|
||||
self.bSimple = not self.bSimple
|
||||
PlayerData.StarTower:SetPotentialDescSimple(self.bSimple)
|
||||
self:SetSimpleState()
|
||||
for _, v in ipairs(self._mapNode.potentialCard) do
|
||||
v:ChangeDesc(self.bSimple)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnBtnClick_Confirm()
|
||||
self:SelectComplete()
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnBtnClick_Roll()
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnBtnSelect_PotentialItem(btn, nIndex)
|
||||
local nUIType = GamepadUIManager.GetCurUIType()
|
||||
if nUIType ~= AllEnum.GamepadUIType.Other and nUIType ~= AllEnum.GamepadUIType.Mouse then
|
||||
self:OnBtnClick_PotentialItem(btn, nIndex)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnBtnClick_PotentialItem(btn, nIndex)
|
||||
if nil == self.tbPotential[nIndex] or self.nSelectIdx == nIndex then
|
||||
return
|
||||
end
|
||||
WwiseAudioMgr:PlaySound("ui_roguelike_xintiao_slide")
|
||||
self:MoveConfirmButton(btn)
|
||||
for k, v in ipairs(self._mapNode.potentialCard) do
|
||||
if k == nIndex then
|
||||
v:PlayAnim("tc_newperk_card_switch_up")
|
||||
v:ChangeWordRaycast(true)
|
||||
elseif k == self.nSelectIdx then
|
||||
v:PlayAnim("tc_newperk_card_switch_down")
|
||||
v:ChangeWordRaycast(false)
|
||||
end
|
||||
end
|
||||
self:SelectScroll(nIndex)
|
||||
self.nSelectIdx = nIndex
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnEvent_TutorialPotentialSelect(tbPotential, callback)
|
||||
self.callback = callback
|
||||
if tbPotential == nil or #tbPotential == 0 then
|
||||
traceback("潜能卡选择列表为空!!!")
|
||||
return
|
||||
end
|
||||
self._panel:SetTop(self.canvas)
|
||||
self.bSkip = false
|
||||
local bCloseCamera = false
|
||||
if not self.bOpen then
|
||||
PanelManager.InputDisable()
|
||||
EventManager.Hit("StarTowerSetButtonEnable", false, false)
|
||||
bCloseCamera = true
|
||||
GamepadUIManager.EnableGamepadUI("TutorialPotentialSelectCtrl", self.tbGamepadUINode)
|
||||
end
|
||||
self.bOpen = true
|
||||
self.tbPotential = {}
|
||||
self._mapNode.contentRoot.gameObject:SetActive(false)
|
||||
self._mapNode.blurBg.gameObject:SetActive(true)
|
||||
self._mapNode.menuBg.gameObject:SetActive(false)
|
||||
self._mapNode.cardFinishParticle:SetActive(false)
|
||||
self._mapNode.RollButton:SetActive(false)
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
if bCloseCamera then
|
||||
CS.GameCameraStackManager.Instance:CloseMainCamera(0.1)
|
||||
end
|
||||
self._mapNode.contentRoot.gameObject:SetActive(true)
|
||||
self._mapNode.animCtrl:Play("PotentialSelectPanel_in")
|
||||
self:Refresh(tbPotential)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
self._mapNode.btnConfirm.gameObject:SetActive(false)
|
||||
self.nSelectIdx = 0
|
||||
self.bSimple = PlayerData.StarTower:GetPotentialDescSimple()
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnEvent_CloseStarTowerDepot()
|
||||
if self.bOpenDepot then
|
||||
self.bOpenDepot = false
|
||||
EventManager.Hit("StarTowerSetButtonEnable", false, false)
|
||||
self._mapNode.blurBg.gameObject:SetActive(true)
|
||||
local nSelect = self.nSelectIdx ~= 0 and self.nSelectIdx or 1
|
||||
GamepadUIManager.SetSelectedUI(self._mapNode.btnPotential[nSelect].gameObject)
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
CS.GameCameraStackManager.Instance:CloseMainCamera(0.1)
|
||||
self._mapNode.contentRoot.gameObject:SetActive(true)
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
for k, v in ipairs(self._mapNode.potentialCard) do
|
||||
v:CloseBgEffect()
|
||||
end
|
||||
if self.nSelectIdx == 0 and GamepadUIManager.GetCurUIType() ~= AllEnum.GamepadUIType.Other then
|
||||
self.nSelectIdx = 1
|
||||
self:MoveConfirmButton(self._mapNode.btnPotential[self.nSelectIdx])
|
||||
end
|
||||
if self.nSelectIdx ~= 0 then
|
||||
for k, v in ipairs(self._mapNode.potentialCard) do
|
||||
if k == self.nSelectIdx then
|
||||
v:PlayAnim("tc_newperk_card_switch_up")
|
||||
v:ChangeWordRaycast(true)
|
||||
self:SelectScroll(self.nSelectIdx)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnEvent_GamepadUIChange(sName, nBeforeType, nAfterType)
|
||||
if sName ~= "TutorialPotentialSelectCtrl" then
|
||||
return
|
||||
end
|
||||
if nBeforeType == AllEnum.GamepadUIType.Other or nBeforeType == AllEnum.GamepadUIType.Mouse then
|
||||
GamepadUIManager.ClearSelectedUI()
|
||||
GamepadUIManager.SetSelectedUI(self._mapNode.btnPotential[self.nSelectIdx].gameObject)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:OnEvent_Reopen(sName)
|
||||
if sName ~= "TutorialPotentialSelectCtrl" then
|
||||
return
|
||||
end
|
||||
if self.bOpenDepot then
|
||||
self:OnEvent_CloseStarTowerDepot()
|
||||
else
|
||||
if self.nSelectIdx == 0 and GamepadUIManager.GetCurUIType() ~= AllEnum.GamepadUIType.Other then
|
||||
self.nSelectIdx = 1
|
||||
end
|
||||
if self.nSelectIdx == 0 then
|
||||
return
|
||||
end
|
||||
GamepadUIManager.SetSelectedUI(self._mapNode.btnPotential[self.nSelectIdx].gameObject)
|
||||
self._mapNode.potentialCard[self.nSelectIdx]:ChangeWordRaycast(true)
|
||||
self:SelectScroll(self.nSelectIdx)
|
||||
end
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:ResetSelect(tbUI)
|
||||
self.nSelectIdx = 0
|
||||
GamepadUIManager.SetNavigation(tbUI)
|
||||
local animTime = NovaAPI.GetAnimClipLength(self._mapNode.animCtrl, {
|
||||
"PotentialSelectPanel_in"
|
||||
}) + 0.1
|
||||
self:AddTimer(1, animTime, function()
|
||||
if self.nSelectIdx == 0 then
|
||||
local nSelect = 1
|
||||
GamepadUIManager.ClearSelectedUI()
|
||||
GamepadUIManager.SetSelectedUI(self._mapNode.btnPotential[nSelect].gameObject)
|
||||
if GamepadUIManager.GetCurUIType() == AllEnum.GamepadUIType.Mouse then
|
||||
self:OnBtnClick_PotentialItem(self._mapNode.btnPotential[nSelect].gameObject, nSelect)
|
||||
end
|
||||
end
|
||||
if self.bSpecialPotential then
|
||||
EventManager.Hit("Guide_PassiveCheck_Msg", "Guide_PotentialSelectSpecial_Tutorial")
|
||||
else
|
||||
EventManager.Hit("Guide_PassiveCheck_Msg", "Guide_PotentialSelect_Tutorial")
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function TutorialPotentialSelectCtrl:SelectScroll(nIndex)
|
||||
for _, v in ipairs(self._mapNode.ScrollView) do
|
||||
NovaAPI.SetComponentEnable(v, false)
|
||||
end
|
||||
if nIndex then
|
||||
NovaAPI.SetComponentEnable(self._mapNode.ScrollView[nIndex], true)
|
||||
end
|
||||
for _, v in ipairs(self._mapNode.SpScrollView) do
|
||||
NovaAPI.SetComponentEnable(v, false)
|
||||
end
|
||||
if nIndex then
|
||||
NovaAPI.SetComponentEnable(self._mapNode.SpScrollView[nIndex], true)
|
||||
end
|
||||
end
|
||||
return TutorialPotentialSelectCtrl
|
||||
@@ -0,0 +1,226 @@
|
||||
local TutorialResultCtrl = class("TutorialResultCtrl", BaseCtrl)
|
||||
local WwiseManger = CS.WwiseAudioManager.Instance
|
||||
TutorialResultCtrl._mapNodeConfig = {
|
||||
imgBlurredBg = {},
|
||||
goComplete = {sComponentName = "GameObject"},
|
||||
goFailed = {sComponentName = "GameObject"},
|
||||
Mask = {
|
||||
sComponentName = "CanvasGroup"
|
||||
},
|
||||
txtName = {nCount = 2, sComponentName = "TMP_Text"},
|
||||
ButtonClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
goRoot = {
|
||||
sNodeName = "----SafeAreaRoot----"
|
||||
},
|
||||
txtQuestTitle1 = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_Result_QuestTitle"
|
||||
},
|
||||
txtQuestValue1 = {sComponentName = "TMP_Text"},
|
||||
txtTip = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_Result_FailTips"
|
||||
},
|
||||
txtTipShadow = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_Result_FailTips"
|
||||
},
|
||||
NextLevelName = {},
|
||||
txtNextName = {sComponentName = "TMP_Text"},
|
||||
btn_goNext = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_GoNext"
|
||||
},
|
||||
txt_goNext = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_NextLevel"
|
||||
},
|
||||
btn_retry = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Retry"
|
||||
},
|
||||
txt_retry = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_Restart"
|
||||
},
|
||||
btn_complete = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
txt_complete = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Tutorial_Complete"
|
||||
},
|
||||
animComplete = {sNodeName = "goComplete", sComponentName = "Animator"},
|
||||
animFailed = {sNodeName = "goFailed", sComponentName = "Animator"}
|
||||
}
|
||||
TutorialResultCtrl._mapEventConfig = {}
|
||||
TutorialResultCtrl._mapRedDotConfig = {}
|
||||
function TutorialResultCtrl:Awake()
|
||||
EventManager.Hit(EventId.AvgBubbleShutDown)
|
||||
NovaAPI.SetComponentEnableByName(self.gameObject, "Canvas", false)
|
||||
end
|
||||
function TutorialResultCtrl:OnEnable()
|
||||
local tbParam = self:GetPanelParam()
|
||||
local nResultState = tbParam[1]
|
||||
self.nLevelId = tbParam[2]
|
||||
local GenerRewardItems = tbParam[3] or {}
|
||||
local nCurQuest = tbParam[4] or 0
|
||||
local nMaxQuest = tbParam[5] or 0
|
||||
local tbChar = tbParam[6] or {}
|
||||
self.mapChangeInfo = tbParam[7] or {}
|
||||
local bPureAvg = tbParam[8] or false
|
||||
self.bSuccess = nResultState == 1
|
||||
local levelConfig = ConfigTable.GetData("TutorialLevel", self.nLevelId)
|
||||
local sLevelName = ""
|
||||
if levelConfig ~= nil then
|
||||
sLevelName = levelConfig.Title
|
||||
end
|
||||
for _, v in ipairs(self._mapNode.txtName) do
|
||||
NovaAPI.SetTMPText(v, sLevelName)
|
||||
end
|
||||
self.nextLevelId = PlayerData.TutorialData:GetNextLevelId(self.nLevelId)
|
||||
if self.nextLevelId == 0 then
|
||||
self._mapNode.NextLevelName:SetActive(false)
|
||||
self._mapNode.btn_goNext.gameObject:SetActive(false)
|
||||
else
|
||||
local nextLevelConfig = ConfigTable.GetData("TutorialLevel", self.nextLevelId)
|
||||
if nextLevelConfig ~= nil then
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextName, nextLevelConfig.Title)
|
||||
end
|
||||
end
|
||||
self.mapReward = {}
|
||||
for _, v in pairs(GenerRewardItems) do
|
||||
table.insert(self.mapReward, v)
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.txtQuestValue1, nCurQuest .. "/" .. nMaxQuest)
|
||||
local nCurTeam = 5
|
||||
if PlayerData.nCurGameType == AllEnum.WorldMapNodeType.Mainline then
|
||||
nCurTeam = PlayerData.Mainline.nCurTeamIndex
|
||||
end
|
||||
local tbTeamMemberId, nCaptain
|
||||
if tbChar == nil then
|
||||
nCaptain, tbTeamMemberId = PlayerData.Team:GetTeamData(nCurTeam)
|
||||
else
|
||||
tbTeamMemberId = tbChar
|
||||
end
|
||||
local tbRoleId = {}
|
||||
for i = 1, #tbTeamMemberId do
|
||||
if tbTeamMemberId[i] ~= nil and 0 < tbTeamMemberId[i] then
|
||||
table.insert(tbRoleId, tbTeamMemberId[i])
|
||||
end
|
||||
end
|
||||
if #tbRoleId == 0 then
|
||||
table.insert(tbRoleId, 112)
|
||||
end
|
||||
WwiseManger:PostEvent("ui_loading_combatSFX_mute", nil, false)
|
||||
WwiseManger:PostEvent("char_common_all_pause")
|
||||
WwiseManger:PostEvent("mon_common_all_pause")
|
||||
WwiseManger:SetState("level", "None")
|
||||
WwiseManger:SetState("combat", "None")
|
||||
local nAnimTime
|
||||
if nResultState == 1 then
|
||||
WwiseManger:PlaySound("ui_roguelike_victory")
|
||||
WwiseManger:SetState("system", "victory")
|
||||
self._mapNode.goRoot.gameObject:SetActive(true)
|
||||
self._mapNode.goFailed:SetActive(false)
|
||||
self._mapNode.goComplete:SetActive(true)
|
||||
nAnimTime = 4
|
||||
else
|
||||
WwiseManger:SetState("system", "defeat")
|
||||
CS.AdventureModuleHelper.PauseLogic()
|
||||
self._mapNode.goRoot.gameObject:SetActive(false)
|
||||
self._mapNode.imgBlurredBg.gameObject:SetActive(true)
|
||||
self._mapNode.goFailed:SetActive(true)
|
||||
self._mapNode.goComplete:SetActive(false)
|
||||
nAnimTime = 3
|
||||
end
|
||||
self._mapNode.Mask.gameObject:SetActive(false)
|
||||
self._mapNode.ButtonClose.gameObject:SetActive(false)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.goRoot.gameObject:SetActive(true)
|
||||
self._mapNode.ButtonClose.gameObject:SetActive(true)
|
||||
NovaAPI.SetComponentEnableByName(self.gameObject, "Canvas", true)
|
||||
if bPureAvg then
|
||||
self:OpenReward()
|
||||
end
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
self:AddTimer(1, nAnimTime, "PlayAnim", true, true, true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, nAnimTime)
|
||||
PlayerData.Voice:PlayBattleResultVoice(tbRoleId, nResultState == 1)
|
||||
self.bProcessingClose = false
|
||||
end
|
||||
function TutorialResultCtrl:OnDisable()
|
||||
PlayerData.Voice:StopCharVoice()
|
||||
end
|
||||
function TutorialResultCtrl:OnDestroy()
|
||||
end
|
||||
function TutorialResultCtrl:PlayAnim()
|
||||
PlayerData.SideBanner:TryOpenSideBanner()
|
||||
local callback = function()
|
||||
self:OpenReward()
|
||||
end
|
||||
self.bOpenUpgrade = PlayerData.Base:TryOpenWorldClassUpgrade(callback)
|
||||
end
|
||||
function TutorialResultCtrl:ClosePanel()
|
||||
if self.bProcessingClose then
|
||||
return
|
||||
end
|
||||
self.bProcessingClose = true
|
||||
CS.AdventureModuleHelper.ResumeLogic()
|
||||
if NovaAPI.GetCurrentModuleName() == "MainMenuModuleScene" then
|
||||
EventManager.Hit(EventId.CloesCurPanel)
|
||||
PlayerData.Base:OnBackToMainMenuModule()
|
||||
else
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.Mask, 0)
|
||||
self._mapNode.Mask.gameObject:SetActive(true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.5)
|
||||
local sequence = DOTween.Sequence()
|
||||
sequence:Append(self._mapNode.Mask:DOFade(1, 0.5):SetUpdate(true))
|
||||
sequence:AppendCallback(function()
|
||||
if self.bSuccess then
|
||||
NovaAPI.EnterModule("MainMenuModuleScene", true, 17)
|
||||
self._mapNode.imgBlurredBg:SetActive(false)
|
||||
else
|
||||
local function levelEndCallback()
|
||||
EventManager.Remove("ADVENTURE_LEVEL_UNLOAD_COMPLETE", self, levelEndCallback)
|
||||
NovaAPI.EnterModule("MainMenuModuleScene", true, 17)
|
||||
self._mapNode.imgBlurredBg:SetActive(false)
|
||||
end
|
||||
EventManager.Add("ADVENTURE_LEVEL_UNLOAD_COMPLETE", self, levelEndCallback)
|
||||
CS.AdventureModuleHelper.LevelStateChanged(true, 0, true)
|
||||
end
|
||||
end)
|
||||
sequence:SetUpdate(true)
|
||||
end
|
||||
end
|
||||
function TutorialResultCtrl:Close()
|
||||
if self.bOpenUpgrade then
|
||||
self:ClosePanel()
|
||||
else
|
||||
self:OpenReward()
|
||||
end
|
||||
end
|
||||
function TutorialResultCtrl:OpenReward(callback)
|
||||
if self.mapChangeInfo and next(self.mapChangeInfo) ~= nil then
|
||||
local callback = function()
|
||||
self:ClosePanel()
|
||||
end
|
||||
UTILS.OpenReceiveByChangeInfo(self.mapChangeInfo, callback)
|
||||
else
|
||||
self:ClosePanel()
|
||||
end
|
||||
end
|
||||
function TutorialResultCtrl:OnBtnClick_Close()
|
||||
self:Close()
|
||||
end
|
||||
function TutorialResultCtrl:OnBtnClick_GoNext()
|
||||
end
|
||||
function TutorialResultCtrl:OnBtnClick_Retry()
|
||||
end
|
||||
return TutorialResultCtrl
|
||||
@@ -0,0 +1,21 @@
|
||||
local TutorialResultPanel = class("TutorialResultPanel", BasePanel)
|
||||
TutorialResultPanel._bAddToBackHistory = false
|
||||
TutorialResultPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "Tutorial/TutorialResultPanel.prefab",
|
||||
sCtrlName = "Game.UI.Tutorial.TutorialResultCtrl"
|
||||
}
|
||||
}
|
||||
function TutorialResultPanel:Awake()
|
||||
end
|
||||
function TutorialResultPanel:OnEnable()
|
||||
end
|
||||
function TutorialResultPanel:OnAfterEnter()
|
||||
end
|
||||
function TutorialResultPanel:OnDisable()
|
||||
end
|
||||
function TutorialResultPanel:OnDestroy()
|
||||
end
|
||||
function TutorialResultPanel:OnRelease()
|
||||
end
|
||||
return TutorialResultPanel
|
||||
Reference in New Issue
Block a user