Revert "Revert "装备界面改动""

This reverts commit 9a1d361c63.
dev_chengFeng
jiaoyangna 2021-07-28 16:58:44 +08:00
parent 33edb62796
commit ab7c586a90
2 changed files with 60 additions and 55 deletions

View File

@ -144984,7 +144984,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &268016902880247916
RectTransform:
m_ObjectHideFlags: 0
@ -145000,10 +145000,10 @@ RectTransform:
m_Father: {fileID: 224358324289722092}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 97.10004, y: -82}
m_SizeDelta: {x: 155, y: 85}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1834664782885917125
CanvasRenderer:

View File

@ -32,7 +32,7 @@ local curHeroData
local heroListData
local curSelectEquipData
local index
local indexBtnNum = 0
local indexBtnNum = 1
local typeTab = {
[0] = Language[10175],
[1] = Language[10391],
@ -86,7 +86,7 @@ function RoleEquipPanel:InitComponent()
end
--装备list
this.effect = Util.GetGameObject(self.transform, "bg/effect")
for i = 0, 6 do
for i = 1, 6 do
tabs[i] = Util.GetGameObject(self.transform, "Tabs/Btn" .. i)
Util.GetGameObject(tabs[i], "Text"):GetComponent("Text").fontSize = GetCurLanguage() == 0 and 48 or 40
effectList[i] = Util.GetGameObject(self.transform, "bg/equipInfo/equip" .. i .. "/effect")
@ -192,7 +192,7 @@ function RoleEquipPanel:BindEvent()
end
)
for i = 0, 6 do
for i = 1, 6 do
Util.AddClick(
tabs[i],
function()
@ -201,11 +201,12 @@ function RoleEquipPanel:BindEvent()
return
end
indexBtnNum = i
if indexBtnNum == PosIdConst.All then
this:OnClickAllBtn()
else
this:OnClickTabBtn(indexBtnNum)
end
this:OnClickTabBtn(indexBtnNum)
-- if indexBtnNum == PosIdConst.All then
-- this:OnClickAllBtn()
-- else
-- this:OnClickTabBtn(indexBtnNum)
-- end
end
)
end
@ -247,11 +248,12 @@ end
function this.CurrEquipDataChange()
this.ShowHeroEquip()
if indexBtnNum == PosIdConst.All then
this:OnClickAllBtn()
else
this:OnClickTabBtn(indexBtnNum)
end
this:OnClickTabBtn(indexBtnNum)
-- if indexBtnNum == PosIdConst.All then
-- this:OnClickAllBtn()
-- else
-- this:OnClickTabBtn(indexBtnNum)
-- end
end
--界面打开时调用(用于子类重写)
@ -284,10 +286,10 @@ function RoleEquipPanel:OnShow()
effectList[i]:SetActive(false)
end
end
indexBtnNum = PosIdConst.All
indexBtnNum = PosIdConst.WuQi
teamHero = FormationManager.GetAllMainFormationHeroId()
this.ShowHeroEquip(true)
this:OnClickAllBtn()
this:OnClickTabBtn(indexBtnNum)
this.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main})
end
@ -301,22 +303,24 @@ function this:RightBtnOnClick()
index = (index + 1 <= #heroListData and index + 1 or 1)
curHeroData = heroListData[index]
this.ShowHeroEquip()
if indexBtnNum == PosIdConst.All then
this:OnClickAllBtn()
else
this:OnClickTabBtn(indexBtnNum)
end
this:OnClickTabBtn(indexBtnNum)
-- if indexBtnNum == PosIdConst.All then
-- this:OnClickAllBtn()
-- else
-- this:OnClickTabBtn(indexBtnNum)
-- end
end
--左切换按钮点击
function this:LeftBtnOnClick()
index = (index - 1 > 0 and index - 1 or #heroListData)
curHeroData = heroListData[index]
this.ShowHeroEquip()
if indexBtnNum == PosIdConst.All then
this:OnClickAllBtn()
else
this:OnClickTabBtn(indexBtnNum)
end
this:OnClickTabBtn(indexBtnNum)
-- if indexBtnNum == PosIdConst.All then
-- this:OnClickAllBtn()
-- else
-- this:OnClickTabBtn(indexBtnNum)
-- end
end
--一键装备
@ -716,25 +720,25 @@ function this:UpdateEquipItem(go,data,lvObj,refineObj)
end
EquipManager.SetEquipStarShow(this.spLoader, Util.GetGameObject(go.transform, "frame/star"),data.itemConfig.Id)
end
--点击全部按钮
function this:OnClickAllBtn()
this:SetSelectBtn()
local itemData = BagManager.GetEquipDataByEquipPosition(curHeroData.heroConfig.Profession)
this:SortEquipDatas(itemData)
local count = 0
for i=1,#itemData do
count = count + 1--itemData[i].num
end
--加上宝器数据
local curAllEquipTreasure = EquipTreasureManager.GetAllTreasures(curHeroData.heroConfig.PropertyName)
--宝器排序
for i = 1, #curAllEquipTreasure do
table.insert(itemData, curAllEquipTreasure[i])
end
--"装备数量:"
this.itemNumText.text = Language[12181] .. count + LengthOfTable(curAllEquipTreasure)
this:SetItemData(itemData)
end
-- --点击全部按钮
-- function this:OnClickAllBtn()
-- this:SetSelectBtn()
-- local itemData = BagManager.GetEquipDataByEquipPosition(curHeroData.heroConfig.Profession)
-- this:SortEquipDatas(itemData)
-- local count = 0
-- for i=1,#itemData do
-- count = count + 1--itemData[i].num
-- end
-- --加上宝器数据
-- local curAllEquipTreasure = EquipTreasureManager.GetAllTreasures(curHeroData.heroConfig.PropertyName)
-- --宝器排序
-- for i = 1, #curAllEquipTreasure do
-- table.insert(itemData, curAllEquipTreasure[i])
-- end
-- --"装备数量:"
-- this.itemNumText.text = Language[12181] .. count + LengthOfTable(curAllEquipTreasure)
-- this:SetItemData(itemData)
-- end
--点击装备按钮
function this:OnClickTabBtn(_index)
@ -1076,12 +1080,13 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure, _type, _selectEquipDataLi
this.ShowHeroEquip()
--上阵刷新红点
this.allEquipUpRedPoint:SetActive(#HeroManager.GetHeroIsUpEquip(curHeroData.dynamicId) > 0 and isUpZhen)
--刷新当前英雄可穿装备
if indexBtnNum == PosIdConst.All then
this:OnClickAllBtn()
else
this:OnClickTabBtn(indexBtnNum)
end
this:OnClickTabBtn(indexBtnNum)
-- --刷新当前英雄可穿装备
-- if indexBtnNum == PosIdConst.All then
-- this:OnClickAllBtn()
-- else
-- this:OnClickTabBtn(indexBtnNum)
-- end
--对比战力并更新战力值 播放战力变更动画
HeroManager.CompareWarPower(curHeroData.dynamicId)
end