Update - 1.9.0.103
EN: 1.9.0.103 CN: 1.9.0.104 JP: 1.9.0.106 KR: 1.9.0.108
This commit is contained in:
@@ -91,6 +91,14 @@ CharacterInfoCtrl._mapNodeConfig = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_CloseWordTip"
|
||||
},
|
||||
btnSetFavorite = {
|
||||
sComponentName = "Button",
|
||||
callback = "OnBtnClick_btnSetFavorite"
|
||||
},
|
||||
favorite_on = {
|
||||
sNodeName = "Favorite_on",
|
||||
sComponentName = "CanvasGroup"
|
||||
},
|
||||
imgWordTipBg = {},
|
||||
TMPWordDesc = {sComponentName = "TMP_Text"},
|
||||
TMPWordTipsTitle = {sComponentName = "TMP_Text"},
|
||||
@@ -202,6 +210,7 @@ function CharacterInfoCtrl:RefreshCharacterInfo()
|
||||
self:SetAtlasSprite(self._mapNode.imgElementIcon, "12_rare", sName)
|
||||
NovaAPI.SetTMPColor(self._mapNode.txtElement, AllEnum.ElementColor[self.configData.EET])
|
||||
NovaAPI.SetTMPText(self._mapNode.txtElement, ConfigTable.GetUIText("T_Element_Attr_" .. self.configData.EET))
|
||||
self:RefreshFavoriteState()
|
||||
end
|
||||
function CharacterInfoCtrl:RefreshProperty()
|
||||
local attrList = self.attrData:GetAttrList()
|
||||
@@ -365,6 +374,31 @@ end
|
||||
function CharacterInfoCtrl:OnBtnClick_Development()
|
||||
EventManager.Hit(EventId.CharRelatePanelOpen, PanelId.CharUpPanel, self._panel.nCharId)
|
||||
end
|
||||
function CharacterInfoCtrl:OnBtnClick_btnSetFavorite()
|
||||
local bOnFavorite = PlayerData.Char:GetCharFavoriteState(self.characterId)
|
||||
bOnFavorite = not bOnFavorite
|
||||
local func_callback = function()
|
||||
PlayerData.Char:SetCharFavoriteState(self.characterId, bOnFavorite)
|
||||
if bOnFavorite then
|
||||
sTip = ConfigTable.GetUIText("SetCharacterCommon_Tip")
|
||||
EventManager.Hit(EventId.OpenMessageBox, sTip)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 0.5)
|
||||
end
|
||||
self:RefreshFavoriteState()
|
||||
end
|
||||
local msgSend = {
|
||||
Value = self.characterId
|
||||
}
|
||||
HttpNetHandler.SendMsg(NetMsgId.Id.char_favorite_set_req, msgSend, nil, func_callback)
|
||||
end
|
||||
function CharacterInfoCtrl:RefreshFavoriteState()
|
||||
local bOnFavorite = PlayerData.Char:GetCharFavoriteState(self.characterId)
|
||||
if bOnFavorite then
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.favorite_on, 1)
|
||||
else
|
||||
NovaAPI.SetCanvasGroupAlpha(self._mapNode.favorite_on, 0)
|
||||
end
|
||||
end
|
||||
function CharacterInfoCtrl:OnEvent_RefreshPanel()
|
||||
if self._panel.nPanelId ~= PanelId.CharInfo then
|
||||
return
|
||||
|
||||
@@ -100,6 +100,9 @@ function CharEquipmentCtrl:RefreshPresetSlot()
|
||||
for k, v in ipairs(self._mapNode.goEquipmentSlotItem) do
|
||||
v:Init(self.tbSlot[k], self.nCharId)
|
||||
end
|
||||
if self._mapNode.goEquipmentSlotItem[self.nLastIndex] then
|
||||
self._mapNode.goEquipmentSlotItem[self.nLastIndex]:SetChooseState(true)
|
||||
end
|
||||
end
|
||||
function CharEquipmentCtrl:PlaySwitchAnim(nClosePanelId, nOpenPanelId)
|
||||
if nClosePanelId == PanelId.CharEquipment then
|
||||
@@ -121,22 +124,51 @@ function CharEquipmentCtrl:OnEnable()
|
||||
self:OnRefreshPanel()
|
||||
if self.nLastIndex and self.tbSlot and self.nLastIndex > 0 and self.tbSlot[self.nLastIndex].bUnlock and not PlayerData.Guide:CheckInGuideGroup(50) then
|
||||
local mapSelect = PlayerData.Equipment:GetEquipmentSelect()
|
||||
local mapUpgrade = PlayerData.Equipment:GetEquipmentUpgrade()
|
||||
if mapSelect and mapSelect.nCharId == self.nCharId then
|
||||
if self._mapNode.goEquipmentSlotItem[self.nLastIndex] then
|
||||
self._mapNode.goEquipmentSlotItem[self.nLastIndex]:SetChooseState(false)
|
||||
end
|
||||
bHasLastIndex = true
|
||||
local nEquipIndex = 0
|
||||
for k, v in ipairs(self.tbSlot) do
|
||||
if v.nSlotId == mapSelect.nSlotId then
|
||||
nEquipIndex = v.nGemIndex
|
||||
self.nLastIndex = k
|
||||
break
|
||||
end
|
||||
end
|
||||
if self._mapNode.goEquipmentSlotItem[self.nLastIndex] then
|
||||
self._mapNode.goEquipmentSlotItem[self.nLastIndex]:SetChooseState(true)
|
||||
end
|
||||
local nAnimTime = NovaAPI.GetAnimClipLength(self._mapNode.animRoot, {
|
||||
"CharEquipmentPanel_in"
|
||||
})
|
||||
local ani = function()
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.EquipmentInfo, self.nCharId, mapSelect.nSlotId, nEquipIndex, mapSelect.nGemIndex)
|
||||
end
|
||||
self:AddTimer(1, nAnimTime, ani, true, true, true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, nAnimTime)
|
||||
elseif mapUpgrade and mapUpgrade.nCharId == self.nCharId then
|
||||
if self._mapNode.goEquipmentSlotItem[self.nLastIndex] then
|
||||
self._mapNode.goEquipmentSlotItem[self.nLastIndex]:SetChooseState(false)
|
||||
end
|
||||
bHasLastIndex = true
|
||||
for k, v in ipairs(self.tbSlot) do
|
||||
if v.nSlotId == mapUpgrade.nSlotId then
|
||||
self.nLastIndex = k
|
||||
break
|
||||
end
|
||||
end
|
||||
if self._mapNode.goEquipmentSlotItem[self.nLastIndex] then
|
||||
self._mapNode.goEquipmentSlotItem[self.nLastIndex]:SetChooseState(true)
|
||||
end
|
||||
do
|
||||
local nAnimTime = NovaAPI.GetAnimClipLength(self._mapNode.animRoot, {
|
||||
"CharEquipmentPanel_in"
|
||||
})
|
||||
local ani = function()
|
||||
local nEquipIndex = 0
|
||||
for k, v in ipairs(self.tbSlot) do
|
||||
if v.nSlotId == mapSelect.nSlotId then
|
||||
nEquipIndex = v.nGemIndex
|
||||
self.nLastIndex = k
|
||||
break
|
||||
end
|
||||
end
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.EquipmentInfo, self.nCharId, mapSelect.nSlotId, nEquipIndex, mapSelect.nGemIndex)
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.EquipmentUpgrade, self.nCharId, mapUpgrade.nSlotId, mapUpgrade.nGemIndex, mapUpgrade.nSelectUpgradeIndex)
|
||||
end
|
||||
self:AddTimer(1, nAnimTime, ani, true, true, true)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, nAnimTime)
|
||||
@@ -150,6 +182,7 @@ function CharEquipmentCtrl:OnEnable()
|
||||
end
|
||||
function CharEquipmentCtrl:OnDestroy()
|
||||
PlayerData.Equipment:GetEquipmentSelect()
|
||||
PlayerData.Equipment:GetEquipmentUpgrade()
|
||||
self.nLastIndex = 0
|
||||
end
|
||||
function CharEquipmentCtrl:OnBtnClick_EquipmentSlot(_, nIndex)
|
||||
@@ -216,6 +249,7 @@ function CharEquipmentCtrl:OnEvent_RefreshPanel()
|
||||
if self._panel.nPanelId ~= PanelId.CharEquipment then
|
||||
return
|
||||
end
|
||||
self.nLastIndex = 0
|
||||
self:OnRefreshPanel()
|
||||
end
|
||||
return CharEquipmentCtrl
|
||||
|
||||
Reference in New Issue
Block a user