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,82 @@
|
||||
local CharAdvanceSucCtrl = class("CharAdvanceSucCtrl", BaseCtrl)
|
||||
CharAdvanceSucCtrl._mapNodeConfig = {
|
||||
txtNextLevel = {nCount = 2, sComponentName = "TMP_Text"},
|
||||
goAdvanceStar = {
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateStarAdvanceCtrl"
|
||||
},
|
||||
trBg = {sNodeName = "rtProperty", sComponentName = "Transform"},
|
||||
goProperty = {},
|
||||
txtContentDesc = {nCount = 3, sComponentName = "TMP_Text"},
|
||||
ani1 = {sNodeName = "rtTitle", sComponentName = "Animator"},
|
||||
ani2 = {
|
||||
sNodeName = "t_unlockdesc_01",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
aniLine = {
|
||||
nCount = 3,
|
||||
sNodeName = "Line",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
Line = {nCount = 3}
|
||||
}
|
||||
CharAdvanceSucCtrl._mapEventConfig = {}
|
||||
function CharAdvanceSucCtrl:Open()
|
||||
self:RefreshContent()
|
||||
local SuccessBar = self:BindCtrlByNode(self.gameObject, "Game.UI.SuccessBarEx.SuccessBarCtrl")
|
||||
SuccessBar:PlayAni(AllEnum.SuccessBar.Yellow, self.tbAni)
|
||||
end
|
||||
function CharAdvanceSucCtrl:RefreshContent()
|
||||
self.tbAni = {}
|
||||
local nLevel = self._panel.mapData.nLevel
|
||||
local nLevelMax = self._panel.mapData.nLevelMax
|
||||
local mapAttrBefore = self._panel.mapData.mapAttrBefore
|
||||
local mapAttrAfter = self._panel.mapData.mapAttrAfter
|
||||
local tbDesc = self._panel.mapData.tbDesc
|
||||
local nAdvance = self._panel.mapData.nAdvance
|
||||
local nMaxAdvance = self._panel.mapData.nMaxAdvance
|
||||
self._mapNode.goAdvanceStar:SetStar(nAdvance, nMaxAdvance)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel[1], nLevel)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel[2], "/" .. nLevelMax)
|
||||
table.insert(self.tbAni, self._mapNode.ani1)
|
||||
delChildren(self._mapNode.trBg)
|
||||
for k, mapAttachAttr in ipairs(AllEnum.CharAttr) do
|
||||
local mapAttr = mapAttrBefore[mapAttachAttr.sKey]
|
||||
if mapAttr and mapAttr.Value > 0 then
|
||||
local goItemObj = instantiate(self._mapNode.goProperty, self._mapNode.trBg)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplatePropertyCtrl")
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, mapAttrAfter[mapAttachAttr.sKey].Value)
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
local nCount = tbDesc and #tbDesc or 0
|
||||
if nCount == 0 then
|
||||
self._mapNode.ani2.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, 3 do
|
||||
if i <= nCount then
|
||||
if i == 1 then
|
||||
table.insert(self.tbAni, {
|
||||
self._mapNode.ani2,
|
||||
self._mapNode.aniLine[1],
|
||||
bMulti = true
|
||||
})
|
||||
else
|
||||
table.insert(self.tbAni, self._mapNode.aniLine[i])
|
||||
end
|
||||
local txtUnlockDesc = self._mapNode.Line[i].transform:Find("txtUnlockDesc"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(txtUnlockDesc, tbDesc[i].sFront)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtContentDesc[i], tbDesc[i].sAfter)
|
||||
end
|
||||
self._mapNode.Line[i]:SetActive(i <= nCount)
|
||||
end
|
||||
end
|
||||
function CharAdvanceSucCtrl:Awake()
|
||||
end
|
||||
function CharAdvanceSucCtrl:OnEnable()
|
||||
end
|
||||
function CharAdvanceSucCtrl:OnDisable()
|
||||
end
|
||||
function CharAdvanceSucCtrl:OnDestroy()
|
||||
end
|
||||
return CharAdvanceSucCtrl
|
||||
@@ -0,0 +1,44 @@
|
||||
local CharSucBarCtrl = class("CharSucBarCtrl", BaseCtrl)
|
||||
CharSucBarCtrl._mapNodeConfig = {
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_blue",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
Upgrade = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.CharUpgradeSucCtrl"
|
||||
},
|
||||
Advance = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.CharAdvanceSucCtrl"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
}
|
||||
}
|
||||
CharSucBarCtrl._mapEventConfig = {}
|
||||
function CharSucBarCtrl:Open()
|
||||
self._mapNode.Upgrade.gameObject:SetActive(self._panel.bUp)
|
||||
self._mapNode.Advance.gameObject:SetActive(not self._panel.bUp)
|
||||
if self._panel.bUp then
|
||||
self._mapNode.Upgrade:Open()
|
||||
else
|
||||
self._mapNode.Advance:Open()
|
||||
end
|
||||
end
|
||||
function CharSucBarCtrl:Awake()
|
||||
end
|
||||
function CharSucBarCtrl:OnEnable()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
self:Open()
|
||||
end
|
||||
function CharSucBarCtrl:OnDisable()
|
||||
end
|
||||
function CharSucBarCtrl:OnDestroy()
|
||||
end
|
||||
function CharSucBarCtrl:OnBtnClick_Close(btn)
|
||||
if self._panel.callback then
|
||||
self._panel.callback()
|
||||
end
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.CharSucBar)
|
||||
end
|
||||
return CharSucBarCtrl
|
||||
@@ -0,0 +1,23 @@
|
||||
local CharSucBarPanel = class("CharSucBarPanel", BasePanel)
|
||||
CharSucBarPanel._bIsMainPanel = false
|
||||
CharSucBarPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "SuccessBarEx/CharSucBarPanel.prefab",
|
||||
sCtrlName = "Game.UI.SuccessBarEx.CharSucBarCtrl"
|
||||
}
|
||||
}
|
||||
function CharSucBarPanel:Awake()
|
||||
local tbParam = self:GetPanelParam()
|
||||
if type(tbParam) == "table" then
|
||||
self.mapData = tbParam[1]
|
||||
self.bUp = tbParam[2]
|
||||
self.callback = tbParam[3]
|
||||
end
|
||||
end
|
||||
function CharSucBarPanel:OnEnable()
|
||||
end
|
||||
function CharSucBarPanel:OnDisable()
|
||||
end
|
||||
function CharSucBarPanel:OnDestroy()
|
||||
end
|
||||
return CharSucBarPanel
|
||||
@@ -0,0 +1,45 @@
|
||||
local CharUpgradeSucCtrl = class("CharUpgradeSucCtrl", BaseCtrl)
|
||||
CharUpgradeSucCtrl._mapNodeConfig = {
|
||||
txtNextLevel = {sComponentName = "TMP_Text"},
|
||||
txtLvCn = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Template_CharRank"
|
||||
},
|
||||
trBg = {sNodeName = "rtProperty", sComponentName = "Transform"},
|
||||
goProperty = {},
|
||||
ani1 = {sNodeName = "rtTitle", sComponentName = "Animator"}
|
||||
}
|
||||
CharUpgradeSucCtrl._mapEventConfig = {}
|
||||
function CharUpgradeSucCtrl:Open()
|
||||
self:RefreshContent()
|
||||
local SuccessBar = self:BindCtrlByNode(self.gameObject, "Game.UI.SuccessBarEx.SuccessBarCtrl")
|
||||
SuccessBar:PlayAni(AllEnum.SuccessBar.Blue, self.tbAni)
|
||||
end
|
||||
function CharUpgradeSucCtrl:RefreshContent()
|
||||
self.tbAni = {}
|
||||
local nLevel = self._panel.mapData.nLevel
|
||||
local mapAttrBefore = self._panel.mapData.mapAttrBefore
|
||||
local mapAttrAfter = self._panel.mapData.mapAttrAfter
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel, nLevel)
|
||||
table.insert(self.tbAni, self._mapNode.ani1)
|
||||
delChildren(self._mapNode.trBg)
|
||||
for k, mapAttachAttr in ipairs(AllEnum.CharAttr) do
|
||||
local mapAttr = mapAttrBefore[mapAttachAttr.sKey]
|
||||
if mapAttr and mapAttr.Value > 0 then
|
||||
local goItemObj = instantiate(self._mapNode.goProperty, self._mapNode.trBg)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplatePropertyCtrl")
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, mapAttrAfter[mapAttachAttr.sKey].Value)
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
end
|
||||
function CharUpgradeSucCtrl:Awake()
|
||||
end
|
||||
function CharUpgradeSucCtrl:OnEnable()
|
||||
end
|
||||
function CharUpgradeSucCtrl:OnDisable()
|
||||
end
|
||||
function CharUpgradeSucCtrl:OnDestroy()
|
||||
end
|
||||
return CharUpgradeSucCtrl
|
||||
@@ -0,0 +1,91 @@
|
||||
local DiscAdvanceSucCtrl = class("DiscAdvanceSucCtrl", BaseCtrl)
|
||||
DiscAdvanceSucCtrl._mapNodeConfig = {
|
||||
txtNextLevel = {nCount = 2, sComponentName = "TMP_Text"},
|
||||
txtLvCn = {sComponentName = "TMP_Text", sLanguageId = "Disc_Level"},
|
||||
goProperty = {},
|
||||
goBuff = {},
|
||||
goAdvanceStar = {
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateStarAdvanceCtrl"
|
||||
},
|
||||
trBg = {sNodeName = "rtProperty", sComponentName = "Transform"},
|
||||
txtLvMax = {sComponentName = "TMP_Text"},
|
||||
ani1 = {sNodeName = "rtTitle", sComponentName = "Animator"},
|
||||
ani2 = {
|
||||
sNodeName = "t_unlockdesc_01",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
aniLine = {
|
||||
nCount = 2,
|
||||
sNodeName = "Line",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
Line = {nCount = 2}
|
||||
}
|
||||
DiscAdvanceSucCtrl._mapEventConfig = {}
|
||||
function DiscAdvanceSucCtrl:Open()
|
||||
self:RefreshContent()
|
||||
local SuccessBar = self:BindCtrlByNode(self.gameObject, "Game.UI.SuccessBarEx.SuccessBarCtrl")
|
||||
SuccessBar:PlayAni(AllEnum.SuccessBar.Yellow, self.tbAni)
|
||||
end
|
||||
function DiscAdvanceSucCtrl:RefreshContent()
|
||||
self.tbAni = {}
|
||||
local nLevel = self._panel.mapData.nLevel
|
||||
local nLevelMax = self._panel.mapData.nLevelMax
|
||||
local mapAttrBefore = self._panel.mapData.mapAttrBefore
|
||||
local mapAttrAfter = self._panel.mapData.mapAttrAfter
|
||||
local tbDesc = self._panel.mapData.tbDesc
|
||||
local nPhase = self._panel.mapData.nPhase
|
||||
local nMaxPhase = self._panel.mapData.nMaxPhase
|
||||
local tbUpgradeNote = self._panel.mapData.tbUpgradeNote
|
||||
self._mapNode.goAdvanceStar:SetStar(nPhase, nMaxPhase)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel[1], nLevel)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel[2], "/" .. nLevelMax)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtLvMax, nLevelMax)
|
||||
table.insert(self.tbAni, self._mapNode.ani1)
|
||||
delChildren(self._mapNode.trBg)
|
||||
for _, mapAttachAttr in pairs(AllEnum.AttachAttr) do
|
||||
local mapAttr = mapAttrBefore[mapAttachAttr.sKey]
|
||||
if mapAttr.Value > 0 then
|
||||
local goItemObj = instantiate(self._mapNode.goProperty, self._mapNode.trBg)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplatePropertyCtrl")
|
||||
local bValueChanged = mapAttrAfter[mapAttachAttr.sKey].Value ~= mapAttr.Value
|
||||
if bValueChanged then
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, mapAttrAfter[mapAttachAttr.sKey].Value, true)
|
||||
else
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, nil, true)
|
||||
end
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
for _, v in pairs(tbUpgradeNote) do
|
||||
local goItemObj = instantiate(self._mapNode.goProperty, self._mapNode.trBg)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplatePropertyCtrl")
|
||||
ctrlItem:SetNote(v[1], v[2], v[3], true)
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
local nCount = tbDesc and #tbDesc or 0
|
||||
if 0 < nCount then
|
||||
local goGrid = instantiate(self._mapNode.goBuff, self._mapNode.trBg)
|
||||
goGrid:SetActive(true)
|
||||
local txtBuff = goGrid.transform:Find("--Basic--/txtBuff")
|
||||
if txtBuff ~= nil then
|
||||
NovaAPI.SetTMPText(txtBuff:GetComponent("TMP_Text"), tbDesc[1].sFront)
|
||||
end
|
||||
local txtBuffContent = goGrid.transform:Find("--Basic--/txtBuffContent")
|
||||
if txtBuffContent ~= nil then
|
||||
NovaAPI.SetTMPText(txtBuffContent:GetComponent("TMP_Text"), tbDesc[1].sAfter)
|
||||
end
|
||||
table.insert(self.tbAni, goGrid.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
function DiscAdvanceSucCtrl:Awake()
|
||||
end
|
||||
function DiscAdvanceSucCtrl:OnEnable()
|
||||
end
|
||||
function DiscAdvanceSucCtrl:OnDisable()
|
||||
end
|
||||
function DiscAdvanceSucCtrl:OnDestroy()
|
||||
end
|
||||
return DiscAdvanceSucCtrl
|
||||
@@ -0,0 +1,87 @@
|
||||
local DiscBreakLimitAllSucCtrl = class("DiscBreakLimitAllSucCtrl", BaseCtrl)
|
||||
DiscBreakLimitAllSucCtrl._mapNodeConfig = {
|
||||
txtTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Disc_BreakLimitAll_ConsumedMaterials"
|
||||
},
|
||||
btnGrid = {},
|
||||
goItemList1 = {sComponentName = "Transform"},
|
||||
goItemList2 = {},
|
||||
sv = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
rtTitle = {sComponentName = "Transform"},
|
||||
rtItem = {sComponentName = "Transform"}
|
||||
}
|
||||
DiscBreakLimitAllSucCtrl._mapEventConfig = {}
|
||||
function DiscBreakLimitAllSucCtrl:Open(nType)
|
||||
self:RefreshContent()
|
||||
local SuccessBar = self:BindCtrlByNode(self.gameObject, "Game.UI.SuccessBarEx.SuccessBarCtrl")
|
||||
SuccessBar:PlayAni(nType, self.tbAni)
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:RefreshContent()
|
||||
local ani1 = self._mapNode.rtTitle:GetComponent("Animator")
|
||||
local ani2 = self._mapNode.rtItem:GetComponent("Animator")
|
||||
self.tbAni = {}
|
||||
table.insert(self.tbAni, ani1)
|
||||
table.insert(self.tbAni, ani2)
|
||||
self.tbMat = self._panel.mapData.tbMat
|
||||
self.nAllCount = #self.tbMat
|
||||
if self.nAllCount <= 8 then
|
||||
self._mapNode.goItemList1.gameObject:SetActive(true)
|
||||
self._mapNode.goItemList2:SetActive(false)
|
||||
self:RefreshNormal()
|
||||
else
|
||||
self._mapNode.goItemList1.gameObject:SetActive(false)
|
||||
self._mapNode.goItemList2:SetActive(true)
|
||||
self:RefreshSV()
|
||||
end
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:RefreshNormal()
|
||||
for _, v in ipairs(self.tbMat) do
|
||||
local nItemId = v.nTid
|
||||
local goItem = instantiate(self._mapNode.btnGrid, self._mapNode.goItemList1)
|
||||
local ctrlObj = self:BindCtrlByNode(goItem, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
ctrlObj:SetItem(nItemId, nil, v.nCount)
|
||||
local btnGrid = goItem:GetComponent("UIButton")
|
||||
btnGrid.onClick:RemoveAllListeners()
|
||||
local cbSelect = function()
|
||||
self:OnSelectItem(nItemId, btnGrid)
|
||||
end
|
||||
btnGrid.onClick:AddListener(cbSelect)
|
||||
end
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:RefreshSV()
|
||||
self._mapNode.sv:Init(self.nAllCount, self, self.OnGridRefresh, self.OnGridBtnClick)
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:OnGridRefresh(goGrid, gridIndex)
|
||||
local nIndex = gridIndex + 1
|
||||
local mapItem = self.tbMat[nIndex]
|
||||
local nInstanceId = goGrid:GetInstanceID()
|
||||
if not self.tbGridCtrl[nInstanceId] then
|
||||
self.tbGridCtrl[nInstanceId] = self:BindCtrlByNode(goGrid.transform:Find("btnGrid").gameObject, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
end
|
||||
self.tbGridCtrl[nInstanceId]:SetItem(mapItem.nTid, nil, mapItem.nCount)
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:OnGridBtnClick(goGrid, gridIndex)
|
||||
local nIndex = gridIndex + 1
|
||||
self:OnSelectItem(self.tbMat[nIndex].nTid, goGrid.transform:Find("btnGrid"))
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:OnSelectItem(itemId, btn)
|
||||
UTILS.ClickItemGridWithTips(itemId, btn.transform, true, true, false)
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:Awake()
|
||||
self.tbGridCtrl = {}
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:OnEnable()
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:OnDisable()
|
||||
for nInstanceId, objCtrl in pairs(self.tbGridCtrl) do
|
||||
self:UnbindCtrlByNode(objCtrl)
|
||||
self.tbGridCtrl[nInstanceId] = nil
|
||||
end
|
||||
self.tbGridCtrl = {}
|
||||
end
|
||||
function DiscBreakLimitAllSucCtrl:OnDestroy()
|
||||
end
|
||||
return DiscBreakLimitAllSucCtrl
|
||||
@@ -0,0 +1,68 @@
|
||||
local DiscStarSucCtrl = class("DiscStarSucCtrl", BaseCtrl)
|
||||
DiscStarSucCtrl._mapNodeConfig = {
|
||||
goStar = {
|
||||
nCount = 2,
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateDiscLimitCtrl"
|
||||
},
|
||||
goProperty = {},
|
||||
trBg = {sNodeName = "rtProperty", sComponentName = "Transform"},
|
||||
txtName = {sComponentName = "TMP_Text"},
|
||||
txtDesc = {sComponentName = "TMP_Text"},
|
||||
TMP_Link = {
|
||||
sNodeName = "txtDesc",
|
||||
sComponentName = "TMPHyperLink",
|
||||
callback = "OnLinkClick_Word"
|
||||
},
|
||||
rtStar = {sComponentName = "Transform"},
|
||||
imgDescBg = {sComponentName = "Transform"}
|
||||
}
|
||||
DiscStarSucCtrl._mapEventConfig = {}
|
||||
function DiscStarSucCtrl:Open(nType)
|
||||
self:RefreshContent()
|
||||
local SuccessBar = self:BindCtrlByNode(self.gameObject, "Game.UI.SuccessBarEx.SuccessBarCtrl")
|
||||
SuccessBar:PlayAni(nType, self.tbAni)
|
||||
end
|
||||
function DiscStarSucCtrl:RefreshContent()
|
||||
local ani1 = self._mapNode.rtStar:GetComponent("Animator")
|
||||
local ani2 = self._mapNode.imgDescBg:GetComponent("Animator")
|
||||
self.tbAni = {}
|
||||
local nBeforeStar = self._panel.mapData.nBeforeStar
|
||||
local nAfterStar = self._panel.mapData.nAfterStar
|
||||
local sDesc = self._panel.mapData.sDesc
|
||||
local sName = self._panel.mapData.sName
|
||||
local mapAttrBefore = self._panel.mapData.mapAttrBefore
|
||||
local mapAttrAfter = self._panel.mapData.mapAttrAfter
|
||||
local mapDisc = PlayerData.Disc:GetDiscById(self._panel.mapData.nId)
|
||||
self._mapNode.goStar[1]:SetLimit(nBeforeStar + 1, 0, mapDisc.nRarity)
|
||||
self._mapNode.goStar[2]:SetLimit(nAfterStar + 1, 0, mapDisc.nRarity)
|
||||
table.insert(self.tbAni, ani1)
|
||||
delChildren(self._mapNode.trBg)
|
||||
for _, mapAttachAttr in pairs(AllEnum.AttachAttr) do
|
||||
local mapAttr = mapAttrBefore[mapAttachAttr.sKey]
|
||||
if 0 < mapAttr.Value then
|
||||
local bValueChanged = mapAttrAfter[mapAttachAttr.sKey].Value ~= mapAttr.Value
|
||||
if bValueChanged then
|
||||
local goItemObj = instantiate(self._mapNode.goProperty, self._mapNode.trBg)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplatePropertyCtrl")
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, mapAttrAfter[mapAttachAttr.sKey].Value, true)
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.txtName, string.format("「%s」", sName))
|
||||
NovaAPI.SetTMPText(self._mapNode.txtDesc, sDesc)
|
||||
table.insert(self.tbAni, ani2)
|
||||
end
|
||||
function DiscStarSucCtrl:Awake()
|
||||
end
|
||||
function DiscStarSucCtrl:OnEnable()
|
||||
end
|
||||
function DiscStarSucCtrl:OnDisable()
|
||||
end
|
||||
function DiscStarSucCtrl:OnDestroy()
|
||||
end
|
||||
function DiscStarSucCtrl:OnLinkClick_Word(link, sWordId)
|
||||
UTILS.ClickWordLink(link, sWordId)
|
||||
end
|
||||
return DiscStarSucCtrl
|
||||
@@ -0,0 +1,57 @@
|
||||
local DiscSucBarCtrl = class("DiscSucBarCtrl", BaseCtrl)
|
||||
DiscSucBarCtrl._mapNodeConfig = {
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_blue",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
Upgrade = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.DiscUpgradeSucCtrl"
|
||||
},
|
||||
Advance = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.DiscAdvanceSucCtrl"
|
||||
},
|
||||
BreakLimit = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.DiscStarSucCtrl"
|
||||
},
|
||||
BreakLimitAll = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.DiscBreakLimitAllSucCtrl"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
}
|
||||
}
|
||||
DiscSucBarCtrl._mapEventConfig = {}
|
||||
function DiscSucBarCtrl:Open()
|
||||
self._mapNode.Upgrade.gameObject:SetActive(self._panel.nCurTog == AllEnum.DiscSucBar.Upgrade)
|
||||
self._mapNode.Advance.gameObject:SetActive(self._panel.nCurTog == AllEnum.DiscSucBar.Advance)
|
||||
self._mapNode.BreakLimit.gameObject:SetActive(self._panel.nCurTog == AllEnum.DiscSucBar.BreakLimit)
|
||||
self._mapNode.BreakLimitAll.gameObject:SetActive(self._panel.nCurTog == AllEnum.DiscSucBar.BreakLimitAll)
|
||||
if self._panel.nCurTog == AllEnum.DiscSucBar.Upgrade then
|
||||
self._mapNode.Upgrade:Open()
|
||||
elseif self._panel.nCurTog == AllEnum.DiscSucBar.Advance then
|
||||
self._mapNode.Advance:Open()
|
||||
elseif self._panel.nCurTog == AllEnum.DiscSucBar.BreakLimit then
|
||||
self._mapNode.BreakLimit:Open(AllEnum.SuccessBar.Yellow)
|
||||
elseif self._panel.nCurTog == AllEnum.DiscSucBar.BreakLimitAll then
|
||||
self._mapNode.BreakLimitAll:Open(AllEnum.SuccessBar.Yellow)
|
||||
end
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.8)
|
||||
end
|
||||
function DiscSucBarCtrl:Awake()
|
||||
end
|
||||
function DiscSucBarCtrl:OnEnable()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
self:Open()
|
||||
end
|
||||
function DiscSucBarCtrl:OnDisable()
|
||||
end
|
||||
function DiscSucBarCtrl:OnDestroy()
|
||||
end
|
||||
function DiscSucBarCtrl:OnBtnClick_Close(btn)
|
||||
if self._panel.callback then
|
||||
self._panel.callback()
|
||||
end
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.DiscSucBar)
|
||||
end
|
||||
return DiscSucBarCtrl
|
||||
@@ -0,0 +1,23 @@
|
||||
local DiscSucBarPanel = class("DiscSucBarPanel", BasePanel)
|
||||
DiscSucBarPanel._bIsMainPanel = false
|
||||
DiscSucBarPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "SuccessBarEx/DiscSucBarPanel.prefab",
|
||||
sCtrlName = "Game.UI.SuccessBarEx.DiscSucBarCtrl"
|
||||
}
|
||||
}
|
||||
function DiscSucBarPanel:Awake()
|
||||
local tbParam = self:GetPanelParam()
|
||||
if type(tbParam) == "table" then
|
||||
self.mapData = tbParam[1]
|
||||
self.nCurTog = tbParam[2]
|
||||
self.callback = tbParam[3]
|
||||
end
|
||||
end
|
||||
function DiscSucBarPanel:OnEnable()
|
||||
end
|
||||
function DiscSucBarPanel:OnDisable()
|
||||
end
|
||||
function DiscSucBarPanel:OnDestroy()
|
||||
end
|
||||
return DiscSucBarPanel
|
||||
@@ -0,0 +1,50 @@
|
||||
local DiscUpgradeSucCtrl = class("DiscUpgradeSucCtrl", BaseCtrl)
|
||||
DiscUpgradeSucCtrl._mapNodeConfig = {
|
||||
txtNextLevel = {sComponentName = "TMP_Text"},
|
||||
txtLvCn = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Outfit_Level"
|
||||
},
|
||||
goProperty = {},
|
||||
trBg = {sNodeName = "rtProperty", sComponentName = "Transform"},
|
||||
ani1 = {sNodeName = "rtTitle", sComponentName = "Animator"}
|
||||
}
|
||||
DiscUpgradeSucCtrl._mapEventConfig = {}
|
||||
function DiscUpgradeSucCtrl:Open()
|
||||
self:RefreshContent()
|
||||
local SuccessBar = self:BindCtrlByNode(self.gameObject, "Game.UI.SuccessBarEx.SuccessBarCtrl")
|
||||
SuccessBar:PlayAni(AllEnum.SuccessBar.Blue, self.tbAni)
|
||||
end
|
||||
function DiscUpgradeSucCtrl:RefreshContent()
|
||||
self.tbAni = {}
|
||||
local nLevel = self._panel.mapData.nLevel
|
||||
local mapAttrBefore = self._panel.mapData.mapAttrBefore
|
||||
local mapAttrAfter = self._panel.mapData.mapAttrAfter
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel, nLevel)
|
||||
table.insert(self.tbAni, self._mapNode.ani1)
|
||||
delChildren(self._mapNode.trBg)
|
||||
for _, mapAttachAttr in pairs(AllEnum.AttachAttr) do
|
||||
local mapAttr = mapAttrBefore[mapAttachAttr.sKey]
|
||||
if mapAttr.Value > 0 then
|
||||
local goItemObj = instantiate(self._mapNode.goProperty, self._mapNode.trBg)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplatePropertyCtrl")
|
||||
local bValueChanged = mapAttrAfter[mapAttachAttr.sKey].Value ~= mapAttr.Value
|
||||
if bValueChanged then
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, mapAttrAfter[mapAttachAttr.sKey].Value, true)
|
||||
else
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, nil, true)
|
||||
end
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
end
|
||||
function DiscUpgradeSucCtrl:Awake()
|
||||
end
|
||||
function DiscUpgradeSucCtrl:OnEnable()
|
||||
end
|
||||
function DiscUpgradeSucCtrl:OnDisable()
|
||||
end
|
||||
function DiscUpgradeSucCtrl:OnDestroy()
|
||||
end
|
||||
return DiscUpgradeSucCtrl
|
||||
@@ -0,0 +1,80 @@
|
||||
local EquipmentSucBarCtrl = class("EquipmentSucBarCtrl", BaseCtrl)
|
||||
EquipmentSucBarCtrl._mapNodeConfig = {
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_blue",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
SuccessBar = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.SuccessBarCtrl"
|
||||
},
|
||||
rtProperty = {sComponentName = "Transform"},
|
||||
rtRandomProperty = {sComponentName = "Transform"},
|
||||
goProperty = {},
|
||||
goRandomProperty = {},
|
||||
txtNextLevel = {sComponentName = "TMP_Text"},
|
||||
txtLvCn = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Equipment_Upgrade_Suc_Level"
|
||||
},
|
||||
ani1 = {sNodeName = "rtTitle", sComponentName = "Animator"}
|
||||
}
|
||||
EquipmentSucBarCtrl._mapEventConfig = {}
|
||||
function EquipmentSucBarCtrl:Open()
|
||||
self:RefreshContent()
|
||||
self._mapNode.SuccessBar.gameObject:SetActive(true)
|
||||
self._mapNode.SuccessBar:PlayAni(AllEnum.SuccessBar.Blue, self.tbAni)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.8)
|
||||
end
|
||||
function EquipmentSucBarCtrl:RefreshContent()
|
||||
self.tbAni = {}
|
||||
local nLevel = self._panel.mapData.nLevel
|
||||
local mapAttrBefore = self._panel.mapData.mapAttrBefore
|
||||
local mapAttrAfter = self._panel.mapData.mapAttrAfter
|
||||
local tbUnlockRandomAttr = self._panel.mapData.tbUnlockAttr
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel, nLevel)
|
||||
table.insert(self.tbAni, self._mapNode.ani1)
|
||||
delChildren(self._mapNode.rtProperty)
|
||||
for _, mapAttachAttr in pairs(AllEnum.AttachAttr) do
|
||||
local mapAttr = mapAttrBefore[mapAttachAttr.sKey]
|
||||
if nil ~= mapAttr and mapAttr.Value > 0 then
|
||||
local goItemObj = instantiate(self._mapNode.goProperty, self._mapNode.rtProperty)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplatePropertyCtrl")
|
||||
local bValueChanged = mapAttrAfter[mapAttachAttr.sKey].Value ~= mapAttr.Value
|
||||
if bValueChanged then
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, mapAttrAfter[mapAttachAttr.sKey].Value, true)
|
||||
else
|
||||
ctrlItem:SetItemProperty(mapAttr.Key, mapAttr.Value, nil, true)
|
||||
end
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
for _, v in ipairs(tbUnlockRandomAttr) do
|
||||
local goItemObj = instantiate(self._mapNode.goRandomProperty, self._mapNode.rtRandomProperty)
|
||||
goItemObj:SetActive(true)
|
||||
local ctrlItem = self:BindCtrlByNode(goItemObj, "Game.UI.TemplateEx.TemplateRandomPropertyCtrl")
|
||||
ctrlItem:SetProperty(v.Tag, v.AttrId, v.Value)
|
||||
table.insert(self.tbAni, goItemObj.transform:GetComponent("Animator"))
|
||||
end
|
||||
end
|
||||
function EquipmentSucBarCtrl:Awake()
|
||||
end
|
||||
function EquipmentSucBarCtrl:OnEnable()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
self:Open()
|
||||
end
|
||||
function EquipmentSucBarCtrl:OnDisable()
|
||||
end
|
||||
function EquipmentSucBarCtrl:OnDestroy()
|
||||
end
|
||||
function EquipmentSucBarCtrl:OnBtnClick_Close(btn)
|
||||
if self._panel.callback then
|
||||
self._panel.callback()
|
||||
end
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.EquipmentSucBar)
|
||||
end
|
||||
return EquipmentSucBarCtrl
|
||||
@@ -0,0 +1,22 @@
|
||||
local EquipmentSucBarPanel = class("EquipmentSucBarPanel", BasePanel)
|
||||
EquipmentSucBarPanel._bIsMainPanel = false
|
||||
EquipmentSucBarPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "SuccessBarEx/EquipmentSucBarPanel.prefab",
|
||||
sCtrlName = "Game.UI.SuccessBarEx.EquipmentSucBarCtrl"
|
||||
}
|
||||
}
|
||||
function EquipmentSucBarPanel:Awake()
|
||||
local tbParam = self:GetPanelParam()
|
||||
if type(tbParam) == "table" then
|
||||
self.mapData = tbParam[1]
|
||||
self.callback = tbParam[2]
|
||||
end
|
||||
end
|
||||
function EquipmentSucBarPanel:OnEnable()
|
||||
end
|
||||
function EquipmentSucBarPanel:OnDisable()
|
||||
end
|
||||
function EquipmentSucBarPanel:OnDestroy()
|
||||
end
|
||||
return EquipmentSucBarPanel
|
||||
@@ -0,0 +1,148 @@
|
||||
local ReceiveAutoTransCtrl = class("ReceiveAutoTransCtrl", BaseCtrl)
|
||||
ReceiveAutoTransCtrl._mapNodeConfig = {
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_blue",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
SuccessBar = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.SuccessBarCtrl"
|
||||
},
|
||||
txtDstTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "AutoTrans_DstItem"
|
||||
},
|
||||
txtTip = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "AutoTrans_Tip"
|
||||
},
|
||||
goSrcList = {nCount = 2},
|
||||
goDstList = {nCount = 2},
|
||||
trSrcList = {sNodeName = "goSrcList1", sComponentName = "Transform"},
|
||||
trDstList = {sNodeName = "goDstList1", sComponentName = "Transform"},
|
||||
goSrcItem = {},
|
||||
goDstItem = {},
|
||||
svSrc = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
svDst = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
ani1 = {sNodeName = "Src", sComponentName = "Animator"},
|
||||
ani2 = {sNodeName = "Arrow", sComponentName = "Animator"},
|
||||
ani3 = {sNodeName = "Dst", sComponentName = "Animator"}
|
||||
}
|
||||
ReceiveAutoTransCtrl._mapEventConfig = {}
|
||||
function ReceiveAutoTransCtrl:Open()
|
||||
self:RefreshContent()
|
||||
self._mapNode.SuccessBar.gameObject:SetActive(true)
|
||||
self._mapNode.SuccessBar:PlayAni(AllEnum.SuccessBar.Purple, self.tbAni, 4)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.8)
|
||||
end
|
||||
function ReceiveAutoTransCtrl:RefreshContent()
|
||||
self.tbAni = {}
|
||||
self.tbSrc = self._panel.tbSrc
|
||||
self.tbDst = self._panel.tbDst
|
||||
local nSrcCount = #self.tbSrc
|
||||
self._mapNode.goSrcList[1]:SetActive(nSrcCount < 8)
|
||||
self._mapNode.goSrcList[2]:SetActive(8 <= nSrcCount)
|
||||
if nSrcCount < 8 then
|
||||
delChildren(self._mapNode.trSrcList)
|
||||
for _, mapItem in ipairs(self.tbSrc) do
|
||||
local goItem = instantiate(self._mapNode.goSrcItem, self._mapNode.trSrcList)
|
||||
goItem:SetActive(true)
|
||||
self:RefreshGrid(goItem, mapItem)
|
||||
local btnGrid = goItem.transform:Find("btnGrid"):GetComponent("UIButton")
|
||||
btnGrid.onClick:RemoveAllListeners()
|
||||
local cbSelect = function()
|
||||
self:OnSelectItem(mapItem.Tid, btnGrid)
|
||||
end
|
||||
btnGrid.onClick:AddListener(cbSelect)
|
||||
end
|
||||
else
|
||||
self._mapNode.svSrc:Init(nSrcCount, self, self.OnGridRefreshSrc, self.OnGridBtnClickSrc)
|
||||
end
|
||||
table.insert(self.tbAni, self._mapNode.ani1)
|
||||
table.insert(self.tbAni, self._mapNode.ani2)
|
||||
local nDstCount = #self.tbDst
|
||||
self._mapNode.goDstList[1]:SetActive(nDstCount < 6)
|
||||
self._mapNode.goDstList[2]:SetActive(6 <= nDstCount)
|
||||
if nDstCount < 6 then
|
||||
delChildren(self._mapNode.trDstList)
|
||||
for _, mapItem in ipairs(self.tbDst) do
|
||||
local goItem = instantiate(self._mapNode.goDstItem, self._mapNode.trDstList)
|
||||
goItem:SetActive(true)
|
||||
self:RefreshGrid(goItem, mapItem)
|
||||
local btnGrid = goItem.transform:Find("btnGrid"):GetComponent("UIButton")
|
||||
btnGrid.onClick:RemoveAllListeners()
|
||||
local cbSelect = function()
|
||||
self:OnSelectItem(mapItem.Tid, btnGrid)
|
||||
end
|
||||
btnGrid.onClick:AddListener(cbSelect)
|
||||
end
|
||||
else
|
||||
self._mapNode.svDst:Init(nDstCount, self, self.OnGridRefreshDst, self.OnGridBtnClickDst)
|
||||
end
|
||||
table.insert(self.tbAni, self._mapNode.ani3)
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnGridRefreshSrc(goGrid, gridIndex)
|
||||
local nIndex = gridIndex + 1
|
||||
local mapItem = self.tbSrc[nIndex]
|
||||
self:RefreshGrid(goGrid, mapItem)
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnGridRefreshDst(goGrid, gridIndex)
|
||||
local nIndex = gridIndex + 1
|
||||
local mapItem = self.tbDst[nIndex]
|
||||
self:RefreshGrid(goGrid, mapItem)
|
||||
end
|
||||
function ReceiveAutoTransCtrl:RefreshGrid(goGrid, mapItem)
|
||||
local nInstanceId = goGrid:GetInstanceID()
|
||||
if not self.tbGridCtrl[nInstanceId] then
|
||||
self.tbGridCtrl[nInstanceId] = self:BindCtrlByNode(goGrid.transform:Find("btnGrid").gameObject, "Game.UI.TemplateEx.TemplateItemCtrl")
|
||||
end
|
||||
local mapCfg = ConfigTable.GetData_Item(mapItem.Tid)
|
||||
if mapCfg then
|
||||
if mapCfg.Type == GameEnum.itemType.Char then
|
||||
self.tbGridCtrl[nInstanceId]:SetChar(mapItem.Tid, mapItem.Qty, nil, mapItem.rewardType)
|
||||
else
|
||||
self.tbGridCtrl[nInstanceId]:SetItem(mapItem.Tid, mapCfg.Rarity, mapItem.Qty, nil, nil, mapItem.rewardType and mapItem.rewardType == AllEnum.RewardType.First, mapItem.rewardType and mapItem.rewardType == AllEnum.RewardType.Three, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnGridBtnClickSrc(goGrid, gridIndex)
|
||||
local nIndex = gridIndex + 1
|
||||
self:OnSelectItem(self.tbSrc[nIndex].Tid, goGrid.transform:Find("btnGrid"))
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnGridBtnClickDst(goGrid, gridIndex)
|
||||
local nIndex = gridIndex + 1
|
||||
self:OnSelectItem(self.tbDst[nIndex].Tid, goGrid.transform:Find("btnGrid"))
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnSelectItem(itemId, btn)
|
||||
UTILS.ClickItemGridWithTips(itemId, btn.transform, false, true, false)
|
||||
end
|
||||
function ReceiveAutoTransCtrl:Awake()
|
||||
self.tbGridCtrl = {}
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnEnable()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
self:Open()
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnDisable()
|
||||
for nInstanceId, objCtrl in pairs(self.tbGridCtrl) do
|
||||
self:UnbindCtrlByNode(objCtrl)
|
||||
self.tbGridCtrl[nInstanceId] = nil
|
||||
end
|
||||
self.tbGridCtrl = {}
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnDestroy()
|
||||
end
|
||||
function ReceiveAutoTransCtrl:OnBtnClick_Close(btn)
|
||||
if self._panel.callback then
|
||||
self._panel.callback()
|
||||
end
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.ReceiveAutoTrans)
|
||||
end
|
||||
return ReceiveAutoTransCtrl
|
||||
@@ -0,0 +1,42 @@
|
||||
local ReceiveAutoTransPanel = class("ReceiveAutoTransPanel", BasePanel)
|
||||
ReceiveAutoTransPanel._bIsMainPanel = false
|
||||
ReceiveAutoTransPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "SuccessBarEx/ReceiveAutoTransPanel.prefab",
|
||||
sCtrlName = "Game.UI.SuccessBarEx.ReceiveAutoTransCtrl"
|
||||
}
|
||||
}
|
||||
function ReceiveAutoTransPanel:Awake()
|
||||
local tbParam = self:GetPanelParam()
|
||||
if type(tbParam) == "table" then
|
||||
self.tbSrc = tbParam[1]
|
||||
self.tbDst = tbParam[2]
|
||||
self.callback = tbParam[3]
|
||||
local sort = function(a, b)
|
||||
local cfgA = ConfigTable.GetData_Item(a.Tid)
|
||||
local cfgB = ConfigTable.GetData_Item(b.Tid)
|
||||
local rarityA = cfgA.Rarity
|
||||
local rarityB = cfgB.Rarity
|
||||
local typeA = cfgA.Type
|
||||
local typeB = cfgB.Type
|
||||
if rarityA ~= rarityB then
|
||||
return rarityA < rarityB
|
||||
elseif typeA ~= typeB then
|
||||
return typeA < typeB
|
||||
elseif a.Qty ~= b.Qty then
|
||||
return a.Qty > b.Qty
|
||||
else
|
||||
return a.Tid < b.Tid
|
||||
end
|
||||
end
|
||||
table.sort(self.tbSrc, sort)
|
||||
table.sort(self.tbDst, sort)
|
||||
end
|
||||
end
|
||||
function ReceiveAutoTransPanel:OnEnable()
|
||||
end
|
||||
function ReceiveAutoTransPanel:OnDisable()
|
||||
end
|
||||
function ReceiveAutoTransPanel:OnDestroy()
|
||||
end
|
||||
return ReceiveAutoTransPanel
|
||||
@@ -0,0 +1,84 @@
|
||||
local SkillSucBarCtrl = class("SkillSucBarCtrl", BaseCtrl)
|
||||
SkillSucBarCtrl._mapNodeConfig = {
|
||||
aniBlur = {
|
||||
sNodeName = "t_fullscreen_blur_blue",
|
||||
sComponentName = "Animator"
|
||||
},
|
||||
btnClose = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Close"
|
||||
},
|
||||
SuccessBar = {
|
||||
sCtrlName = "Game.UI.SuccessBarEx.SuccessBarCtrl"
|
||||
},
|
||||
txtName = {sComponentName = "TMP_Text"},
|
||||
txtDesc = {sComponentName = "TMP_Text"},
|
||||
TMP_Link = {
|
||||
sNodeName = "txtDesc",
|
||||
sComponentName = "TMPHyperLink",
|
||||
callback = "OnLinkClick_Word"
|
||||
},
|
||||
txtNextLevel = {sComponentName = "TMP_Text"},
|
||||
txtLvCn = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Skill_Level"
|
||||
},
|
||||
txtAddLv = {sComponentName = "TMP_Text"},
|
||||
ani1 = {sNodeName = "rtTitle", sComponentName = "Animator"},
|
||||
ani2 = {sNodeName = "imgDescBg", sComponentName = "Animator"}
|
||||
}
|
||||
SkillSucBarCtrl._mapEventConfig = {}
|
||||
function SkillSucBarCtrl:Open()
|
||||
self:RefreshContent()
|
||||
self._mapNode.SuccessBar.gameObject:SetActive(true)
|
||||
self._mapNode.SuccessBar:PlayAni(AllEnum.SuccessBar.Blue, self.tbAni)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.8)
|
||||
end
|
||||
function SkillSucBarCtrl:RefreshContent()
|
||||
self.tbAni = {
|
||||
self._mapNode.ani1,
|
||||
self._mapNode.ani2
|
||||
}
|
||||
local nId = self._panel.mapData.nSkillId
|
||||
local nLevel = self._panel.mapData.nNextLevel
|
||||
local sName = self._panel.mapData.sSkillName
|
||||
local mapCfgData_Skill = ConfigTable.GetData_Skill(nId)
|
||||
local sDesc = ""
|
||||
if mapCfgData_Skill ~= nil then
|
||||
sDesc = UTILS.ParseDesc(mapCfgData_Skill, GameEnum.levelTypeData.SkillSlot, nLevel)
|
||||
end
|
||||
local nAddLv = self._panel.mapData.nAddLevel
|
||||
NovaAPI.SetTMPText(self._mapNode.txtNextLevel, nLevel)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtName, string.format("「%s」", sName))
|
||||
NovaAPI.SetTMPText(self._mapNode.txtDesc, sDesc)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self._mapNode.txtDesc.gameObject:SetActive(false)
|
||||
self._mapNode.txtDesc.gameObject:SetActive(true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
self._mapNode.txtAddLv.gameObject:SetActive(0 < nAddLv)
|
||||
if 0 < nAddLv then
|
||||
NovaAPI.SetTMPText(self._mapNode.txtAddLv, "(+" .. nAddLv .. ")")
|
||||
end
|
||||
end
|
||||
function SkillSucBarCtrl:Awake()
|
||||
end
|
||||
function SkillSucBarCtrl:OnEnable()
|
||||
self._mapNode.aniBlur.gameObject:SetActive(true)
|
||||
self:Open()
|
||||
end
|
||||
function SkillSucBarCtrl:OnDisable()
|
||||
end
|
||||
function SkillSucBarCtrl:OnDestroy()
|
||||
end
|
||||
function SkillSucBarCtrl:OnBtnClick_Close(btn)
|
||||
if self._panel.callback then
|
||||
self._panel.callback()
|
||||
end
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.SkillSucBar)
|
||||
end
|
||||
function SkillSucBarCtrl:OnLinkClick_Word(link, sWordId)
|
||||
UTILS.ClickWordLink(link, sWordId)
|
||||
end
|
||||
return SkillSucBarCtrl
|
||||
@@ -0,0 +1,22 @@
|
||||
local SkillSucBarPanel = class("SkillSucBarPanel", BasePanel)
|
||||
SkillSucBarPanel._bIsMainPanel = false
|
||||
SkillSucBarPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "SuccessBarEx/SkillSucBarPanel.prefab",
|
||||
sCtrlName = "Game.UI.SuccessBarEx.SkillSucBarCtrl"
|
||||
}
|
||||
}
|
||||
function SkillSucBarPanel:Awake()
|
||||
local tbParam = self:GetPanelParam()
|
||||
if type(tbParam) == "table" then
|
||||
self.mapData = tbParam[1]
|
||||
self.callback = tbParam[2]
|
||||
end
|
||||
end
|
||||
function SkillSucBarPanel:OnEnable()
|
||||
end
|
||||
function SkillSucBarPanel:OnDisable()
|
||||
end
|
||||
function SkillSucBarPanel:OnDestroy()
|
||||
end
|
||||
return SkillSucBarPanel
|
||||
@@ -0,0 +1,85 @@
|
||||
local SuccessBarCtrl = class("SuccessBarCtrl", BaseCtrl)
|
||||
local nFrameHeight = 70
|
||||
local nStartHeight = 48
|
||||
SuccessBarCtrl._mapNodeConfig = {
|
||||
BarBg = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
aniFrame = {sNodeName = "imgFrameBg", sComponentName = "Animator"},
|
||||
rtFrame = {
|
||||
sNodeName = "imgFrameBg",
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
Mask = {
|
||||
sComponentName = "RectTransform"
|
||||
}
|
||||
}
|
||||
SuccessBarCtrl._mapEventConfig = {}
|
||||
function SuccessBarCtrl:PlayAni(nType, tbAni, nSpeed)
|
||||
self.tbAni = tbAni
|
||||
self._mapNode.aniFrame:Play("SuccessBar_in" .. nType)
|
||||
local nTime = 0.6
|
||||
if nSpeed then
|
||||
self._mapNode.aniFrame.speed = nSpeed
|
||||
nTime = 0.6 / nSpeed
|
||||
end
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
self:AddTimer(1, nTime, "PlayContentAni", true, true, true)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
EventManager.Hit(EventId.BlockInput, true)
|
||||
end
|
||||
function SuccessBarCtrl:PlayContentAni()
|
||||
local nAniCount = #self.tbAni
|
||||
local nHeight = self._mapNode.BarBg.rect.height
|
||||
local nTotalHeight = (nHeight + nFrameHeight) / 2 - nStartHeight
|
||||
self._mapNode.aniFrame.enabled = false
|
||||
self._mapNode.rtFrame:DOLocalMoveY(nTotalHeight, 0.167):SetUpdate(true):SetEase(Ease.OutCubic)
|
||||
self._mapNode.Mask:DOSizeDelta(Vector2(0, nHeight), 0.167):SetUpdate(true):SetEase(Ease.OutCubic)
|
||||
local sequence = DOTween.Sequence()
|
||||
for i = 1, nAniCount do
|
||||
sequence:AppendCallback(function()
|
||||
if self.tbAni[i].bMulti then
|
||||
for _, v in ipairs(self.tbAni[i]) do
|
||||
v:SetTrigger("tIn")
|
||||
end
|
||||
else
|
||||
self.tbAni[i]:SetTrigger("tIn")
|
||||
end
|
||||
if i == nAniCount then
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
self:StartShowSkinPanel()
|
||||
end
|
||||
end)
|
||||
sequence:AppendInterval(0.067)
|
||||
end
|
||||
end
|
||||
function SuccessBarCtrl:StartShowSkinPanel()
|
||||
if PlayerData.CharSkin:CheckNewSkin() then
|
||||
self:AddTimer(1, 0.8, function()
|
||||
PlayerData.CharSkin:TryOpenSkinShowPanel()
|
||||
self:ClosePanel()
|
||||
end, true, true, true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.8)
|
||||
end
|
||||
end
|
||||
function SuccessBarCtrl:ClosePanel()
|
||||
if self._panel.callback then
|
||||
self._panel.callback()
|
||||
end
|
||||
EventManager.Hit(EventId.ClosePanel, PanelId.CharSucBar)
|
||||
end
|
||||
function SuccessBarCtrl:Awake()
|
||||
end
|
||||
function SuccessBarCtrl:OnEnable()
|
||||
end
|
||||
function SuccessBarCtrl:OnDisable()
|
||||
EventManager.Hit(EventId.BlockInput, false)
|
||||
if not PanelManager.CheckPanelOpen(PanelId.ReceiveSpecialReward) then
|
||||
PlayerData.CharSkin:TryOpenSkinShowPanel()
|
||||
end
|
||||
end
|
||||
function SuccessBarCtrl:OnDestroy()
|
||||
end
|
||||
return SuccessBarCtrl
|
||||
Reference in New Issue
Block a user