【幸运探宝】进度条奖励包装显示修改
parent
fe996d3e54
commit
4af21bc33d
Binary file not shown.
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 30 KiB |
File diff suppressed because it is too large
Load Diff
|
@ -139,9 +139,9 @@ function this.InitActivityServerData(msg, isUpdate)
|
||||||
this.CheckMoneyProgress(v)
|
this.CheckMoneyProgress(v)
|
||||||
this.mission[v.activityId] = v
|
this.mission[v.activityId] = v
|
||||||
|
|
||||||
LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value)
|
-- LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value)
|
||||||
for n, m in ipairs(v.mission) do
|
for n, m in ipairs(v.mission) do
|
||||||
LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress)
|
-- LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress)
|
||||||
if (v.activityId == ActivityTypeDef.OnlineGift) then
|
if (v.activityId == ActivityTypeDef.OnlineGift) then
|
||||||
this.onlineOpen = true
|
this.onlineOpen = true
|
||||||
this.onlineGetRewardState[m.missionId] = m.state
|
this.onlineGetRewardState[m.missionId] = m.state
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
--local LuckyTurnTablePanel= quick_class("LuckyTurnTablePanel")
|
require("Base/BasePanel")
|
||||||
--local this = LuckyTurnTablePanel
|
|
||||||
--function LuckyTurnTablePanel:ctor(mainPanel, gameObject)
|
|
||||||
-- self.mainPanel = mainPanel
|
|
||||||
-- self.gameObject = gameObject
|
|
||||||
-- self:InitComponent(gameObject)
|
|
||||||
-- self:BindEvent()
|
|
||||||
--end
|
|
||||||
require("Base/BasePanel")
|
|
||||||
LuckyTurnTablePanel = Inherit(BasePanel)
|
LuckyTurnTablePanel = Inherit(BasePanel)
|
||||||
local this = LuckyTurnTablePanel
|
local this = LuckyTurnTablePanel
|
||||||
|
|
||||||
|
@ -105,14 +97,16 @@ function LuckyTurnTablePanel:InitComponent(gameObject)
|
||||||
for i=1,5 do
|
for i=1,5 do
|
||||||
this.rewardBoxList[i]=Util.GetGameObject(this.rewardBox,"Item"..i)
|
this.rewardBoxList[i]=Util.GetGameObject(this.rewardBox,"Item"..i)
|
||||||
end
|
end
|
||||||
this.rewardPanel=Util.GetGameObject(this.slider,"RewardPanel")--幸运值奖励预览面板
|
-- this.rewardPanel=Util.GetGameObject(this.slider,"RewardPanel")--幸运值奖励预览面板
|
||||||
this.itemViewParent=Util.GetGameObject(this.rewardPanel,"ItemViewParent")--item父物体
|
-- this.itemViewParent=Util.GetGameObject(this.rewardPanel,"ItemViewParent")--item父物体
|
||||||
this.rewardPanelMaskBtn=Util.GetGameObject(this.rewardPanel,"Mask")--幸运值奖励预览遮罩按钮
|
-- this.rewardPanelMaskBtn=Util.GetGameObject(this.rewardPanel,"Mask")--幸运值奖励预览遮罩按钮
|
||||||
this.rewardItemView=SubUIManager.Open(SubUIConfig.ItemView,this.itemViewParent.transform)
|
-- this.rewardItemView=SubUIManager.Open(SubUIConfig.ItemView,this.itemViewParent.transform)
|
||||||
|
|
||||||
-- 奖励预览
|
-- 奖励预览
|
||||||
this.btnPreview = Util.GetGameObject(self.gameObject, "Panel/Top/btnPreview")
|
this.btnPreview = Util.GetGameObject(self.gameObject, "Panel/Top/btnPreview")
|
||||||
this.maxTimes = Util.GetGameObject(self.gameObject, "Panel/maxTimes"):GetComponent("Text")
|
this.maxTimes = Util.GetGameObject(self.gameObject, "Panel/maxTimes"):GetComponent("Text")
|
||||||
|
|
||||||
|
this.itemRewardList = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
---绑定事件(用于子类重写)
|
---绑定事件(用于子类重写)
|
||||||
|
@ -143,10 +137,10 @@ function LuckyTurnTablePanel:BindEvent()
|
||||||
this.SwitchTreasureType(TreasureType.Advanced)
|
this.SwitchTreasureType(TreasureType.Advanced)
|
||||||
end)
|
end)
|
||||||
--幸运值奖励预览遮罩按钮
|
--幸运值奖励预览遮罩按钮
|
||||||
Util.AddClick(this.rewardPanelMaskBtn, function()
|
-- Util.AddClick(this.rewardPanelMaskBtn, function()
|
||||||
this.rewardPanelMaskBtn.gameObject:SetActive(false)
|
-- this.rewardPanelMaskBtn.gameObject:SetActive(false)
|
||||||
this.rewardPanel.gameObject:SetActive(false)
|
-- this.rewardPanel.gameObject:SetActive(false)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
Util.AddClick(this.btnPreview, function()
|
Util.AddClick(this.btnPreview, function()
|
||||||
UIManager.OpenPanel(UIName.RewardPreviewPopup, LuckyTurnTableManager.curTreasureType == TreasureType.Lucky and PRE_REWARD_POOL_TYPE.LUCK_FIND or PRE_REWARD_POOL_TYPE.UPPER_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)
|
||||||
|
@ -199,7 +193,7 @@ end
|
||||||
function LuckyTurnTablePanel:OnClose()
|
function LuckyTurnTablePanel:OnClose()
|
||||||
--Log("==YSP== 关闭幸运转盘")
|
--Log("==YSP== 关闭幸运转盘")
|
||||||
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
||||||
this.rewardPanel.gameObject:SetActive(false)
|
-- this.rewardPanel.gameObject:SetActive(false)
|
||||||
if this.thread then
|
if this.thread then
|
||||||
coroutine.stop(this.thread)
|
coroutine.stop(this.thread)
|
||||||
this.thread=nil
|
this.thread=nil
|
||||||
|
@ -228,7 +222,8 @@ end
|
||||||
function LuckyTurnTablePanel:OnDestroy()
|
function LuckyTurnTablePanel:OnDestroy()
|
||||||
this.spLoader:Destroy()
|
this.spLoader:Destroy()
|
||||||
this.itemViewList=nil
|
this.itemViewList=nil
|
||||||
this.rewardItemView=nil
|
this.itemRewardList = {}
|
||||||
|
-- this.rewardItemView=nil
|
||||||
SubUIManager.Close(this.upView)
|
SubUIManager.Close(this.upView)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -742,8 +737,16 @@ end
|
||||||
function this.SetRewardBox()
|
function this.SetRewardBox()
|
||||||
if LuckyTurnTableManager.curTreasureType==TreasureType.Lucky then
|
if LuckyTurnTableManager.curTreasureType==TreasureType.Lucky then
|
||||||
for i = 1, 5 do
|
for i = 1, 5 do
|
||||||
this.rewardBoxList[i]:GetComponent("Image").sprite=SetIcon(this.spLoader, LuckyTurnTableManager.boxReward_One[i].Reward[1][1])
|
local BG = Util.GetGameObject(this.rewardBoxList[i],"BG"):GetComponent("Image")
|
||||||
Util.GetGameObject(this.rewardBoxList[i],"Value"):GetComponent("Text").text=LuckyTurnTableManager.boxReward_One[i].Values[1][1]
|
BG.sprite = SetIcon(this.spLoader, LuckyTurnTableManager.boxReward_One[i].Reward[1][1])
|
||||||
|
Util.GetGameObject(this.rewardBoxList[i],"Value"):GetComponent("Text").text =LuckyTurnTableManager.boxReward_One[i].Values[1][1]
|
||||||
|
Util.GetGameObject(this.rewardBoxList[i],"Num/Text"):GetComponent("Text").text =LuckyTurnTableManager.boxReward_One[i].Reward[1][2]
|
||||||
|
|
||||||
|
if not this.itemRewardList[i] then
|
||||||
|
this.itemRewardList[i] = SubUIManager.Open(SubUIConfig.ItemView,BG.transform)
|
||||||
|
end
|
||||||
|
this.itemRewardList[i]:OnOpen(false, LuckyTurnTableManager.boxReward_One[i].Reward[1],1, false, false, false, sortingOrder)
|
||||||
|
this.itemRewardList[i].gameObject:SetActive(false)
|
||||||
|
|
||||||
--显示奖盒红点
|
--显示奖盒红点
|
||||||
if LuckyTurnTableManager.value_1>=LuckyTurnTableManager.boxReward_One[i].Values[1][1] then
|
if LuckyTurnTableManager.value_1>=LuckyTurnTableManager.boxReward_One[i].Values[1][1] then
|
||||||
|
@ -751,8 +754,7 @@ function this.SetRewardBox()
|
||||||
Util.GetGameObject(this.rewardBoxList[i],"redPoint"):SetActive(true)
|
Util.GetGameObject(this.rewardBoxList[i],"redPoint"):SetActive(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Util.AddOnceClick(BG.gameObject, function()
|
||||||
Util.AddOnceClick(this.rewardBoxList[i], function()
|
|
||||||
--Log("==YSP==点击幸运探宝奖励盒"..i)
|
--Log("==YSP==点击幸运探宝奖励盒"..i)
|
||||||
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
||||||
--如果幸运值达到奖励要求值
|
--如果幸运值达到奖励要求值
|
||||||
|
@ -765,25 +767,34 @@ function this.SetRewardBox()
|
||||||
this.RrFreshInfo()
|
this.RrFreshInfo()
|
||||||
end)
|
end)
|
||||||
else--奖励已领取 可预览
|
else--奖励已领取 可预览
|
||||||
this.OpenRewardPreview(LuckyTurnTableManager.boxReward_One,i)
|
this.itemRewardList[i]:OnBtnCkickEvent(LuckyTurnTableManager.boxReward_One[i].Reward[1][1])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--奖励不可领,可预览
|
--奖励不可领,可预览
|
||||||
this.OpenRewardPreview(LuckyTurnTableManager.boxReward_One,i)
|
this.itemRewardList[i]:OnBtnCkickEvent(LuckyTurnTableManager.boxReward_One[i].Reward[1][1])
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
elseif LuckyTurnTableManager.curTreasureType==TreasureType.Advanced then
|
elseif LuckyTurnTableManager.curTreasureType==TreasureType.Advanced then
|
||||||
for i = 1, 5 do
|
for i = 1, 5 do
|
||||||
this.rewardBoxList[i]:GetComponent("Image").sprite=SetIcon(this.spLoader, LuckyTurnTableManager.boxReward_Two[i].Reward[1][1])
|
local BG = Util.GetGameObject(this.rewardBoxList[i],"BG"):GetComponent("Image")
|
||||||
|
BG.sprite = SetIcon(this.spLoader, LuckyTurnTableManager.boxReward_Two[i].Reward[1][1])
|
||||||
Util.GetGameObject(this.rewardBoxList[i],"Value"):GetComponent("Text").text=LuckyTurnTableManager.boxReward_Two[i].Values[1][1]
|
Util.GetGameObject(this.rewardBoxList[i],"Value"):GetComponent("Text").text=LuckyTurnTableManager.boxReward_Two[i].Values[1][1]
|
||||||
|
Util.GetGameObject(this.rewardBoxList[i],"Num/Text"):GetComponent("Text").text =LuckyTurnTableManager.boxReward_Two[i].Reward[1][2]
|
||||||
|
|
||||||
|
if not this.itemRewardList[i] then
|
||||||
|
this.itemRewardList[i] = SubUIManager.Open(SubUIConfig.ItemView,BG.transform)
|
||||||
|
end
|
||||||
|
this.itemRewardList[i]:OnOpen(false, LuckyTurnTableManager.boxReward_Two[i].Reward[1],1, false, false, false, sortingOrder)
|
||||||
|
this.itemRewardList[i].gameObject:SetActive(false)
|
||||||
|
|
||||||
--显示红点
|
--显示红点
|
||||||
if LuckyTurnTableManager.value_2>=LuckyTurnTableManager.boxReward_Two[i].Values[1][1] then
|
if LuckyTurnTableManager.value_2>=LuckyTurnTableManager.boxReward_Two[i].Values[1][1] then
|
||||||
if LuckyTurnTableManager.GetRewardState(31,LuckyTurnTableManager.boxReward_Two[i].Id)==0 then
|
if LuckyTurnTableManager.GetRewardState(31,LuckyTurnTableManager.boxReward_Two[i].Id)==0 then
|
||||||
Util.GetGameObject(this.rewardBoxList[i],"redPoint"):SetActive(true)
|
Util.GetGameObject(this.rewardBoxList[i],"redPoint"):SetActive(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Util.AddOnceClick(this.rewardBoxList[i], function()
|
Util.AddOnceClick(BG.gameObject, function()
|
||||||
--Log("==YSP==点击高级探宝奖励盒"..i)
|
--Log("==YSP==点击高级探宝奖励盒"..i)
|
||||||
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
||||||
if LuckyTurnTableManager.value_2>=LuckyTurnTableManager.boxReward_Two[i].Values[1][1] then
|
if LuckyTurnTableManager.value_2>=LuckyTurnTableManager.boxReward_Two[i].Values[1][1] then
|
||||||
|
@ -794,10 +805,10 @@ function this.SetRewardBox()
|
||||||
this.RrFreshInfo()
|
this.RrFreshInfo()
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
this.OpenRewardPreview(LuckyTurnTableManager.boxReward_Two,i)
|
this.itemRewardList[i]:OnBtnCkickEvent(LuckyTurnTableManager.boxReward_Two[i].Reward[1][1])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
this.OpenRewardPreview(LuckyTurnTableManager.boxReward_Two,i)
|
this.itemRewardList[i]:OnBtnCkickEvent(LuckyTurnTableManager.boxReward_Two[i].Reward[1][1])
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
@ -805,35 +816,35 @@ function this.SetRewardBox()
|
||||||
end
|
end
|
||||||
|
|
||||||
---奖盒滑动条奖励背景切换
|
---奖盒滑动条奖励背景切换
|
||||||
function this.RewardBgProgress()
|
-- function this.RewardBgProgress()
|
||||||
for i = 1, 4 do
|
-- for i = 1, 4 do
|
||||||
local bg=Util.GetGameObject(this.rewardBoxList[i],"BG"):GetComponent("Image")
|
-- local bg=Util.GetGameObject(this.rewardBoxList[i],"BG"):GetComponent("Image")
|
||||||
if LuckyTurnTableManager.curTreasureType==TreasureType.Lucky then
|
-- if LuckyTurnTableManager.curTreasureType==TreasureType.Lucky then
|
||||||
if LuckyTurnTableManager.value_1>=LuckyTurnTableManager.boxReward_One[i].Values[1][1] then
|
-- if LuckyTurnTableManager.value_1>=LuckyTurnTableManager.boxReward_One[i].Values[1][1] then
|
||||||
bg.sprite=this.spLoader:LoadSprite(RewardName[2])
|
-- bg.sprite=this.spLoader:LoadSprite(RewardName[2])
|
||||||
else
|
-- else
|
||||||
bg.sprite=this.spLoader:LoadSprite(RewardName[1])
|
-- bg.sprite=this.spLoader:LoadSprite(RewardName[1])
|
||||||
end
|
-- end
|
||||||
elseif LuckyTurnTableManager.curTreasureType==TreasureType.Advanced then
|
-- elseif LuckyTurnTableManager.curTreasureType==TreasureType.Advanced then
|
||||||
if LuckyTurnTableManager.value_2>=LuckyTurnTableManager.boxReward_Two[i].Values[1][1] then
|
-- if LuckyTurnTableManager.value_2>=LuckyTurnTableManager.boxReward_Two[i].Values[1][1] then
|
||||||
bg.sprite=this.spLoader:LoadSprite(RewardName[2])
|
-- bg.sprite=this.spLoader:LoadSprite(RewardName[2])
|
||||||
else
|
-- else
|
||||||
bg.sprite=this.spLoader:LoadSprite(RewardName[1])
|
-- bg.sprite=this.spLoader:LoadSprite(RewardName[1])
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
bg:SetNativeSize()
|
-- bg:SetNativeSize()
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
---设置奖盒预览信息 并打开面板
|
---设置奖盒预览信息 并打开面板
|
||||||
function this.OpenRewardPreview(boxReward,i)
|
-- function this.OpenRewardPreview(boxReward,i)
|
||||||
--设置奖励预览信息 并打开面板
|
-- --设置奖励预览信息 并打开面板
|
||||||
local tab={boxReward[i].Reward[1][1],boxReward[i].Reward[1][2]}
|
-- local tab={boxReward[i].Reward[1][1],boxReward[i].Reward[1][2]}
|
||||||
this.rewardItemView:OnOpen(false, {tab[1],tab[2]},1, false, false, false, sortingOrder)
|
-- this.rewardItemView:OnOpen(false, {tab[1],tab[2]},1, false, false, false, sortingOrder)
|
||||||
|
|
||||||
this.rewardPanelMaskBtn.gameObject:SetActive(true)
|
-- -- this.rewardPanelMaskBtn.gameObject:SetActive(true)
|
||||||
this.rewardPanel.gameObject:SetActive(true)
|
-- -- this.rewardPanel.gameObject:SetActive(true)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
---刷新幸运值
|
---刷新幸运值
|
||||||
function this.RefreshLuckyValue()
|
function this.RefreshLuckyValue()
|
||||||
|
@ -869,7 +880,7 @@ function this.RrFreshInfo()
|
||||||
this.RefreshLuckyValue()
|
this.RefreshLuckyValue()
|
||||||
this.CheckRedPoint()
|
this.CheckRedPoint()
|
||||||
this.SetRewardBox()
|
this.SetRewardBox()
|
||||||
this.RewardBgProgress()
|
-- this.RewardBgProgress()
|
||||||
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue