[送无限抽]=======提交

dev_chengFeng
wangzhenxing 2022-10-17 16:13:47 +08:00
parent b0532edcca
commit 74d375cf7f
5 changed files with 1262 additions and 42 deletions

View File

@ -1434,6 +1434,7 @@ ActivityTypeDef = {
LingShouBaoGe = 100,--灵兽宝阁 LingShouBaoGe = 100,--灵兽宝阁
LingShowTeHui = 101, --灵兽特惠 LingShowTeHui = 101, --灵兽特惠
XinJiangLaiXi = 200,--新将来袭 XinJiangLaiXi = 200,--新将来袭
SongWuXianChou=106,--送无限抽
XunBaoMiZong = 82, --寻宝迷踪 XunBaoMiZong = 82, --寻宝迷踪
--主题活动 --主题活动

View File

@ -18,6 +18,12 @@ function OpenSeverWelfarePanel:InitComponent()
this.ScrollView.moveTween.MomentumAmount = 1 this.ScrollView.moveTween.MomentumAmount = 1
this.ScrollView.moveTween.Strength = 1 this.ScrollView.moveTween.Strength = 1
this.NoviceItemList={}--存储itemview 重复利用 this.NoviceItemList={}--存储itemview 重复利用
this.getBtn=Util.GetGameObject(self.transform, "title/lingquButton")
this.getTxt=Util.GetGameObject(self.transform, "title/lingquButton/Text"):GetComponent("Text")
this.goBtn=Util.GetGameObject(self.transform, "title/qianwangButton")
this.title=Util.GetGameObject(self.transform, "title")
this.content=Util.GetGameObject(self.transform, "title/content")
end end
--绑定事件(用于子类重写) --绑定事件(用于子类重写)
@ -26,6 +32,9 @@ function OpenSeverWelfarePanel:BindEvent()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel) PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel() self:ClosePanel()
end) end)
end end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
@ -59,15 +68,87 @@ end
local isShowNeedGetUpTextId = 0 local isShowNeedGetUpTextId = 0
local activityData = {} local activityData = {}
function this.OnShowPanelData(isTop,isAni) function this.OnShowPanelData(isTop,isAni)
this.titleText.text = Language[10021] this.titleText.text = "送无限抽"
activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.OpenSeverWelfare) activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.SongWuXianChou)
isShowNeedGetUpTextId = 0 isShowNeedGetUpTextId = 0
if activityData then if activityData then
this.RemainTimeDown(this.timeTextGo,this.timeText,activityData.endTime - GetTimeStamp()) this.RemainTimeDown(this.timeTextGo,this.timeText,activityData.endTime - GetTimeStamp())
ActivityGiftManager.OpenSeverWelfareRewardTabsSort(activityData.mission)
this.ScrollView:SetData(activityData.mission, function (index, go) local missions={}
this.SingleDataShow(go, activityData.mission[index]) local first={}
for i = 1, #activityData.mission do
if activityData.mission[i].missionId==20016 then
first=activityData.mission[i]
else
table.insert(missions,activityData.mission[i])
end
end
ActivityGiftManager.OpenSeverWelfareRewardTabsSort(missions)
this.ScrollView:SetData(missions, function (index, go)
this.SingleDataShow(go, missions[index])
end,not isTop,not isAni) end,not isTop,not isAni)
--顶部每日奖励
if first then
local sConFigData = activityRewardConfig[first.missionId]
if this.NoviceItemList[this.title] then
for i = 1, 4 do
this.NoviceItemList[this.title][i].gameObject:SetActive(false)
end
for i = 1, #sConFigData.Reward do
if this.NoviceItemList[this.title][i] then
this.NoviceItemList[this.title][i]:OnOpen(false, {sConFigData.Reward[i][1],sConFigData.Reward[i][2]}, 0.9,false,false,false,sortingOrder)
this.NoviceItemList[this.title][i].gameObject:SetActive(true)
end
end
else
this.NoviceItemList[this.title]={}
for i = 1, 4 do
this.NoviceItemList[this.title][i] = SubUIManager.Open(SubUIConfig.ItemView, this.content.transform)
this.NoviceItemList[this.title][i].gameObject:SetActive(false)
end
for i = 1, #sConFigData.Reward do
this.NoviceItemList[this.title][i]:OnOpen(false, {sConFigData.Reward[i][1],sConFigData.Reward[i][2]}, 0.9,false,false,false,sortingOrder)
this.NoviceItemList[this.title][i].gameObject:SetActive(true)
end
end
local state = first.state
local value = sConFigData.Values[2][1]
--local isPass = FightPointPassManager.IsFightPointPass2(value)
-- if state==0 and isPass then
-- this.getBtn:SetActive(true)
-- else
-- this.getBtn:SetActive(state>0)
-- end
this.getBtn:SetActive(state>0)
this.goBtn:SetActive(state == 0 and not isPass)
if state == 1 then
this.getTxt.text = Language[11948]
Util.SetGray(this.getBtn,false)
this.getBtn:GetComponent("Button").interactable = true
elseif state==2 then
this.getTxt.text = Language[10101]
Util.SetGray(this.getBtn,true)
this.getBtn:GetComponent("Button").interactable = false
elseif state==0 and isPass then
this.getTxt.text = Language[11948]
Util.SetGray(this.getBtn,false)
this.getBtn:GetComponent("Button").interactable = true
end
Util.AddClick(this.getBtn,function()
NetManager.GetActivityRewardRequest(first.missionId, activityData.activityId, function(drop)
--ActivityGiftManager.GetActivityRewardRequest(ActivityTypeDef.OpenSeverWelfare,rewardData.missionId, function(msg)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
this.OnShowPanelData(false,false)
Game.GlobalEvent:DispatchEvent(GameEvent.Mission.GetOpenServerRewardRefreshFightPoint)
end)
end)
end)
Util.AddClick(this.goBtn,function()
if sConFigData.Jump then
JumpManager.GoJump(sConFigData.Jump[1])
end
end)
end
if isPlayAnim then if isPlayAnim then
SecTorPlayAnimByScroll(this.ScrollView) SecTorPlayAnimByScroll(this.ScrollView)
isPlayAnim = false isPlayAnim = false
@ -116,26 +197,30 @@ function this.SingleDataShow(go,rewardData)
local getRewardProgress = Util.GetGameObject(activityRewardGo.gameObject, "getRewardProgress") local getRewardProgress = Util.GetGameObject(activityRewardGo.gameObject, "getRewardProgress")
local needGetUpText = Util.GetGameObject(activityRewardGo.gameObject, "needGetUpText") local needGetUpText = Util.GetGameObject(activityRewardGo.gameObject, "needGetUpText")
local state = rewardData.state local state = rewardData.state
local value = sConFigData.Values[1][1] local value = sConFigData.Values[2][1]
local isPass = FightPointPassManager.IsFightPointPass(value) local isPass = FightPointPassManager.IsFightPointPass(value)
lingquButton:SetActive(isPass) lingquButton:SetActive(state>0)
qianwangButton:SetActive(state == 0 and not isPass) qianwangButton:SetActive(state == 0 and not isPass)
if state == 1 then if state == 1 then
text.text = Language[11948]
Util.SetGray(lingquButton,false)
lingquButton:GetComponent("Button").interactable = true
elseif state==2 then
text.text = Language[10101] text.text = Language[10101]
Util.SetGray(lingquButton,true) Util.SetGray(lingquButton,true)
lingquButton:GetComponent("Button").interactable = false lingquButton:GetComponent("Button").interactable = false
else else
text.text = Language[11948]
Util.SetGray(lingquButton,false)
lingquButton:GetComponent("Button").interactable = true
end end
-- getFinishText:SetActive(state == 1) -- getFinishText:SetActive(state == 1)
getFinishText:SetActive(false) getFinishText:SetActive(false)
needGetUpText:SetActive(state == 0) --needGetUpText:SetActive(state == 0)
if isShowNeedGetUpTextId == 0 and state == 0 or isShowNeedGetUpTextId == rewardData.missionId then -- if isShowNeedGetUpTextId == 0 and state == 0 or isShowNeedGetUpTextId == rewardData.missionId then
isShowNeedGetUpTextId = rewardData.missionId -- isShowNeedGetUpTextId = rewardData.missionId
needGetUpText:SetActive(false) -- needGetUpText:SetActive(false)
end -- end
needGetUpText:SetActive(false)
getRewardProgress:SetActive(state == 0) getRewardProgress:SetActive(state == 0)
if state == 0 and isPass then if state == 0 and isPass then
getRewardProgress:GetComponent("Text").text = "(1/1)" getRewardProgress:GetComponent("Text").text = "(1/1)"
@ -148,10 +233,10 @@ function this.SingleDataShow(go,rewardData)
end end
end) end)
Util.AddOnceClick(lingquButton, function() Util.AddOnceClick(lingquButton, function()
if isShowNeedGetUpTextId ~= rewardData.missionId then -- if isShowNeedGetUpTextId ~= rewardData.missionId then
PopupTipPanel.ShowTip(Language[10022]) -- PopupTipPanel.ShowTip(Language[10022])
return -- return
end -- end
NetManager.GetActivityRewardRequest(rewardData.missionId, activityData.activityId, function(drop) NetManager.GetActivityRewardRequest(rewardData.missionId, activityData.activityId, function(drop)
--ActivityGiftManager.GetActivityRewardRequest(ActivityTypeDef.OpenSeverWelfare,rewardData.missionId, function(msg) --ActivityGiftManager.GetActivityRewardRequest(ActivityTypeDef.OpenSeverWelfare,rewardData.missionId, function(msg)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function() UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()

View File

@ -233,9 +233,11 @@ function FightPointPassMainPanel:InitComponent()
this.OpenSeverWelfare = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnOpenSeverWelfare/bg") this.OpenSeverWelfare = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnOpenSeverWelfare/bg")
this.OpenSeverWelfareicon = Util.GetGameObject(this.UI_Effect_MuBiaoJiangLi, "UI_MuBiaoJiangLi_Import_05"):GetComponent("Image") this.OpenSeverWelfareicon = Util.GetGameObject(this.UI_Effect_MuBiaoJiangLi, "UI_MuBiaoJiangLi_Import_05"):GetComponent("Image")
this.OpenSeverWelfareiconText = Util.GetGameObject(this.OpenSeverWelfare, "iconText"):GetComponent("Image") this.OpenSeverWelfareiconText = Util.GetGameObject(this.OpenSeverWelfare, "iconText"):GetComponent("Image")
this.OpenSeverWelfareProgressBg = Util.GetGameObject(this.OpenSeverWelfare, "progressBg")
this.OpenSeverWelfareProgressText = Util.GetGameObject(this.OpenSeverWelfare, "progressBg/progress"):GetComponent("Text") this.OpenSeverWelfareProgressText = Util.GetGameObject(this.OpenSeverWelfare, "progressBg/progress"):GetComponent("Text")
this.OpenSeverWelfareProgressImage = Util.GetGameObject(this.OpenSeverWelfare, "progressBg/progressImage"):GetComponent("Image") this.OpenSeverWelfareProgressImage = Util.GetGameObject(this.OpenSeverWelfare, "progressBg/progressImage"):GetComponent("Image")
this.OpenSeverWelfareTimeText = Util.GetGameObject(this.OpenSeverWelfare, "time"):GetComponent("Text") this.OpenSeverWelfareTimeText = Util.GetGameObject(this.OpenSeverWelfare, "time"):GetComponent("Text")
this.OpenSeverWelfareTimeText.gameObject:SetActive(false)
this.OpenSeverWelfareInfoText = Util.GetGameObject(this.OpenSeverWelfare, "info"):GetComponent("Text") this.OpenSeverWelfareInfoText = Util.GetGameObject(this.OpenSeverWelfare, "info"):GetComponent("Text")
this.OpenSeverWelfareRed = Util.GetGameObject(this.OpenSeverWelfare, "redpot") this.OpenSeverWelfareRed = Util.GetGameObject(this.OpenSeverWelfare, "redpot")
this.battleUpLvTip = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip") this.battleUpLvTip = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip")
@ -414,13 +416,22 @@ function FightPointPassMainPanel:OnOpen(func)
callBack = func callBack = func
end end
end end
function FightPointPassMainPanel:OnFocus()
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge)
if activityId and activityId~=0 and ActTimeCtrlManager.SingleFuncState(1) then
this.btnFirstRechar:SetActive(true)
else
this.btnFirstRechar:SetActive(false)
end
end
-- 从战斗出来会加载两次 -- 从战斗出来会加载两次
function FightPointPassMainPanel:OnShow() function FightPointPassMainPanel:OnShow()
CheckRedPointStatus(RedPointType.XiaoYaoYouRedPoint) CheckRedPointStatus(RedPointType.XiaoYaoYouRedPoint)
CheckRedPointStatus(RedPointType.numberGame) CheckRedPointStatus(RedPointType.numberGame)
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge)
if activityId and activityId~=0 and DynamicActivityManager.IsQualifiled(1) then if activityId and activityId~=0 and ActTimeCtrlManager.SingleFuncState(1) then
this.btnFirstRechar:SetActive(true) this.btnFirstRechar:SetActive(true)
else else
this.btnFirstRechar:SetActive(false) this.btnFirstRechar:SetActive(false)
@ -1019,23 +1030,39 @@ local OpenSeverWelfareRewardShow = {
function this.UpdateOpenSeverWelfare() function this.UpdateOpenSeverWelfare()
local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig) local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
local activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig) local activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.OpenSeverWelfare) local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SongWuXianChou)
local activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.OpenSeverWelfare) local activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.SongWuXianChou)
--LogGreen("#activityData.mission "..#activityData.mission) --LogGreen("#activityData.mission "..#activityData.mission)
if activityId and activityId > 0 and activityData and #activityData.mission > 0 then if activityId and activityId > 0 and activityData and #activityData.mission > 0 then
ActivityGiftManager.OpenSeverWelfareRewardTabsSort(activityData.mission) --ActivityGiftManager.OpenSeverWelfareRewardTabsSort(activityData.mission)
local curMissionConfig = nil local curMissionConfig = nil
local isShowBtn = false local isShowRed = false
for i = 1, #activityData.mission do for i = 1, #activityData.mission do
if activityData.mission[i].state == 0 and not curMissionConfig then if activityData.mission[i].state == 0 and not curMissionConfig then
curMissionConfig = activityRewardConfig[activityData.mission[i].missionId] curMissionConfig = activityRewardConfig[activityData.mission[i].missionId]
--LogError("activityData.mission[i].missionId=="..activityData.mission[i].missionId)
-- local value = curMissionConfig.Values[2][1]
-- local isPass = FightPointPassManager.IsFightPointPass2(value)
-- if isPass then
-- isShowRed=true
-- end
end end
if activityData.mission[i].state == 0 then if activityData.mission[i].state == 1 then
isShowBtn = true isShowRed = true
end end
end end
this.btnOpenSeverWelfare:SetActive(isShowBtn) local isAll=false
if not curMissionConfig then return end if not curMissionConfig then
isAll=true
curMissionConfig = activityRewardConfig[20016]
end
if activityData and activityData.mission then
this.btnOpenSeverWelfare:SetActive(true)
else
this.btnOpenSeverWelfare:SetActive(false)
end
-- 奖励图 -- 奖励图
this.OpenSeverWelfareicon.sprite = this.spLoader:LoadSprite(OpenSeverWelfareRewardShow[curMissionConfig.Reward[1][1]].image1) this.OpenSeverWelfareicon.sprite = this.spLoader:LoadSprite(OpenSeverWelfareRewardShow[curMissionConfig.Reward[1][1]].image1)
this.OpenSeverWelfareicon:SetNativeSize() this.OpenSeverWelfareicon:SetNativeSize()
@ -1047,15 +1074,24 @@ function this.UpdateOpenSeverWelfare()
else else
this.OpenSeverWelfareiconText.gameObject:SetActive(false) this.OpenSeverWelfareiconText.gameObject:SetActive(false)
end end
-- LogError("FightPointPassManager.lastPassFightId=="..FightPointPassManager.lastPassFightId)
local curPassLevelSortId = FightPointPassManager.lastPassFightId ~= FightPointPassManager.curOpenFight and mainLevelConfig[FightPointPassManager.lastPassFightId].SortId or 0 local curPassLevelSortId = FightPointPassManager.lastPassFightId ~= FightPointPassManager.curOpenFight and mainLevelConfig[FightPointPassManager.lastPassFightId].SortId or 0
local getRewardLevelSortId = mainLevelConfig[curMissionConfig.Values[1][1]].SortId local getRewardLevelSortId = mainLevelConfig[curMissionConfig.Values[2][1]].SortId
this.OpenSeverWelfareRed:SetActive(curPassLevelSortId >= getRewardLevelSortId) this.OpenSeverWelfareRed:SetActive(isShowRed)
if isAll then
this.OpenSeverWelfareProgressText.gameObject:SetActive(false)
this.OpenSeverWelfareProgressBg:SetActive(false)
this.OpenSeverWelfareInfoText.gameObject:SetActive(false)
else
this.OpenSeverWelfareProgressText.gameObject:SetActive(true)
this.OpenSeverWelfareProgressBg:SetActive(true)
this.OpenSeverWelfareInfoText.gameObject:SetActive(true)
end
curPassLevelSortId = curPassLevelSortId >= getRewardLevelSortId and getRewardLevelSortId or curPassLevelSortId curPassLevelSortId = curPassLevelSortId >= getRewardLevelSortId and getRewardLevelSortId or curPassLevelSortId
this.OpenSeverWelfareProgressText.text = curPassLevelSortId .. "/" .. getRewardLevelSortId this.OpenSeverWelfareProgressText.text = curPassLevelSortId .. "/" .. getRewardLevelSortId
this.OpenSeverWelfareProgressImage.fillAmount =curPassLevelSortId/ getRewardLevelSortId this.OpenSeverWelfareProgressImage.fillAmount =curPassLevelSortId/ getRewardLevelSortId
this.OpenSeverWelfareInfoText.text = GetLanguageStrById(curMissionConfig.ContentsShow) this.OpenSeverWelfareInfoText.text = GetLanguageStrById(curMissionConfig.ContentsShow)
this.RemainTimeDown(this.btnOpenSeverWelfare,this.OpenSeverWelfareTimeText,activityData.endTime - GetTimeStamp()) --this.RemainTimeDown(this.btnOpenSeverWelfare,this.OpenSeverWelfareTimeText,activityData.endTime - GetTimeStamp())
else else
this.btnOpenSeverWelfare:SetActive(false) this.btnOpenSeverWelfare:SetActive(false)
end end

View File

@ -57,6 +57,8 @@ function this.InitAllFightPointState(msg)
this.curOpenFight = msg.fightId this.curOpenFight = msg.fightId
if mainLevelConfig[this.curOpenFight].SortId-1 > 0 then if mainLevelConfig[this.curOpenFight].SortId-1 > 0 then
this.lastPassFightId = ConfigManager.GetConfigDataByKey(ConfigName.MainLevelConfig,"SortId", mainLevelConfig[this.curOpenFight].SortId-1).Id this.lastPassFightId = ConfigManager.GetConfigDataByKey(ConfigName.MainLevelConfig,"SortId", mainLevelConfig[this.curOpenFight].SortId-1).Id
LogError("this.lastPassFightId=="..this.lastPassFightId)
PlayerPrefs.SetInt(PlayerManager.uid .. OLD_ID,this.lastPassFightId)
end end
this.curFightState = msg.state this.curFightState = msg.state
this.adventrueEnemyList=msg.adventureBossInfo this.adventrueEnemyList=msg.adventureBossInfo
@ -130,6 +132,33 @@ function this.IsFightPointPass(fightId)
return isPass return isPass
end end
-- 获取某一关卡是否通关
function this.IsFightPointPass2(fightId)
local isPass = false
LogError("fightid=="..fightId.." this.curOpenFight=="..this.curOpenFight)
local curDiff = mainLevelConfig[this.curOpenFight].Difficulty
local judgeDiff = mainLevelConfig[fightId].Difficulty
if curDiff == judgeDiff then
if fightId < this.curOpenFight then
isPass = true
elseif fightId == this.curOpenFight then
if this.curFightState == 2 then -- 最后一章的最后一关
isPass = true
else
isPass = true
end
else
isPass = false
end
elseif curDiff > judgeDiff then
isPass = true
else
isPass = false
end
return isPass
end
-- 战斗胜利后刷新当前关卡的ID -- 战斗胜利后刷新当前关卡的ID
function this.RefreshFightId(msg) function this.RefreshFightId(msg)
--local data = mainLevelConfig[this.curOpenFight] --local data = mainLevelConfig[this.curOpenFight]