2021-09-06 17:21:53 +08:00
|
|
|
|
require("Base/BasePanel")
|
|
|
|
|
local QiJieShiLianPanel = Inherit(BasePanel)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
local QijieStage = ConfigManager.GetConfig(ConfigName.QijieStage)
|
|
|
|
|
local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
|
|
|
|
|
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
2023-09-01 18:27:39 +08:00
|
|
|
|
local roleConfig = ConfigManager.GetConfig(ConfigName.RoleConfig)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
--初始化组件(用于子类重写)
|
|
|
|
|
function QiJieShiLianPanel:InitComponent()
|
|
|
|
|
self.spLoader = SpriteLoader.New()
|
|
|
|
|
-- 屏幕适配修改
|
|
|
|
|
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
|
|
|
|
self.backBtn = Util.GetGameObject(self.gameObject,"backBtn")
|
|
|
|
|
self.helpBtn = Util.GetGameObject(self.gameObject,"HelpBtn")
|
|
|
|
|
self.helpPosition=self.helpBtn:GetComponent("RectTransform").localPosition
|
|
|
|
|
self.aniRoot = Util.GetGameObject(self.gameObject,"aniRoot")
|
|
|
|
|
--上部
|
|
|
|
|
self.topBar = Util.GetGameObject(self.gameObject,"TopBar")
|
|
|
|
|
self.name = Util.GetGameObject(self.topBar,"Name"):GetComponent("Text")
|
|
|
|
|
self.info = Util.GetGameObject(self.topBar,"Info"):GetComponent("Text")
|
|
|
|
|
--左侧按钮
|
|
|
|
|
self.leftBtns = Util.GetGameObject(self.gameObject,"leftBtns")
|
|
|
|
|
self.goalBtn = Util.GetGameObject(self.leftBtns,"goalBtn")
|
|
|
|
|
self.giftBtn = Util.GetGameObject(self.leftBtns,"giftBtn")
|
|
|
|
|
self.treasureBtn = Util.GetGameObject(self.leftBtns,"treasureBtn")
|
2021-09-22 16:25:29 +08:00
|
|
|
|
self.treasureRed = Util.GetGameObject(self.treasureBtn,"redPoint")
|
2021-09-06 17:21:53 +08:00
|
|
|
|
--右侧按钮
|
|
|
|
|
self.rightBtns = Util.GetGameObject(self.gameObject,"rightBtns")
|
|
|
|
|
self.rewardBtn = Util.GetGameObject(self.rightBtns,"rewardBtn")
|
2023-08-29 17:58:24 +08:00
|
|
|
|
--屏蔽七界排名奖励
|
|
|
|
|
self.rewardBtn:SetActive(false)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
self.sortBtn = Util.GetGameObject(self.rightBtns,"sortBtn")
|
|
|
|
|
self.shopBtn = Util.GetGameObject(self.rightBtns,"shopBtn")
|
|
|
|
|
--下部
|
|
|
|
|
self.bottomBar = Util.GetGameObject(self.gameObject,"BottomBar")
|
2021-09-07 18:09:33 +08:00
|
|
|
|
--挑战加成
|
2021-09-06 17:21:53 +08:00
|
|
|
|
self.addtions = Util.GetGameObject(self.bottomBar,"Info/Content")
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self.addNum = Util.GetGameObject(self.addtions,"Text"):GetComponent("Text")
|
|
|
|
|
self.goalList = {}
|
|
|
|
|
for i = 1, 3 do
|
|
|
|
|
self.goalList[i] = Util.GetGameObject(self.addtions,"goal ("..i..")")
|
|
|
|
|
end
|
|
|
|
|
--挑战奖励
|
2021-09-06 17:21:53 +08:00
|
|
|
|
self.rewards = Util.GetGameObject(self.bottomBar,"Reward/Content")
|
2021-09-10 10:30:50 +08:00
|
|
|
|
--挑战
|
2021-09-06 17:21:53 +08:00
|
|
|
|
self.goBtn = Util.GetGameObject(self.bottomBar,"goBtn")
|
2021-09-10 10:30:50 +08:00
|
|
|
|
--次数
|
2021-09-06 17:21:53 +08:00
|
|
|
|
self.freeTime = Util.GetGameObject(self.bottomBar,"times/freeTime"):GetComponent("Text")
|
2021-09-10 10:30:50 +08:00
|
|
|
|
self.buyTime = Util.GetGameObject(self.bottomBar,"times/buyTime"):GetComponent("Text")
|
2021-09-06 17:21:53 +08:00
|
|
|
|
self.buyBtn = Util.GetGameObject(self.bottomBar,"times/buyBtn")
|
|
|
|
|
--下方按钮
|
|
|
|
|
self.TabBox = Util.GetGameObject(self.gameObject,"TabBox")
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self.box = Util.GetGameObject(self.TabBox,"box")
|
|
|
|
|
self.tabPre = Util.GetGameObject(self.TabBox,"tabPre")
|
|
|
|
|
|
|
|
|
|
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.box.transform,
|
2023-08-30 22:07:43 +08:00
|
|
|
|
self.tabPre, nil, Vector2.New(940.6, 240), 2, 1, Vector2.New(20, 0))
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self.ScrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(-8, 0)
|
|
|
|
|
self.ScrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
|
|
|
|
self.ScrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
|
|
|
|
self.ScrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
|
|
|
|
self.ScrollView.moveTween.MomentumAmount = 1
|
|
|
|
|
self.ScrollView.moveTween.Strength = 2
|
|
|
|
|
self.ScrollView.elastic = false
|
|
|
|
|
|
|
|
|
|
self.rewardPre = Util.GetGameObject(self.bottomBar,"rewardPre")
|
|
|
|
|
self.ScrollView2 = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.rewards.transform,
|
2021-09-24 15:11:57 +08:00
|
|
|
|
self.rewardPre, nil, Vector2.New(450, 235), 2, 1, Vector2.New(30, 0))
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self.ScrollView2.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(-8, 0)
|
|
|
|
|
self.ScrollView2.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
|
|
|
|
self.ScrollView2.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
|
|
|
|
self.ScrollView2.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
|
|
|
|
self.ScrollView2.moveTween.MomentumAmount = 1
|
|
|
|
|
self.ScrollView2.moveTween.Strength = 2
|
|
|
|
|
self.ScrollView2.elastic = false
|
|
|
|
|
|
|
|
|
|
--左右切换按钮
|
|
|
|
|
self.lastBtn = Util.GetGameObject(self.gameObject,"lastBtn")
|
|
|
|
|
self.nextBtn = Util.GetGameObject(self.gameObject,"nextBtn")
|
|
|
|
|
self.itemViewList = {}
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
|
function QiJieShiLianPanel:BindEvent()
|
|
|
|
|
Util.AddClick(self.backBtn,function()
|
|
|
|
|
self:ClosePanel()
|
|
|
|
|
end)
|
|
|
|
|
Util.AddOnceClick(self.helpBtn, function()
|
2021-09-10 10:30:50 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.QiJieShiLian,self.helpPosition.x,self.helpPosition.y)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.goalBtn,function()
|
2021-09-22 19:38:16 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.QiJieGoalAttri,self.configData,Vector2(0,450))
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.giftBtn,function()
|
2021-09-11 15:47:19 +08:00
|
|
|
|
NetManager.SevenWorldRelicRequest(0,function (msg)
|
2021-09-08 17:32:48 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.QiJieTreasure)
|
2021-09-08 16:26:40 +08:00
|
|
|
|
end)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.treasureBtn,function()
|
2021-09-22 16:25:29 +08:00
|
|
|
|
local actInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.QiJieTreasure)
|
|
|
|
|
if not actInfo then
|
|
|
|
|
PopupTipPanel.ShowTip("活动暂未开启。")
|
|
|
|
|
else
|
|
|
|
|
UIManager.OpenPanel(UIName.GeneralTreasurePanel,ActivityTypeDef.QiJieTreasure)
|
|
|
|
|
end
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.rewardBtn,function()
|
2021-09-16 19:36:16 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.GeneralRankRewardPanel,4,QiJieShiLianManager.curRank)--需要活动id,和我的排名
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.sortBtn,function()
|
2021-09-22 15:19:27 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[32])
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.shopBtn,function()
|
2021-09-17 13:42:27 +08:00
|
|
|
|
JumpManager.GoJump(40035)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.goBtn,function()
|
2021-09-10 10:30:50 +08:00
|
|
|
|
if PrivilegeManager.GetPrivilegeRemainValue(3201) <= 0 then
|
2021-09-18 18:23:48 +08:00
|
|
|
|
if PrivilegeManager.GetPrivilegeRemainValue(3202) > 0 then
|
|
|
|
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP,10042, 1)
|
|
|
|
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
|
|
|
|
MsgPanel.ShowTwo(string.format( Language[10516],finalNum,itemName), nil, function()
|
|
|
|
|
--买东西
|
|
|
|
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,10042,1,function()
|
|
|
|
|
PopupTipPanel.ShowTip(Language[10517])
|
|
|
|
|
PrivilegeManager.RefreshPrivilegeUsedTimes(3202, 1)--更新特权
|
2021-09-22 19:38:16 +08:00
|
|
|
|
-- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.QIJIESHILIAN,self.configData)
|
|
|
|
|
UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.QiJieShiLianMonster,self.configData)
|
2021-09-23 14:21:30 +08:00
|
|
|
|
self:SetBuyTime()
|
2021-09-18 18:23:48 +08:00
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip("<color=red>今日已无挑战次数!</color>")
|
|
|
|
|
end
|
|
|
|
|
else
|
2021-09-22 19:38:16 +08:00
|
|
|
|
-- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.QIJIESHILIAN,self.configData)
|
|
|
|
|
UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.QiJieShiLianMonster,self.configData)
|
2021-09-10 10:30:50 +08:00
|
|
|
|
end
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.buyBtn,function()
|
2021-09-10 10:30:50 +08:00
|
|
|
|
if PrivilegeManager.GetPrivilegeRemainValue(3202) > 0 then
|
|
|
|
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP,10042, 1)
|
|
|
|
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
|
|
|
|
MsgPanel.ShowTwo(string.format( Language[10516],finalNum,itemName), nil, function()
|
|
|
|
|
--买东西
|
|
|
|
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,10042,1,function()
|
|
|
|
|
PopupTipPanel.ShowTip(Language[10517])
|
|
|
|
|
PrivilegeManager.RefreshPrivilegeUsedTimes(3202, 1)--更新特权
|
|
|
|
|
self:SetBuyTime()
|
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip("<color=red>今日已无购买次数!</color>")
|
|
|
|
|
end
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
Util.AddClick(self.lastBtn,function()
|
2021-09-16 21:05:43 +08:00
|
|
|
|
QiJieShiLianManager.SwitchBtnCheck(-1,function ()
|
2021-09-10 10:30:50 +08:00
|
|
|
|
self:Refresh()
|
2021-09-16 21:05:43 +08:00
|
|
|
|
end)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.nextBtn,function()
|
2021-09-16 21:05:43 +08:00
|
|
|
|
QiJieShiLianManager.SwitchBtnCheck(1,function ()
|
2021-09-10 10:30:50 +08:00
|
|
|
|
self:Refresh()
|
2021-09-16 21:05:43 +08:00
|
|
|
|
end)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
end)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
|
function QiJieShiLianPanel:AddListener()
|
2021-09-18 15:04:32 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.QiJieShiLian.RefreshPanel, self.Refresh,self)
|
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Privilege.OnPrivilegeZeroUpdate, self.SetBuyTime,self)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
|
function QiJieShiLianPanel:RemoveListener()
|
2021-09-18 15:04:32 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.QiJieShiLian.RefreshPanel, self.Refresh,self)
|
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Privilege.OnPrivilegeZeroUpdate, self.SetBuyTime,self)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--跨服
|
|
|
|
|
function QiJieShiLianPanel:OnOpen()
|
2021-09-10 15:23:15 +08:00
|
|
|
|
self.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.QiJie})
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
function QiJieShiLianPanel:OnShow()
|
2021-09-16 21:05:43 +08:00
|
|
|
|
if QiJieShiLianManager.IsLock then
|
2021-09-18 18:18:22 +08:00
|
|
|
|
NetManager.SevenWorldInfoRequest(QiJieShiLianManager.curLevelId)
|
2021-09-16 21:05:43 +08:00
|
|
|
|
else
|
|
|
|
|
NetManager.SevenWorldInfoRequest(0)
|
|
|
|
|
end
|
2021-09-06 17:21:53 +08:00
|
|
|
|
self:Refresh()
|
|
|
|
|
end
|
|
|
|
|
|
2021-09-16 21:05:43 +08:00
|
|
|
|
function QiJieShiLianPanel:Refresh()
|
|
|
|
|
self.qijieData = QiJieShiLianManager.GetQiJieData()
|
2021-10-29 13:28:04 +08:00
|
|
|
|
CheckRedPointStatus(RedPointType.QiJieShiLian)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self.configData = self.qijieData.curStageData
|
2021-09-23 14:21:30 +08:00
|
|
|
|
Log("七界试炼当前层数Id:"..tostring(QiJieShiLianManager.curLevelId).." 最大层数Id:"..tostring(QiJieShiLianManager.curMaxStage))
|
2021-09-10 10:30:50 +08:00
|
|
|
|
local num = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,128).Value)
|
2021-09-18 10:29:30 +08:00
|
|
|
|
self.giftBtn:SetActive(self.qijieData.curProgress >= num)
|
2021-09-16 21:05:43 +08:00
|
|
|
|
self.lastBtn:SetActive(not not QijieStage[QiJieShiLianManager.curLevelId-1])
|
|
|
|
|
self.nextBtn:SetActive(QiJieShiLianManager.curMaxStage~=QiJieShiLianManager.curLevelId)
|
2021-09-22 16:25:29 +08:00
|
|
|
|
self.treasureRed:SetActive(QiJieShiLianManager.CheckQiJieTreasureRedPoint())
|
2021-09-24 14:57:04 +08:00
|
|
|
|
self.treasureBtn:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.QiJieTreasure))
|
2021-10-19 09:33:37 +08:00
|
|
|
|
PlayUIAnims(self.lastBtn)
|
|
|
|
|
PlayUIAnims(self.nextBtn)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self:SetTabBox()
|
|
|
|
|
self:SetTopBar()
|
|
|
|
|
self:SetBottomBar()
|
|
|
|
|
|
|
|
|
|
--设置立绘
|
|
|
|
|
if self.Live then
|
|
|
|
|
poolManager:UnLoadLive(self.bgName, self.Live)
|
|
|
|
|
end
|
2021-09-22 16:25:29 +08:00
|
|
|
|
self.tempId = self.configData.BossId
|
2021-09-07 18:09:33 +08:00
|
|
|
|
if not heroConfig[self.tempId] then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
local herodata = heroConfig[self.tempId]
|
|
|
|
|
local pos = herodata.Position
|
|
|
|
|
local scale = herodata.Scale
|
2023-09-01 18:27:39 +08:00
|
|
|
|
self.bgName = artConfig[herodata.Painting].Name
|
|
|
|
|
self.Live = poolManager:LoadLive(self.bgName, self.aniRoot.transform, Vector3.one*roleConfig[self.tempId].play_liveScale, Vector2.New(pos[1],pos[2]))
|
2021-09-10 10:30:50 +08:00
|
|
|
|
|
|
|
|
|
self:SetBuyTime()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function QiJieShiLianPanel:SetBuyTime()
|
2023-08-30 20:33:29 +08:00
|
|
|
|
self.freeTime.text = string.format( "<color=#F7F8F8>免费次数:</color>%s",PrivilegeManager.GetPrivilegeRemainValue(3201))
|
|
|
|
|
self.buyTime.text = string.format( "<color=#F7F8F8>购买次数:</color>%s",PrivilegeManager.GetPrivilegeRemainValue(3202))
|
2021-09-07 18:09:33 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--设置下方滑动条
|
|
|
|
|
function QiJieShiLianPanel:SetTabBox()
|
|
|
|
|
local tabList = QiJieShiLianManager.GetTabList()
|
|
|
|
|
self.ScrollView:SetData(tabList, function (index, go)
|
|
|
|
|
Util.GetGameObject(go,"Text"):GetComponent("Text").text = tabList[index].Chapter
|
|
|
|
|
local state = tabList[index].QijieType == self.configData.QijieType
|
2023-08-30 22:07:43 +08:00
|
|
|
|
local name = state and "UI_hz_kuang_bg_01" or "UI_hz_kuang_bg_01"
|
2021-09-07 18:09:33 +08:00
|
|
|
|
Util.GetGameObject(go,"Image"):GetComponent("Image").sprite = self.spLoader:LoadSprite(name)
|
|
|
|
|
Util.GetGameObject(go,"LockImage"):SetActive(not state)
|
2021-09-08 10:06:24 +08:00
|
|
|
|
Util.AddOnceClick(go,function ()
|
|
|
|
|
if not state then
|
2021-09-08 16:26:40 +08:00
|
|
|
|
PopupTipPanel.ShowTip(string.format( "%s开启<color=red>【%s】试炼!</color>",NumToWeek[index],tabList[index].Chapter))
|
2021-09-08 10:06:24 +08:00
|
|
|
|
end
|
|
|
|
|
end)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
end,false,true)
|
2021-09-08 10:06:24 +08:00
|
|
|
|
local num = (self.configData.QijieType - 2) > 0 and (self.configData.QijieType - 2) or 1
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self.ScrollView:SetIndex(num)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--设置上方信息
|
|
|
|
|
function QiJieShiLianPanel:SetTopBar()
|
2021-09-10 10:30:50 +08:00
|
|
|
|
local text = self.qijieData.curRank > 0 and self.qijieData.curRank or "未上榜"
|
2021-09-18 15:04:32 +08:00
|
|
|
|
local text2 = self.qijieData.curScore >= 0 and self.qijieData.curScore or "0"
|
2023-08-30 21:25:36 +08:00
|
|
|
|
self.info.text = string.format( "<color=#F7F8F8>本周排名:</color>%s <color=#F7F8F8>本周积分:</color>%s",text,text2)
|
2021-09-07 18:09:33 +08:00
|
|
|
|
self.name.text = string.format( "%s·%s层",self.configData.Chapter,self.configData.Stage)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--设置下方挑战信息和奖励信息
|
|
|
|
|
function QiJieShiLianPanel:SetBottomBar()
|
|
|
|
|
--设置挑战加成数据
|
2021-09-22 19:38:16 +08:00
|
|
|
|
self.addNum.text = string.format( "每满足一种获得界灵数量+%s",self.configData.ConditionValue[1][2]/100).."%"
|
2021-09-07 18:09:33 +08:00
|
|
|
|
for i = 1, #self.goalList do
|
|
|
|
|
local text = Util.GetGameObject(self.goalList[i],"Text"):GetComponent("Text")
|
|
|
|
|
local image = Util.GetGameObject(self.goalList[i],"Image"):GetComponent("Image")
|
2021-09-15 18:09:21 +08:00
|
|
|
|
local state = QiJieShiLianManager.CheckGoalIsFinish(self.configData.ConditionValue[i][1],text)--检测是否完成此条目(顺便设置文字)
|
2023-08-30 21:25:36 +08:00
|
|
|
|
local imgname = state and "UI_hz_qj_04" or "UI_hz_qj_05"
|
2021-09-07 18:09:33 +08:00
|
|
|
|
image.sprite = self.spLoader:LoadSprite(imgname)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--拿取奖励列表
|
|
|
|
|
local rewardList = {}
|
2021-09-15 18:09:21 +08:00
|
|
|
|
table.insert(rewardList,self.configData.JielingReward[1])
|
2021-09-07 18:09:33 +08:00
|
|
|
|
for i = 1, #self.configData.Reward do
|
|
|
|
|
table.insert(rewardList,self.configData.Reward[i])
|
|
|
|
|
end
|
|
|
|
|
--设置显示
|
|
|
|
|
for key, value in pairs(self.itemViewList) do
|
|
|
|
|
value.gameObject:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
self.ScrollView2:SetData(rewardList, function (index, go)
|
|
|
|
|
if not self.itemViewList[index] then
|
|
|
|
|
self.itemViewList[index] = SubUIManager.Open(SubUIConfig.ItemView, go.transform)
|
|
|
|
|
end
|
|
|
|
|
self.itemViewList[index]:OnOpen(false, rewardList[index], 1,false,false,false,self.sortingOrder)
|
|
|
|
|
self.itemViewList[index].gameObject:SetActive(true)
|
|
|
|
|
end,false,true)
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
|
function QiJieShiLianPanel:OnClose()
|
2021-09-07 18:09:33 +08:00
|
|
|
|
if self.Live then
|
|
|
|
|
poolManager:UnLoadLive(self.bgName, self.Live)
|
|
|
|
|
end
|
|
|
|
|
self.Live = nil
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
|
function QiJieShiLianPanel:OnDestroy()
|
|
|
|
|
self.spLoader:Destroy()
|
2021-09-07 18:09:33 +08:00
|
|
|
|
if self.Live then
|
|
|
|
|
poolManager:UnLoadLive(self.bgName, self.Live)
|
|
|
|
|
end
|
|
|
|
|
self.Live = nil
|
|
|
|
|
self.goalList = {}
|
|
|
|
|
self.itemViewList = {}
|
2021-09-06 17:21:53 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return QiJieShiLianPanel
|