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

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,--灵兽宝阁
LingShowTeHui = 101, --灵兽特惠
XinJiangLaiXi = 200,--新将来袭
SongWuXianChou=106,--送无限抽
XunBaoMiZong = 82, --寻宝迷踪
--主题活动

View File

@ -18,6 +18,12 @@ function OpenSeverWelfarePanel:InitComponent()
this.ScrollView.moveTween.MomentumAmount = 1
this.ScrollView.moveTween.Strength = 1
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
--绑定事件(用于子类重写)
@ -26,6 +32,9 @@ function OpenSeverWelfarePanel:BindEvent()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
@ -59,15 +68,87 @@ end
local isShowNeedGetUpTextId = 0
local activityData = {}
function this.OnShowPanelData(isTop,isAni)
this.titleText.text = Language[10021]
activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.OpenSeverWelfare)
this.titleText.text = "送无限抽"
activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.SongWuXianChou)
isShowNeedGetUpTextId = 0
if activityData then
this.RemainTimeDown(this.timeTextGo,this.timeText,activityData.endTime - GetTimeStamp())
ActivityGiftManager.OpenSeverWelfareRewardTabsSort(activityData.mission)
this.ScrollView:SetData(activityData.mission, function (index, go)
this.SingleDataShow(go, activityData.mission[index])
local missions={}
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)
--顶部每日奖励
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
SecTorPlayAnimByScroll(this.ScrollView)
isPlayAnim = false
@ -116,26 +197,30 @@ function this.SingleDataShow(go,rewardData)
local getRewardProgress = Util.GetGameObject(activityRewardGo.gameObject, "getRewardProgress")
local needGetUpText = Util.GetGameObject(activityRewardGo.gameObject, "needGetUpText")
local state = rewardData.state
local value = sConFigData.Values[1][1]
local value = sConFigData.Values[2][1]
local isPass = FightPointPassManager.IsFightPointPass(value)
lingquButton:SetActive(isPass)
lingquButton:SetActive(state>0)
qianwangButton:SetActive(state == 0 and not isPass)
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]
Util.SetGray(lingquButton,true)
lingquButton:GetComponent("Button").interactable = false
else
text.text = Language[11948]
Util.SetGray(lingquButton,false)
lingquButton:GetComponent("Button").interactable = true
end
-- getFinishText:SetActive(state == 1)
getFinishText:SetActive(false)
needGetUpText:SetActive(state == 0)
if isShowNeedGetUpTextId == 0 and state == 0 or isShowNeedGetUpTextId == rewardData.missionId then
isShowNeedGetUpTextId = rewardData.missionId
needGetUpText:SetActive(false)
end
--needGetUpText:SetActive(state == 0)
-- if isShowNeedGetUpTextId == 0 and state == 0 or isShowNeedGetUpTextId == rewardData.missionId then
-- isShowNeedGetUpTextId = rewardData.missionId
-- needGetUpText:SetActive(false)
-- end
needGetUpText:SetActive(false)
getRewardProgress:SetActive(state == 0)
if state == 0 and isPass then
getRewardProgress:GetComponent("Text").text = "(1/1)"
@ -148,10 +233,10 @@ function this.SingleDataShow(go,rewardData)
end
end)
Util.AddOnceClick(lingquButton, function()
if isShowNeedGetUpTextId ~= rewardData.missionId then
PopupTipPanel.ShowTip(Language[10022])
return
end
-- if isShowNeedGetUpTextId ~= rewardData.missionId then
-- PopupTipPanel.ShowTip(Language[10022])
-- return
-- end
NetManager.GetActivityRewardRequest(rewardData.missionId, activityData.activityId, function(drop)
--ActivityGiftManager.GetActivityRewardRequest(ActivityTypeDef.OpenSeverWelfare,rewardData.missionId, function(msg)
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.OpenSeverWelfareicon = Util.GetGameObject(this.UI_Effect_MuBiaoJiangLi, "UI_MuBiaoJiangLi_Import_05"):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.OpenSeverWelfareProgressImage = Util.GetGameObject(this.OpenSeverWelfare, "progressBg/progressImage"):GetComponent("Image")
this.OpenSeverWelfareTimeText = Util.GetGameObject(this.OpenSeverWelfare, "time"):GetComponent("Text")
this.OpenSeverWelfareTimeText.gameObject:SetActive(false)
this.OpenSeverWelfareInfoText = Util.GetGameObject(this.OpenSeverWelfare, "info"):GetComponent("Text")
this.OpenSeverWelfareRed = Util.GetGameObject(this.OpenSeverWelfare, "redpot")
this.battleUpLvTip = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip")
@ -414,13 +416,22 @@ function FightPointPassMainPanel:OnOpen(func)
callBack = func
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()
CheckRedPointStatus(RedPointType.XiaoYaoYouRedPoint)
CheckRedPointStatus(RedPointType.numberGame)
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)
else
this.btnFirstRechar:SetActive(false)
@ -1019,23 +1030,39 @@ local OpenSeverWelfareRewardShow = {
function this.UpdateOpenSeverWelfare()
local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
local activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.OpenSeverWelfare)
local activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.OpenSeverWelfare)
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SongWuXianChou)
local activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.SongWuXianChou)
--LogGreen("#activityData.mission "..#activityData.mission)
if activityId and activityId > 0 and activityData and #activityData.mission > 0 then
ActivityGiftManager.OpenSeverWelfareRewardTabsSort(activityData.mission)
--ActivityGiftManager.OpenSeverWelfareRewardTabsSort(activityData.mission)
local curMissionConfig = nil
local isShowBtn = false
local isShowRed = false
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]
--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
if activityData.mission[i].state == 0 then
isShowBtn = true
if activityData.mission[i].state == 1 then
isShowRed = true
end
end
this.btnOpenSeverWelfare:SetActive(isShowBtn)
if not curMissionConfig then return end
local isAll=false
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:SetNativeSize()
@ -1047,15 +1074,24 @@ function this.UpdateOpenSeverWelfare()
else
this.OpenSeverWelfareiconText.gameObject:SetActive(false)
end
--
LogError("FightPointPassManager.lastPassFightId=="..FightPointPassManager.lastPassFightId)
local curPassLevelSortId = FightPointPassManager.lastPassFightId ~= FightPointPassManager.curOpenFight and mainLevelConfig[FightPointPassManager.lastPassFightId].SortId or 0
local getRewardLevelSortId = mainLevelConfig[curMissionConfig.Values[1][1]].SortId
this.OpenSeverWelfareRed:SetActive(curPassLevelSortId >= getRewardLevelSortId)
local getRewardLevelSortId = mainLevelConfig[curMissionConfig.Values[2][1]].SortId
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
this.OpenSeverWelfareProgressText.text = curPassLevelSortId .. "/" .. getRewardLevelSortId
this.OpenSeverWelfareProgressImage.fillAmount =curPassLevelSortId/ getRewardLevelSortId
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
this.btnOpenSeverWelfare:SetActive(false)
end

View File

@ -57,6 +57,8 @@ function this.InitAllFightPointState(msg)
this.curOpenFight = msg.fightId
if mainLevelConfig[this.curOpenFight].SortId-1 > 0 then
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
this.curFightState = msg.state
this.adventrueEnemyList=msg.adventureBossInfo
@ -130,6 +132,33 @@ function this.IsFightPointPass(fightId)
return isPass
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
function this.RefreshFightId(msg)
--local data = mainLevelConfig[this.curOpenFight]