diff --git a/Assets/ManagedResources/~Lua/Common/functions.lua b/Assets/ManagedResources/~Lua/Common/functions.lua index 25be61d94..d8fda3335 100644 --- a/Assets/ManagedResources/~Lua/Common/functions.lua +++ b/Assets/ManagedResources/~Lua/Common/functions.lua @@ -1049,6 +1049,8 @@ function GetEquipPosStrByEquipPosNum(_index) return GetLanguageStrById(50532) elseif _index == 8 then return GetLanguageStrById(50533) + elseif _index == 9 then + return GetLanguageStrById(1012392) end end diff --git a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Gift.lua b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Gift.lua index 69c644a73..a8ab11c92 100644 --- a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Gift.lua +++ b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Gift.lua @@ -53,14 +53,16 @@ function this:BindEvent() end) Util.AddLongPressClick(needSoulPrint[i], function() if selectUpList[i]~=0 then - UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,{id=selectUpList[i],num=0},0,false,nil,nil,4) + --UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,{id=selectUpList[i],num=0},0,false,nil,nil,4) + UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,{id=selectUpList[i],num=0}) end end, 0.5) end Util.AddClick(this.compoundSoulPrintBtn, function() --UIManager.OpenPanel(UIName.SoulPrintPopUp,0,nil,curSelectSoulPrint.Id,nil,nil) - UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,{id=curSelectSoulPrint.Id,num=0},0,false,nil,nil,4) + --UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,{id=curSelectSoulPrint.Id,num=0},0,false,nil,nil,4) + UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,{id=curSelectSoulPrint.Id,num=0}) end) end diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua index a3bb308a9..541df6b5e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua @@ -9,6 +9,7 @@ local curSuitProGo = {}--当前套装属性对象 local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig) local _MainProList = {} local isShowfenjie = true +local isDown = false --初始化组件(用于子类重写) function RewardEquipSingleShowPopup2:InitComponent() this.eqiopName = Util.GetGameObject(self.transform, "bg/Content/armorInfo/name"):GetComponent("Text") @@ -43,6 +44,7 @@ function RewardEquipSingleShowPopup2:InitComponent() -- this.btnSure = Util.GetGameObject(self.transform, "Content/bg/btnGrid/btnSure") -- this.btnJump = Util.GetGameObject(self.transform, "Content/bg/btnGrid/btnJump") this.btnSure = Util.GetGameObject(self.transform, "bg/Content/btnGrid/btnSure") + this.btnDown = Util.GetGameObject(self.transform, "bg/Content/btnGrid/btnDown") this.btnJump = Util.GetGameObject(self.transform, "bg/Content/btnGrid/btnJump") this.btnLock = Util.GetGameObject(self.transform, "bg/Content/btnLock") this.upLockImage = Util.GetGameObject(self.transform, "bg/Content/btnLock/upLock") @@ -67,33 +69,85 @@ function RewardEquipSingleShowPopup2:BindEvent() end end) Util.AddClick(this.btnSure, function() - --数量大于1 ,弹选择框 - if BagManager.GetItemCountById(equipData.id) > 1 then - UIManager.OpenPanel(UIName.GeneralPopup, GENERAL_POPUP_TYPE.EquipSingleSell, equipData, func) - this:ClosePanel() - elseif BagManager.GetItemCountById(equipData.id) == 1 then - --只有一个,分解品质大于4, 弹框 - if equipData.itemConfig.Quantity >= 4 then - UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 2, equipData.itemConfig.ItemBaseType, equipData, function () - if func then - func() - end - end) + --装备逻辑 + if equipConfigData.Position==9 then + local idList={} + table.insert(idList,self.equipData.id) + local heroId="" + if self.curHeroData then + heroId=self.curHeroData.dynamicId + local list=GiftManager.GetHeroGifts(heroId) + if #list >= 12 then + PopupTipPanel.ShowTip("礼物数量已达上限!") + return + end + else - local curResolveAllItemList={} - local equip = {} - equip.itemId = equipData.id - equip.itemNum = 1 - table.insert(curResolveAllItemList,equip) - local type = 1 - NetManager.UseAndPriceItemRequest(type,curResolveAllItemList,function (drop) - this.SendBackResolveReCallBack(drop) - end) + heroId="0" + local list=GiftManager.GetPlayerGifts() + if #list >= 12 then + PopupTipPanel.ShowTip("礼物数量已达上限!") + return + end end + NetManager.GiftEquipWearRequest(1,heroId,idList,function() + self:ClosePanel() + if heroId=="0" then + GiftManager.SetPlayerGift(idList) + HeroManager.ChangeAllHeroGiftLV() + else + GiftManager.SetHeroGift(self.curHeroData.dynamicId,idList,1) + end + self.parent.RefreshWindowData() + end) else - PopupTipPanel.ShowTipByLanguageId(12265) + local equipIdList={} + local equipDataList={} + table.insert(equipIdList,tostring(self.equipData.id)) + table.insert(equipDataList,self.equipData) + NetManager.EquipWearRequest(self.curHeroData.dynamicId,equipIdList,1,function () + self:ClosePanel() + self.parent.UpdateEquipPosHeroData(1,typeToUpdate[self.openType],equipDataList,0,self.position) + end) + end end) + Util.AddClick(this.btnDown, function() + --卸下逻辑 + if equipConfigData.Position==9 then + local idList={} + local heroId="" + if self.curHeroData then + heroId=self.curHeroData.dynamicId + else + heroId="0" + end + LogError("2222222222222222222222"..heroId) + LogError("self.equipData.id==="..self.equipData.id) + + table.insert(idList,self.equipData.id) + --table.insert(idList,5200020) + NetManager.GiftEquipWearRequest(2,heroId,idList,function() + self:ClosePanel() + if heroId=="0" then + GiftManager.RemovePlayerGift(idList) + HeroManager.ChangeAllHeroGiftLV() + else + GiftManager.SetHeroGift(self.curHeroData.dynamicId,idList,2) + end + self.parent.RefreshWindowData() + end) + else + local equipIdList={} + local equipDataList={} + table.insert(equipIdList,tostring(self.equipData.id)) + table.insert(equipDataList,self.equipData) + NetManager.EquipUnLoadOptRequest(self.curHeroData.dynamicId,equipIdList ,1, function () + self:ClosePanel() + self.parent.UpdateEquipPosHeroData(1,typeToUpdate[self.openType],equipDataList) + end) + end + end) Util.AddClick(this.btnLock, function() self:OnLockClickEvent() end) @@ -108,7 +162,7 @@ function RewardEquipSingleShowPopup2:RemoveListener() end --界面打开时调用(用于子类重写) -function RewardEquipSingleShowPopup2:OnOpen(_equipData, _func,_isRewardItemPop,_isShowfenjie) +function RewardEquipSingleShowPopup2:OnOpen(_equipData, _func,_isRewardItemPop,_isShowfenjie,_isDown) if not _equipData then return end @@ -116,12 +170,14 @@ function RewardEquipSingleShowPopup2:OnOpen(_equipData, _func,_isRewardItemPop,_ func = _func isRewardItemPop = _isRewardItemPop and _isRewardItemPop or false isShowfenjie = not not (_isShowfenjie or false) + isDown = _isDown and _isDown or false end function RewardEquipSingleShowPopup2:OnShow() --装备基础信息 local equipConfigData = ConfigManager.GetConfigData(ConfigName.EquipConfig, tonumber(equipData.id)) local itemConfigData = ConfigManager.GetConfigData(ConfigName.ItemConfig, tonumber(equipData.id)) this.btnSure:SetActive(isShowfenjie) + this.btnDown:SetActive(isDown) --local curEquipData = {} -- if func and itemConfigData.IfResolve==1 then -- curEquipData = EquipManager.GetSingleEquipData(equipData.id) diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua index 9fcf1001d..9586ac308 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua @@ -370,7 +370,8 @@ function this.SingleUpItemShow(_go,data,_index) return end BagManager.isBagPanel=false - UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,data,2,false,nil,curHeroData,4) + --UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,data,2,false,nil,curHeroData,4) + UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,data,nil,false,false,true) end ) else @@ -475,7 +476,8 @@ function this.SingleItemDataShow(_go, _itemData) if isHave then UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,_itemData,6,false,nil,curHeroData,4) else - UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,_itemData,3,false,nil,curHeroData,4) + --UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,_itemData,3,false,nil,curHeroData,4) + UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,_itemData,false,true) end end )