主题活动提交

(cherry picked from commit 847adfc761)
dev_chengFeng
jiaoyangna 2021-05-10 20:20:20 +08:00
parent 5eed825a7c
commit 06fb7e218f
18 changed files with 280 additions and 3997 deletions

View File

@ -557,6 +557,7 @@ GameObject:
m_Component:
- component: {fileID: 6860498336681067139}
- component: {fileID: 6862404990152815265}
- component: {fileID: 4061525271630096499}
m_Layer: 5
m_Name: pageContent
m_TagString: Untagged
@ -591,6 +592,35 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6642745862761146423}
m_CullTransparentMesh: 0
--- !u!114 &4061525271630096499
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6642745862761146423}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: d9eb47e7e33ca8a4aa13a0de17b927ab, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &6963380778722333028
GameObject:
m_ObjectHideFlags: 0

View File

@ -1010,6 +1010,8 @@ JumpType = {
HeadChange = 10021, --巅峰赛
XianShiDuiHuan = 10022, --主题活动限时兑换
ZhuTiHuoDong = 20000,
QianKunShangDian = 20044, --乾坤商店
SheJiDaDianShangDian = 20060, --社稷大典商店
}
YaoHunFrame = {
--[6] = "r_tongyong_yaohunkuang002",

View File

@ -435,4 +435,5 @@ SubUIConfig = {
[21] = {name = "page12",assetName = "page12",script = "Modules/DynamicActivity/LingShouBaoGe"},--灵兽宝阁
[22] = {name = "page13",assetName = "page13",script = "Modules/DynamicActivity/XinJiangLaiXi"},--新将来袭
[23] = {name = "page14",assetName = "page14",script = "Modules/DynamicActivity/XiangYaoDuoBao"},--降妖夺宝
[24] = { name = "ShopView", assetName = "ShopView", script = "View/ShopViewNew" },
}

View File

@ -60,7 +60,7 @@ function ActivityMainPanel:CheckActOpen(_index)
if tabs[_index].IfBack == 1 then
if tabs[_index].ActiveType > 0 then
local id = ActivityGiftManager.IsActivityTypeOpen(tabs[_index].ActiveType)
if id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[_index].ActiveType) and (tabs[_index].ActiveType == ActivityTypeDef.DynamicAct or not GlobalActConfig[id].ShowArt or GlobalActConfig[id].ShowArt == this.activityType) then
if id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[_index].ActiveType) and (tabs[_index].ActiveType == ActivityTypeDef.DynamicAct or not GlobalActConfig[id].ShowArt or GlobalActConfig[id].ShowArt < 1 or GlobalActConfig[id].ShowArt == this.activityType) then
_CurPageIndex = _index
end
elseif tabs[_index].FunType > 0 then
@ -175,10 +175,7 @@ function this.PageTabAdapter(tab, index, status)
local id = ActivityGiftManager.IsActivityTypeOpen(tabs[index].ActiveType)
if id and id > 0 then
local actConfig
local actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",GlobalActConfig[id].ShowArt,"PageType",0,"ActiveType:",tabs[index].ActiveType)
if not actConfig then
actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",tabs[index].ActiveType,"PageType",this.activityType,"ActiveType",tabs[index].ActiveType)
end
local actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",GlobalActConfig[id].ShowArt,"PageType",this.activityType,"ActiveType",tabs[index].ActiveType)
if not actConfig then
actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",id,"PageType",this.activityType,"ActiveType",tabs[index].ActiveType)
end
@ -204,8 +201,7 @@ function this.PageTabAdapter(tab, index, status)
if tabs[index].IfBack == 1 then
if tabs[index].ActiveType > 0 then
local id = ActivityGiftManager.IsActivityTypeOpen(tabs[index].ActiveType)
--LogGreen("tabs[index].ActiveType:"..tabs[index].ActiveType.." id:"..tostring(id))
isshow = id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[index].ActiveType) and (tabs[index].ActiveType == ActivityTypeDef.DynamicAct or not GlobalActConfig[id].ShowArt or GlobalActConfig[id].ShowArt == this.activityType)
isshow = id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[index].ActiveType) and (tabs[index].ActiveType == ActivityTypeDef.DynamicAct or not GlobalActConfig[id].ShowArt or GlobalActConfig[id].ShowArt < 1 or GlobalActConfig[id].ShowArt == this.activityType)
elseif tabs[index].FunType > 0 then
isshow = ActTimeCtrlManager.SingleFuncState(tabs[index].FunType)
else

View File

@ -1,5 +1,4 @@
local LingShouBaoGe = {}
local ActivityDetail = require("Modules/DynamicActivity/ActivityDetail")--活动详情
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
@ -7,21 +6,10 @@ local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local SpiritAnimalConfig = ConfigManager.GetConfig(ConfigName.SpiritAnimal)
local gloAcivity = ConfigManager.GetConfig(ConfigName.GlobalActivity)
local activityId = 0
local singleRecruit = nil
local tenRecruit = nil
local sortingOrder = 0
local parent
local freeTime= 0 --免费抽取次数
local showData = {}
local rewardData = {}
local curScore = 0
local Live
local bgName
local ActData=nil
local LSrewardData=nil
--按钮类型
local bType={
Btn1=1,
@ -37,12 +25,13 @@ function LingShouBaoGe:New(gameObject)
setmetatable(b, { __index = LingShouBaoGe })
return b
end
function LingShouBaoGe:InitComponent(gameObject)
function LingShouBaoGe:InitComponent()
self.helpBtn = Util.GetGameObject(self.gameObject,"help")
self.helpPosition=self.helpBtn:GetComponent("RectTransform").localPosition
self.preview = Util.GetGameObject(self.gameObject,"rightUp/preview")
self.change = Util.GetGameObject(self.gameObject,"rightUp/change")
self.change:SetActive(false)
self.detailBtn = Util.GetGameObject(self.gameObject,"rightUp/detailBtn")
self.upper=Util.GetGameObject(self.gameObject,"bottom/times"):GetComponent("Text") ---召唤上限
@ -51,9 +40,6 @@ function LingShouBaoGe:InitComponent(gameObject)
self.btnGroup=Util.GetGameObject(self.gameObject,"bottom/btngroup")
self.leftTime=Util.GetGameObject(self.gameObject,"bottom/lefttime"):GetComponent("Text")
self.detail= Util.GetGameObject(self.gameObject, "detail")
self.detail.gameObject:SetActive(false)
self.grid = Util.GetGameObject(self.gameObject, "aniRoot")
self.title = Util.GetGameObject(self.gameObject, "Bg/title"):GetComponent("Image")
@ -70,16 +56,16 @@ function LingShouBaoGe:BindEvent()
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.LingShouBaoGe,self.helpPosition.x,self.helpPosition.y)
end)
Util.AddClick(self.detailBtn, function()
ActivityDetail.new(self.detail,3)
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.RecrutDetail,self.actConfig.HelpId,self.actType,PRE_REWARD_POOL_TYPE.LING_SHOU_UP,PRE_REWARD_POOL_TYPE.LING_SHOU)
end)
Util.AddClick(self.change, function()
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.LingShouBaoGe,ActData,showData.monsterId,function()
this:Refresh()
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.LingShouBaoGe,self.actData,self.showData.monsterId,function()
self:Refresh()
end)
end)
Util.AddClick(self.preview, function()
local battleId = tonumber(gloAcivity[activityId].ExpertDec)
local battleId = tonumber(gloAcivity[self.activityId].ExpertDec)
local fdata, fseed = BattleManager.GetFakeBattleData(battleId)
local testFightData = {
fightData = fdata,
@ -89,35 +75,54 @@ function LingShouBaoGe:BindEvent()
}
UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test,function ()
Timer.New(function ()
this:Refresh()
self:Refresh()
end,3):Start()
end)
end)
end
function LingShouBaoGe:OnShow(_sortingOrder,_parent)
local actId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LingShouBaoGe)
if not actId or actId <= 0 then return end
parent = _parent
sortingOrder = _sortingOrder
self.gameObject:SetActive(true)
--界面打开时调用(用于子类重写)
function LingShouBaoGe:OnOpen(_activityConfig,_index,parent)
self.actConfig = _activityConfig
self.pageIndex = _index
self.parent = parent
end
this:Refresh()
function LingShouBaoGe:OnShow(_sortingOrder)
self.gameObject:SetActive(true)
sortingOrder = _sortingOrder
self.actId = self.actConfig.ActId
self.actType = self.actConfig.ActiveType > 0 and self.actConfig.ActiveType or self.actConfig.FunType
if self.actConfig.IfBack == 1 then
if self.actConfig.ActiveType > 0 then
local id = ActivityGiftManager.IsActivityTypeOpen(self.actConfig.ActiveType)
if id and id > 0 then
self.actId = id
local config = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"PageType",self.actConfig.PageType,"ActiveType",self.actConfig.ActiveType,"ActId",id)
if config then
self.actConfig = config
end
end
end
end
self:Refresh()
end
function LingShouBaoGe:Refresh()
ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.LingShouBaoGe)
activityId = ActData.activityId
LSrewardData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",activityId)
local array = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySetting,"ActivityId",activityId)
singleRecruit = array[1]
tenRecruit = array[2]
self.actData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.LingShouBaoGe)
self.activityId = self.actData.activityId
self.LSrewardData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",self.activityId)
local array = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySetting,"ActivityId",self.activityId)
self.singleRecruit = array[1]
self.tenRecruit = array[2]
self.change:SetActive(false)
CheckRedPointStatus(RedPointType.LingShouBaoGe)
this:refreshBtnShow()--刷新按钮显示
this:TimeCountDown()--时间
this:SetData()--加载界面数据立绘+进度条
self:refreshBtnShow()--刷新按钮显示
self:TimeCountDown()--时间
self:SetData()--加载界面数据立绘+进度条
end
local PositionList = {
@ -128,45 +133,45 @@ local PositionList = {
[20009] = {pos = 70,title = "l_lingshou_jukun_zh"},
}
function LingShouBaoGe:SetData()
rewardData={}
showData={}
rewardData,showData,curScore = DynamicActivityManager.LingShouBuildData()
self.title.sprite = Util.LoadSprite(PositionList[showData.monsterId].title)
self.rewardData={}
self.showData={}
self.rewardData,self.showData,self.curScore = DynamicActivityManager.LingShouBuildData()
self.title.sprite = Util.LoadSprite(PositionList[self.showData.monsterId].title)
--设置立绘
bgName = artConfig[SpiritAnimalConfig[showData.monsterId].Live].Name
local pos = SpiritAnimalConfig[showData.monsterId].Position
local scale = SpiritAnimalConfig[showData.monsterId].Scale
if Live then
poolManager:UnLoadLive(bgName, Live)
self.bgName = artConfig[SpiritAnimalConfig[self.showData.monsterId].Live].Name
local pos = SpiritAnimalConfig[self.showData.monsterId].Position
local scale = SpiritAnimalConfig[self.showData.monsterId].Scale
if self.Live then
poolManager:UnLoadLive(self.bgName, self.Live)
end
Live = poolManager:LoadLive(bgName, self.grid.transform, Vector3.one*scale*0.8, Vector2.New(pos[1],pos[2]+PositionList[showData.monsterId].pos))
local RoleLiveGOGraphic = Live:GetComponent("SkeletonGraphic")
self.Live = poolManager:LoadLive(self.bgName, self.grid.transform, Vector3.one*scale*0.8, Vector2.New(pos[1],pos[2]+PositionList[self.showData.monsterId].pos))
local RoleLiveGOGraphic = self.Live:GetComponent("SkeletonGraphic")
RoleLiveGOGraphic.AnimationState:SetAnimation(0, "idle", true)
local leftTime = lotterySetting[singleRecruit.Id].DiamondBoxContain[1][2] - ActData.value
self.tip2.text = Language[10480].."<color=green>"..leftTime..Language[10481]..GetLanguageStrById(SpiritAnimalConfig[showData.monsterId].Name)
local leftTime = lotterySetting[self.singleRecruit.Id].DiamondBoxContain[1][2] - self.actData.value
self.tip2.text = Language[10480].."<color=green>"..leftTime..Language[10481]..GetLanguageStrById(SpiritAnimalConfig[self.showData.monsterId].Name)
--设置奖励
self.progressValue.fillAmount = curScore/LSrewardData[#LSrewardData].Values[1][1]
Util.GetGameObject(self.value, "num"):GetComponent("Text").text = curScore
self.progressValue.fillAmount = self.curScore/self.LSrewardData[#self.LSrewardData].Values[1][1]
Util.GetGameObject(self.value, "num"):GetComponent("Text").text = self.curScore
Util.GetGameObject(self.value, "tips"):GetComponent("Text").text = Language[10482]
for i = 1, self.reward.transform.childCount do
local item = self.reward.transform:GetChild(i-1)
Util.GetGameObject(item, "num/Text"):GetComponent("Text").text = LSrewardData[i].Reward[1][2]
Util.GetGameObject(item, "Text"):GetComponent("Text").text = LSrewardData[i].Values[1][1]
Util.GetGameObject(item, "icon"):GetComponent("Image").sprite = Util.LoadSprite(artConfig[SpiritAnimalConfig[showData.monsterId].Icon].Name)
Util.GetGameObject(item, "red"):SetActive(rewardData[i].state == 1)
Util.GetGameObject(item, "num/Text"):GetComponent("Text").text = self.LSrewardData[i].Reward[1][2]
Util.GetGameObject(item, "Text"):GetComponent("Text").text = self.LSrewardData[i].Values[1][1]
Util.GetGameObject(item, "icon"):GetComponent("Image").sprite = Util.LoadSprite(artConfig[SpiritAnimalConfig[self.showData.monsterId].Icon].Name)
Util.GetGameObject(item, "red"):SetActive(self.rewardData[i].state == 1)
local btn = Util.GetGameObject(item, "icon")
Util.AddOnceClick(btn,function ()
if rewardData[i].state == 1 then
NetManager.GetActivityRewardRequest(rewardData[i].missionId,activityId,function (drop)
if self.rewardData[i].state == 1 then
NetManager.GetActivityRewardRequest(self.rewardData[i].missionId,self.activityId,function (drop)
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1,function ()
this:Refresh()
self:Refresh()
end)
end)
else
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,LSrewardData[i].Reward[1][1],nil)
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,self.LSrewardData[i].Reward[1][1],nil)
end
end)
end
@ -175,16 +180,16 @@ end
function LingShouBaoGe:refreshBtnShow()
--下方的数量显示
local maxtimesId=lotterySetting[singleRecruit.Id].MaxTimes
local maxtimesId=lotterySetting[self.singleRecruit.Id].MaxTimes
local curTimes=PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)
self.upper.text = Language[10483]..curTimes.."/"..privilegeConfig[maxtimesId].Condition[1][2]--召唤上限
--是否是免费抽
local freeTimesId=lotterySetting[singleRecruit.Id].FreeTimes
local freeTimesId=lotterySetting[self.singleRecruit.Id].FreeTimes
if freeTimesId > 0 then
freeTime = PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId] = freeTime
self.freeTime = PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId] = self.freeTime
end
--按钮赋值
for n, m in ipairs(btns) do
@ -194,17 +199,17 @@ function LingShouBaoGe:refreshBtnShow()
local icon = Util.GetGameObject(btn.gameObject,"Content/Icon"):GetComponent("Image")
local num = Util.GetGameObject(btn.gameObject,"Content/Num"):GetComponent("Text")
--存在免费次数 并且 免费>=1 并且是1按钮
local isFree = freeTime and freeTime >= 1 and n == bType.Btn1
local isFree = self.freeTime and self.freeTime >= 1 and n == bType.Btn1
redPot.gameObject:SetActive(isFree)
icon.gameObject:SetActive(not isFree)
num.gameObject:SetActive(not isFree)
self.tip1.gameObject:SetActive(freeTime == 0)
self.tip1.gameObject:SetActive(self.freeTime == 0)
local itemId=0
local itemNum=0
local type = 0
type = n == bType.Btn1 and singleRecruit.Id or tenRecruit.Id
type = n == bType.Btn1 and self.singleRecruit.Id or self.tenRecruit.Id
local d = RecruitManager.GetExpendData(type)
if isFree then
@ -251,16 +256,16 @@ function LingShouBaoGe:Recruit(id,RecruitMaxtimesId,itemId,itemNum,state,freeTim
function()
RecruitManager.RecruitRequest(id,function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(RecruitMaxtimesId,num)
UIManager.OpenPanel(UIName.PokemonSingleResultPanel,id,msg.drop,activityId,recruitType,function ()
this:Refresh()
UIManager.OpenPanel(UIName.PokemonSingleResultPanel,id,msg.drop,self.activityId,recruitType,function ()
self:Refresh()
end)
end,freeTimesId,itemId,itemNum)
end,itemNum)
else
RecruitManager.RecruitRequest(id, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(RecruitMaxtimesId,num)
UIManager.OpenPanel(UIName.PokemonSingleResultPanel,id,msg.drop,activityId,recruitType,function ()
this:Refresh()
UIManager.OpenPanel(UIName.PokemonSingleResultPanel,id,msg.drop,self.activityId,recruitType,function ()
self:Refresh()
end)
end,freeTimesId,itemId,itemNum)
end
@ -288,22 +293,22 @@ function LingShouBaoGe:TimeCountDown()
local timeDown=CalculateSecondsNowTo_N_OClock(0)
self.tip1.text = TimeToHMS(timeDown)..Language[10488]
local timeDown2 = ActData.endTime - GetTimeStamp()
local timeDown2 = self.actData.endTime - GetTimeStamp()
self.leftTime.text = Language[10023]..TimeToFelaxible(timeDown2)
self.tip1.gameObject:SetActive((timeDown < timeDown2) and (freeTime == 0))
self.tip1.gameObject:SetActive((timeDown < timeDown2) and (self.freeTime == 0))
self.timer = Timer.New(function()
if timeDown < 1 then
self.timer:Stop()
self.timer = nil
this:Refresh()
self:Refresh()
return
end
if timeDown2 < 1 then
self.timer:Stop()
self.timer = nil
parent:ClosePanel()
self.parent:ClosePanel()
return
end
timeDown = timeDown - 1
@ -314,13 +319,12 @@ function LingShouBaoGe:TimeCountDown()
self.timer:Start()
end
function LingShouBaoGe:OnHide()
if Live then
poolManager:UnLoadLive(bgName, Live)
end
Live = nil
function LingShouBaoGe:OnClose()
self.gameObject:SetActive(false)
self.detail.gameObject:SetActive(false)
if self.Live then
poolManager:UnLoadLive(self.bgName, self.Live)
end
self.Live = nil
if self.timer then
self.timer:Stop()
self.timer = nil
@ -328,11 +332,10 @@ function LingShouBaoGe:OnHide()
end
function LingShouBaoGe:OnDestroy()
if Live then
poolManager:UnLoadLive(bgName, Live)
if self.Live then
poolManager:UnLoadLive(self.bgName, self.Live)
end
Live = nil
ActivityDetail.OnDestroy()
self.Live = nil
end
--添加事件监听(用于子类重写)

View File

@ -1,12 +1,6 @@
local LingShowTeHui = {}
local allData={}
local itemsGrid = {}--item重复利用
local this=LingShowTeHui
local parent = {}
local spiritAnimalConfig = ConfigManager.GetConfig(ConfigName.SpiritAnimal)
local rechargeConfigId = 0
local rechargeData = {}
local itemViewList = {}
function LingShowTeHui:New(gameObject)
local b = {}
b.gameObject = gameObject
@ -30,18 +24,18 @@ end
--绑定事件(用于子类重写)
function LingShowTeHui:BindEvent()
Util.AddClick(self.buyBtn,function()
if rechargeData.buyTimes >= rechargeData.dynamicBuyTimes then
if self.rechargeData.buyTimes >= self.rechargeData.dynamicBuyTimes then
return
end
--直购商品
PayManager.Pay(rechargeConfigId, function(id)
self.RechargeSuccessFunc(id)
PayManager.Pay(self.rechargeConfigId, function(id)
self:RechargeSuccessFunc(id)
end)
end)
end
function self.RechargeSuccessFunc(id)
function LingShowTeHui:RechargeSuccessFunc(id)
FirstRechargeManager.RefreshAccumRechargeValue(id)
self.OnShowData()
self:OnShowData()
end
--添加事件监听(用于子类重写)
function LingShowTeHui:AddListener()
@ -53,16 +47,33 @@ end
local sortingOrder = 0
--界面打开时调用(用于子类重写)
function LingShowTeHui:OnOpen()
function LingShowTeHui:OnOpen(_activityConfig,_index,parent)
self.actConfig = _activityConfig
self.pageIndex = _index
self.parent = parent
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function LingShowTeHui:OnShow(_sortingOrder,_parent)
parent = _parent
self.gameObject:SetActive(true)
sortingOrder = _sortingOrder
this:OnShowData()
LingShowTeHui:SetTime()
self.actId = self.actConfig.ActId
self.actType = self.actConfig.ActiveType > 0 and self.actConfig.ActiveType or self.actConfig.FunType
if self.actConfig.IfBack == 1 then
if self.actConfig.ActiveType > 0 then
local id = ActivityGiftManager.IsActivityTypeOpen(self.actConfig.ActiveType)
if id and id > 0 then
self.actId = id
local config = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"PageType",self.actConfig.PageType,"ActiveType",self.actConfig.ActiveType,"ActId",id)
if config then
self.actConfig = config
end
end
end
end
self:OnShowData()
self:SetTime()
end
local FrameSprite = {
[3] = "l_lishoutehui_ziyuan",
@ -70,23 +81,22 @@ local FrameSprite = {
[5] = "l_lishoutehui_huangyuan",
}
function LingShowTeHui:OnShowData()
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LingShowTeHui)
local activityConfig = ConfigManager.GetConfigData(ConfigName.GlobalActivity,activityId)
rechargeConfigId = activityConfig.CanBuyRechargeId[1]
allData = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,rechargeConfigId)
self.buyBtnText.text = MoneyUtil.GetMoneyUnitNameWithMoney(allData.Price)
if not itemsGrid then
itemsGrid = {}
local activityConfig = ConfigManager.GetConfigData(ConfigName.GlobalActivity,self.actId)
self.rechargeConfigId = activityConfig.CanBuyRechargeId[1]
self.allData = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,self.rechargeConfigId)
self.buyBtnText.text = MoneyUtil.GetMoneyUnitNameWithMoney(self.allData.Price)
if not self.itemsGrid then
self.itemsGrid = {}
end
for k,v in ipairs(itemsGrid) do
for k,v in ipairs(self.itemsGrid) do
v.gameObject:SetActive(false)
end
for k,v in ipairs(allData.RewardShow) do
if not itemsGrid[k] then
itemsGrid[k] = SubUIManager.Open(SubUIConfig.ItemView,self.scrollItem.transform)
for k,v in ipairs(self.allData.RewardShow) do
if not self.itemsGrid[k] then
self.itemsGrid[k] = SubUIManager.Open(SubUIConfig.ItemView,self.scrollItem.transform)
end
itemsGrid[k].gameObject:SetActive(true)
itemsGrid[k]:OnOpen(false, {v[1],v[2]}, 1,false,false,false,sortingOrder)
self.itemsGrid[k].gameObject:SetActive(true)
self.itemsGrid[k]:OnOpen(false, {v[1],v[2]}, 1,false,false,false,sortingOrder)
end
for _,v in pairs(self.giftItemView) do
@ -104,26 +114,26 @@ function LingShowTeHui:OnShowData()
if self.giftItemView[i] then
self.giftItemView[i].gameObject:SetActive(true)
self.giftItemView[i]:GetComponent("Image").sprite = Util.LoadSprite(FrameSprite[itemLocalConfig.Quality])
if not itemViewList then
itemViewList = {}
if not self.itemViewList then
self.itemViewList = {}
end
if not itemViewList[i] then
itemViewList[i] = SubUIManager.Open(SubUIConfig.ItemView,self.giftItemView[i].transform)
if not self.itemViewList[i] then
self.itemViewList[i] = SubUIManager.Open(SubUIConfig.ItemView,self.giftItemView[i].transform)
end
itemViewList[i].gameObject:SetActive(true)
itemViewList[i].gameObject:GetComponent("RectTransform").anchoredPosition = Vector3.New(36.03,-29.37,0)
itemViewList[i]:OnOpen(false, {itemLocalConfig.Id,0}, 1.1,false,false,false,sortingOrder)
self.itemViewList[i].gameObject:SetActive(true)
self.itemViewList[i].gameObject:GetComponent("RectTransform").anchoredPosition = Vector3.New(36.03,-29.37,0)
self.itemViewList[i]:OnOpen(false, {itemLocalConfig.Id,0}, 1.1,false,false,false,sortingOrder)
end
end
end
rechargeData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, rechargeConfigId)
if rechargeData then
local freetimes = rechargeData.dynamicBuyTimes - rechargeData.buyTimes
self.rechargeData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, self.rechargeConfigId)
if self.rechargeData then
local freetimes = self.rechargeData.dynamicBuyTimes - self.rechargeData.buyTimes
self.buytimes.text = Language[10492]..(freetimes < 0 and 0 or freetimes)
else
--LogGreen("找不到数据了:"..rechargeConfigId)
--LogGreen("找不到数据了:"..self.rechargeConfigId)
end
end
@ -147,20 +157,12 @@ function LingShowTeHui:SetTime()
self.timer:Start()
end
--界面打开时调用(用于子类重写)
function LingShowTeHui:OnOpen()
end
function self.RechargeSuccessFunc(id)
FirstRechargeManager.RefreshAccumRechargeValue(id)
--OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.GiftBuy, id)
self.OnShowData()
end
function LingShowTeHui:OnClose()
self.gameObject:SetActive(false)
if self.timer then
self.timer:Stop()
self.timer = nil
end
end
--界面销毁时调用(用于子类重写)
@ -170,16 +172,8 @@ function LingShowTeHui:OnDestroy()
self.timer = nil
end
sortingOrder = 0
itemsGrid = {}
itemViewList = {}
end
function LingShowTeHui:OnHide()
if self.timer then
self.timer:Stop()
self.timer = nil
end
sortingOrder = 0
self.itemsGrid = {}
self.itemViewList = {}
end
return LingShowTeHui

View File

@ -63,7 +63,7 @@ function QianKunBox:BindEvent()
end)
Util.AddClick(self.btnStore, function()
JumpManager.GoJump(41033)
JumpManager.GoJump(40017)
end)
end

View File

@ -2,7 +2,7 @@
local SheJiDaDian = {}
local sortingOrder = 0
local globalActive = ConfigManager.GetConfig(ConfigName.GlobalActivity)
local t = 20 --用来区分长按和点击的临界值
local t = 3 --用来区分长按和点击的临界值
function SheJiDaDian:New(gameObject)
local b = {}
b.gameObject = gameObject
@ -72,13 +72,43 @@ function SheJiDaDian:InitComponent()
self.itemData[i].num = Util.GetGameObject(self.itemData[i].go,"text/num"):GetComponent("Text")
self.itemData[i].donImg = Util.GetGameObject(self.itemData[i].go,"Image")
self.itemData[i].trigger = Util.GetEventTriggerListener(self.itemData[i].donImg)
self.itemData[i].trigger.onPointerDown = self.itemData[i].trigger.onPointerDown + function(go, data) self.OnPointerDown(go, data, i) end
self.itemData[i].trigger.onPointerUp = self.itemData[i].trigger.onPointerUp + self.OnPointerUp
self.itemData[i].OnPointerDo = function(go, data)
self:OnPointerDown(go, data, i)
end
self.itemData[i].OnPointerUp = function(go, data)
self:OnPointerUp(go,data)
end
self.itemData[i].trigger.onPointerDown = self.itemData[i].trigger.onPointerDown + self.itemData[i].OnPointerDo
self.itemData[i].trigger.onPointerUp = self.itemData[i].trigger.onPointerUp + self.itemData[i].OnPointerUp
end
self.curItemIndex = 0
self.numCount = 0
self.isPressed = false
self.isShortPress = false
end
function SheJiDaDian:OnPointerUp(Pointgo,data)--抬起
if PlayerManager.level < 50 or PlayerManager.familyId == 0 then
return
end
if self.isPressed then
LogGreen("111111111111111111111111111111111111111111111111")
self.isPressed = false
self:RefreshBottom(true)
end
end
--点击或长按处理升级处理
function SheJiDaDian:OnPointerDown(Pointgo,data,i)--按下
if PlayerManager.level < 50 then
PopupTipPanel.ShowTip("本活动需玩家等级达到五十级!")
return
end
if PlayerManager.familyId == 0 then
PopupTipPanel.ShowTip("请先加入公会!")
return
end
self.curItemIndex = i
if itemDataList[i].leftNum == 0 then
PopupTipPanel.ShowTip("道具不足,请先获取道具")
return
end
self.isPressed = true
end
--绑定事件(用于子类重写)
@ -103,12 +133,7 @@ function SheJiDaDian:BindEvent()
end)
Util.AddOnceClick(self.btnStore,function()
-- self.effect:SetActive(false)--特效还没加,加好后放开
-- self.shop:SetActive(true)
-- self.btnBack:SetActive(false)
-- self.tabList:SetActive(false)
-- self.bottomBar:SetActive(false)
-- self:StoreShow()--商店
JumpManager.GoJump(40018)
end)
Util.AddOnceClick(self.btnDetail,function()
@ -193,6 +218,12 @@ end
--刷新整个页面
function SheJiDaDian:Refresh()
self.curItemIndex = 0
self.numCount = 0
self.num = 0
self.isPressed = false
self.isShortPress = false
self.effect:SetActive(true)
self.effect2:SetActive(false)
self.ActInfo = ActivityGiftManager.GetActivityTypeInfo(self.actType)--活动数据
@ -232,35 +263,13 @@ function SheJiDaDian:RefreshRewardBox()
end
end
--点击或长按处理升级处理
function SheJiDaDian.OnPointerDown(Pointgo,data,i)--按下
if PlayerManager.level < 50 then
PopupTipPanel.ShowTip("本活动需玩家等级达到五十级!")
return
end
if PlayerManager.familyId == 0 then
PopupTipPanel.ShowTip("请先加入公会!")
return
end
self.curItemIndex = i
if itemDataList[i].leftNum == 0 then
PopupTipPanel.ShowTip("道具不足,请先获取道具")
return
end
self.numCount = 1
self.isPressed = true
end
function SheJiDaDian.OnPointerUp(Pointgo,data)--抬起
if PlayerManager.level < 50 or PlayerManager.familyId == 0 then
return
end
self:RefreshBottom(true)
end
function SheJiDaDian:OnUpdate()
if self.isPressed then
if self.numCount > t then
self.isShortPress = false
self:RefreshBottom(false)
self.numCount = 0
else
self.isShortPress = true
end
@ -311,17 +320,14 @@ end
--刷新一次
function SheJiDaDian:RefreshBottom(isSend)
if isSend then
if self.isShortPress then
self.numCount = 1
else
if itemDataList[self.curItemIndex].leftNum >= 0 then
self.numCount = self.numCount/t
end
end
self:RequestDonate(self.numCount)
self.isPressed = false
self.isShortPress = false
if self.num < 1 then
self.num = 1
end
self:RequestDonate(self.num)
else
self.num = self.num + 1
itemDataList[self.curItemIndex].leftNum = itemDataList[self.curItemIndex].leftNum - 1
if itemDataList[self.curItemIndex].leftNum < 1 then
self.isPressed = false
@ -331,7 +337,7 @@ function SheJiDaDian:RefreshBottom(isSend)
self.itemData[self.curItemIndex].num.text = itemDataList[self.curItemIndex].leftNum
self.curScore = self.curScore + itemDataList[self.curItemIndex].value
self.scoreText.text = ((self.curScore)%(self.actReward[1].Values[2][1])).."/"..self.actReward[1].Values[2][1]
self.value.value = (((self.curScore))%(self.actReward[1].Values[2][1]))/self.actReward[1].Values[2][1]
self.sliderComp.value = (((self.curScore))%(self.actReward[1].Values[2][1]))/self.actReward[1].Values[2][1]
self.level.text = math.floor((self.curScore)/(self.actReward[1].Values[2][1])) .. ""
end
end

View File

@ -1,5 +1,4 @@
local XiangYaoDuoBao = {}
local ActivityDetail = require("Modules/DynamicActivity/ActivityDetail")--活动详情
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
@ -50,10 +49,6 @@ function XiangYaoDuoBao:InitComponent()
self.btnGroup=Util.GetGameObject(self.gameObject,"bottom/btngroup")
self.leftTime=Util.GetGameObject(self.gameObject,"bottom/lefttime"):GetComponent("Text")
self.canGet=Util.GetGameObject(self.gameObject,"bottom/canGet"):GetComponent("Text")
self.detail= Util.GetGameObject(self.gameObject, "detail")
self.detail.gameObject:SetActive(false)
self.grid = Util.GetGameObject(self.gameObject, "aniRoot")
--mid
self.progressValue = Util.GetGameObject(self.gameObject, "mid/progress/value"):GetComponent("Image")--fillAmount
@ -73,7 +68,7 @@ function XiangYaoDuoBao:BindEvent()
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.XiangYaoDuoBao,self.helpPosition.x,self.helpPosition.y)
end)
Util.AddClick(self.detailBtn, function()
ActivityDetail.new(self.detail,4)
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.RecrutDetail,self.actConfig.HelpId,self.actType,PRE_REWARD_POOL_TYPE.XIANG_YAO_UP)
end)
Util.AddClick(self.btn,function ()
local thread=coroutine.start(function()
@ -334,7 +329,6 @@ function XiangYaoDuoBao:OnHide()
end
Live = nil
self.gameObject:SetActive(false)
self.detail.gameObject:SetActive(false)
if self.timer then
self.timer:Stop()
self.timer = nil

View File

@ -1,5 +1,4 @@
local YiJingBaoKu = {}
local sortingOrder = 0
local trigger = true
local BlessingConfig = ConfigManager.GetConfig(ConfigName.BlessingRewardPoolNew)
@ -87,6 +86,22 @@ end
function YiJingBaoKu:OnShow(_sortingOrder)
self.gameObject:SetActive(true)
Util.AddParticleSortLayer(self.effect, _sortingOrder - sortingOrder)
sortingOrder = _sortingOrder
self.actId = self.actConfig.ActId
self.actType = self.actConfig.ActiveType > 0 and self.actConfig.ActiveType or self.actConfig.FunType
if self.actConfig.IfBack == 1 then
if self.actConfig.ActiveType > 0 then
local id = ActivityGiftManager.IsActivityTypeOpen(self.actConfig.ActiveType)
if id and id > 0 then
self.actId = id
local config = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"PageType",self.actConfig.PageType,"ActiveType",self.actConfig.ActiveType,"ActId",id)
if config then
self.actConfig = config
end
end
end
end
local image = Util.GetGameObject(self.effect, "UI_Effect_YJBK_Zao/GameObject/Image (2)"):GetComponent("Canvas")
image.sortingOrder = _sortingOrder + 1
sortingOrder = _sortingOrder

View File

@ -50,7 +50,7 @@ end
function ZhenQiYiBaoPage:OnShowData(isTop,isAni)
allData={}
-- allData = ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.RechargeCommodityConfig, "ShowType", 23, "Type", GoodsTypeDef.DirectPurchaseGift)
local curActId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.f)
local curActId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.ZhenQiYiBaoPage)
for i = 1, #GlobalActivity[curActId].CanBuyRechargeId do
local data = ConfigManager.GetConfigDataByKey(ConfigName.RechargeCommodityConfig, "Id", GlobalActivity[curActId].CanBuyRechargeId[i])
table.insert(allData,data)

View File

@ -61,9 +61,9 @@ function this:OnShow(_parent,...)
this.time.text="概率有效期:"..str2
local poolUpType = args[3]
local poolType = args[4]
local poolType = args[4] or 0
local UpItemList=RecruitManager.GetRewardPreviewData(poolUpType)
local itemList=RecruitManager.GetRewardPreviewData(poolType)
local itemList = RecruitManager.GetRewardPreviewData(poolType)
local rateList = this:BuildRateData(activityType,itemList,UpItemList)
this:ReFreshUpItem(UpItemList,rateList)
end

View File

@ -695,10 +695,10 @@ function this.CreatActivity()
if v.ActiveType > 0 then
local activityId = ActivityGiftManager.IsActivityTypeOpen(v.ActiveType)
if activityId and activityId > 0 and ActivityGiftManager.IsQualifiled(v.ActiveType) and v.ActiveType ~= 42 then
local tempConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",GlobalActConfig[activityId].ShowArt,"PageType",0,"ActiveType:",v.ActiveType)
local tempConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",GlobalActConfig[activityId].ShowArt,"PageType",0,"ActiveType",v.ActiveType)
if not tempConfig then
tempConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",activityId,"PageType",0,"ActiveType:",v.ActiveType)
end
tempConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",activityId,"PageType",0,"ActiveType",v.ActiveType)
end
if tempConfig then
activityTabs[k].img.sprite = Util.LoadSprite(tempConfig.Icon[1])
else
@ -1218,9 +1218,9 @@ function this.RefreshActivityBtn(context)
if v.FunType and v.FunType == 41 then
activityTabs[k].go.gameObject:SetActive(DailyRechargeManager.GetDailyRechargeExist())
elseif v.ActiveType == 20000 then
local tempConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",GlobalActConfig[activityId].ShowArt,"PageType",0,"ActiveType:",v.ActiveType)
local tempConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",GlobalActConfig[activityId].ShowArt,"PageType",0,"ActiveType",v.ActiveType)
if not tempConfig then
tempConfig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.ActivityGroups,"ActId",activityId,"PageType",0)
tempConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",activityId,"PageType",0,"ActiveType",v.ActiveType)
end
if tempConfig then
activityTabs[k].img.sprite = Util.LoadSprite(tempConfig.Icon[1])

View File

@ -1,5 +1,6 @@
local CommonActPage = {}
local rechargeNum = 0
local GlobalActConfig = ConfigManager.GetConfig(ConfigName.GlobalActivity)
function CommonActPage:New(gameObject)
local b = {}
b.gameObject = gameObject
@ -64,9 +65,13 @@ function CommonActPage:OnShow(_sortingOrder)
local id = ActivityGiftManager.IsActivityTypeOpen(self.actConfig.ActiveType)
if id and id > 0 then
self.actId = id
local config = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"PageType",self.actConfig.PageType,"ActiveType",self.actConfig.ActiveType,"ActId",id)
if config then
self.actConfig = config
local actConfig
local actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",GlobalActConfig[id].ShowArt,"PageType",self.actConfig.PageType,"ActiveType",self.actConfig.ActiveType)
if not actConfig then
actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",id,"PageType",self.actConfig.PageType,"ActiveType",self.actConfig.ActiveType)
end
if actConfig then
self.actConfig = actConfig
end
else
LogRed("活动类型:"..tostring(self.actConfig.ActiveType).."的活动未开启")

View File

@ -646,6 +646,13 @@ local jumpDic = {
[JumpType.ZhuTiHuoDong] = function (data)
this.JumpActivity(JumpType.ZhuTiHuoDong,data[1])
end,
[JumpType.QianKunShangDian] = function (data)
this.JumpActivity(JumpType.QianKunShangDian,data[1])
end,
[JumpType.SheJiDaDianShangDian] = function (data)
this.JumpActivity(JumpType.QianKunShangDian,data[1])
end,
}
function this.JumpActivity(data,skipfactor)

View File

@ -234,6 +234,8 @@ function this.GetRewardPreviewData(type)
or type==PRE_REWARD_POOL_TYPE.LING_SHOU_UP--灵兽宝阁UP
or type==PRE_REWARD_POOL_TYPE.XIANG_YAO_UP then--降妖夺宝UP
return this.GetActivityPreviewData(type)--非常驻抽卡需要检测时间
else
return {}
end
end

View File

@ -55,7 +55,8 @@ function this.ReceiveShopData(msg)
this.allShopData = {}
for _, data in ipairs(msg.storeInfo) do
table.insert(this.allShopData, data)
-- Log(string.format("商店id = %d, lt = %s, startTime = %s, endTime = %s", data.id, data.lastRefreshTime, data.startTime, data.endTime))
LogGreen(string.format("商店id = %d, lt = %s, startTime = %s, endTime = %s", data.id, data.lastRefreshTime, data.startTime, data.endTime))
LogGreen("StoreType:"..this.GetShopInfo(data.id).StoreType)
end
-- 刷新物品排序
this.SortItemList()