【优化】scrollview分帧加载-游戏内适应性修改

dev_chengFeng
gaoxin 2020-12-29 19:13:14 +08:00 committed by JieLing
parent 962c41e11c
commit 9f691e4e05
32 changed files with 431 additions and 181 deletions

View File

@ -312,12 +312,12 @@ function SecTorPlayAnimByScroll(scroll,_scale)
if _scale then
scale = _scale
end
scroll:ForeachItemGO(function (index, go)
Timer.New(function ()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, scale*(index-1)):Start()
end)
-- scroll:ForeachItemGO(function (index, go)
-- Timer.New(function ()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, scale*(index-1)):Start()
-- end)
end
function PlayUIAnimBack(gameObject, callback)
--local anim = gameObject:GetComponent(typeof(PlayFlyAnim))

View File

@ -2,6 +2,8 @@
OpenSeverWelfarePanel = Inherit(BasePanel)
local this = OpenSeverWelfarePanel
local activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)
local sortingOrder = 0
local isPlayAnim = true
--初始化组件(用于子类重写)
function OpenSeverWelfarePanel:InitComponent()
this.closeBtn = Util.GetGameObject(self.transform, "bg/closeBtn")
@ -20,6 +22,7 @@ end
--绑定事件(用于子类重写)
function OpenSeverWelfarePanel:BindEvent()
Util.AddClick(this.closeBtn, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
end
@ -39,6 +42,7 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function OpenSeverWelfarePanel:OnShow()
isPlayAnim = true
this.OnShowPanelData()
end
function OpenSeverWelfarePanel:OnSortingOrderChange()
@ -49,6 +53,7 @@ function OpenSeverWelfarePanel:OnSortingOrderChange()
end
end
end
sortingOrder = self.sortingOrder
end
local isShowNeedGetUpTextId = 0
local activityData = {}
@ -62,12 +67,20 @@ function this.OnShowPanelData()
this.ScrollView:SetData(activityData.mission, function (index, go)
this.SingleDataShow(go, activityData.mission[index])
end)
if isPlayAnim then
SecTorPlayAnimByScroll(this.ScrollView)
isPlayAnim = false
end
end
end
function this.SingleDataShow(go,rewardData)
local activityRewardGo = go
activityRewardGo:SetActive(true)
-- if isPlayAnim then
-- activityRewardGo:SetActive(false)
-- else
-- activityRewardGo:SetActive(true)
-- end
local sConFigData = activityRewardConfig[rewardData.missionId]
local titleText = Util.GetGameObject(activityRewardGo, "titleImage/titleText"):GetComponent("Text")
titleText.text = sConFigData.ContentsShow

View File

@ -203,13 +203,26 @@ function this:SetItemData(_itemDatas)
this.ScrollView.moveTween.Strength = 2
end
this.ScrollView:SetData(_itemDatas, function(index, go)
if this.isFristOpen then
go.gameObject:SetActive(false)
end
this.SingleItemDataShow(go, _itemDatas[index])
if _itemDatas[index].itemConfig.ItemType == ItemType.HunYin then
table.insert(list,go)
end
-- if this.isFristOpen then
-- go.gameObject:SetActive(false)
-- end
--FHF 将原有 同步 数据更新 修改为现有的异步方式,
-- local _updater=coroutine.start(function()
-- coroutine.wait(0.05*index)
-- Log("BagPanel SingleItemDataShow..")
this.SingleItemDataShow(go, _itemDatas[index])
if _itemDatas[index].itemConfig.ItemType == ItemType.HunYin then
table.insert(list,go)
end
-- end)
-- this.SingleItemDataShow(go, _itemDatas[index])
--if _itemDatas[index].itemConfig.ItemType == ItemType.HunYin then
-- table.insert(list,go)
--FHF
end)
--特效层级重设
for i=1,#list do
@ -219,12 +232,12 @@ function this:SetItemData(_itemDatas)
orginLayer = this.sortingOrder
if this.isFristOpen then
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.01 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.01 * (index - 1)):Start()
-- end)
if isFristOpenTime then
isFristOpenTime:Stop()
isFristOpenTime = nil

View File

@ -110,12 +110,12 @@ function this.OnClickTabBtn(_curIndex)
this.SingleItemDataShow(go, equipDatas[index],equipStarsConfig[equipDatas[index].Star])
end)
this.ShowTitleData(equipStarsConfig[curSelectEquip.Star])
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
function this.ShowTitleData(curEquipStarsConfig)

View File

@ -90,12 +90,12 @@ function this.OnShowData()
this.ScrollView:SetData(soulPrintDatas, function (index, go)
this.SingleItemDataShow(go, soulPrintDatas[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
sortingOrder2 = sortingOrder
end
function this.ShowGoldNum(equipSign)

View File

@ -97,12 +97,12 @@ function this.ShowCurrPosTreasures()
this.ScrollView:SetData(equipDatas, function (index, go)
this.SingleItemDataShow(go, equipDatas[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
--设置按钮选中

View File

@ -95,12 +95,12 @@ function this.ShowCurrPosHeroCompound()
this.ScrollView:SetData(heroDatas, function (index, go)
this.SingleHeroDataShow(go, heroDatas[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
--显示当前阵营的英雄
function this.ShowCurrPosHeroCompound2()

View File

@ -189,12 +189,12 @@ function this.ShowCurrPosHeroReplace(_curIndex)
-- end
this.SingleHeroDataShow(go, heroDatas[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
--通过职业筛选英雄

View File

@ -211,11 +211,11 @@ function DemonSlayerPanel:SingleDataShow(pre,data,index)
local activityRewardGo = pre
if isPlayAnim then
activityRewardGo:SetActive(false)
else
activityRewardGo:SetActive(true)
end
-- if isPlayAnim then
-- activityRewardGo:SetActive(false)
-- else
-- activityRewardGo:SetActive(true)
-- end
--滚动条复用重设itemview
if itemsGrid[pre] then

View File

@ -4,6 +4,7 @@ local itemList = {}--优化itemView使用
local activityRewardConfig
local activeData
local activityId = 43
local isPlayAnim = true
function Expert_UpLv:ctor(mainPanel, gameObject)
self.mainPanel = mainPanel
self.gameObject = gameObject
@ -43,8 +44,13 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function Expert_UpLv:OnShow(index,_sortingOrder)
activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)
isPlayAnim = true
sortingOrder = _sortingOrder
this:Refresh(index)
end
function Expert_UpLv:Refresh(index)
activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)
ActivityGiftManager.RefreshAcitvityData({activityId},function ()
this:OnShowData(index)
end)
@ -76,11 +82,22 @@ function Expert_UpLv:OnShowData()
this.ScrollView:SetData(activeData.mission, function (index, go)
this.SingleItemDataShow(go, activeData.mission[index])
end)
if isPlayAnim then
SecTorPlayAnimByScroll(self.ScrollView)
isPlayAnim = false
end
end
function this.SingleItemDataShow(go,data)
local activityRewardGo = go
--LogError("data.missionId "..data.missionId)
-- if isPlayAnim then
-- activityRewardGo:SetActive(false)
-- else
-- activityRewardGo:SetActive(true)
-- end
local curConfigData = activityRewardConfig[data.missionId]
if not itemList[go.name] then
itemList[go.name] = {}

View File

@ -8,7 +8,7 @@ local refreshIsMaterial = true
local isRefreshAddNum = false
local orginLayer = 0
local isFirstOpen
local isPlayAnim = true
local starImage={[1]="x_xunbao_xingxingkong",[2]="ui_1xing"}--星星资源名
--初始化组件(用于子类重写)
function FindTreasureMainPanel:InitComponent()
@ -21,14 +21,14 @@ function FindTreasureMainPanel:InitComponent()
self.allGetBtn = Util.GetGameObject(self.gameObject, "allGetBtn")
self.findTreasureGridGo = Util.GetGameObject(self.gameObject, "rect/rect (1)/grid")
self.rewardPre = Util.GetGameObject(self.gameObject, "rewardPre")
for i = 1, 2 do
findTreasureGrid[i] = Util.GetGameObject(self.gameObject, "rect/rect (1)/grid/rewardPre ("..i..")")
local curexpertRewardItemsGri = {}
for j = 1, 4 do
curexpertRewardItemsGri[j] = SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(findTreasureGrid[i], "content").transform)
end
findTreasureItemsGrid[i] = curexpertRewardItemsGri
end
-- for i = 1, 2 do
-- findTreasureGrid[i] = Util.GetGameObject(self.gameObject, "rect/rect (1)/grid/rewardPre ("..i..")")
-- local curexpertRewardItemsGri = {}
-- for j = 1, 4 do
-- curexpertRewardItemsGri[j] = SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(findTreasureGrid[i], "content").transform)
-- end
-- findTreasureItemsGrid[i] = curexpertRewardItemsGri
-- end
self.FindTreasureVipIcon = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/icon"):GetComponent("Image")
self.FindTreasureVipTextIcon = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/icon/icon (1)"):GetComponent("Image")
self.FindTreasureVipText = Util.GetGameObject(self.gameObject, "FindTreasureVipBtn/Text"):GetComponent("Text")
@ -54,6 +54,7 @@ end
function FindTreasureMainPanel:BindEvent()
Util.AddClick(self.btnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
Util.AddClick(self.materialImageBg, function()
@ -71,6 +72,7 @@ function FindTreasureMainPanel:BindEvent()
self.findTreasureVipBtnRedPoint:SetActive(FindTreasureManager.GetShowFindTreasureVipRedPoint())
end)
Util.AddClick(self.refreshBtn, function()
PlaySoundWithoutClick("UI_refresh")
if refreshIsMaterial then
local isShowTwo = false
for i = 1, #missionInfo do
@ -88,6 +90,7 @@ function FindTreasureMainPanel:BindEvent()
if isRefreshAddNum then
PlayerManager.missingRefreshCount = PlayerManager.missingRefreshCount + 1
end
isPlayAnim = true
self:OnShowPanelData(true)
end)
end, nil, nil, nil)
@ -97,6 +100,7 @@ function FindTreasureMainPanel:BindEvent()
if isRefreshAddNum then
PlayerManager.missingRefreshCount = PlayerManager.missingRefreshCount + 1
end
isPlayAnim = true
self:OnShowPanelData(true)
end)
end
@ -148,7 +152,7 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function FindTreasureMainPanel:OnShow()
isPlayAnim = true
self:OnShowPanelData(true)
end
function FindTreasureMainPanel:OnSortingOrderChange()
@ -171,9 +175,10 @@ function FindTreasureMainPanel:OnShowPanelData(isSort)
if isSort then
self:MissionInfoSort(missionInfo)
end
for i = 1, math.max(#missionInfo, #findTreasureGrid) do
local go = findTreasureGrid[i]
if not go then
if not findTreasureGrid[i] then
go = newObject(self.rewardPre)
go.transform:SetParent(self.findTreasureGridGo.transform)
go.transform.localScale = Vector3.one
@ -184,8 +189,17 @@ function FindTreasureMainPanel:OnShowPanelData(isSort)
end
go.gameObject:SetActive(false)
end
local tempList = {}
for i = 1, #missionInfo do
self:ActivityRewardSingleShow(i,missionInfo[i])
table.insert(tempList,findTreasureGrid[i])
-- if isPlayAnim then
-- findTreasureGrid[i].gameObject:SetActive(false)
-- end
end
if isPlayAnim then
SecTorPlayAnim(tempList)
isPlayAnim = false
end
if isFirstOpen then
isFirstOpen = false
@ -211,7 +225,7 @@ function FindTreasureMainPanel:OnShowPanelData(isSort)
self.FindTreasureVipIcon.sprite = Util.LoadSprite(FindTreasureVipTypeSprite[curVipState])
self.FindTreasureVipTextIcon.sprite = Util.LoadSprite(FindTreasureVipTextTypeSprite[curVipState])
--刷新道具
local mazeTreasureSetting = ConfigManager.GetConfigData(ConfigName.MazeTreasureSetting,1)--得判断是否 特权
local mazeTreasureSetting = ConfigManager.GetConfigData(ConfigName.MazeTreasureSetting,1)--得判断是否特权
local itemNum = BagManager.GetItemCountById(FindTreasureManager.refreshTicketItemId)
local RefreshItemNum = BagManager.GetItemCountById(mazeTreasureSetting.RefreshItem[1])
--Log("83 itemNum "..itemNum)

View File

@ -206,12 +206,12 @@ function FormationSetPanel:SetRoleList(_roleDatas)
self:SingleHeroDataShow(go, roleDatas[index])
end)
if isFirstOpen then
self.ScrollView:ForeachItemGO(function (index, go)
Timer.New(function ()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.03*(index-1)):Start()
end)
-- self.ScrollView:ForeachItemGO(function (index, go)
-- Timer.New(function ()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.03*(index-1)):Start()
-- end)
isFirstOpen = false
end
end

View File

@ -4,6 +4,7 @@ local this = GoodFriendMainPanel
local friendNumber = 0
local index = 1
local canApplyFriendsList={}
local isPlayAnim = true
--初始化组件(用于子类重写)
function GoodFriendMainPanel:InitComponent()
--this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform)
@ -220,6 +221,7 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function GoodFriendMainPanel:OnShow()
isPlayAnim = true
--GoodFriendManager.OnRefreshDataNextDay()
this.roleImage1:SetActive(false)
this.roleImage2:SetActive(false)
@ -362,7 +364,16 @@ function GoodFriendMainPanel:FriendListDataShow()
this.ScrollView1:SetData(list, function(index, item)
local itemData = list[index]
this:FriendListRefreshData(item, itemData)
-- if isPlayAnim then
-- item.gameObject:SetActive(false)
-- else
-- item.gameObject:SetActive(true)
-- end
end)
if isPlayAnim then
SecTorPlayAnimByScroll(this.ScrollView1)
isPlayAnim = false
end
this.friendNumberText:GetComponent("Text").text = Language[10812] .. #list .. "/" .. GoodFriendManager.goodFriendLimit
this.haveGetRewardNumText.text=Language[10813]..(GoodFriendManager.MaxEnergy-GoodFriendManager.MaxEnergyGet).."/"..GoodFriendManager.MaxEnergy
end
@ -400,7 +411,16 @@ function GoodFriendMainPanel:FriendApplicationDataShow()
this.ScrollView2:SetData(list, function(index, item)
local itemData = list[index]
this:FriendApplicationRefreshData(item, itemData)
-- if isPlayAnim then
-- item.gameObject:SetActive(false)
-- else
-- item.gameObject:SetActive(true)
-- end
end)
if isPlayAnim then
SecTorPlayAnimByScroll(this.ScrollView2)
isPlayAnim = false
end
end
--好友搜索循环滚动数据
@ -431,7 +451,16 @@ function GoodFriendMainPanel:FriendSearchDataShow()
this.ScrollView3:SetData(list, function(index, item)
local itemData = list[index]
this:FriendSearchRefreshData(item, itemData)
-- if isPlayAnim then
-- item.gameObject:SetActive(false)
-- else
-- item.gameObject:SetActive(true)
-- end
end)
if isPlayAnim then
SecTorPlayAnimByScroll(this.ScrollView3)
isPlayAnim = false
end
end
--黑名单滚动数据
@ -462,7 +491,16 @@ function GoodFriendMainPanel:BlackListDataShow()
this.ScrollView4:SetData(list, function(index, item)
local itemData = list[index]
this:BlackListRefreshData(item, itemData)
-- if isPlayAnim then
-- item.gameObject:SetActive(false)
-- else
-- item.gameObject:SetActive(true)
-- end
end)
if isPlayAnim then
SecTorPlayAnimByScroll(this.ScrollView4)
isPlayAnim = false
end
this.blackFriendNum.text= Language[10814] .. #list .. "/" .. GoodFriendManager.blackFriendLimit
end

View File

@ -16,6 +16,7 @@ local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1),
this.timer = Timer.New()
local challengeNum = 0
local lootNum = 0
local isPlayAnim = true
--初始化组件(用于子类重写)
function GuildCarDelayMainPanel:InitComponent()
this.live2dRoot = Util.GetGameObject(self.gameObject, "live2dRoot")
@ -145,6 +146,7 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function GuildCarDelayMainPanel:OnShow()
isPlayAnim = true
this.TabCtrl:SetTabAdapter(this.TabAdapter)
this.TabCtrl:SetChangeTabCallBack(this.SwitchView)
this.TabCtrl:Init(this.tabBox, _TabData, curIndex)
@ -232,6 +234,7 @@ end
--切换视图
function this.SwitchView(index)
curIndex = index or curIndex
isPlayAnim = true
if curIndex == 2 then
NetManager.RequestRankInfo(RANK_TYPE.GUILD_CAR_DELEAY_SINGLE, function(msg)
this.SetRankDataShow(msg)
@ -267,8 +270,17 @@ function this.SetRankDataShow(msg)
this.ScrollView:SetData(msg.ranks, function (index, go)
this.SingleRankDataShow(go, msg.ranks[index])
end)
if isPlayAnim then
SecTorPlayAnimByScroll(this.ScrollView)
isPlayAnim = false
end
end
function this.SingleRankDataShow(go,userRank)
-- if isPlayAnim then
-- go.gameObject:SetActive(false)
-- else
-- go.gameObject:SetActive(true)
-- end
local sortNumTabs = {}
for i = 1, 4 do
sortNumTabs[i] = Util.GetGameObject(go, "SortNum/SortNum ("..i..")")
@ -288,6 +300,7 @@ function this.SingleRankDataShow(go,userRank)
Util.GetGameObject(go, "Value0"):GetComponent("Text").text = userRank.guildName.."("..userRank.rankInfo.param2..")"
end
Util.GetGameObject(go, "Value1"):GetComponent("Text").text = PrintWanNum3(userRank.rankInfo.param1)
end
--刷新倒计时显示
function this.RemainTimeDown(_timeTextExpertgo,_timeTextExpert,timeNumText,timeDown,timeText)

View File

@ -5,6 +5,7 @@ local allMail
local openPanel
local allGetMail
local allDrop = {}
local isPlayAnim = true
--初始化组件(用于子类重写)
function MailMainPanel:InitComponent()
@ -30,6 +31,7 @@ end
function MailMainPanel:BindEvent()
Util.AddClick(this.closeBtn, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
Util.AddClick(this.GetAllMailBtn, function()
@ -117,9 +119,10 @@ function MailMainPanel:OnOpen(...)
end
function MailMainPanel:OnShow()
Log("MailMainPanel:OnShow")
isPlayAnim = true
allMail={}
NetManager.GetAllMailData(function ()
this.OnShowMailListData(MailManager.mialDataList)
this.OnShowMailListData(MailManager.mialDataList, true)
end)
end
function this.CallBackOnShow()
@ -130,7 +133,7 @@ function this.CallBackOnShow()
end
local maildataCount=0--数据数量
--设置英雄列表数据
function this.OnShowMailListData(_allMail)
function this.OnShowMailListData(_allMail, isTop)
allMail= _allMail
this:SortAllMail(allMail)
maildataCount=#allMail
@ -138,6 +141,13 @@ function this.OnShowMailListData(_allMail)
this.ScrollView:SetData(allMail, function (index, go)
this.SingleMialDataShow(go, allMail[index])
end)
-- if isPlayAnim then
-- SecTorPlayAnimByScroll(this.ScrollView)
-- isPlayAnim = false
-- end
if isTop then
this.ScrollView:SetIndex(1)
end
end
function this.SingleMialDataShow(_go,_mailData)
local mailImage = Util.GetGameObject(_go.transform, "mailImage")
@ -169,7 +179,7 @@ function this.SingleMialDataShow(_go,_mailData)
openMailImage :SetActive(true)
getOk :SetActive(true)
end
Util.GetGameObject(_go.transform, "infoText"):GetComponent("Text").text = Language[11148].._mailData.head
Util.GetGameObject(_go.transform, "infoText"):GetComponent("Text").text = _mailData.head
Util.GetGameObject(_go.transform, "sendText"):GetComponent("Text").text = GetTimeStrBySeconds(_mailData.sendTime)--Language[11149].._mailData.sendName
local mialBtn = Util.GetGameObject(_go.transform, "Imagebg")
Util.AddOnceClick(mialBtn, function()
@ -182,7 +192,13 @@ function this.SingleMialDataShow(_go,_mailData)
end
UIManager.OpenPanel(UIName.MainSingleInfoPanel,_mailData,this)
end)
Util.GetGameObject(_go.transform, "mialRedPoint"):SetActive( _mailData.state==0)
-- if isPlayAnim then
-- _go:SetActive(false)
-- else
-- _go:SetActive(true)
-- end
end
function this.UpdateMailData()
this.OnShowMailListData(MailManager.mialDataList)

View File

@ -10,6 +10,7 @@ local itemList = {}
local curAllData = {}
local achievementConfig = ConfigManager.GetConfig(ConfigName.AchievementConfig)
local itemGrid = {}
local isPlayAnim = true
function this:InitComponent(gameObject)
this.rewardPre = Util.GetGameObject(gameObject, "rewardPre")
local v = Util.GetGameObject(gameObject, "rect"):GetComponent("RectTransform").rect
@ -29,12 +30,13 @@ function this:RemoveListener()
end
function this:OnShow(_parent,...)
isPlayAnim = true
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
local args = {...}
fun = args[1]
this.OnShowPanelData()
this.OnShowPanelData(true)
end
function this:OnSortingOrderChange(sortingOrder)
for i, v in pairs(this.NoviceItemList) do
@ -45,7 +47,7 @@ function this:OnSortingOrderChange(sortingOrder)
end
end
end
function this.OnShowPanelData()
function this.OnShowPanelData(isTop)
local curAllData = TaskManager.GetCurShowAllAchievementData(TaskTypeDef.Achievement)
local AllData = {}
for i, v in pairs(curAllData) do
@ -55,11 +57,23 @@ function this.OnShowPanelData()
this.ScrollView:SetData(AllData, function (index, go)
this.SingleDataShow(go, AllData[index])
end)
-- if isPlayAnim then
-- SecTorPlayAnimByScroll(this.ScrollView)
-- isPlayAnim = false
-- end
if isTop then
this.ScrollView:SetIndex(1)
end
end
function this.SingleDataShow(go,rewardData)
local activityRewardGo = go
activityRewardGo:SetActive(true)
-- if isPlayAnim then
-- activityRewardGo:SetActive(false)
-- else
-- activityRewardGo:SetActive(true)
-- end
local sConFigData = achievementConfig[rewardData.missionId]
local titleText = Util.GetGameObject(activityRewardGo, "titleImage/titleText"):GetComponent("Text")
titleText.text = sConFigData.ContentsShow

View File

@ -23,6 +23,7 @@ local allMissionDailyPres = {}
local allMissionDailyItemPres = {}
local allMissionDailyBoxItemPres = {}
local myGo
local isPlayAnim = true
function this:InitComponent(gameObject)
myGo = gameObject
this.rectMask=Util.GetGameObject(gameObject,"rect"):GetComponent("Image")
@ -61,6 +62,7 @@ end
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.MissionDaily.OnMissionDailyChanged, this.OnShowData)
Game.GlobalEvent:AddEvent(GameEvent.CloseUI.OnClose, this.ClosePanel)
end
function this:RemoveListener()
@ -69,13 +71,14 @@ function this:RemoveListener()
end
function this:OnShow(_parent,...)
isPlayAnim = true
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
local args = {...}
fun = args[1]
this.rectMask.enabled=true
this.OnShowData()
this.OnShowData(true)
end
function this:OnSortingOrderChange(sortingOrder)
for i, v in pairs(this.NoviceItemList) do
@ -90,17 +93,17 @@ function this:OnSortingOrderChange(sortingOrder)
Util.AddParticleSortLayer(boxList[i], sortingOrder)
end
end
function this.OnShowData()
function this.OnShowData(isTop)
dailyTasksConfig=ConfigManager.GetConfig(ConfigName.DailyTasksConfig)
curDailyMissionData = {}
curDailyMissionBoxData = {}
for i, v in pairs(TaskManager.GetTypeTaskList(TaskTypeDef.DayTask)) do
for i, v in pairs(TaskManager.GetTypeTaskList(TaskTypeDef.DayTask)) do
if v.missionId < 10000 then
if dailyTasksConfig[v.missionId].OpenLevel or ActTimeCtrlManager.SingleFuncState(dailyTasksConfig[v.missionId].OpenLevel) then
if dailyTasksConfig[v.missionId].OpenLevel then
table.insert(curDailyMissionData,v)
end
else
if dailyTasksConfig[v.missionId].OpenLevel or ActTimeCtrlManager.SingleFuncState(dailyTasksConfig[v.missionId].OpenLevel) then
if dailyTasksConfig[v.missionId].OpenLevel then
table.insert(curDailyMissionBoxData,v)
end
end
@ -115,8 +118,16 @@ function this.OnShowData()
local AllData = TaskManager.GetTypeTaskList(TaskTypeDef.Achievement)
this.ScrollView:SetData(curDailyMissionData, function (index, go)
this.SingleMissionDatasDataShow(go,curDailyMissionData[index])
end)
end)
this.SetDailyMissionBox(curDailyMissionBoxData)
-- if isPlayAnim then
-- SecTorPlayAnimByScroll(this.ScrollView)
-- isPlayAnim = false
-- end
if isTop then
this.ScrollView:SetIndex(1)
end
end
function this.SingleMissionDatasDataShow(_go,_missionData)
@ -133,7 +144,6 @@ function this.SingleMissionDatasDataShow(_go,_missionData)
table.insert(reward,{reward = {missionConfigData.MazePoint[i][1],missionConfigData.MazePoint[i][2]},type = 2})
end
end
_go:SetActive(true)
local titleText = Util.GetGameObject(_go, "titleImage/titleText"):GetComponent("Text")
titleText.text =string.format(missionConfigData.Desc,missionConfigData.Values[2][1])
local itemGroup = Util.GetGameObject(_go, "content")
@ -146,7 +156,6 @@ function this.SingleMissionDatasDataShow(_go,_missionData)
this.NoviceItemList[_go][i] = SubUIManager.Open(SubUIConfig.ItemView, itemGroup.transform)
end
this.NoviceItemList[_go][i].gameObject:SetActive(false)
end
local show
for i = 1, #reward do
@ -202,17 +211,18 @@ function this.SetDailyMissionBox(_missionDatas)
go.transform.localPosition = Vector3.zero
boxList[i] = go
end
go.gameObject:SetActive(false)
-- go.gameObject:SetActive(false)
end
local curGetRewardNum=0
for i, v in pairs(curDailyMissionBoxData) do
for i, v in ipairs(curDailyMissionBoxData) do
--LogGreen("v.missionId "..v.missionId.." "..v.progress)
if v.progress > curGetRewardNum then
curGetRewardNum = v.progress
end
end
--LogGreen("#_missionDatas:"..#_missionDatas)
this.progressBottom.fillAmount=curGetRewardNum/dailyTasksConfig[_missionDatas[#_missionDatas].missionId].Values[2][1]
this.totalPro.text= Language[11361]..curGetRewardNum--.."/"..LengthOfTable(curDailyMissionData)
for i, v in pairs(_missionDatas) do

View File

@ -8,6 +8,7 @@ local sortingOrder=0
local curScore = 0--当前分数
local treasureState = 0
local itemsList={}
local isPlayAnim = true
function this:InitComponent(gameObject)
--topBar/btnBack
this.gameObject = gameObject
@ -70,6 +71,7 @@ function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
end
this.Closefunction = function()
isPlayAnim = true
Timer.New(function()
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
LogBlue("1111111")
@ -84,6 +86,7 @@ this.Closefunction = function()
end,1):Start()
end
function this:OnShow(_parent,...)
isPlayAnim = true
parent=_parent
sortingOrder = _parent.sortingOrder
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
@ -104,10 +107,7 @@ function this:OnSortingOrderChange(sortingOrder)
end
function this:OnClose()
if self.timer then
self.timer :Stop()
self.timer = nil
end
end
function this:OnDestroy()
itemsList={}
@ -226,11 +226,20 @@ function this:showTaskList()
end
end
this.ScrollView:SetIndex(index)
-- if isPlayAnim then
-- SecTorPlayAnimByScroll(this.ScrollView)
-- isPlayAnim = false
-- end
end
--单个任务
function this:SingleTask(rewardItem, rewardSingleData)
-- if isPlayAnim then
-- rewardItem:SetActive(false)
-- else
-- rewardItem:SetActive(true)
-- end
local scoreLevel = Util.GetGameObject(rewardItem, "scoreLevel"):GetComponent("Text")
local box1 = Util.GetGameObject(rewardItem, "box1")
local box2 = Util.GetGameObject(rewardItem, "box2")

View File

@ -6,6 +6,7 @@ local parent
local sortingOrder=0
local curType = 1
local treasureState
local isPlayAnim = true
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
function this:InitComponent(gameObject)
this.gameObject = gameObject
@ -43,11 +44,11 @@ end
function this:BindEvent()
Util.AddClick(this.weekTrailBtn,function()
curType = 1
this.refresh(curType)
this.refresh()
end)
Util.AddClick(this.finalTrailBtn,function()
curType = 2
this.refresh(curType)
this.refresh()
end)
end
@ -65,22 +66,22 @@ function this:SetSelect()
end
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh,curType)
Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh)
Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.TaskRefresh, this.RefreshTime)
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose,this.CloseFunction)
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh,curType)
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
end
function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh,curType)
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh)
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.TaskRefresh, this.RefreshTime)
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose,this.CloseFunction)
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh,curType)
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
end
function this.RefreshTime()
NetManager.RefreshTimeSLRequest(function (msg)
this.refresh(curType)
this.refresh()
end)
end
@ -100,13 +101,14 @@ this.CloseFunction = function()
end
function this:OnShow(_parent,...)
isPlayAnim = true
parent=_parent
sortingOrder = _parent.sortingOrder
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
parent:ClosePanel()
return
end
this.refresh(curType)
this.refresh()
end
--topBar按钮状态
@ -137,7 +139,7 @@ function this:SetTopBar()
NetManager.GetActivityRewardRequest(-2,id,function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(1007, 1)
PopupTipPanel.ShowTip(Language[12355])
this.refresh(curType)
this.refresh()
end)
end,1.5):Start()
end)
@ -161,12 +163,12 @@ function this:OnDestroy()
end
end
function this.refresh(type)
function this.refresh()
QinglongSerectTreasureManager.UpdateTreasureState2()
this:SetTopBar()
this:SetSelect()
this:ShowTime(type)
this:showTaskList(type)
this:ShowTime(curType)
this:showTaskList(curType)
this:SetRedPoint()
CheckRedPointStatus(RedPointType.QinglongSerectTreasureTrail)
CheckRedPointStatus(RedPointType.QinglongSerectTreasure)
@ -196,6 +198,11 @@ function this:showTaskList(type)
this.ScrollView:SetData(rewardData,function(index, rewardItem)
this:SingleTask(rewardItem, rewardData[index])
end)
this.ScrollView:SetIndex(1)
-- if isPlayAnim then
-- SecTorPlayAnimByScroll(this.ScrollView)
-- isPlayAnim = false
-- end
end
local type={
[0]={sprite = "s_slbz_1anniuhuangse",text = Language[10023]},
@ -204,8 +211,12 @@ local type={
}
--单个任务
function this:SingleTask(go, rewardSingleData)
local activityRewardGo = go
activityRewardGo:SetActive(true)
local activityRewardGo = go
-- if isPlayAnim then
-- activityRewardGo:SetActive(false)
-- else
-- activityRewardGo:SetActive(true)
-- end
local sConFigData = rewardSingleData
local strs = string.split(sConFigData.show)
local titleText = Util.GetGameObject(activityRewardGo, "content"):GetComponent("Text")
@ -225,7 +236,7 @@ function this:SingleTask(go, rewardSingleData)
NetManager.TakeMissionRewardRequest(TaskTypeDef.TreasureOfSomeBody,sConFigData.id, function(msg)
PopupTipPanel.ShowTip(Language[12358]..sConFigData.integral[1][2]..itemConfig[tonumber(sConFigData.integral[1][1])].Name)
Timer.New(function()
this.refresh(curType)
this.refresh()
end,1):Start()
end)
elseif state == 0 then

View File

@ -9,7 +9,7 @@ local ContinuityRechargeItem = require("Modules/Operating/ContinuityRechargeItem
--积天豪礼
---@class ContinuityRechargePage
local ContinuityRechargePage = quick_class("ContinuityRechargePage")
local isPlayAnim = true
local sortingOrder = 0
function ContinuityRechargePage:ctor(mainPanel, gameObject)
self.mainPanel = mainPanel
@ -25,6 +25,7 @@ function ContinuityRechargePage:ctor(mainPanel, gameObject)
end
function ContinuityRechargePage:OnShow(_sortingOrder)
isPlayAnim = true
Util.AddParticleSortLayer( self.effect, _sortingOrder - sortingOrder)
sortingOrder = _sortingOrder
Game.GlobalEvent:AddEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, self.RefreshPanel, self)
@ -51,20 +52,32 @@ function ContinuityRechargePage:RefreshPanel()
"ActivityId", ActivityTypeDef.ContinuityRecharge)
self.conditionDesc.text = actRewardConfigs[1].Values[1][1]
--Log("连续充值刷新"..ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.ContinuityRecharge).value)
if table.nums(self.continuityTaskList) > 0 then
table.walk(self.continuityTaskList, function(taskItem)
taskItem:SetValue()
end)
return
end
for i, actRewardInfo in ipairs(actRewardConfigs) do
self.continuityTaskList[i] = ContinuityRechargeItem.create(self.continuityTaskItem, self.continuityTaskContent)
self.continuityTaskList[i]:Init(actRewardInfo,sortingOrder)
if not self.continuityTaskList[i] then
self.continuityTaskList[i] = ContinuityRechargeItem.create(self.continuityTaskItem, self.continuityTaskContent)
self.continuityTaskList[i]:Init(actRewardInfo,sortingOrder)
self.continuityTaskList[i].gameObject:SetActive(false)
end
-- if isPlayAnim then
-- self.continuityTaskList[i].gameObject:SetActive(false)
-- else
-- self.continuityTaskList[i].gameObject:SetActive(true)
-- end
self.continuityTaskList[i]:SetValue()
end
-- for i, actRewardInfo in ipairs(actRewardConfigs) do
-- self.continuityTaskList[i] = ContinuityRechargeItem.create(self.continuityTaskItem, self.continuityTaskContent)
-- self.continuityTaskList[i]:Init(actRewardInfo,sortingOrder)
-- self.continuityTaskList[i]:SetValue()
-- end
table.walk(self.continuityTaskList, function(continuityTaskItem)
continuityTaskItem:TrySetLastSibling()
end)
if isPlayAnim then
SecTorPlayAnim(self.continuityTaskList)
isPlayAnim = false
end
end
return ContinuityRechargePage

View File

@ -3,7 +3,7 @@ local curGiftsId--当前礼包Id
local actRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)--读取礼包任务信息
local rewardNameConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)--读取奖励名称信息
local GlobalActivity = ConfigManager.GetConfig(ConfigName.GlobalActivity)
local isPlayAnim = true
local giftList = {
[101] = 6,--表内没有礼包id101、102、103、104、105和ActivityId的对应关系
[102] = 7,
@ -49,6 +49,7 @@ function GrowthGiftPage:BindEvent()
end
function GrowthGiftPage:OnShow()
isPlayAnim = true
self.gameObject:SetActive(true)
self:RefreshData()
end
@ -92,6 +93,10 @@ function GrowthGiftPage:RefreshGiftData()
self:RefreshShowData(item, list[index])
end
self.scrollView:SetData(list, callBack)
if isPlayAnim then
SecTorPlayAnimByScroll(self.scrollView)
isPlayAnim = false
end
end
--刷新每一条item
@ -120,6 +125,12 @@ function GrowthGiftPage:RefreshShowData(item, data)
local state = singleRewardData.state
local isCanGetReward = PlayerManager.level >= actRewardConfig[data.Id].Values[1][2]
-- if isPlayAnim then
-- item:SetActive(false)
-- else
-- item:SetActive(true)
-- end
--设置滚动条
if self.ItemList[item] then--如果已经存在在list中
self.ItemList[item]:OnOpen(false, {shows[1][1],shows[1][2]}, 0.9,false,false,false,self.mainPanel.sortingOrder)

View File

@ -120,11 +120,11 @@ function WeekMonthGiftPackPage:RefreshShowData(item, data)
--limitNum = OperatingManager.GetLeftBuyTime(GoodsTypeDef.DirectPurchaseGift,data.goodsId)
costId, finalNum, oriCostNum = nil,shopItemData.Price,nil
if isPlayAnim then
item:SetActive(false)
else
item:SetActive(true)
end
-- if isPlayAnim then
-- item:SetActive(false)
-- else
-- item:SetActive(true)
-- end
--滚动条复用重设itemview
if self.ItemList[item] then

View File

@ -83,12 +83,12 @@ function this.SortTypeClick(_sortType)
this.ScrollView:SetData(tarHero, function (index, go)
this.SingleHeroDataShow(go, tarHero[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
--英雄单个数据展示

View File

@ -82,12 +82,12 @@ function this.SortTypeClick(_sortType)
this.ScrollView:SetData(tarEquipTreasure, function (index, go)
this.SingleHeroDataShow(go, tarEquipTreasure[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
function this.SortDatas(tarEquipTreasure)
table.sort(

View File

@ -252,12 +252,12 @@ function this.SortTypeClick(_sortType)
this.ScrollView:SetData(heroDatas, function (index, go)
this.SingleHeroDataShow(go, heroDatas[index],false)
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
--英雄单个数据展示

View File

@ -92,12 +92,12 @@ function this.SortTypeClick(_sortType)
this.ScrollView:SetData(tarHero, function (index, go)
this.SingleHeroDataShow(go, tarHero[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
--获取筛选后的英雄数据

View File

@ -81,12 +81,12 @@ function this.SortTypeClick(_sortType)
this.ScrollView:SetData(tarHero, function (index, go)
this.SingleHeroDataShow(go, tarHero[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
end
--获取筛选后的英雄数据

View File

@ -793,11 +793,11 @@ function this.SingleItemDataShow(_go, _itemData)
if not itemConfig[_itemData.id] then
return
end
if isPlayAnim then
_go.gameObject:SetActive(false)
else
_go.gameObject:SetActive(true)
end
-- if isPlayAnim then
-- _go.gameObject:SetActive(false)
-- else
-- _go.gameObject:SetActive(true)
-- end
local frame = Util.GetGameObject(_go.transform, "frame"):GetComponent("Image")
local icon = Util.GetGameObject(_go.transform, "icon"):GetComponent("Image")
local name = Util.GetGameObject(_go.transform, "name"):GetComponent("Text")

View File

@ -182,9 +182,9 @@ function RoleListPanel:OnShow()
else
Util.SetGray(this.formationBtn, true)
end
if this.ScrollView then
this.ScrollView:SetIndex(1)
end
-- if this.ScrollView then
-- this.ScrollView:SetIndex(1)
-- end
this.FreshPlayerInfo()
this.SetPlayerHead()
@ -225,25 +225,42 @@ function this:GetCurSortHeroListData()
this:SetSelectBtn()
end
--设置英雄列表数据
function this:SetRoleList(_roleDatas)
roleDatas=_roleDatas
this:SortHeroDatas(_roleDatas)
HeroManager.heroSortedDatas = roleDatas
this.heroNumText:GetComponent("Text").text=string.format(Language[11856],#_roleDatas)
--FHF
Log("RoleListPanel::SetRoleList.....")
this.ScrollView:SetData(_roleDatas, function (index, go)
if this.isFirstOpen then
go.gameObject:SetActive(false)
end
this.SingleHeroDataShow(go, roleDatas[index])
-- if this.isFirstOpen then
-- go.gameObject:SetActive(false)
-- end
this.SingleHeroDataShow(go, roleDatas[index])
--Log("RoleListPanel::SetRoleList_HeroDataShow____")
end)
-- this.ScrollView:SetIndex(#roleDatas)
Log("RoleListPanel::SetRoleList____END")
if this.isFirstOpen then
this.ScrollView:ForeachItemGO(function (index, go)
Timer.New(function ()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.03*(index-1)):Start()
end)
-- this.ScrollView:ForeachItemGO(function (index, go)
-- Timer.New(function ()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- --将原有同步的数据更新,修改为异步调用
-- -- this.SingleHeroDataShow(go, roleDatas[index])
-- end, 0.03*(index-1)):Start()
-- end)
if isFristOpenTime then
isFristOpenTime:Stop()
isFristOpenTime = nil

View File

@ -31,6 +31,8 @@ local _specialData={}
local isUpZhen = false
local list={}
local teamHero = {}
local isPlayAnim = true
local isFristOpenTime
function SoulPrintPanel:InitComponent()
this.upView = SubUIManager.Open(SubUIConfig.UpView, this.gameObject.transform, { showType = UpViewOpenType.ShowLeft})
this.helpBtn= Util.GetGameObject(this.gameObject, "HelpBtn")
@ -68,6 +70,7 @@ function SoulPrintPanel:InitComponent()
this.scrollView.moveTween.MomentumAmount = 1
this.scrollView.moveTween.Strength = 2
this.SetIsShow()
this.BgMask = Util.GetGameObject(this.gameObject,"bgMask")
end
function SoulPrintPanel:BindEvent()
@ -77,10 +80,12 @@ function SoulPrintPanel:BindEvent()
end)
--向左切换英雄数据
Util.AddClick(this.leftBtn, function()
isPlayAnim = true
this.OnLeftBtnClick()
end)
--向右切换英雄数据
Util.AddClick(this.rightBtn, function()
isPlayAnim = true
this.OnRightBtnClick()
end)
--点击图鉴按钮
@ -144,6 +149,7 @@ function SoulPrintPanel:OnOpen(_curHeroData,_heroDatas)
end
function SoulPrintPanel:OnShow()
isPlayAnim = true
this.upView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
--已激活魂印的Hero为1时 隐藏左右按钮
this.leftBtn.gameObject:SetActive(#heroDatas>1)
@ -156,6 +162,10 @@ function SoulPrintPanel:OnClose()
loopCount=0
local var=isShow and 1 or 0
PlayerPrefs.SetInt(PlayerManager.uid .. "_SoulPrint_IsShow",var)
if isFristOpenTime then
isFristOpenTime:Stop()
isFristOpenTime = nil
end
end
function SoulPrintPanel:OnDestroy()
@ -188,7 +198,7 @@ function this.RefreshShow()
this.SetHero()
this.SetScrollData()
--对比战力并更新战力值 播放战力变更动画
HeroManager.CompareWarPower(curHeroData.dynamicId)
-- HeroManager.CompareWarPower(curHeroData.dynamicId)
-- local allPro = HeroManager.CalculateHeroAllProValList(1, curHeroData.dynamicId, false)
local allAddProVal
--计算面板属性
@ -300,6 +310,8 @@ function this.SetLoopPre(root,type,index,data,curIndex)
UIManager.OpenPanel(UIName.SoulPrintPopUp,2,curHeroData.dynamicId,data.equipId,pos,function()
PopupTipPanel.ShowTip(Language[11949])
this.RefreshShow()
--对比战力并更新战力值 播放战力变更动画
HeroManager.CompareWarPower(curHeroData.dynamicId)
end)
end)
end
@ -343,6 +355,18 @@ function this.SetScrollData()
this.SetScrollPre(root,data[index])
table.insert(list,root)
end)
if isPlayAnim then
if isFristOpenTime then
isFristOpenTime:Stop()
isFristOpenTime = nil
end
isFristOpenTime = Timer.New(function()
this.BgMask:SetActive(false)
end, 1):Start()
this.BgMask:SetActive(true)
SecTorPlayAnimByScroll(this.scrollView)
isPlayAnim = false
end
--特效层级重设
for i=1,#list do
Util.SetParticleSortLayer(list[i], this.sortingOrder)
@ -351,6 +375,11 @@ function this.SetScrollData()
end
--设置魂印列表预设
function this.SetScrollPre(root,data)
-- if isPlayAnim then
-- root.gameObject:SetActive(false)
-- else
-- root.gameObject:SetActive(true)
-- end
SetSoulEffect(equipConfig[data.id].Quality,root)
local frame=Util.GetGameObject(root,"Frame"):GetComponent("Image")
@ -389,6 +418,8 @@ function this.SetScrollPre(root,data)
UIManager.OpenPanel(UIName.SoulPrintPopUp,1,curHeroData.dynamicId,data.id,pos,function()
PopupTipPanel.ShowTip(Language[11604])
this.RefreshShow()
--对比战力并更新战力值 播放战力变更动画
HeroManager.CompareWarPower(curHeroData.dynamicId)
end,data)
-- end
end)

View File

@ -5,6 +5,7 @@ local this=TreasureStorePopup
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local GlobalActivity = ConfigManager.GetConfig(ConfigName.GlobalActivity)
local itemsGrid = {}
local isPlayAnim = true
function TreasureStorePopup:InitComponent()
this.panel=Util.GetGameObject(this.gameObject,"Panel")
this.backBtn=Util.GetGameObject(this.panel,"BackBtn")
@ -41,6 +42,7 @@ end
function TreasureStorePopup:OnShow()
this:RefreshPanel()
this:TimeCountDown()
isPlayAnim = true
end
function TreasureStorePopup:OnClose()
@ -77,6 +79,10 @@ function TreasureStorePopup:RefreshPanel()
this:SetScrollPre(go, allData[index])
end)
end
-- if isPlayAnim then
-- SecTorPlayAnimByScroll(this.scrollView)
-- isPlayAnim = false
-- end
this.scrollView:SetIndex(1)
end
@ -97,7 +103,11 @@ function this.SortData(allData)
end
--设置每一条
function this:SetScrollPre(root,data)
root.gameObject:SetActive(true)
-- if isPlayAnim then
-- root.gameObject:SetActive(false)
-- else
-- root.gameObject:SetActive(true)
-- end
local title=Util.GetGameObject(root,"Title"):GetComponent("Text")
local iRoot=Util.GetGameObject(root,"ItemRoot")
local buyBtn=Util.GetGameObject(root,"BuyBtn")

View File

@ -387,17 +387,17 @@ function this:RefreshItemList(isTop)
self.RechargeScrollView:SetData(itemlist, function(index, shopItem)
local itemData = itemlist[index]
self:RechargeShopItemAdapter(shopItem, itemData)
if isPlayShow then
shopItem.gameObject:SetActive(false)
end
-- if isPlayShow then
-- shopItem.gameObject:SetActive(false)
-- end
end)
if isTop then
self.RechargeScrollView:SetIndex(1)
end
if isPlayShow then
SecTorPlayAnimByScroll(self.RechargeScrollView,0.03)
isPlayShow = false
end
-- if isPlayShow then
-- SecTorPlayAnimByScroll(self.RechargeScrollView,0.03)
-- isPlayShow = false
-- end
else
-- 重置列表
self.RechargeScrollView.gameObject:SetActive(false)