玲珑宝镜修改
parent
0efe76995b
commit
faf7591cf5
|
|
@ -943,7 +943,7 @@ RedPointType = {
|
|||
jijin328 = 79,
|
||||
chaozhijijin = 80,
|
||||
|
||||
|
||||
linglongBaojing = 671,
|
||||
}
|
||||
|
||||
RedPointStatus = {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ function MissionDailyTipPanel:BindEvent()
|
|||
PopupTipPanel.ShowTip(Language[11305])
|
||||
return
|
||||
end
|
||||
if GameObject.Find("LingLongBaoJingPanel") and GameObject.Find("LingLongBaoJingPanel").activeSelf then--掉落界面打开时,关闭掉落界面
|
||||
return
|
||||
end
|
||||
if UIManager.IsOpen(UIName.RewardItemPopup) then--掉落界面打开时,关闭掉落界面
|
||||
UIManager.ClosePanel(UIName.RewardItemPopup, false)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -538,6 +538,8 @@ function this.RegisterRedCheckFunc()
|
|||
|
||||
RPData:AddCheckFunc(RedPointType.jijin128,ActivityGiftManager.CheckRedpointUpperMonthCard)
|
||||
RPData:AddCheckFunc(RedPointType.jijin328,ActivityGiftManager.CheckRedpointUpperMonthCard)
|
||||
|
||||
RPData:AddCheckFunc(RedPointType.linglongBaojing,LingLongBaoJingManager.CheckRedPointLingLong)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -110,8 +110,10 @@ end
|
|||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function DropGetSSRHeroShopPanel:OnClose()
|
||||
|
||||
poolManager:UnLoadLive(GetResourcePath(heroStaticData.Live), testLiveGO)
|
||||
if testLiveGO then
|
||||
poolManager:UnLoadLive(GetResourcePath(heroStaticData.Live), testLiveGO)
|
||||
testLiveGO = nil
|
||||
end
|
||||
if callBack then
|
||||
callBack()
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,14 +5,17 @@ local rewardList = {}
|
|||
--初始化
|
||||
function this.Initialize()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose,this.RefreshData)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold,this.CheckRedPointLingLong)
|
||||
end
|
||||
|
||||
function this.RefreshData()
|
||||
this.CheckRedPointLingLong()
|
||||
this.InitData(nil)
|
||||
end
|
||||
|
||||
function this.InitData(func)
|
||||
local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.lingLongBaoJing)
|
||||
LogGreen("id:"..tostring(id))
|
||||
if not id or id < 1 then
|
||||
hitList = {}
|
||||
rewardList = {}
|
||||
|
|
@ -23,12 +26,15 @@ function this.InitData(func)
|
|||
end
|
||||
this.InitDataList(id)
|
||||
NetManager.QiMenDunJiaHitListRequest(id,function(msg)
|
||||
--sLogGreen("msg.hitList:"..#msg.hitList)
|
||||
-- for i = 1,#msg.hitList do
|
||||
-- LogGreen("msg.hitList:"..msg.hitList[i])
|
||||
-- end
|
||||
hitList = msg.hitList
|
||||
this.SetDataListState(hitList)
|
||||
if not msg.hitList or #msg.hitList < 1 then
|
||||
else
|
||||
LogGreen("msg.hitList:"..#msg.hitList)
|
||||
for i = 1,#msg.hitList do
|
||||
LogGreen("msg.hitList:"..msg.hitList[i])
|
||||
end
|
||||
this.SetDataListState(hitList)
|
||||
end
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
|
|
@ -36,6 +42,7 @@ function this.InitData(func)
|
|||
end
|
||||
|
||||
function this.InitDataList(id)
|
||||
rewardList = {}
|
||||
local configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.LingLongPool,"ActivityId",id)
|
||||
if configs then
|
||||
for i = 1 ,#configs do
|
||||
|
|
@ -61,7 +68,9 @@ end
|
|||
function this.SetDataListState(list,typeIndex)
|
||||
if list and #list > 0 then
|
||||
for i = 1,#list do
|
||||
rewardList[list[i]].state = 1
|
||||
if rewardList[list[i]] then
|
||||
rewardList[list[i]].state = 1
|
||||
end
|
||||
end
|
||||
else
|
||||
for k,v in pairs(rewardList) do
|
||||
|
|
@ -94,4 +103,19 @@ function this.QiMenDunJiaDrawRequest(id,func)
|
|||
end)
|
||||
end
|
||||
|
||||
function this.CheckRedPointLingLong()
|
||||
local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.lingLongBaoJing)
|
||||
if not id or id < 1 then
|
||||
return false
|
||||
end
|
||||
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig,117)
|
||||
local strs = string.split(config.Value,"|")
|
||||
local costId = tonumber(strs[1])
|
||||
LogGreen("BagManager.GetItemCountById(costId):"..BagManager.GetItemCountById(costId))
|
||||
if BagManager.GetItemCountById(costId) > 0 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -17,6 +17,8 @@ end
|
|||
|
||||
local a,b,c,d
|
||||
local configs
|
||||
local isClose = false
|
||||
local drop = nil
|
||||
---初始化组件(用于子类重写)
|
||||
function LingLongBaoJingPanel:InitComponent(gameObject)
|
||||
self.spLoader = SpriteLoader.New()
|
||||
|
|
@ -124,70 +126,93 @@ function LingLongBaoJingPanel:BindEvent()
|
|||
PopupTipPanel.ShowTip("道具不足")
|
||||
return
|
||||
end
|
||||
LingLongBaoJingManager.QiMenDunJiaDrawRequest(self.actId,function(idList,drop)
|
||||
LingLongBaoJingManager.QiMenDunJiaDrawRequest(self.actId,function(idList,_drop)
|
||||
if not idList[1] then
|
||||
PopupTipPanel.ShowTip("转盘奖励出错了")
|
||||
return
|
||||
end
|
||||
end
|
||||
drop = _drop
|
||||
LingLongBaoJingManager.CheckRedPointLingLong()
|
||||
self:DelayMaskWithBool(true)
|
||||
self.fx_linglongbaojing_kaiqi.gameObject:SetActive(true)
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_kaiqi_002)
|
||||
-- local drop = {}
|
||||
-- drop.itemlist = {}
|
||||
-- local idList = {1,1}
|
||||
LingLongBaoJingManager.SetDataListState(idList)
|
||||
local isAllGet = false
|
||||
if idList[2] and idList[2] > 0 then
|
||||
if LingLongBaoJingManager.IsAllGet() then
|
||||
isAllGet = true
|
||||
LingLongBaoJingManager.SetDataListState(nil,1)
|
||||
end
|
||||
LingLongBaoJingManager.SetDataListState(nil,2)
|
||||
end
|
||||
local x = function(isGetBigReward)
|
||||
LingLongBaoJingManager.SetDataListState(idList)
|
||||
local tempData = {}
|
||||
for i = 1,#idList do
|
||||
table.insert(tempData,data[idList[i]])
|
||||
end
|
||||
self:RefreshTreasureTypeState(0,tempData)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
|
||||
if isGetBigReward then
|
||||
if LingLongBaoJingManager.IsAllGet() then
|
||||
LingLongBaoJingManager.SetDataListState(nil,1)
|
||||
self:RefreshTreasureTypeState(1)
|
||||
if drop then
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
|
||||
drop = nil
|
||||
if isGetBigReward then
|
||||
if isAllGet then
|
||||
self:RefreshTreasureTypeState(1)
|
||||
end
|
||||
self:RefreshTreasureTypeState(2)
|
||||
if not isClose then
|
||||
self.itemList[1][data[idList[2]].address].selectKuang.gameObject:SetActive(false)
|
||||
self.itemList[2][data[idList[1]].address].selectKuang.gameObject:SetActive(false)
|
||||
end
|
||||
else
|
||||
if not isClose then
|
||||
self.itemList[2][data[idList[1]].address].selectKuang.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
self:SetPropShow()
|
||||
self.fx_linglongbaojing_kaiqi.gameObject:SetActive(false)
|
||||
if not isClose then
|
||||
self.itemList[2][1].effect.gameObject:SetActive(false)
|
||||
end
|
||||
LingLongBaoJingManager.SetDataListState(nil,2)
|
||||
self:RefreshTreasureTypeState(2)
|
||||
self.itemList[1][data[idList[2]].address].selectKuang.gameObject:SetActive(false)
|
||||
self.itemList[2][data[idList[1]].address].selectKuang.gameObject:SetActive(false)
|
||||
else
|
||||
self.itemList[2][data[idList[1]].address].selectKuang.gameObject:SetActive(false)
|
||||
end
|
||||
self:SetPropShow()
|
||||
self.fx_linglongbaojing_kaiqi.gameObject:SetActive(false)
|
||||
self.itemList[2][1].effect.gameObject:SetActive(false)
|
||||
self.fx_linglongbaojing_longchuxian.gameObject:SetActive(false)
|
||||
for i = 1,#self.itemList[1] do
|
||||
self.itemList[1][i].effect.gameObject:SetActive(false)
|
||||
end
|
||||
self:DelayMaskWithBool(false)
|
||||
end)
|
||||
self.fx_linglongbaojing_longchuxian.gameObject:SetActive(false)
|
||||
for i = 1,#self.itemList[1] do
|
||||
if not isClose then
|
||||
self.itemList[1][i].effect.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
self:DelayMaskWithBool(false)
|
||||
end)
|
||||
end
|
||||
end
|
||||
curTurnPos = 1
|
||||
self:SetTableTurnEffect(TableTurnType.Expedite,2,data[idList[1]].address,function()
|
||||
if idList[2] and idList[2] > 0 then
|
||||
--PopupTipPanel.ShowTip("播放一些开门的特效")
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_longmengezi_004)
|
||||
self.Btncoroutine = coroutine.start(function()
|
||||
self.itemList[2][1].effect.gameObject:SetActive(true)
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_longsaoguang_006)
|
||||
coroutine.wait(1)
|
||||
self.fx_linglongbaojing_longchuxian.gameObject:SetActive(true)
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_longpanxuan_005)
|
||||
coroutine.wait(1)
|
||||
self:RefreshTreasureMaskByType(1,false)
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_waiquandianliang_008)
|
||||
for i = 1,#self.itemList[1] do
|
||||
self.itemList[1][i].effect.gameObject:SetActive(true)
|
||||
end
|
||||
coroutine.wait(1)
|
||||
curTurnPos = 1
|
||||
self:SetTableTurnEffect(TableTurnType.Expedite,1,data[idList[2]].address,function()
|
||||
self:RefreshTreasureMaskByType(1,true)
|
||||
x(true)
|
||||
end)
|
||||
self.Btncoroutine = coroutine.start(function()
|
||||
local isStartWai = false
|
||||
while(not isClose and not isStartWai) do
|
||||
self.itemList[2][1].effect.gameObject:SetActive(true)
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_longsaoguang_006)
|
||||
coroutine.wait(1)
|
||||
self.fx_linglongbaojing_longchuxian.gameObject:SetActive(true)
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_longpanxuan_005)
|
||||
coroutine.wait(1)
|
||||
self:RefreshTreasureMaskByType(1,false)
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_waiquandianliang_008)
|
||||
for i = 1,#self.itemList[1] do
|
||||
self.itemList[1][i].effect.gameObject:SetActive(true)
|
||||
end
|
||||
--coroutine.wait(0.5)
|
||||
isStartWai = true
|
||||
end
|
||||
while(not isClose and isStartWai) do
|
||||
isStartWai = false
|
||||
curTurnPos = 1
|
||||
self:SetTableTurnEffect(TableTurnType.Expedite,1,data[idList[2]].address,function()
|
||||
self:RefreshTreasureMaskByType(1,true)
|
||||
x(true)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
else
|
||||
x(false)
|
||||
|
|
@ -221,6 +246,7 @@ end
|
|||
|
||||
-- 打开,重新打开时回调
|
||||
function LingLongBaoJingPanel:OnShow(_sortingOrder)
|
||||
isClose = false
|
||||
--self.parent.tabbox.gameObject:SetActive(false)
|
||||
self.gameObject:SetActive(true)
|
||||
self.sortingOrder = _sortingOrder
|
||||
|
|
@ -291,7 +317,7 @@ function LingLongBaoJingPanel:SetTime()
|
|||
remainTime = remainTime - 1
|
||||
self.time.text = "活动倒计时:"..TimeToDHMS(remainTime)
|
||||
if remainTime <= 0 then
|
||||
self:ClosePanel()
|
||||
self.time.text = "活动倒计时:"..TimeToDHMS(0)
|
||||
end
|
||||
end,1,-1,false)
|
||||
self.timer:Start()
|
||||
|
|
@ -337,7 +363,7 @@ function LingLongBaoJingPanel:RefreshTreasureTypeState(typeIndex,_data)
|
|||
tempData = data
|
||||
end
|
||||
for k,v in pairs(tempData) do
|
||||
if (v.typeIndex == typeIndex) or typeIndex == 0 then
|
||||
if ((v.typeIndex == typeIndex) or typeIndex == 0) and not isClose then
|
||||
if v.state == 0 then
|
||||
self.itemList[v.typeIndex][v.address].get.gameObject:SetActive(false)
|
||||
else
|
||||
|
|
@ -349,7 +375,7 @@ end
|
|||
--外圈遮罩设置
|
||||
function LingLongBaoJingPanel:RefreshTreasureMaskByType(typeIndex,value)
|
||||
for k,v in pairs(data) do
|
||||
if v.typeIndex == typeIndex then
|
||||
if v.typeIndex == typeIndex and not isClose then
|
||||
self.itemList[v.typeIndex][v.address].mask.gameObject:SetActive(value)
|
||||
end
|
||||
end
|
||||
|
|
@ -357,6 +383,12 @@ end
|
|||
|
||||
---界面关闭时调用(用于子类重写)
|
||||
function LingLongBaoJingPanel:OnClose()
|
||||
isClose = true
|
||||
if drop then
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
|
||||
drop = nil
|
||||
end)
|
||||
end
|
||||
--self.parent.tabbox.gameObject:SetActive(true)
|
||||
self.fx_linglongbaojing_long.gameObject:SetActive(false)
|
||||
self.fx_linglongbaojing_chuxian.gameObject:SetActive(false)
|
||||
|
|
@ -411,16 +443,21 @@ end
|
|||
|
||||
---转盘滚动特效重设 1移动速度,值越小越快 2是否停止 3停止位置
|
||||
function LingLongBaoJingPanel:TurnEffectReset(turnSpeed,treasureType,isStop,pos,func)
|
||||
if not self.turnEffect then
|
||||
self.turnEffect = Timer.New()
|
||||
end
|
||||
self.turnEffect:Reset(function()
|
||||
if curTurnPos > #self.itemList[treasureType] then
|
||||
curTurnPos = 1
|
||||
end
|
||||
if curTurnPos == 1 then
|
||||
self.itemList[treasureType][#self.itemList[treasureType]].selectKuang.gameObject:SetActive(false)
|
||||
else
|
||||
self.itemList[treasureType][curTurnPos - 1].selectKuang.gameObject:SetActive(false)
|
||||
if not isClose then
|
||||
if curTurnPos == 1 then
|
||||
self.itemList[treasureType][#self.itemList[treasureType]].selectKuang.gameObject:SetActive(false)
|
||||
else
|
||||
self.itemList[treasureType][curTurnPos - 1].selectKuang.gameObject:SetActive(false)
|
||||
end
|
||||
self.itemList[treasureType][curTurnPos].selectKuang.gameObject:SetActive(true)
|
||||
end
|
||||
self.itemList[treasureType][curTurnPos].selectKuang.gameObject:SetActive(true)
|
||||
if treasureType == 2 then
|
||||
SoundManager.PlaySound(SoundConfig.Audio_linglongbaojing_neiquanlunge_007)
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue