【幸运探宝优化】界面显示规则优化
parent
1e83996522
commit
778f2360a7
|
@ -145,7 +145,7 @@ function LuckyTurnTablePanel:BindEvent()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.btnPreview, function()
|
Util.AddClick(this.btnPreview, function()
|
||||||
UIManager.OpenPanel(UIName.RewardPreviewPopup, PRE_REWARD_POOL_TYPE.LUCK_FIND)
|
UIManager.OpenPanel(UIName.RewardPreviewPopup, LuckyTurnTableManager.curTreasureType == TreasureType.Lucky and PRE_REWARD_POOL_TYPE.LUCK_FIND or PRE_REWARD_POOL_TYPE.UPPER_LUCK_FIND)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ function this.InitPreData()
|
||||||
this.previewElementData={}
|
this.previewElementData={}
|
||||||
this.previewLuckData = {} --- 幸运探宝
|
this.previewLuckData = {} --- 幸运探宝
|
||||||
this.previewLingShou={} --灵兽奖励数据
|
this.previewLingShou={} --灵兽奖励数据
|
||||||
-- this.previewGhostFindData = {}
|
this.previewGhostFindData = {}
|
||||||
-- this.previewTimeLimitedData = {}--限时招募
|
-- this.previewTimeLimitedData = {}--限时招募
|
||||||
-- this.previewTimeLimitedUPData={}
|
-- this.previewTimeLimitedUPData={}
|
||||||
-- this.previewLotterySoulData = {}--乾坤宝囊其他奖励
|
-- this.previewLotterySoulData = {}--乾坤宝囊其他奖励
|
||||||
|
@ -123,19 +123,26 @@ function this.InitPreData()
|
||||||
table.insert(this.previewLingShou,v)
|
table.insert(this.previewLingShou,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for key, value in ConfigPairs(dailyRewardConfig) do
|
for key, value in ConfigPairs(dailyRewardConfig) do
|
||||||
table.insert( this.previewLuckData, value)
|
if value.ActivityId == 30 then
|
||||||
|
table.insert( this.previewLuckData, value)
|
||||||
|
else
|
||||||
|
table.insert( this.previewGhostFindData, value)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if #this.previewLuckData > 1 then
|
if #this.previewLuckData > 1 then
|
||||||
table.sort(this.previewLuckData, function(a, b)
|
table.sort(this.previewLuckData, function(a, b)
|
||||||
if itemConfig[a.Reward[1]].Quantity == itemConfig[b.Reward[1]].Quantity then
|
return a.Rank < b.Rank
|
||||||
return a.Reward[1] > b.Reward[1]
|
|
||||||
else
|
|
||||||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if #this.previewGhostFindData > 1 then
|
||||||
|
table.sort(this.previewGhostFindData, function(a, b)
|
||||||
|
return a.Rank < b.Rank
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
--灵兽奖品排序
|
--灵兽奖品排序
|
||||||
if #this.previewLingShou > 1 then
|
if #this.previewLingShou > 1 then
|
||||||
table.sort(this.previewLingShou, function(a, b)
|
table.sort(this.previewLingShou, function(a, b)
|
||||||
|
@ -219,8 +226,8 @@ function this.GetRewardPreviewData(type)
|
||||||
return this.previewElementData
|
return this.previewElementData
|
||||||
elseif type == PRE_REWARD_POOL_TYPE.LUCK_FIND then--常驻
|
elseif type == PRE_REWARD_POOL_TYPE.LUCK_FIND then--常驻
|
||||||
return this.previewLuckData
|
return this.previewLuckData
|
||||||
-- elseif type == PRE_REWARD_POOL_TYPE.GHOST_FIND then--常驻
|
elseif type == PRE_REWARD_POOL_TYPE.UPPER_LUCK_FIND then--常驻
|
||||||
-- return this.previewGhostFindData
|
return this.previewGhostFindData
|
||||||
elseif type ==PRE_REWARD_POOL_TYPE.FRIEND then--常驻
|
elseif type ==PRE_REWARD_POOL_TYPE.FRIEND then--常驻
|
||||||
return this.previewFriendData
|
return this.previewFriendData
|
||||||
elseif type==PRE_REWARD_POOL_TYPE.NORMAL then--常驻
|
elseif type==PRE_REWARD_POOL_TYPE.NORMAL then--常驻
|
||||||
|
|
|
@ -50,8 +50,8 @@ function RewardPreviewPopup:OnOpen(type)
|
||||||
this.tabBox:SetActive(false)
|
this.tabBox:SetActive(false)
|
||||||
this.previewRoot:SetActive(true)
|
this.previewRoot:SetActive(true)
|
||||||
this.grid.transform:DOAnchorPosY(0, 0, true)
|
this.grid.transform:DOAnchorPosY(0, 0, true)
|
||||||
if type == PRE_REWARD_POOL_TYPE.LUCK_FIND then
|
if type == PRE_REWARD_POOL_TYPE.LUCK_FIND or type == PRE_REWARD_POOL_TYPE.UPPER_LUCK_FIND then
|
||||||
typeNum = 2
|
typeNum = 1
|
||||||
elseif type == PRE_REWARD_POOL_TYPE.GHOST_FIND then
|
elseif type == PRE_REWARD_POOL_TYPE.GHOST_FIND then
|
||||||
typeNum = 4
|
typeNum = 4
|
||||||
elseif type==PRE_REWARD_POOL_TYPE.LING_SHOU then
|
elseif type==PRE_REWARD_POOL_TYPE.LING_SHOU then
|
||||||
|
@ -80,9 +80,21 @@ function this.CreatePreview(typeNum, type)
|
||||||
value.gameObject:SetActive(false)
|
value.gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for key, value in pairs(this.List3) do
|
||||||
|
if value then
|
||||||
|
value.gameObject:SetActive(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for key, value in pairs(this.List4) do
|
||||||
|
if value then
|
||||||
|
value.gameObject:SetActive(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if type == PRE_REWARD_POOL_TYPE.LUCK_FIND then
|
if type == PRE_REWARD_POOL_TYPE.LUCK_FIND then
|
||||||
this.CreateLuckInfo(showData)
|
this.CreateLuckInfo(showData,Language[11709])
|
||||||
|
elseif type == PRE_REWARD_POOL_TYPE.UPPER_LUCK_FIND then
|
||||||
|
this.CreateLuckInfo(showData,Language[11710])
|
||||||
elseif type == PRE_REWARD_POOL_TYPE.GHOST_FIND then
|
elseif type == PRE_REWARD_POOL_TYPE.GHOST_FIND then
|
||||||
this.previewList[4].gameObject:SetActive(false)
|
this.previewList[4].gameObject:SetActive(false)
|
||||||
this.CreateEastGhostInfo(showData)
|
this.CreateEastGhostInfo(showData)
|
||||||
|
@ -92,8 +104,8 @@ function this.CreatePreview(typeNum, type)
|
||||||
-- 显隐显示
|
-- 显隐显示
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
if this.previewList[i] then
|
if this.previewList[i] then
|
||||||
if type == PRE_REWARD_POOL_TYPE.LUCK_FIND then
|
if type == PRE_REWARD_POOL_TYPE.LUCK_FIND or type == PRE_REWARD_POOL_TYPE.UPPER_LUCK_FIND then
|
||||||
this.previewList[i]:SetActive(i <= 2)
|
this.previewList[i]:SetActive(i <= 1)
|
||||||
elseif type == PRE_REWARD_POOL_TYPE.GHOST_FIND then
|
elseif type == PRE_REWARD_POOL_TYPE.GHOST_FIND then
|
||||||
this.previewList[i]:SetActive(i <= 3)
|
this.previewList[i]:SetActive(i <= 3)
|
||||||
elseif type== PRE_REWARD_POOL_TYPE.LING_SHOU then
|
elseif type== PRE_REWARD_POOL_TYPE.LING_SHOU then
|
||||||
|
@ -106,21 +118,8 @@ function this.CreatePreview(typeNum, type)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 幸运探宝
|
-- 幸运探宝
|
||||||
function this.CreateLuckInfo(showData)
|
function this.CreateLuckInfo(normalData,title)
|
||||||
Util.GetGameObject(this.previewList[1], "title/Text"):GetComponent("Text").text = Language[11709]
|
Util.GetGameObject(this.previewList[1], "title/Text"):GetComponent("Text").text = title
|
||||||
Util.GetGameObject(this.previewList[2], "title/Text"):GetComponent("Text").text = Language[11710]
|
|
||||||
|
|
||||||
local normalData = {}
|
|
||||||
local upperData = {}
|
|
||||||
|
|
||||||
for i = 1, #showData do
|
|
||||||
if showData[i].ActivityId == 30 then -- 幸运探宝
|
|
||||||
normalData[#normalData + 1] = showData[i]
|
|
||||||
elseif showData[i].ActivityId == 31 then
|
|
||||||
upperData[#upperData + 1] = showData[i]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for i = 1, #normalData do
|
for i = 1, #normalData do
|
||||||
if not this.List1[i] then
|
if not this.List1[i] then
|
||||||
this.List1[i] =
|
this.List1[i] =
|
||||||
|
@ -131,17 +130,6 @@ function this.CreateLuckInfo(showData)
|
||||||
string.format("<color=#EDB64C>%0.2f%s</color>", normalData[i].ShowWeight, "%")
|
string.format("<color=#EDB64C>%0.2f%s</color>", normalData[i].ShowWeight, "%")
|
||||||
this.List1[i].gameObject:SetActive(true)
|
this.List1[i].gameObject:SetActive(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1, #upperData do
|
|
||||||
if not this.List2[i] then
|
|
||||||
this.List2[i] =
|
|
||||||
SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(this.previewList[2], "gird").transform)
|
|
||||||
end
|
|
||||||
this.List2[i]:OnOpen(false, {upperData[i].Reward[1], upperData[i].Reward[2]}, 1.1, true)
|
|
||||||
this.List2[i].name:GetComponent("Text").text =
|
|
||||||
string.format("<color=#EDB64C>%0.2f%s</color>", upperData[i].ShowWeight, "%")
|
|
||||||
this.List2[i].gameObject:SetActive(true)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 灵兽数据
|
-- 灵兽数据
|
||||||
|
|
|
@ -85,6 +85,7 @@ end
|
||||||
function TreasureStorePopup:RefreshPanel(isAni)
|
function TreasureStorePopup:RefreshPanel(isAni)
|
||||||
local allData = {}
|
local allData = {}
|
||||||
local curActId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureStore)
|
local curActId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureStore)
|
||||||
|
LogGreen("curActId:"..curActId)
|
||||||
if not curActId then
|
if not curActId then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue