Merge branch 'china/dev-c' into 0功能/升星预览

# Conflicts:
#	Assets/ManagedResources/ResConfigs/ResourcePathConfig.asset
#	Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua
dev_chengFeng
jiaoyangna 2021-06-18 11:08:40 +08:00
commit 09095e5b16
17 changed files with 2268 additions and 564 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 44cd36c170deed543a74ff06bb6ba462
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 56
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 794794f29d3867545a48f34b4f87e7d7
vertices: []
indices:
edges: []
weights: []
spritePackingTag: MainAtlas
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -46,7 +46,7 @@ TextureImporter:
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteBorder: {x: 0, y: 217, z: 0, w: 13}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: bf76043688f656748a4435f259582021
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 56
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 16865e80355d87b488a3f906eb3d6804
vertices: []
indices:
edges: []
weights: []
spritePackingTag: SurpriseBoxAtlas
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2131,7 +2131,7 @@ FacePanelType = {
MonsterWave = 9,--心魔试炼限时礼包
MainLevel = 10,--主线限时礼包
TimeLimitSkin = 11,--限时神装礼包
FuXingGaoZhao = 12,--福星高照活动
SurpriseBox = 12,--福星高照活动
Pokemon = 13,--灵兽推送礼包
Surprise = 14, --惊喜礼包推送
}

View File

@ -138,11 +138,11 @@ function this.RefreshRankInfo()
-- if not isShowRank then return end
ArenaTopMatchManager.RequestRankData(1,function()
local rankData,madata=ArenaTopMatchManager.GetRankData()
if battleStage == TOP_MATCH_STAGE.ELIMINATION and battleTurn==4 and battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END and isShowRank then
if battleStage == TOP_MATCH_STAGE.ELIMINATION and battleTurn==4 and isShowRank then--and battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END
this.RefreshRankData(rankData,showTip.Four)
elseif battleStage == TOP_MATCH_STAGE.ELIMINATION and battleTurn==5 and battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END and isShowRank then
elseif battleStage == TOP_MATCH_STAGE.ELIMINATION and battleTurn==5 and isShowRank then--and battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END
this.RefreshRankData(rankData,showTip.Two)
elseif battleStage == TOP_MATCH_STAGE.ELIMINATION and battleTurn==6 and battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END and isShowRank then
elseif battleStage == TOP_MATCH_STAGE.ELIMINATION and battleTurn==6 and isShowRank then--and battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END
this.RefreshRankData(rankData,showTip.One)
elseif battleStage == TOP_MATCH_STAGE.OVER and battleTurn==-2 and battleState==TOP_MATCH_TIME_STATE.OVER then--后加的结束了 也要显示八强数据
this.RefreshRankData(rankData,showTip.Four)

View File

@ -13,13 +13,11 @@ end
local immune3 = function(buff)
return buff.type == BuffName.Shield and buff.shieldType == ShieldTypeName.AllReduce
end
--自定义免疫
local immune4=nil
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function Immune:SetData(type,func)
self.immuneType =type
immune4=func
self.immuneType = type
self.immune4 = func
self.isBuff = true
-- 刷新排序等级
@ -38,8 +36,8 @@ function Immune:OnStart()
elseif self.immuneType == 3 then --免疫无敌盾
self.target.buffFilter:Add(immune3)
elseif self.immuneType==4 then--自定义免疫
if immune4 then
self.target.buffFilter:Add(immune4)
if self.immune4 then
self.target.buffFilter:Add(self.immune4)
end
end
if condition then
@ -66,8 +64,7 @@ function Immune:OnEnd()
elseif self.immuneType == 3 then --免疫无敌盾
immune = immune3
elseif self.immuneType == 4 then--自定义免疫
immune=immune4
immune4=nil
immune = self.immune4
end
for i = 1, self.target.buffFilter.size do
if self.target.buffFilter.buffer[i] == immune then

View File

@ -5,12 +5,12 @@ local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local SpiritAnimalConfig = ConfigManager.GetConfig(ConfigName.SpiritAnimal)
local globalActive = 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 = {}
@ -85,16 +85,39 @@ end
function XiangYaoDuoBao:OnSortingOrderChange()
end
function XiangYaoDuoBao:OnShow(_sortingOrder,_parent)
local actId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.XiangYaoDuoBao)
if not actId or actId <= 0 then return end
parent = _parent
Util.AddParticleSortLayer(self.effect1, _sortingOrder - sortingOrder)
Util.AddParticleSortLayer(self.effect2, _sortingOrder - sortingOrder)
sortingOrder = sortingOrder
--界面打开时调用(用于子类重写)
function XiangYaoDuoBao:OnOpen(_activityConfig,_index,parent)
self.actConfig = _activityConfig
self.pageIndex = _index
self.parent = parent
end
function XiangYaoDuoBao:OnShow(_sortingOrder)
self.sortingOrder = _sortingOrder
Util.SetParticleSortLayer(self.effect1,self.sortingOrder + 1)
Util.AddParticleSortLayer(self.effect2,self.sortingOrder + 1)
self.gameObject:SetActive(true)
this:Refresh()
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 actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",globalActive[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
end
end
end
self:Refresh()
end
function XiangYaoDuoBao:Refresh()
@ -106,9 +129,9 @@ function XiangYaoDuoBao:Refresh()
tenRecruit = array[2]
CheckRedPointStatus(RedPointType.XiangYaoDuoBao)
this:refreshBtnShow()--刷新按钮显示
this:TimeCountDown()--时间
this:SetData()--加载界面数据立绘+进度条
self:refreshBtnShow()--刷新按钮显示
self:TimeCountDown()--时间
self:SetData()--加载界面数据立绘+进度条
end
function XiangYaoDuoBao:SetData()
@ -134,14 +157,14 @@ function XiangYaoDuoBao:SetData()
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 = this.spLoader:LoadSprite(artConfig[itemConfig[rewardData[i].iconId].ResourceID].Name)
Util.GetGameObject(item, "icon"):GetComponent("Image").sprite = self.spLoader:LoadSprite(artConfig[itemConfig[rewardData[i].iconId].ResourceID].Name)
Util.GetGameObject(item, "red"):SetActive(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)
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1,function ()
this:Refresh()
self:Refresh()
end)
end)
else
@ -221,11 +244,11 @@ function XiangYaoDuoBao:refreshBtnShow()
local recruitOne = function()
RoleLiveGOGraphic.AnimationState:SetAnimation(0, "hit1", true)
self.effect1:SetActive(true)
self.mainPanel.mask:SetActive(true)
self.parent.mask:SetActive(true)
Timer.New(function ()
RoleLiveGOGraphic.AnimationState:SetAnimation(0, "idle", true)
self.effect1:SetActive(false)
self.mainPanel.mask:SetActive(false)
self.parent.mask:SetActive(false)
RecruitManager.RecruitRequest(singleRecruit.Id, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,1)--记录抽卡次数
if not isFree and d[1] == 16 then
@ -254,11 +277,11 @@ function XiangYaoDuoBao:refreshBtnShow()
local recruitTen = function()
RoleLiveGOGraphic.AnimationState:SetAnimation(0, "hit3", true)
self.effect2:SetActive(true)
self.mainPanel.mask:SetActive(true)
self.parent.mask:SetActive(true)
Timer.New(function ()
RoleLiveGOGraphic.AnimationState:SetAnimation(0, "idle", true)
self.effect2:SetActive(false)
self.mainPanel.mask:SetActive(false)
self.parent.mask:SetActive(false)
RecruitManager.RecruitRequest(tenRecruit.Id, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,10)--记录抽卡次数
if d[1] == 16 then
@ -310,13 +333,13 @@ function XiangYaoDuoBao:TimeCountDown()
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
@ -327,7 +350,7 @@ function XiangYaoDuoBao:TimeCountDown()
self.timer:Start()
end
function XiangYaoDuoBao:OnHide()
function XiangYaoDuoBao:OnClose()
if Live then
poolManager:UnLoadLive(bgName, Live)
end
@ -345,7 +368,6 @@ function XiangYaoDuoBao:OnDestroy()
poolManager:UnLoadLive(bgName, Live)
end
Live = nil
ActivityDetail.OnDestroy()
end
--添加事件监听(用于子类重写)

View File

@ -1,5 +1,5 @@
local XinJiangLaiXi = {}
local sortingOrder = 0
local globalActive = ConfigManager.GetConfig(ConfigName.GlobalActivity)
function XinJiangLaiXi:New(gameObject)
local b = {}
@ -17,7 +17,7 @@ function XinJiangLaiXi:InitComponent()
self.storeBtn = Util.GetGameObject(self.gameObject, "storeBtn")
self.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn")
self.helpPosition=self.helpBtn:GetComponent("RectTransform").localPosition
self.scrollItem = Util.GetGameObject(self.gameObject, "scroller/grid")
self.scrollItem = Util.GetGameObject(self.gameObject, "layout/scroller/grid")
self.liveRoot = Util.GetGameObject(self.gameObject, "bg/liveRoot")
self.tip1 = Util.GetGameObject(self.gameObject, "layout/Text1"):GetComponent("Text")
self.tip2 = Util.GetGameObject(self.gameObject, "layout/Text2"):GetComponent("Text")
@ -28,9 +28,9 @@ function XinJiangLaiXi:InitComponent()
self.btnBack = Util.GetGameObject(self.mainPanel,"bg/btnBack")
self.bottomBar = Util.GetGameObject(self.mainPanel,"bg/bottomBar")
self.shop = Util.GetGameObject(self.gameObject,"shop")
self.shopBack = Util.GetGameObject(self.shop,"shopBack/btnBack")
self.content = Util.GetGameObject(self.shop,"content")
-- self.shop = Util.GetGameObject(self.gameObject,"shop")
-- self.shopBack = Util.GetGameObject(self.shop,"shopBack/btnBack")
-- self.content = Util.GetGameObject(self.shop,"content")
self.allData={}
self.itemsGrid = {}--item重复利用
@ -67,9 +67,7 @@ function XinJiangLaiXi:BindEvent()
PrivilegeManager.RefreshPrivilegeUsedTimes(2012, 1)--更新特权
local fightData = BattleManager.GetBattleServerData(msg,0)
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.XINJIANG,function ()
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1,function ()
self:Refresh()
end)
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1)
end)
end)
else
@ -115,22 +113,39 @@ function XinJiangLaiXi:OnSortingOrderChange()
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function XinJiangLaiXi:OnShow(_sortingOrder,_parent)
local actId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.XinJiangLaiXi)
if not actId or actId <= 0 then return end
sortingOrder = _sortingOrder
XinJiangLaiXi:Refresh()
function XinJiangLaiXi:OnShow(_sortingOrder)
self.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 actConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"ActId",globalActive[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
end
end
end
self:Refresh()
end
function XinJiangLaiXi:Refresh()
CheckRedPointStatus(RedPointType.XinJiangLaiXi)
self.allData = DynamicActivityManager.XinJiangBuildData()
XinJiangLaiXi:OnShowData()
XinJiangLaiXi:SetTime()
self:OnShowData()
self:SetTime()
end
function XinJiangLaiXi:OnShowData()
self.shop:SetActive(false)
-- self.shop:SetActive(false)
if not self.itemsGrid then
self.itemsGrid = {}
end
@ -143,7 +158,7 @@ function XinJiangLaiXi:OnShowData()
self.itemsGrid[i] = SubUIManager.Open(SubUIConfig.ItemView,self.scrollItem.transform)
end
self.itemsGrid[i].gameObject:SetActive(true)
self.itemsGrid[i]:OnOpen(false, self.allData.reward[i], 1,false,false,false,sortingOrder)
self.itemsGrid[i]:OnOpen(false, self.allData.reward[i], 1,false,false,false,self.sortingOrder)
end
if self.LiveObj then
@ -180,13 +195,16 @@ function XinJiangLaiXi:SetTime()
self.timer:Start()
end
--界面打开时调用(用于子类重写)
function XinJiangLaiXi:OnOpen()
end
function XinJiangLaiXi:OnClose()
if self.timer then
self.timer:Stop()
self.timer = nil
end
if self.shopView then
self.shopView = SubUIManager.Close(self.shopView)
self.shopView = nil
end
self.gameObject:SetActive(false)
end
--界面销毁时调用(用于子类重写)
@ -200,20 +218,7 @@ function XinJiangLaiXi:OnDestroy()
poolManager:UnLoadLive(self.LiveObj.name,self.LiveObj)
self.LiveObj = nil
end
sortingOrder = 0
self.itemsGrid = {}
end
function XinJiangLaiXi:OnHide()
if self.timer then
self.timer:Stop()
self.timer = nil
end
if self.shopView then
self.shopView = SubUIManager.Close(self.shopView)
self.shopView = nil
end
sortingOrder = 0
end
return XinJiangLaiXi

View File

@ -246,7 +246,7 @@ function this.PatFaceSpecialMonitor(v,patFaceAllData,type,starUpGiftNum)
end
elseif v.Type == 12 then--惊喜礼盒活动
local ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.SurpriseBox)
if PlayerPrefs.GetInt(PlayerManager.uid.."SurpriseBoxPatFaceDay"..ActData.value) == "0" then
if ActData and PlayerPrefs.GetInt(PlayerManager.uid.."SurpriseBoxPatFaceDay"..ActData.value) == 0 then
table.insert(patFaceAllData,v)
end
else
@ -382,15 +382,16 @@ this.backPatFaceAllData = {}
function this.SetPatFaceDaqta(PatFaceDatas)
if PatFaceDatas and PatFaceDatas.id and #PatFaceDatas.id > 0 then
for i = 1, #PatFaceDatas.id do
LogYellow("后端推送礼包拍脸 礼包id "..PatFaceDatas.id[i])
--LogYellow("后端推送礼包拍脸 礼包id "..PatFaceDatas.id[i])
local curRechargeCommodityConfig = ConfigManager.TryGetConfigData(ConfigName.RechargeCommodityConfig,PatFaceDatas.id[i])
if curRechargeCommodityConfig and curRechargeCommodityConfig.PosterUiId then
LogYellow("后端推送礼包拍脸 拍脸ID "..curRechargeCommodityConfig.PosterUiId)
--LogYellow("后端推送礼包拍脸 拍脸ID "..curRechargeCommodityConfig.PosterUiId)
table.insert(this.backPatFaceAllData, ConfigManager.GetConfigData(ConfigName.LoginPosterConfig,curRechargeCommodityConfig.PosterUiId))
end
end
end
if this.backPatFaceAllData and this.GetcurCanPatFace() then
if this.backPatFaceAllData and this.GetcurCanPatFace() then
--LogGreen("#this.backPatFaceAllData:"..#this.backPatFaceAllData)
this.OpenPatFacePanel(this.backPatFaceAllData)
end
end
@ -399,7 +400,7 @@ function this.GetBackPatFaceDaqta()
return this.backPatFaceAllData
end
function this.DeleBackPatFaceDaqta()
LogYellow("后端推送礼包拍脸 清空 ")
--LogYellow("后端推送礼包拍脸 清空 ")
this.backPatFaceAllData = {}
end
function this.GetcurCanPatFace()

View File

@ -76,7 +76,7 @@ function PatFacePanel:InitComponent()
--限时神装礼包
self.obg8 = Util.GetGameObject(self.transform, "frame/obg8")
-- 惊喜礼盒活动
-- self.obg9 = Util.GetGameObject(self.transform, "frame/obg9")
self.obg9 = Util.GetGameObject(self.transform, "frame/obg9")
end
--绑定事件(用于子类重写)
@ -119,11 +119,11 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function PatFacePanel:OnShow()
self:OnShowPatFaceData()
self:OnShowPatFaceData()
end
function PatFacePanel:OnShowPatFaceData()
if patFaceSingleData then
LogGreen("patFaceSingleData.Type:"..patFaceSingleData.Type)
self.obg1:SetActive(patFaceSingleData.Type == FacePanelType.Sbtj)
self.obg2:SetActive(patFaceSingleData.Type == FacePanelType.Tesc)
self.obg3:SetActive(patFaceSingleData.Type == FacePanelType.GuildFight or patFaceSingleData.Type == FacePanelType.Championship)
@ -160,9 +160,8 @@ function PatFacePanel:OnShowPatFaceData()
self:OnShowOb7Data(patFaceSingleData.Type)
elseif patFaceSingleData.Type == FacePanelType.TimeLimitSkin then
self:OnShowOb8Data()
-- elseif patFaceSingleData.Type == FacePanelType.FuXingGaoZhao then
-- LogRed("patFaceSingleData.Type == FacePanelType.FuXingGaoZhao")
-- self:OnShowOb9Data()
elseif patFaceSingleData.Type == FacePanelType.SurpriseBox then
self:OnShowOb9Data()
end
end
end
@ -368,7 +367,6 @@ end
--第九种 --惊喜礼盒活动
function PatFacePanel:OnShowOb9Data()
LogRed("function PatFacePanel:OnShowOb9Data()..SurpriseBoxPanel")
UIManager.OpenPanel(UIName.SurpriseBoxPanel,function() self:ClosePanel() end)
end

View File

@ -90,6 +90,10 @@ function this:OnShow(_parent,...)
return a.sort < b.sort
end)
local index = 0
for k,m in pairs(itemList) do
itemList[k].item.gameObject:SetActive(false)
end
for k,m in pairs(data) do
index = index + 1
if not itemList[k] then
@ -100,6 +104,7 @@ function this:OnShow(_parent,...)
itemList[k].k[2] = Util.GetGameObject(itemList[k].item, "k2")
itemList[k].k[3] = Util.GetGameObject(itemList[k].item, "k3")
end
itemList[k].item.gameObject:SetActive(true)
if index == LengthOfTable(data) then
Util.GetGameObject(itemList[k].item, "Image (4)").gameObject:SetActive(false)
else

View File

@ -146,6 +146,29 @@ local TypeUpdateFunc = {
local curData = dataList[ActivityTypeDef.ChaoFanRuSheng]
this.InitMissionDdataUpStar(curData)
end,
[ActivityTypeDef.SurpriseBox] = function ()--惊喜礼盒
local curData = dataList[ActivityTypeDef.SurpriseBox]
local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.SurpriseBoxConfig,"ActivityId",curData.activityId)
local rechargeConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
for i = 1, #curData.rewards do
for j = 1, #configData do
if curData.rewards[i].missionId == configData[j].Id then
curData.rewards[i].otherData.PackId = configData[j].PackId
curData.rewards[i].otherData.BuyDay = configData[j].BuyDay
curData.rewards[i].otherData.Name = rechargeConfig[configData[j].PackId].Name
curData.rewards[i].otherData.Reward = rechargeConfig[configData[j].PackId].RewardShow
curData.rewards[i].otherData.Price = rechargeConfig[configData[j].PackId].Price
curData.rewards[i].otherData.Warning = configData[j].Warning
end
end
end
for i = #curData.rewards, 1,-1 do
if curData.rewards[i].progress == 5 then
table.remove(curData.rewards,i)
end
end
end,
}
function this.InitMissionDdataUpStar(curData)
@ -297,7 +320,11 @@ function this.GetExpertData(indexType,actType)
else
curData.rewards[i].otherData.state = 3
end
curData.rewards[i].otherData.info = string.format("剩余:%s",curData.rewards[i].progress)
if PlayerManager.level >= curData.rewards[i].otherData.Values then
curData.rewards[i].otherData.info = string.format("%s/%s",curData.rewards[i].otherData.Values,curData.rewards[i].otherData.Values)
else
curData.rewards[i].otherData.info = string.format("%s/%s",PlayerManager.level,curData.rewards[i].otherData.Values)
end
end
else --日累计充值 达人
if actType == ActivityTypeDef.AccumulativeRechargeExper or actType == ActivityTypeDef.DynamicAct_recharge then

View File

@ -1,11 +1,31 @@
require("Base/BasePanel")
local SurpriseBox = Inherit(BasePanel)
local rechargeConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
function SurpriseBox:InitComponent()
self.spLoader = SpriteLoader.New()
self.btnBack = Util.GetGameObject(self.gameObject, "panel/btnBack")
self.mask = Util.GetGameObject(self.gameObject, "mask")
self.scroll = Util.GetGameObject(self.gameObject, "panel/kuang/scroll")
self.scrollItem = Util.GetGameObject(self.gameObject, "panel/kuang/scroll")
self.itemPre = Util.GetGameObject(self.gameObject, "ItemPre")
self.viewText = Util.GetGameObject(self.gameObject, "panel/view/Text")
self.viewList = {}
for i = 1, 4 do
self.viewList[i] = Util.GetGameObject(self.gameObject, "panel/view/Grid/Item ("..i..")")
end
local rootHight = self.scrollItem.transform.rect.height
local width = self.scrollItem.transform.rect.width
self.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scrollItem.transform,
self.itemPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0, 0))
self.scrollView.moveTween.MomentumAmount = 1
self.scrollView.moveTween.Strength = 2
self.itemList = {}
self.lightList = {}
self.jiantouList = {}
self.itemViewList = {}
end
--绑定事件(用于子类重写)
@ -25,8 +45,10 @@ end
function SurpriseBox:RemoveListener()
end
local fun
--界面打开时调用(用于子类重写)
function SurpriseBox:OnOpen()
function SurpriseBox:OnOpen(_fun)
fun = _fun
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
@ -37,15 +59,159 @@ end
function SurpriseBox:Refresh()
self.actData = CommonActPageManager.GetData(ActivityTypeDef.SurpriseBox)
PlayerPrefs.SetInt(PlayerManager.uid.."SurpriseBoxPatFaceDay"..self.actData.value,1)
SurpriseBox:CheckCurBox()
SurpriseBox:SetItemList()
self.scrollView:SetIndex(self.curBoxIndex-1 > 0 and self.curBoxIndex-1 or 1)
SurpriseBox:SetViewList()
end
--判断当前第几个箱子亮起
function SurpriseBox:CheckCurBox()
for i = 1, #self.actData.rewards do
if self.actData.rewards[i].progress ~= 8 then
self.curBoxIndex = self.actData.rewards[i].otherData.BuyDay
self.PackData = self.actData.rewards[i]
return
end
end
end
--Set左侧礼盒列表
function SurpriseBox:SetItemList()
self.scrollView:SetData(self.actData.rewards, function (index, item)
SurpriseBox:ShowSingleData(item, self.actData.rewards[index],index)
end)
end
function SurpriseBox:ShowSingleData(item,data,index)
LogGreen("PackId:"..tostring(data.otherData.PackId).." State:"..tostring(data.progress))
local box = Util.GetGameObject(item,"box"):GetComponent("Image")
local lock = Util.GetGameObject(item,"lock")
local getBtn = Util.GetGameObject(item,"getBtn")
local img = Util.GetGameObject(item,"Img")
local light1 = Util.GetGameObject(item,"light1")
local light2 = Util.GetGameObject(item,"light2")
local light = data.otherData.BuyDay == 1 and light1 or light2
local tip = Util.GetGameObject(item,"Tip")
local tipText = Util.GetGameObject(item,"Tip/Text"):GetComponent("Text")
local price = Util.GetGameObject(item,"getBtn/Price")
local priceText = Util.GetGameObject(item,"getBtn/Text"):GetComponent("Text")
local jiantou = Util.GetGameObject(item,"jiantou")
local finished = Util.GetGameObject(item,"finished")
img:SetActive(data.otherData.Warning ~= nil)
box.sprite = self.spLoader:LoadSprite("q_qiankun_xiangzi_01")--有色宝箱
tip:SetActive(false)
tipText.text = string.format("%s天后可购买", data.otherData.BuyDay - self.actData.value)
price:SetActive(true)
priceText.text = string.format("%s元",data.otherData.Price)
lock:SetActive(false)
light1:SetActive(false)
light2:SetActive(false)
light:SetActive(self.curBoxIndex == data.otherData.BuyDay)
jiantou:SetActive(self.curBoxIndex == data.otherData.BuyDay)
self.lightList[item] = light
self.jiantouList[item] = jiantou
finished:SetActive(false)
if data.progress == 1 then--完成所有条件,可购买
elseif data.progress == 2 then--可见了,解锁了,未到购买时间
elseif data.progress == 3 then--可见了,解锁了,到达购买时间,前置礼包未购买
elseif data.progress == 4 then--可见了,解锁了,到达购买时间,前置礼包购买了,未激活月卡特权
elseif data.progress == 6 then--可见了,未解锁,可预览
box.sprite = self.spLoader:LoadSprite("j_jingxilihe_baoxiang2")--灰色宝箱
tip:SetActive(true)
lock:SetActive(true)
elseif data.progress == 7 then--可见了,未解锁,不可预览
box.sprite = self.spLoader:LoadSprite("j_jingxilihe_baoxiang2")--灰色宝箱
tip:SetActive(true)
lock:SetActive(true)
elseif data.progress == 8 then--买完了
box.sprite = self.spLoader:LoadSprite("j_jingxilihe_baoxiang2")--灰色宝箱
finished:SetActive(true)
end
Util.AddOnceClick(getBtn,function ()
if data.progress == 1 then--完成所有条件,可购买
PayManager.Pay(data.otherData.PackId, function(id)
FirstRechargeManager.RefreshAccumRechargeValue(data.otherData.PackId)
OperatingManager.SetHadBuyGoodsId({data.otherData.PackId})
OperatingManager.RemoveItemInfoByType(GoodsTypeDef.DirectPurchaseGift, data.otherData.PackId)
self:Refresh()
end)
elseif data.progress == 2 then--可见了,解锁了,未到购买时间
PopupTipPanel.ShowTip("礼盒尚未开启,请耐心等待")
elseif data.progress == 3 then--可见了,解锁了,到达购买时间,前置礼包未购买
PopupTipPanel.ShowTip("请先购买上一个礼盒")
elseif data.progress == 4 then--可见了,解锁了,到达购买时间,前置礼包购买了,未激活月卡特权
PopupTipPanel.ShowTip(data.otherData.Warning)
elseif data.progress == 6 then--可见了,未解锁,可预览
PopupTipPanel.ShowTip("礼盒尚未开启,请耐心等待")
elseif data.progress == 7 then--可见了,未解锁,不可预览
PopupTipPanel.ShowTip("礼盒尚未开启,请耐心等待")
elseif data.progress == 8 then--买完了
PopupTipPanel.ShowTip("已购买该礼盒")
end
end)
Util.AddOnceClick(box.gameObject,function ()
for key, value in pairs(self.lightList) do
value:SetActive(false)
end
for key, value in pairs(self.jiantouList) do
value:SetActive(false)
end
light:SetActive(true)
jiantou:SetActive(true)
self.curBoxIndex = data.otherData.BuyDay
self.PackData = data
SurpriseBox:SetViewList()
end)
end
function SurpriseBox:SetViewList()
for i = 1, 4 do
self.viewList[i]:SetActive(false)
end
if self.PackData.progress ~= 7 then
self.viewText:SetActive(false)
local reward = self.PackData.otherData.Reward
for i = 1, #reward do
self.viewList[i]:SetActive(true)
local icon = Util.GetGameObject(self.viewList[i],"icon"):GetComponent("Image")
local name = Util.GetGameObject(self.viewList[i],"Text"):GetComponent("Text")
if not self.itemViewList[i] then
self.itemViewList[i] = SubUIManager.Open(SubUIConfig.ItemView,self.viewList[i].transform)
end
self.itemViewList[i]:OnOpen(false, reward[i], 0,false,false,false,self.sortingOrder)
icon.sprite = SetIcon(self.spLoader,reward[i][1])
name.text = string.format("%s\n×%s",itemConfig[reward[i][1]].Name,reward[i][2])
Util.AddOnceClick(icon.gameObject,function ()
self.itemViewList[i]:OnBtnCkickEvent(reward[i][1])
end)
end
else
self.viewText:SetActive(true)
self.viewText:GetComponent("Text").text = string.format("%s天后开启敬请期待···",self.PackData.otherData.BuyDay - self.actData.value)
end
end
function SurpriseBox:OnClose()
if fun then
fun()
fun = nil
end
PatFaceManager.RefreshPatface()
end
--界面销毁时调用(用于子类重写)
function SurpriseBox:OnDestroy()
self.spLoader:Destroy()
self.viewList = {}
self.itemList = {}
self.lightList = {}
self.jiantouList = {}
self.itemViewList = {}
end
return SurpriseBox

View File

@ -21,7 +21,7 @@ local activityType = {
[3] = {name = "关卡推送礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 25,Text = Language[12320]},
[4] = {name = "心魔试炼礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 26,Text = Language[12321]},
[5] = {name = "灵兽推送礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 31,Text = "恭喜您获得极品灵兽,这是为您准备的灵兽成长礼包,助您实力飞升"},
[6] = {name = "惊喜礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 31,Text = "购买惊喜礼盒成功激活限时豪礼,祝您战力飞升,一路通关"},
[6] = {name = "惊喜礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 33,Text = "购买惊喜礼盒成功激活限时豪礼,祝您战力飞升,一路通关"},
}
--初始化组件(用于子类重写)
function this:InitComponent()