diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/UpStarGift.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/UpStarGift.lua index e458d854fc..c7c63485c6 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/UpStarGift.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/UpStarGift.lua @@ -74,6 +74,7 @@ function UpStarGift:BindEvent() -- 打开选择界面 UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.ChooseUpHero, heroList, choose, function(chooseId) self.tempChoose = chooseId + PlayerPrefs.SetInt(PlayerManager.uid.."_UpStarGift_TempChoose", chooseId) -- 刷新界面限显示 self:RefreshData(true,true,true) end, "选择神将") @@ -95,7 +96,7 @@ function UpStarGift:BindEvent() -- 打开选择界面 UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.ChooseUpHero, heroList, choose, function(chooseId) self.tempChoose = chooseId - + PlayerPrefs.SetInt(PlayerManager.uid.."_UpStarGift_TempChoose", chooseId) -- 刷新界面限显示 self:RefreshData(true,true,true) end, "选择神将") @@ -117,7 +118,7 @@ function UpStarGift:BindEvent() LogError("未找到神将:"..tostring(choose)) return end - local msg = string.format("%s\n将锁定为本次活动的指定神将\n\n锁定后无法修改", con.ReadingName) + local msg = string.format("%s将锁定为本次活动的指定神将,锁定后无法修改。", con.ReadingName) MsgPanel.ShowTwo(msg, nil, function() NetManager.UpStarActivitySelectRequest(self.actId, choose, function() PopupTipPanel.ShowTip("锁定成功") @@ -132,6 +133,8 @@ function UpStarGift:OnOpen(_activityConfig,_index,parent) self.pageIndex = _index self.parent = parent self.gameObject.name = "CommonActPage"..self.actConfig.Id + + self.tempChoose = PlayerPrefs.GetInt(PlayerManager.uid.."_UpStarGift_TempChoose", 0) end function UpStarGift:OnSortingOrderChange() @@ -256,6 +259,12 @@ function UpStarGift:GetCurChooseHero() isTemp = false end if choose == 0 and self.tempChoose and self.tempChoose ~= 0 then + -- 检测一遍临时选择的正确性,选择的人物保存到本地,这里是为了防止两期活动数据冲突 + local heroList = self:GetHeroList() + if table.indexof(heroList, self.tempChoose) then + self.tempChoose = 0 + end + -- choose = self.tempChoose isTemp = true end