【神将来袭】代码完善

dev_chengFeng
ZhangBiao 2020-12-01 15:52:34 +08:00
parent 758c59dcae
commit 2d51e11e10
5 changed files with 1615 additions and 119 deletions

View File

@ -1080,6 +1080,7 @@ ActivityTypeDef = {
ShenYiTianJiang = 71, --神衣天降 ShenYiTianJiang = 71, --神衣天降
LingShouBaoGe = 100,--灵兽宝阁 LingShouBaoGe = 100,--灵兽宝阁
LingShowTeHui = 101, --灵兽特惠 LingShowTeHui = 101, --灵兽特惠
XinJiangLaiXi = 200,--新将来袭
--主题活动 --主题活动
FindFairy=43,--限时招募 FindFairy=43,--限时招募

View File

@ -177,7 +177,8 @@ ConfigName = {
HeroSkin = "HeroSkin", HeroSkin = "HeroSkin",
BlessingConfigNew = "BlessingConfigNew", BlessingConfigNew = "BlessingConfigNew",
BlessingRewardPoolNew = "BlessingRewardPoolNew", BlessingRewardPoolNew = "BlessingRewardPoolNew",
SpiritAnimalSummon = "SpiritAnimalSummon" SpiritAnimalSummon = "SpiritAnimalSummon",
NewHeroConfig = "NewHeroConfig"
} }
require "Framework/GameDataBase" require "Framework/GameDataBase"

View File

@ -223,6 +223,7 @@ function this.LingShouBuildData()
return rewardData,showData,curScore return rewardData,showData,curScore
end end
--灵兽宝阁红点检测
function this.LingShouUpCheckRed() function this.LingShouUpCheckRed()
local freeTime = 0 local freeTime = 0
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting) local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
@ -245,4 +246,20 @@ function this.LingShouUpCheckRed()
return false return false
end end
--新将来袭获取数据
function this.XinJiangBuildData()
local data={}
local ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.XinJiangLaiXi)
local newHeroData = ConfigManager.GetConfigData(ConfigName.NewHeroConfig,ActData.activityId)
data.endTime = ActData.endTime
data.fightTime = PrivilegeManager.GetPrivilegeRemainValue(2012)
data.buyTime = PrivilegeManager.GetPrivilegeRemainValue(2013)
data.money = BagManager.GetTotalItemNum(16)
local rewardGroupId = newHeroData.DropList[#newHeroData.DropList][2]
data.reward = ConfigManager.GetConfigData(ConfigName.RewardGroup,rewardGroupId).RewardItem
data.activityId = ActData.activityId
return data
end
return this return this

View File

@ -1,14 +1,14 @@
local XinJiangLaiXi = quick_class("XinJiangLaiXi") local XinJiangLaiXi = quick_class("XinJiangLaiXi")
-- local allData={} local allData={}
-- local itemsGrid = {}--item重复利用 local itemsGrid = {}--item重复利用
local this=XinJiangLaiXi local this=XinJiangLaiXi
local sortingOrder = 0 local sortingOrder = 0
-- local parent = {} local parent = {}
-- local properTypeConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig) -- local properTypeConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
-- local rechargeConfigId = 0 -- local rechargeConfigId = 0
-- local rechargeData = {} -- local rechargeData = {}
-- local fakeId = 0 -- local fakeId = 0
-- this.LiveObj = nil this.LiveObj = nil
function XinJiangLaiXi:ctor(mainPanel, gameObject) function XinJiangLaiXi:ctor(mainPanel, gameObject)
self.mainPanel = mainPanel self.mainPanel = mainPanel
self.gameObject = gameObject self.gameObject = gameObject
@ -26,33 +26,47 @@ function XinJiangLaiXi:InitComponent(gameObject)
this.liveRoot = Util.GetGameObject(gameObject, "bg/liveRoot") this.liveRoot = Util.GetGameObject(gameObject, "bg/liveRoot")
this.tip1 = Util.GetGameObject(gameObject, "layout/Text1"):GetComponent("Text") this.tip1 = Util.GetGameObject(gameObject, "layout/Text1"):GetComponent("Text")
this.tip2 = Util.GetGameObject(gameObject, "layout/Text2"):GetComponent("Text") this.tip2 = Util.GetGameObject(gameObject, "layout/Text2"):GetComponent("Text")
this.addBtn = Util.GetGameObject(gameObject, "layout/addBtn")
--shop
this.tabList = Util.GetGameObject(this.mainPanel,"bg/tabbox")
this.btnBack = Util.GetGameObject(this.mainPanel,"bg/btnBack")
this.bottomBar = Util.GetGameObject(this.mainPanel,"bg/bottomBar")
this.shop = Util.GetGameObject(this.gameObject,"shop")
this.shopBack = Util.GetGameObject(this.shop,"shopBack/btnBack")
this.content = Util.GetGameObject(this.shop,"content")
end end
--绑定事件(用于子类重写) --绑定事件(用于子类重写)
function XinJiangLaiXi:BindEvent() function XinJiangLaiXi:BindEvent()
-- Util.AddClick(this.buyBtn,function() Util.AddClick(this.fightBtn,function()
-- if rechargeData.buyTimes >= rechargeData.dynamicBuyTimes then local fdata, fseed = BattleManager.GetFakeBattleData(1006)
-- return local testFightData = {
-- end fightData = fdata,
-- --直购商品 fightSeed = fseed,
-- PayManager.Pay(rechargeConfigId, function(id) fightType = 0,
-- this.RechargeSuccessFunc(id) maxRound = 20
-- end) end) }
-- Util.AddClick(this.reviewBtn,function() UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test)
-- local fdata, fseed = BattleManager.GetFakeBattleData(fakeId) end)
-- local testFightData = {
-- fightData = fdata, Util.AddClick(this.storeBtn,function()
-- fightSeed = fseed, this.shop:SetActive(true)
-- fightType = 0, this.btnBack:SetActive(false)
-- maxRound = 20 this.tabList:SetActive(false)
-- } this.bottomBar:SetActive(false)
-- UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test) this:StoreShow()--商店
-- end) end)
Util.AddClick(this.shopBack,function()
this.shop:SetActive(false)
this.btnBack:SetActive(true)
this.tabList:SetActive(true)
this.bottomBar:SetActive(true)
end)
end end
-- function this.RechargeSuccessFunc(id)
-- FirstRechargeManager.RefreshAccumRechargeValue(id)
-- this.OnShowData()
-- end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
function XinJiangLaiXi:AddListener() function XinJiangLaiXi:AddListener()
end end
@ -68,94 +82,69 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写) --界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function XinJiangLaiXi:OnShow(_sortingOrder,_parent) function XinJiangLaiXi:OnShow(_sortingOrder,_parent)
-- parent = _parent parent = _parent
-- sortingOrder = _sortingOrder sortingOrder = _sortingOrder
-- this:OnShowData() allData = DynamicActivityManager.XinJiangBuildData()
-- XinJiangLaiXi:SetTime() XinJiangLaiXi:OnShowData()
XinJiangLaiXi:SetTime()
end end
-- function XinJiangLaiXi:OnShowData() function XinJiangLaiXi:OnShowData()
-- local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.ShenYiTianJiang) if not itemsGrid then
-- local activityConfig = ConfigManager.GetConfigData(ConfigName.GlobalActivity,activityId) itemsGrid = {}
-- rechargeConfigId = activityConfig.CanBuyRechargeId[1] end
-- allData = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,rechargeConfigId) for k,v in ipairs(itemsGrid) do
-- if not itemsGrid then v.gameObject:SetActive(false)
-- itemsGrid = {} end
-- end for k,v in ipairs(allData.reward) do
-- for k,v in ipairs(itemsGrid) do if not itemsGrid[k] then
-- v.gameObject:SetActive(false) itemsGrid[k] = SubUIManager.Open(SubUIConfig.ItemView,this.scrollItem.transform)
-- end end
-- for k,v in ipairs(allData.RewardShow) do itemsGrid[k].gameObject:SetActive(true)
-- if not itemsGrid[k] then itemsGrid[k]:OnOpen(false, v, 1,false,false,false,sortingOrder)
-- itemsGrid[k] = SubUIManager.Open(SubUIConfig.ItemView,this.scrollItem.transform) end
-- end
-- itemsGrid[k].gameObject:SetActive(true)
-- itemsGrid[k]:OnOpen(false, {v[1],v[2]}, 1,false,false,false,sortingOrder)
-- end
-- local strs = string.split(activityConfig.ExpertDec,'#')
-- local skinId = tonumber(strs[1])
-- fakeId = tonumber(strs[2])
-- local skinConfig = ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",skinId)
-- if this.LiveObj then
-- poolManager:UnLoadLive(this.LiveObj.name,this.LiveObj)
-- this.LiveObj = nil
-- end
-- this.proPertyText.text = "属性加成:"
-- if not skinConfig then
-- else
-- LogGreen(skinConfig.Live.." name:"..GetResourcePath(skinConfig.Live))
-- this.LiveObj = poolManager:LoadLive(GetResourcePath(skinConfig.Live),this.liveRoot.transform, Vector3.one * skinConfig.Scale, Vector3.New(skinConfig.Position[1], skinConfig.Position[2], 0))
-- this.skinName.text = ConfigManager.GetConfigData(ConfigName.HeroConfig,skinConfig.HeroId).ReadingName
-- local heroSkinSingleProVal = {}
-- for _,v in ipairs(skinConfig.MonomerProperty) do
-- if not heroSkinSingleProVal[v[1]] then
-- heroSkinSingleProVal[v[1]] = 0
-- end
-- heroSkinSingleProVal[v[1]] = heroSkinSingleProVal[v[1]] + v[2]
-- end
-- for k,v in pairs(heroSkinSingleProVal) do
-- this.proPertyText.text = this.proPertyText.text..properTypeConfig[k].Info.."+"..GetPropertyFormatStr(properTypeConfig[k].Style,v)
-- end
-- end
-- rechargeData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, rechargeConfigId) if this.LiveObj then
-- if rechargeData then poolManager:UnLoadLive(this.LiveObj.name,this.LiveObj)
-- this.buytimes.text = "剩余次数:"..(rechargeData.dynamicBuyTimes - rechargeData.buyTimes) this.LiveObj = nil
-- else end
-- LogGreen("找不到数据了:"..rechargeConfigId) this.LiveObj = poolManager:LoadLive("l_lingshou_fenghuang",this.liveRoot.transform, Vector3.one, Vector3.zero)
-- end
-- end
-- function XinJiangLaiXi:SetTime() this.tip1.text = "剩余挑战次数:".."<color=green>"..allData.fightTime.."</color>"
-- if self.timer then this.tip1.text = "剩余购买次数:".."<color=green>"..allData.buyTime.."</color>"
-- self.timer:Stop() end
-- self.timer = nil
-- end function XinJiangLaiXi:SetTime()
-- local endTime = ActivityGiftManager.GetTaskEndTime(ActivityTypeDef.ShenYiTianJiang) if self.timer then
-- local timeDown = endTime - GetTimeStamp() self.timer:Stop()
-- this.time.text = Language[12321]..TimeToDHMS(timeDown) self.timer = nil
-- self.timer = Timer.New(function() end
-- timeDown = timeDown - 1 local timeDown = allData.endTime - GetTimeStamp()
-- if timeDown < 1 then this.time.text = Language[12321]..TimeToDHMS(timeDown)
-- self.timer:Stop() self.timer = Timer.New(function()
-- self.timer = nil timeDown = timeDown - 1
-- this.time.text = Language[12321]..TimeToDHMS(0) if timeDown < 1 then
-- end self.timer:Stop()
-- this.time.text = Language[12321]..TimeToDHMS(timeDown) self.timer = nil
-- end, 1, -1, true) parent:ClosePanel()
-- self.timer:Start() return
-- end end
this.time.text = Language[12321]..TimeToDHMS(timeDown)
end, 1, -1, true)
self.timer:Start()
end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
function XinJiangLaiXi:OnOpen() function XinJiangLaiXi:OnOpen()
end end
-- function this.RechargeSuccessFunc(id) --商店
-- FirstRechargeManager.RefreshAccumRechargeValue(id) function this:StoreShow()
-- --OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.GiftBuy, id) if not this.shopView then
-- this.OnShowData() this.shopView = SubUIManager.Open(SubUIConfig.ShopView, this.content.transform)
-- end end
this.shopView:ShowShop(SHOP_TYPE.CELEBRATION_SHOP,sortingOrder)
end
function XinJiangLaiXi:OnClose() function XinJiangLaiXi:OnClose()
@ -163,24 +152,24 @@ end
--界面销毁时调用(用于子类重写) --界面销毁时调用(用于子类重写)
function XinJiangLaiXi:OnDestroy() function XinJiangLaiXi:OnDestroy()
-- if self.timer then if self.timer then
-- self.timer:Stop() self.timer:Stop()
-- self.timer = nil self.timer = nil
-- end end
-- if this.LiveObj then -- if this.LiveObj then
-- poolManager:UnLoadLive(this.LiveObj.name,this.LiveObj) -- poolManager:UnLoadLive(this.LiveObj.name,this.LiveObj)
-- this.LiveObj = nil -- this.LiveObj = nil
-- end -- end
-- sortingOrder = 0 sortingOrder = 0
-- itemsGrid = {} -- itemsGrid = {}
end end
function XinJiangLaiXi:OnHide() function XinJiangLaiXi:OnHide()
-- if self.timer then if self.timer then
-- self.timer:Stop() self.timer:Stop()
-- self.timer = nil self.timer = nil
-- end end
-- sortingOrder = 0 sortingOrder = 0
end end
return XinJiangLaiXi return XinJiangLaiXi