From 44415cfded6e18737333f56be89bde98f5b641dc Mon Sep 17 00:00:00 2001 From: gaoxin Date: Tue, 2 Nov 2021 16:42:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E5=9D=90=E9=AA=91=E3=80=91?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B0=E5=9D=90=E9=AA=91=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=89=8D=E5=BE=80=EF=BC=8C=E5=B1=95=E7=A4=BA=E6=96=B0?= =?UTF-8?q?=E5=9D=90=E9=AA=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManagedResources/~Lua/Common/Managers.lua | 2 ++ .../~Lua/Modules/Bag/BagPanel.lua | 5 +++- .../Popup/RewardItemSingleShowPopup.lua | 4 +++ .../Setting/PlayerSetTitleRideSkinManager.lua | 27 +++++++++++++++++++ .../Modules/Setting/SettingPlayerRide.lua | 13 ++++----- 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/Managers.lua b/Assets/ManagedResources/~Lua/Common/Managers.lua index 210a236174..4f20df7970 100644 --- a/Assets/ManagedResources/~Lua/Common/Managers.lua +++ b/Assets/ManagedResources/~Lua/Common/Managers.lua @@ -212,6 +212,8 @@ local ManagerNames = { "GeneralPanel/GeneralTreasureMangaer", --御剑行管理器 "YuJianXing/YuJianXingManager", + --坐骑管理 + "Setting/PlayerSetTitleRideSkinManager", --!!!!红点管理(尽量放在最后)!!!!-- "Player/RedpotManager", } diff --git a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua index 3069edb476..2f826a521c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua @@ -871,7 +871,10 @@ function this.ShowWarPowerChange(powernum,type) elseif type== PowerChangeJumpType.title then str=Language[12291] end - MsgPanel.ShowTwo(str,nil,function() + MsgPanel.ShowTwo(str,function() + -- 所有坐骑设置为旧的 + PlayerSetTitleRideSkinManager.SetAllOldRide() + end,function() UIManager.OpenPanel(UIName.SettingPanel,type) end) end, 1):Start() diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua index 311a4f8d43..7ef44941e3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua @@ -208,6 +208,8 @@ function RewardItemSingleShowPopup:BindEvent() self:ClosePanel() PopupTipPanel.ShowTip(Language[12255]) this.WarPowerChange(oldPowerNum,PowerChangeJumpType.ride) + -- 设置新坐骑 + PlayerSetTitleRideSkinManager.SetNewRide(itemConfigData.Id) end) end) else @@ -216,6 +218,8 @@ function RewardItemSingleShowPopup:BindEvent() self:ClosePanel() PopupTipPanel.ShowTip(Language[12255]) this.WarPowerChange(oldPowerNum,PowerChangeJumpType.ride) + -- 设置新坐骑 + PlayerSetTitleRideSkinManager.SetNewRide(itemConfigData.Id) end) end elseif itemConfigData.ItemType == ItemType.Title then diff --git a/Assets/ManagedResources/~Lua/Modules/Setting/PlayerSetTitleRideSkinManager.lua b/Assets/ManagedResources/~Lua/Modules/Setting/PlayerSetTitleRideSkinManager.lua index ebe5948194..a0cc62f302 100644 --- a/Assets/ManagedResources/~Lua/Modules/Setting/PlayerSetTitleRideSkinManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Setting/PlayerSetTitleRideSkinManager.lua @@ -2,7 +2,34 @@ PlayerSetTitleRideSkinManager = {}; local this = PlayerSetTitleRideSkinManager function this.Initialize() + this.NewRide = {} +end +-- 设置刚刚获取到的坐骑是新的, +function this.SetNewRide(rideId) + this.NewRide[rideId] = 1 +end +-- 查看后设置为旧的 +function this.SetOldRide(rideId) + this.NewRide[rideId] = 0 +end +-- 查看后设置为旧的 +function this.SetAllOldRide() + for rideId, isNew in pairs(this.NewRide) do + this.NewRide[rideId] = 0 + end +end +-- 获取一个新坐骑 +function this.GetNewRide() + local newRideId = nil + for rideId, isNew in pairs(this.NewRide) do + if isNew == 1 then + if not newRideId or newRideId > rideId then + newRideId = rideId + end + end + end + return newRideId end return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Setting/SettingPlayerRide.lua b/Assets/ManagedResources/~Lua/Modules/Setting/SettingPlayerRide.lua index 2762db131b..dbef38fccf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Setting/SettingPlayerRide.lua +++ b/Assets/ManagedResources/~Lua/Modules/Setting/SettingPlayerRide.lua @@ -102,23 +102,24 @@ end --显示信息 function this.ShowPanelData() local rideList = ConfigManager.GetAllConfigsDataByKey(ConfigName.PlayerHeadIcon,"Type",PlayerHeadIconType.Ride) - -- 排序 + -- 排序,已解锁的放前面 table.sort(rideList, function(a, b) - Log(a.Id.."|"..b.Id) if PlayerManager.userMountList[a.Id] and not PlayerManager.userMountList[b.Id] then - Log("true") return true elseif not PlayerManager.userMountList[a.Id] and PlayerManager.userMountList[b.Id] then - Log("false") return false else - Log("ID:"..tostring(a.Id < b.Id)) return a.Id < b.Id end end) --设置选中 + local newRideId = PlayerSetTitleRideSkinManager.GetNewRide() local curUserRideId = PlayerManager.GetPlayerRide() - if curUserRideId > 0 then + if newRideId and newRideId > 0 then + curUserRideConFig = ConfigManager.GetConfigData(ConfigName.PlayerHeadIcon,newRideId) + -- 所有坐骑设置为旧的 + PlayerSetTitleRideSkinManager.SetAllOldRide() + elseif curUserRideId and curUserRideId > 0 then curUserRideConFig = ConfigManager.GetConfigData(ConfigName.PlayerHeadIcon,curUserRideId) else curUserRideConFig = rideList[1] From d43b8282ec1d480ce4e5f677d39b491be464c22a Mon Sep 17 00:00:00 2001 From: gaoxin Date: Tue, 2 Nov 2021 16:57:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90ID1010611=E3=80=91=E3=80=90?= =?UTF-8?q?=E8=A3=85=E5=A4=87=E5=90=88=E6=88=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E5=90=88=E6=88=90=E8=A3=85=E5=A4=87=E5=90=8E=EF=BC=8C=E4=B8=8B?= =?UTF-8?q?=E6=96=B9=E7=9A=84=E8=A3=85=E5=A4=87=E5=88=97=E8=A1=A8=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E9=87=8D=E7=BD=AE=E5=9B=9E=E9=BB=98=E8=AE=A4=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Compound/view/CompoundPanel_Equip.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua index b33598f0fe..e75ec2ed27 100644 --- a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua +++ b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua @@ -112,7 +112,7 @@ function this:OnSortingOrderChange(_sortingOrder) Util.AddParticleSortLayer(v, _sortingOrder - sortingOrder ) end end -function this.OnClickTabBtn(_curIndex) +function this.OnClickTabBtn(_curIndex, isNotTop,isNotAni) curIndex = _curIndex bagPosEquips = EquipManager.GetEquipCompoundDataByEquipPosition1(curIndex) local equipDatas = EquipManager.GetAllSEquipsByPosition(curIndex) @@ -123,7 +123,7 @@ function this.OnClickTabBtn(_curIndex) this.ScrollView:SetData(equipDatas, function (index, go) this.SingleItemDataShow(go, equipDatas[index],equipStarsConfig[equipDatas[index].Star]) - end) + end, isNotTop, isNotAni) this.ShowTitleData(equipStarsConfig[curSelectEquip.Star]) end @@ -306,7 +306,7 @@ function this.Compound() SoundManager.PlaySound(SoundConfig.UI_Duanzao) -- SoundManager.PlaySound(SoundConfig.UI_Baoqi) UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() - this.OnClickTabBtn(curIndex) + this.OnClickTabBtn(curIndex, true, true) end) end) end @@ -398,7 +398,7 @@ function this.AutoCompound(_position) NetManager.ComplexEquipRequest(curIndex,0,0,function(msg) SoundManager.PlaySound(SoundConfig.UI_Duanzao) SoundManager.PlaySound(SoundConfig.UI_Baoqi) - this.OnClickTabBtn(curIndex) + this.OnClickTabBtn(curIndex, true, true) UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() end) end)