diff --git a/Assets/ManagedResources/Prefabs/UI/RoleInfo/RoleEquipPanel.prefab b/Assets/ManagedResources/Prefabs/UI/RoleInfo/RoleEquipPanel.prefab index b9802d7a9b..eec3ccb7c0 100644 --- a/Assets/ManagedResources/Prefabs/UI/RoleInfo/RoleEquipPanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/RoleInfo/RoleEquipPanel.prefab @@ -144984,7 +144984,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !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: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 97.10004, y: -82} - m_SizeDelta: {x: 155, y: 85} + 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_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1834664782885917125 CanvasRenderer: diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua index 377ebe1828..7774246785 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua @@ -32,7 +32,7 @@ local curHeroData local heroListData local curSelectEquipData local index -local indexBtnNum = 1 +local indexBtnNum = 0 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 = 1, 6 do + for i = 0, 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 = 1, 6 do + for i = 0, 6 do Util.AddClick( tabs[i], function() @@ -201,12 +201,11 @@ function RoleEquipPanel:BindEvent() return end indexBtnNum = i - this:OnClickTabBtn(indexBtnNum) - -- if indexBtnNum == PosIdConst.All then - -- this:OnClickAllBtn() - -- else - -- this:OnClickTabBtn(indexBtnNum) - -- end + if indexBtnNum == PosIdConst.All then + this:OnClickAllBtn() + else + this:OnClickTabBtn(indexBtnNum) + end end ) end @@ -248,12 +247,11 @@ end function this.CurrEquipDataChange() this.ShowHeroEquip() - this:OnClickTabBtn(indexBtnNum) - -- if indexBtnNum == PosIdConst.All then - -- this:OnClickAllBtn() - -- else - -- this:OnClickTabBtn(indexBtnNum) - -- end + if indexBtnNum == PosIdConst.All then + this:OnClickAllBtn() + else + this:OnClickTabBtn(indexBtnNum) + end end --界面打开时调用(用于子类重写) @@ -286,10 +284,10 @@ function RoleEquipPanel:OnShow() effectList[i]:SetActive(false) end end - indexBtnNum = PosIdConst.WuQi + indexBtnNum = PosIdConst.All teamHero = FormationManager.GetAllMainFormationHeroId() this.ShowHeroEquip(true) - this:OnClickTabBtn(indexBtnNum) + this:OnClickAllBtn() this.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main}) end @@ -303,24 +301,22 @@ function this:RightBtnOnClick() index = (index + 1 <= #heroListData and index + 1 or 1) curHeroData = heroListData[index] this.ShowHeroEquip() - this:OnClickTabBtn(indexBtnNum) - -- if indexBtnNum == PosIdConst.All then - -- this:OnClickAllBtn() - -- else - -- this:OnClickTabBtn(indexBtnNum) - -- end + 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() - this:OnClickTabBtn(indexBtnNum) - -- if indexBtnNum == PosIdConst.All then - -- this:OnClickAllBtn() - -- else - -- this:OnClickTabBtn(indexBtnNum) - -- end + if indexBtnNum == PosIdConst.All then + this:OnClickAllBtn() + else + this:OnClickTabBtn(indexBtnNum) + end end --一键装备 @@ -720,25 +716,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) @@ -1080,13 +1076,12 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure, _type, _selectEquipDataLi this.ShowHeroEquip() --上阵刷新红点 this.allEquipUpRedPoint:SetActive(#HeroManager.GetHeroIsUpEquip(curHeroData.dynamicId) > 0 and isUpZhen) - this:OnClickTabBtn(indexBtnNum) - -- --刷新当前英雄可穿装备 - -- if indexBtnNum == PosIdConst.All then - -- this:OnClickAllBtn() - -- else - -- this:OnClickTabBtn(indexBtnNum) - -- end + --刷新当前英雄可穿装备 + if indexBtnNum == PosIdConst.All then + this:OnClickAllBtn() + else + this:OnClickTabBtn(indexBtnNum) + end --对比战力并更新战力值 播放战力变更动画 HeroManager.CompareWarPower(curHeroData.dynamicId) end