东海寻仙提交

dev_chengFeng
jiaoyangna 2022-03-18 13:25:09 +08:00
parent d0b2ff1cd8
commit 18803bfc29
15 changed files with 4235 additions and 2793 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1d3c4ad9255881d4cbbd69d0ed239a90
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d4fe5ea1b28f2994b84bcd10ced63002
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1052,6 +1052,12 @@ RedPointType = {
FestevalRed = 9501,
zhognzhichengcheng = 10096,
eastSeaFindGod = 98000,
eastSeaFindGod1 = 98004,
eastSeaFindGod2 = 98005,
eastSeaFindGod3 = 98006,
eastSeaFindGod4 = 98007,
}
RedPointStatus = {

View File

@ -543,5 +543,8 @@ GameEvent = {
},
Gem = {
RefreshPanel = "Gem.RefreshPanel",
}
},
EastSeaFindGod = {
OnMissionChange = "EastSeaFindGod.OnMissionChange",
},
}

View File

@ -1016,7 +1016,7 @@ end
--获取活动剩余时间
function this.GetTaskRemainTime(activityType)
local remainTime = 0
remainTime =this.GetTaskEndTime(activityType)- this.GetTaskEndTime(activityType)
remainTime =this.GetTaskEndTime(activityType)- GetTimeStamp()
return remainTime
end

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cfa67c5fda4501b418125fc20384be6b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,163 @@
require("Base/BasePanel")
EastSeaFindGodPanel = Inherit(BasePanel)
local this = EastSeaFindGodPanel
local TabBox = require("Modules/Common/TabBox")
local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "1",colorDefault = Color.New(243 / 255, 235 / 255, 202 / 255, 1),colorSelect = Color.New(130 / 255, 128 / 255, 120 / 255, 1),type = 4,redpointType = RedPointType.eastSeaFindGod1, },
[2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "2" ,olorDefault = Color.New(243 / 255, 235 / 255, 202 / 255, 1),colorSelect = Color.New(130 / 255, 128 / 255, 120 / 255, 1),type = 5,redpointType = RedPointType.eastSeaFindGod2, },
[3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "3" ,olorDefault = Color.New(243 / 255, 235 / 255, 202 / 255, 1),colorSelect = Color.New(130 / 255, 128 / 255, 120 / 255, 1),type = 6,redpointType = RedPointType.eastSeaFindGod3,},
[4] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "4",olorDefault = Color.New(243 / 255, 235 / 255, 202 / 255, 1),colorSelect = Color.New(130 / 255, 128 / 255, 120 / 255, 1),type = 7,redpointType = RedPointType.eastSeaFindGod4,},
}
local colorTab = {default = Color.New(243 / 255, 235 / 255, 202 / 255, 1),select = Color.New(130 / 255, 128 / 255, 120 / 255, 1)}
--打开弹窗索引
local index=0
local redPointList
local istop ,isAnim
--初始化组件(用于子类重写)
function EastSeaFindGodPanel:InitComponent()
this.spLoader = SpriteLoader.New()
this.tabBox = Util.GetGameObject(self.gameObject, "TabBox")
this.closeBtn = Util.GetGameObject(self.transform, "closeBtn")
this.scroll = Util.GetGameObject(self.transform, "scroll")
local v = this.scroll:GetComponent("RectTransform").rect
this.item = Util.GetGameObject(self.transform, "item")
this.root = Util.GetGameObject(self.transform, "bg/root"):GetComponent("Image")
this.scrollCycleView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform, this.item, nil, Vector2.New(v.width, v.height), 1, 1, Vector2.New(0, 0))
redPointList = {}
this.ItemList = {}
this.timeText = Util.GetGameObject(self.transform, "timeText"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function EastSeaFindGodPanel:BindEvent()
Util.AddClick(this.closeBtn, function()
index = 0
self:ClosePanel()
end)
this.TabCtrl = TabBox.New()
this.TabCtrl:SetTabAdapter(this.TabAdapter)
this.TabCtrl:SetChangeTabCallBack(this.SwitchView)
end
--添加事件监听(用于子类重写)
function EastSeaFindGodPanel:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.EastSeaFindGod.OnMissionChange,this.RefreshData)
end
--移除事件监听(用于子类重写)
function EastSeaFindGodPanel:RemoveListener()
Game.GlobalEvent:DispatchEvent(GameEvent.EastSeaFindGod.OnMissionChange,this.RefreshData)
end
function this.RefreshData()
this.SwitchView(index)
end
--界面打开时调用(用于子类重写)
function EastSeaFindGodPanel:OnOpen(popupType,...)
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function EastSeaFindGodPanel:OnShow()
istop ,isAnim = false,false
if index == 0 then
index = 1
for k,v in ipairs(_TabData) do
if RedpotManager.GetRedPointStatus(v.redpointType) == 1 then
index = k
break
end
end
this.TabCtrl:Init(this.tabBox, _TabData, index)
end
this:SetTime()
end
function EastSeaFindGodPanel:SetTime()
if self.timer then
self.timer:Stop()
self.timer = nil
end
local remainTime = ActivityGiftManager.GetTaskRemainTime(ActivityTypeDef.EastSeaFindGod)
local s = function()
this.timeText.text = "剩余时间:"..TimeToDHMS(remainTime)
remainTime = remainTime - 1
if remainTime < 0 then
index = 0
self:ClosePanel()
end
end
s()
self.timer = Timer.New(s,1,-1,false)
self.timer:Start()
end
function EastSeaFindGodPanel:OnSortingOrderChange()
end
-- tab节点显示自定义
function this.TabAdapter(tab, index, status)
local tabLab = Util.GetGameObject(tab, "Text")
tab:GetComponent("Image").sprite = this.spLoader:LoadSprite(_TabData[index][status])
tabLab:GetComponent("Text").text = _TabData[index].name
tabLab:GetComponent("Text").color = colorTab[status]
local red = Util.GetGameObject(tab,"red")
BindRedPointObject(_TabData[index].redpointType,red )
redPointList[_TabData[index].redpointType] = red
end
--切换视图
function this.SwitchView(_index)
index = _index
this.data = CommonActPageManager.GetData(ActivityTypeDef.EastSeaFindGod,_TabData[_index].type)
this.scrollCycleView:ForeachItemGO(function(index, go)
go.gameObject:SetActive(false)
end)
this.scrollCycleView:SetData(this.data.rewards,function(index,item)
this:RefreshSingleItem(index,item,this.data.rewards[index])
end,istop,isAnim)
-- istop = true
-- isAnim = true
end
function EastSeaFindGodPanel:RefreshSingleItem(index,item,data)
if not this.ItemList then
this.ItemList = {}
end
if not this.ItemList[item] then
local subConfig = SubUIConfig[12]
this.ItemList[item] = SubUIManager.Open(subConfig,item.transform)
end
if not data then
item.gameObject:SetActive(false)
return
end
item.gameObject:SetActive(true)
self.ItemList[item]:SetData(data,this,this.sortingOrder,this.data)
end
--界面关闭时调用(用于子类重写)
function EastSeaFindGodPanel:OnClose()
if self.timer then
self.timer:Stop()
self.timer = nil
end
end
--界面销毁时调用(用于子类重写)
function EastSeaFindGodPanel:OnDestroy()
for k,v in pairs(redPointList) do
ClearRedPointObject(k,v)
end
for k,v in pairs(this.ItemList) do
SubUIManager.Close(v)
end
this.ItemList = {}
if this.scrollCycleView then
SubUIManager.Close( this.scrollCycleView)
end
this.scrollCycleView = nil
this.spLoader:Destroy()
end
return EastSeaFindGodPanel

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f5667461949f1b242920001748116dcd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1140,6 +1140,8 @@ function this:TabBtnAction(id,actType,data)
return
end
UIManager.OpenPanel(UIName.ActivityMainPanel,id)
elseif id == ActivityTypeDef.EastSeaFindGod then
UIManager.OpenPanel(UIName.EastSeaFindGodPanel,id)
end
elseif actType == 2 then
if id == FUNCTION_OPEN_TYPE.SERVER_START_GIFT then

View File

@ -465,6 +465,10 @@ local TypeUpdateFunc = {
end
end)
end,
[ActivityTypeDef.EastSeaFindGod] = function ()--主题活动任务
local curData = dataList[ActivityTypeDef.EastSeaFindGod]
this.InitTaskDataBySmallType(curData,TaskTypeDef.EastSeaFindGod,ConfigName.ThemeActivityTaskConfig,this.args[1])
end,
}
--超凡入圣
@ -493,7 +497,6 @@ end
function this.InitTaskData(curData,taskType,configName)
local allListData = ConfigManager.GetAllConfigsDataByKey(configName, "ActivityId", curData.activityId)
local allMissionData = TaskManager.GetTypeTaskList(taskType)
Log("this.DynamicActType:"..this.DynamicActType)
for i=1,#allListData do
for j=1,#allMissionData do
-- LogGreen("this.DynamicActType:"..this.DynamicActType)
@ -544,6 +547,65 @@ function this.InitTaskData(curData,taskType,configName)
end)
end
--主题活动任务
function this.InitTaskDataBySmallType(curData,taskType,configName,smallType)
local allListData = ConfigManager.GetAllConfigsDataByKey(configName, "ActivityId", curData.activityId)
local allMissionData = TaskManager.GetTypeTaskList(taskType)
for i=1,#allListData do
for j=1,#allMissionData do
if allListData[i].Id == allMissionData[j].missionId and (not smallType or allListData[i].Type == smallType) then
local data = {}
data.missionId = allListData[i].Id
data.type = smallType
data.otherData = {}
data.otherData.missionType = 0
data.otherData.taskType = taskType
data.otherData.Values = allListData[i].TaskValue[2][1]
data.progress = allMissionData[j].progress
data.value = allListData[i].TaskValue[2][1]
data.state = allMissionData[j].state
if data.state == 0 then
if data.progress < data.value then
data.otherData.state = 1
else
data.otherData.state = 0
end
elseif data.state == 1 then
data.otherData.state = 0
else
data.otherData.state = 2
end
data.otherData.ContentsShow = allListData[i].Show
if data.otherData.state == 2 or data.otherData.state == 0 then
data.otherData.info = string.format("(%s/%s)",data.value,data.value)
else
data.otherData.info = string.format("(%s/%s)",(data.progress > data.value and data.value or data.progress),data.value)
end
data.otherData.Reward = allListData[i].Integral
data.otherData.Jump = allListData[i].Jump[1]
table.insert(curData.rewards,data)
end
end
end
local typeIndex = {
[0] = 1,
[1] = 0,
[2] = 2,
}
table.sort(curData.rewards, function(a,b)
if typeIndex[a.state] == typeIndex[b.state] then
if a.type == b.type then
return a.missionId < b.missionId
else
return a.type < b.type
end
else
return typeIndex[a.state] < typeIndex[b.state]
end
end)
end
---日周累计充值
function this.GetMissionData(indexType,actType)
local curData = dataList[actType]
@ -875,4 +937,27 @@ function this.PowerRiceRedCheck()
end
end
function this.GetRedPointEastSeaFindGodnew(red)
return this.GetRedPointEastSeaFindGod(red%98000)
end
function this.GetRedPointEastSeaFindGod(indexType)
local data = this.GetData(ActivityTypeDef.EastSeaFindGod,indexType)
if data then
for i = 1, #data.rewards do
if data.rewards[i].state ~= 2 and data.rewards[i].progress >= data.rewards[i].value then
return true
end
end
return false
end
end
function this.GetRedPointEastSeaFindGodNew()
CheckRedPointStatus(RedPointType.eastSeaFindGod1)
CheckRedPointStatus(RedPointType.eastSeaFindGod2)
CheckRedPointStatus(RedPointType.eastSeaFindGod3)
CheckRedPointStatus(RedPointType.eastSeaFindGod4)
end
return CommonActPageManager

View File

@ -74,20 +74,33 @@ function ExpertPre:SetButton()
Util.SetGray(self.btnGet,btnData.isGray)
self.btnText.text = btnData.Text
self.info.text = self.data.otherData.info
if self.actConfig.ActiveType == ActivityTypeDef.ContinuityRecharge then
local bool = self:IsCurrentSortEnable(self.data.otherData.Sort)
self.btnGet:GetComponent("Button").interactable = bool
Util.SetGray(self.btnGet, not bool)
if self.actConfig then
if self.actConfig.ActiveType == ActivityTypeDef.ContinuityRecharge then
local bool = self:IsCurrentSortEnable(self.data.otherData.Sort)
self.btnGet:GetComponent("Button").interactable = bool
Util.SetGray(self.btnGet, not bool)
end
end
Util.AddOnceClick(self.btnGet, function()
if self.data.otherData.state == 0 then
NetManager.GetActivityRewardRequest(self.data.missionId, self.actData.activityId, function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
self.parent:RefreshData(true,false)
CheckRedPointStatus(RedPointType.Expert_FastExplore)
if self.data.otherData.missionType and self.data.otherData.missionType == 0 then
NetManager.TakeMissionRewardRequest(self.data.otherData.taskType, self.data.missionId, function(drop)
TaskManager.SetTypeTaskState(self.data.otherData.taskType, self.data.missionId, 2, self.data.progress)
UIManager.OpenPanel(UIName.RewardItemPopup,drop.drop ,1,function()
self.parent:RefreshData(true,false)
CheckRedPointStatus(self.data.type + 98000)
end)
end)
end)
else
NetManager.GetActivityRewardRequest(self.data.missionId, self.actData.activityId, function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
self.parent:RefreshData(true,false)
CheckRedPointStatus(RedPointType.Expert_FastExplore)
end)
end)
end
elseif self.data.otherData.state == 1 then
JumpManager.GoJump(self.data.otherData.Jump)
elseif self.data.otherData.state == 2 then

View File

@ -344,6 +344,10 @@ function this.InitRedPointAllRelate()
RPData:SetParent(RedPointType.Gem,RedPointType.Practice_main)
--战力冲刺
RPData:SetParent(RedPointType.PowerRiceGool,RedPointType.PowerRice)
RPData:SetParent(RedPointType.eastSeaFindGod1,RedPointType.eastSeaFindGod)
RPData:SetParent(RedPointType.eastSeaFindGod2,RedPointType.eastSeaFindGod)
RPData:SetParent(RedPointType.eastSeaFindGod3,RedPointType.eastSeaFindGod)
RPData:SetParent(RedPointType.eastSeaFindGod4,RedPointType.eastSeaFindGod)
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.ActivityGroups)) do
if v.RpType > 0 and v.RpTypeParent > 0 then
@ -665,6 +669,11 @@ function this.RegisterRedCheckFunc()
RPData:AddCheckFunc(RedPointType.jijin328,CommonActPageManager.ChaoZhiJiJin328Red)
--战力冲刺
RPData:AddCheckFunc(RedPointType.PowerRiceGool,CommonActPageManager.PowerRiceRedCheck)
RPData:AddCheckFunc(RedPointType.eastSeaFindGod1,CommonActPageManager.GetRedPointEastSeaFindGodnew)
RPData:AddCheckFunc(RedPointType.eastSeaFindGod2,CommonActPageManager.GetRedPointEastSeaFindGodnew)
RPData:AddCheckFunc(RedPointType.eastSeaFindGod3,CommonActPageManager.GetRedPointEastSeaFindGodnew)
RPData:AddCheckFunc(RedPointType.eastSeaFindGod4,CommonActPageManager.GetRedPointEastSeaFindGodnew)
end
-- 向红点绑定物体

View File

@ -33,7 +33,7 @@ function this.InitTypeTaskList(_userMissionList)
userMissionList.takeTimes = _userMissionList[i].takeTimes
userMissionList.heroId = _userMissionList[i].heroId
userMissionList.lock = _userMissionList[i].lock
--LogRed("任务 类型:"..userMissionList.type.." ID:"..userMissionList.missionId.." 状态:"..userMissionList.state.." lock "..userMissionList.lock.. " progress:".._userMissionList[i].progress)
LogRed("任务 类型:"..userMissionList.type.." ID:"..userMissionList.missionId.." 状态:"..userMissionList.state.." lock "..userMissionList.lock.. " progress:".._userMissionList[i].progress)
if not TypeTaskData[_userMissionList[i].type] then
TypeTaskData[_userMissionList[i].type] = {}
end
@ -55,7 +55,7 @@ function this.ResetTaskData(type)
end
--初始化拉去并设定本地type类型的任务数据
--初始化拉去并设定本地type类型的任务数据 只在vip升级时候用
function this.SetTypeTaskList(type, data)
TypeTaskData[type] = {}
for i = 1, #data do
@ -76,7 +76,7 @@ end
local achievementConfig = ConfigManager.GetConfig(ConfigName.AchievementConfig)
local curShowAllAchievementData = {}
local curShowAllOkAchievementData = {}
--获取本地存储的type任务类型数据 前端展示用 红点检测用 飘弹窗提示用
--获取本地存储的type任务类型数据 前端展示用 红点检测用 飘弹窗提示用 只在任务成就里面用
function this.GetCurShowAllAchievementData(type)
curShowAllAchievementData = {}
curShowAllOkAchievementData = {}
@ -145,6 +145,7 @@ function this.SetTypeTaskState(type, Id, state, progress, takeTimes,heroId)
Game.GlobalEvent:DispatchEvent(GameEvent.DynamicTask.OnMissionChange)
Game.GlobalEvent:DispatchEvent(GameEvent.Mission.NiuQiChongTianTask)
Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.MissonChange)
Game.GlobalEvent:DispatchEvent(GameEvent.EastSeaFindGod.OnMissionChange)
end
function this.SetMissionIdState(type, Id, state)
@ -213,6 +214,7 @@ function this.RefreshTypeTaskInfo(taskInfoList)
Game.GlobalEvent:DispatchEvent(GameEvent.DynamicTask.OnMissionChange)
Game.GlobalEvent:DispatchEvent(GameEvent.Mission.NiuQiChongTianTask)
Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.MissonChange)
Game.GlobalEvent:DispatchEvent(GameEvent.EastSeaFindGod.OnMissionChange)
this.SetDirty()
end
@ -266,6 +268,7 @@ function this.ChangeVipRedPointState()
--CheckRedPointStatus(RedPointType.Achievement_Four)
--CheckRedPointStatus(RedPointType.Achievement_Five)
--CheckRedPointStatus(RedPointType.HeroExplore)
CommonActPageManager.GetRedPointEastSeaFindGodNew()
end
function this.GetVipRedPointState()