破阵诛仙
parent
66556e506a
commit
3bb8e284d9
|
|
@ -1043,6 +1043,7 @@ TaskTypeDef = {
|
|||
BloodyTask = 7, -- 血战任务
|
||||
FindTreasure = 8, -- 迷宫寻宝任务
|
||||
Achievement = 9, -- 所有成就任务
|
||||
PoZhenZhuXianTask = 10, -- 所有成就任务
|
||||
}
|
||||
|
||||
--商品类型
|
||||
|
|
|
|||
|
|
@ -14,19 +14,19 @@ local _PageInfo = {--后期可以做成tableInsert,icon名字都去读表
|
|||
default = "q_qiankun_baoheanniu_02", lock = "q_qiankun_baoheanniu_02", select = "q_qiankun_baoheanniu_01",
|
||||
rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
-- [3] = { --破阵诛仙
|
||||
-- default = "p_pozhengzhuxian_anniu_02", lock = "p_pozhengzhuxian_anniu_02", select = "p_pozhengzhuxian_anniu_01",
|
||||
-- rpType = RedPointType.PoZhenZhuXianTask,panelType = PanelType.QianKunBox,
|
||||
-- },
|
||||
[3] = { --破阵诛仙
|
||||
default = "p_pozhengzhuxian_anniu_02", lock = "p_pozhengzhuxian_anniu_02", select = "p_pozhengzhuxian_anniu_01",
|
||||
rpType = RedPointType.PoZhenZhuXianTask,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
[4] = { --珍奇礼包
|
||||
default = "z_zhenqibaoge_anniu_02", lock = "z_zhenqibaoge_anniu_02", select = "z_zhenqibaoge_anniu_01",
|
||||
rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
-- [5] = { --累计充值
|
||||
-- default = "r_huodong_leijichengzhianniu_01", lock = "r_huodong_leijichengzhianniu_01", select = "r_huodong_leijichengzhianniu",
|
||||
-- rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
-- }
|
||||
[3] = { --限时商市
|
||||
[5] = { --累计充值
|
||||
default = "r_huodong_leijichengzhianniu_01", lock = "r_huodong_leijichengzhianniu_01", select = "r_huodong_leijichengzhianniu",
|
||||
rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
[6] = { --限时商市
|
||||
default = "x_xianshishangshi_anniu_02", lock = "x_xianshishangshi_anniu_02", select = "x_xianshishangshi_anniu_01",
|
||||
rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
|
|
@ -36,7 +36,7 @@ local TimeLimitedCall = require("Modules/DynamicActivity/TimeLimitedCall")
|
|||
local QianKunBox = require("Modules/DynamicActivity/QianKunBox")
|
||||
local PoZhenZhuXianPage=require("Modules/DynamicActivity/PoZhenZhuXianPage")
|
||||
local ZhenQiYiBaoPage=require("Modules/DynamicActivity/ZhenQiYiBaoPage")
|
||||
-- local LeiJiChongZhiPage=require("Modules/DynamicActivity/LeiJiChongZhiPage")
|
||||
local LeiJiChongZhiPage=require("Modules/DynamicActivity/LeiJiChongZhiPage")
|
||||
local XianShiShangShi=require("Modules/DynamicActivity/XianShiShangShi")
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
|
|
@ -49,10 +49,10 @@ function DynamicActivityPanel:InitComponent()
|
|||
this.PageList = {
|
||||
[1] = TimeLimitedCall.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_1")),
|
||||
[2] = QianKunBox.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_2")),
|
||||
-- [3] = PoZhenZhuXianPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_3")),
|
||||
[3] = PoZhenZhuXianPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_3")),
|
||||
[4] = ZhenQiYiBaoPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_4")),
|
||||
-- [5] = LeiJiChongZhiPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_5")),
|
||||
[3] = XianShiShangShi.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_6")),
|
||||
[5] = LeiJiChongZhiPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_5")),
|
||||
[6] = XianShiShangShi.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_6")),
|
||||
}
|
||||
|
||||
-- 上部货币显示
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ local singleTaskPre = {}
|
|||
local this=PoZhenZhuXianPage
|
||||
local parent
|
||||
local endtime = 0
|
||||
local activityType = {
|
||||
[1] = {name = "破阵诛仙", bg = "p_pozhengzhuxian_tu",pre = "prefab1"}
|
||||
}
|
||||
function PoZhenZhuXianPage:ctor(mainPanel, gameObject)
|
||||
self.mainPanel = mainPanel
|
||||
self.gameObject = gameObject
|
||||
|
|
@ -16,7 +13,7 @@ function PoZhenZhuXianPage:ctor(mainPanel, gameObject)
|
|||
end
|
||||
|
||||
function PoZhenZhuXianPage:InitComponent(gameObject)
|
||||
this.time = Util.GetGameObject(gameObject, "content/tiao/time")
|
||||
this.time = Util.GetGameObject(gameObject, "content/tiao/time"):GetComponent("Text")
|
||||
this.itemPre = Util.GetGameObject(gameObject, "content/itempre")
|
||||
this.scrollItem = Util.GetGameObject(gameObject, "content/grid")
|
||||
local rootHight = this.scrollItem.transform.rect.height
|
||||
|
|
@ -48,10 +45,11 @@ end
|
|||
function PoZhenZhuXianPage:OnShow(_sortingOrder,_parent)
|
||||
sortingOrder = _sortingOrder
|
||||
parent = _parent
|
||||
this:OnShowData()
|
||||
this.Refresh()
|
||||
end
|
||||
|
||||
function this.Refresh()
|
||||
allData = OperatingManager:InitPoZhenZhuXianData()
|
||||
this:OnShowData()
|
||||
this:SetTime()
|
||||
end
|
||||
|
|
@ -61,37 +59,51 @@ function PoZhenZhuXianPage:SetTime()
|
|||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
end
|
||||
local five_timeDown
|
||||
local week_timeDown
|
||||
five_timeDown = CalculateSecondsNowTo_N_OClock(5)
|
||||
week_timeDown = endtime - GetTimeStamp()
|
||||
for k,v in pairs(singleTaskPre) do
|
||||
v.com.gameObject:SetActive(true)
|
||||
if v and v.data.type == 1 then
|
||||
v.com:GetComponent("Text").text = "剩余:"..TimeToHMS(five_timeDown)
|
||||
else
|
||||
v.com:GetComponent("Text").text = "剩余:"..TimeToHMS(week_timeDown)
|
||||
end
|
||||
end
|
||||
this.time.text = "剩余时间:"..TimeToDHMS(week_timeDown)
|
||||
self.timer = Timer.New(function()
|
||||
local timeDown
|
||||
for i = 1,#allData do
|
||||
if allData[i].type == 1 then
|
||||
timeDown = CalculateSecondsNowTo_N_OClock(5)
|
||||
singleTaskPre[allData[i].id].text = "剩余:"..TimeToHMS(timeDown)
|
||||
else
|
||||
timeDown = endtime - GetTimeStamp()
|
||||
singleTaskPre[allData[i].id].text = "剩余:"..TimeToDHMS(timeDown)
|
||||
end
|
||||
if timeDown < 1 then
|
||||
this.Refresh()
|
||||
return
|
||||
end
|
||||
five_timeDown = five_timeDown - 1
|
||||
week_timeDown = week_timeDown - 1
|
||||
if five_timeDown <= 0 or week_timeDown <= 0 then
|
||||
this.Refresh()
|
||||
return
|
||||
end
|
||||
timeDown = endtime - GetTimeStamp()
|
||||
this.time.text = "剩余时间:"..TimeToDHMS(timeDown)
|
||||
for k,v in pairs(singleTaskPre) do
|
||||
v.com.gameObject:SetActive(true)
|
||||
if v and v.data.type == 1 then
|
||||
v.com:GetComponent("Text").text = "剩余:"..TimeToHMS(five_timeDown)
|
||||
else
|
||||
v.com:GetComponent("Text").text = "剩余:"..TimeToHMS(week_timeDown)
|
||||
end
|
||||
end
|
||||
this.time.text = "剩余时间:"..TimeToDHMS(week_timeDown)
|
||||
end, 1, -1, true)
|
||||
self.timer:Start()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnShowData()
|
||||
allData = OperatingManager:InitPoZhenZhuXianData()
|
||||
function PoZhenZhuXianPage:OnShowData()
|
||||
if allData then
|
||||
endtime = ActivityGiftManager.GetTaskEndTime(ActivityTypeDef.pozhenzhuxian_task)
|
||||
this.SortData(allData)
|
||||
this.ScrollView:SetData(allData, function (index, go)
|
||||
this.SingleDataShow(go, allData[index])
|
||||
singleTaskPre[allData[index].id] = Util.GetGameObject(go,"btn/Text"):GetComponent("Text")
|
||||
end)
|
||||
LogError(#allData)
|
||||
if not singleTaskPre[go] then
|
||||
singleTaskPre[go] = {}
|
||||
end
|
||||
singleTaskPre[go].com = Util.GetGameObject(go,"btn/Text")
|
||||
singleTaskPre[go].data = allData[index]
|
||||
end)
|
||||
else
|
||||
parent.OnPageTabChange(1)
|
||||
PopupTipPanel.ShowTip("活动已结束")
|
||||
|
|
@ -99,22 +111,32 @@ function PoZhenZhuXianPage:OnShowData()
|
|||
end
|
||||
|
||||
end
|
||||
local typeIndex = {
|
||||
[0] = 1,
|
||||
[1] = 0,
|
||||
[2] = 2,
|
||||
}
|
||||
function PoZhenZhuXianPage:SortData()
|
||||
if allData==nil then
|
||||
return
|
||||
end
|
||||
table.sort(allData, function(a,b)
|
||||
if a.type == b.type then
|
||||
return a.id < b.id
|
||||
else
|
||||
return a.type < b.type
|
||||
end
|
||||
if typeIndex[a.state] == typeIndex[b.state] then
|
||||
if a.type == b.type then
|
||||
return a.id < b.id
|
||||
else
|
||||
return a.type < b.type
|
||||
end
|
||||
else
|
||||
return typeIndex[a.state] < typeIndex[b.state]
|
||||
end
|
||||
end)
|
||||
end
|
||||
local type={
|
||||
[0]={sprite = "s_slbz_1anniuhuangse",text = "前往"},
|
||||
[1]={sprite = "s_slbz_1anniuhuise",text = "已领取"},
|
||||
[2]={sprite = "s_slbz_1anniuongse",text = "领取"},
|
||||
[0]={sprite = "s_slbz_1anniuhuangse",text = "前往"},
|
||||
[1]={sprite = "s_slbz_1anniuongse",text = "领取"},
|
||||
[2]={sprite = "s_slbz_1anniuhuise",text = "已领取"},
|
||||
|
||||
}
|
||||
--刷新每一条的显示数据
|
||||
function this.SingleDataShow(pre,value)
|
||||
|
|
@ -130,6 +152,7 @@ function this.SingleDataShow(pre,value)
|
|||
titleText.text = sConFigData.title
|
||||
local missionText = Util.GetGameObject(activityRewardGo, "mission"):GetComponent("Text")
|
||||
missionText.text = sConFigData.content.."("..(sConFigData.progress > sConFigData.value and sConFigData.value or sConFigData.progress) .."/"..sConFigData.value..")"
|
||||
local timeText = Util.GetGameObject(activityRewardGo, "btn/Text")
|
||||
|
||||
local reward = Util.GetGameObject(activityRewardGo.gameObject, "reward")
|
||||
if (not itemsGrid) then
|
||||
|
|
@ -141,30 +164,31 @@ function this.SingleDataShow(pre,value)
|
|||
itemsGrid[pre]:OnOpen(false, sConFigData.reward, 0.9, false)
|
||||
|
||||
local lingquButton = Util.GetGameObject(activityRewardGo.gameObject, "btn")
|
||||
local state = sConFigData.state == 1 and sConFigData.state or (sConFigData.progress >= sConFigData.value and 2 or 0) -- 0 前往 1已领奖 2领奖
|
||||
--0-未完成,1-完成未领取 2-已领取
|
||||
local state = sConFigData.state
|
||||
timeText:SetActive(state == 0)
|
||||
|
||||
local red = Util.GetGameObject(lingquButton.gameObject, "redPoint")
|
||||
red:SetActive(state == 2)
|
||||
red:SetActive(state == 1)
|
||||
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button/Text"):GetComponent("Text").text = type[state].text
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button"):GetComponent("Image").sprite = Util.LoadSprite(type[state].sprite)
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button").gameObject:SetActive(state ~= 1)
|
||||
Util.GetGameObject(lingquButton.gameObject, "image").gameObject:SetActive(state == 1)
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button").gameObject:SetActive(state ~= 2)
|
||||
Util.GetGameObject(lingquButton.gameObject, "image").gameObject:SetActive(state == 2)
|
||||
|
||||
Util.AddOnceClick(Util.GetGameObject(lingquButton.gameObject, "Button"), function()
|
||||
if state == 2 then
|
||||
local curActivityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.pozhenzhuxian_task)
|
||||
NetManager.GetActivityRewardRequest(sConFigData.id, curActivityId,function(respond)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, respond, 1)
|
||||
this.Refresh()
|
||||
if state == 1 then
|
||||
NetManager.TakeMissionRewardRequest(TaskTypeDef.PoZhenZhuXianTask,sConFigData.id, function(respond)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, respond.drop, 1,function ()
|
||||
this.Refresh()
|
||||
end)
|
||||
end)
|
||||
elseif state == 0 then
|
||||
if sConFigData.jump then
|
||||
JumpManager.GoJump(sConFigData.jump[1])
|
||||
JumpManager.GoJump(sConFigData.jump)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
|
|
@ -175,7 +199,7 @@ end
|
|||
function this.RechargeSuccessFunc(id)
|
||||
FirstRechargeManager.RefreshAccumRechargeValue(id)
|
||||
--OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.GiftBuy, id)
|
||||
this.OnShowData()
|
||||
this.Refresh()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnClose()
|
||||
|
|
@ -184,7 +208,16 @@ end
|
|||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnDestroy()
|
||||
if self.timer then
|
||||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
end
|
||||
sortingOrder = 0
|
||||
if singleTaskPre then
|
||||
singleTaskPre = {}
|
||||
end
|
||||
|
||||
itemsGrid = {}
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnHide()
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ function FightPointPassMainPanel:BindEvent()
|
|||
-- 日常任务
|
||||
Util.AddClick(this.btnDailyMission, function ()
|
||||
FightPointPassManager.isBeginFight = true
|
||||
UIManager.OpenPanel(UIName.MissionDailyPanel)
|
||||
UIManager.OpenPanel(UIName.MissionDailyPanel,1)
|
||||
end)
|
||||
|
||||
-- 关卡排行
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ function MissionDailyTipPanel:BindEvent()
|
|||
PopupTipPanel.ShowTip(Language[11347])
|
||||
return
|
||||
end
|
||||
UIManager.OpenPanel(UIName.MissionDailyPanel,showType)
|
||||
if showType == 4 then
|
||||
UIManager.OpenPanel(UIName.MissionDailyPanel,2)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.MissionDailyPanel,showType)
|
||||
end
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ function this:SetTopBar()
|
|||
Util.GetGameObject(this.openExtra,"MeiKaiQi"):SetActive(true)
|
||||
this.openExtra:GetComponent("Animator").enabled = true
|
||||
Timer.New(function()
|
||||
local id = ActivityGiftManager.GetActivityIdByType(8)
|
||||
local id = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||
NetManager.GetActivityRewardRequest(-2,id,function(msg)
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(1007, 1)
|
||||
this.refresh(curType)
|
||||
|
|
|
|||
|
|
@ -485,7 +485,6 @@ function this.TakeMissionRewardRequest(type, taskId, func)
|
|||
local data = buffer:DataByte()
|
||||
local msg = PlayerInfoProto_pb.TakeMissionRewardResponse()
|
||||
msg:ParseFromString(data)
|
||||
LogGreen("TakeMissionRewardResponse.treasureScore:"..msg.treasureScore)
|
||||
QinglongSerectTreasureManager.SetLevel(msg.treasureScore)
|
||||
if func then
|
||||
func(msg)
|
||||
|
|
|
|||
|
|
@ -733,9 +733,7 @@ function this.InitPoZhenZhuXianData()
|
|||
end
|
||||
this.allData = {}
|
||||
local allListData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ThemeActivityTaskConfig, "ActivityId", id)
|
||||
LogBlue("#allListData:"..#allListData)
|
||||
local allMissionData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.pozhenzhuxian_task).mission
|
||||
LogBlue("#allMissionData"..#allMissionData)
|
||||
local allMissionData = TaskManager.GetTypeTaskList(TaskTypeDef.PoZhenZhuXianTask)
|
||||
for i=1,#allListData do
|
||||
for j=1,#allMissionData do
|
||||
if allListData[i].Id == allMissionData[j].missionId then
|
||||
|
|
|
|||
Loading…
Reference in New Issue