【七界试炼】提交
parent
634f78d3c5
commit
1ddc89ad54
|
@ -2,7 +2,7 @@ require("Base/BasePanel")
|
|||
local GeneralTreasurePanel = Inherit(BasePanel)
|
||||
local itemnum = 0
|
||||
local LocalData = {
|
||||
[ActivityTypeDef.QiJieTreasure] = {hp = HELP_TYPE.QiJieTreasure,imgName = "q_qjsl_qjmb2"},--七界秘宝
|
||||
[ActivityTypeDef.QiJieTreasure] = {hp = HELP_TYPE.QiJieTreasure,imgName = "q_qjsl_qjmb2",imgBg = "q_qjsl_qjmb",unLockType = 4,Tips = "挑战七界试炼,提升密保等级,激活密保后还可领取额外奖励"},--七界秘宝
|
||||
}
|
||||
--初始化组件(用于子类重写)
|
||||
function GeneralTreasurePanel:InitComponent()
|
||||
|
@ -11,6 +11,7 @@ function GeneralTreasurePanel:InitComponent()
|
|||
self.btnBack = Util.GetGameObject(self.transform, "bg/btnBack")
|
||||
self.buyBtn = Util.GetGameObject(self.transform, "bg/topBar/buyBtn")
|
||||
self.Text1 = Util.GetGameObject(self.buyBtn, "buy"):GetComponent("Text")
|
||||
self.topBarImg = Util.GetGameObject(self.transform, "bg/topBar"):GetComponent("Image")
|
||||
self.tips = Util.GetGameObject(self.transform, "bg/topBar/tips"):GetComponent("Text")
|
||||
self.time = Util.GetGameObject(self.transform, "bg/topBar/time"):GetComponent("Text")
|
||||
self.quesBtn = Util.GetGameObject(self.transform, "bg/quesBtn")
|
||||
|
@ -80,11 +81,13 @@ end
|
|||
--topBar按钮状态
|
||||
function GeneralTreasurePanel:topBar()
|
||||
--设置礼包购买按钮状态
|
||||
self.topBarImg.sprite = self.spLoader:LoadSprite(LocalData[self.curType].imgBg)
|
||||
self.tips.text = LocalData[self.curType].Tips
|
||||
self.titleName.sprite = self.spLoader:LoadSprite(LocalData[self.curType].imgName)
|
||||
self.buyBtn:GetComponent("Button").interactable = self.treasureData.treasureState == 0
|
||||
self.Text1.text = self.treasureData.treasureState == 0 and "激活秘宝" or "已激活"
|
||||
Util.AddOnceClick(self.buyBtn,function()
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,4)
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,LocalData[self.curType].unLockType)
|
||||
end)
|
||||
end
|
||||
|
||||
|
@ -103,14 +106,14 @@ function GeneralTreasurePanel:showTaskList(isTop,isAni)
|
|||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
--定位打开界面时位置
|
||||
local t = 0
|
||||
local State = self.treasureData.treasureState == 0 and 1 or -1
|
||||
local State = self.treasureData.treasureState == 0 and 2 or 3
|
||||
for i = 1, #self.treasureData.dataList do
|
||||
if self.treasureData.dataList[i].State == State then
|
||||
if self.treasureData.dataList[i].State == State or self.treasureData.dataList[i].State == 4 then
|
||||
t = i
|
||||
break
|
||||
end
|
||||
end
|
||||
self.ScrollView:SetIndex(t)
|
||||
self.ScrollView:SetIndex(t-1)
|
||||
end
|
||||
|
||||
--单个任务
|
||||
|
@ -228,7 +231,7 @@ function GeneralTreasurePanel:OnBtnDealClicked(rewardItem,singleData)
|
|||
end)
|
||||
end)
|
||||
elseif singleData.State == 1 then
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,4)
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,LocalData[self.curType].unLockType)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -164,7 +164,6 @@ function JumpServerPanel:BtnClick(id)
|
|||
local qiejieConfig = ConfigManager.GetConfig(ConfigName.QijieStage)
|
||||
NetManager.SevenWorldInfoRequest(0,function (msg)
|
||||
QiJieShiLianManager.IsLock = false
|
||||
QiJieShiLianManager.curLockStageId = QiJieShiLianManager.curLevelId
|
||||
if qiejieConfig[msg.id] then
|
||||
UIManager.OpenPanel(UIName.QiJieShiLianPanel)
|
||||
else
|
||||
|
|
|
@ -17,7 +17,6 @@ function this.Initialize()
|
|||
this.QijieType = 1
|
||||
this.curProgress = 0
|
||||
this.curMaxStage = 0
|
||||
this.curLockStageId = 0
|
||||
this.IsLock = false
|
||||
|
||||
this.treasureList = {}
|
||||
|
@ -288,27 +287,24 @@ end
|
|||
function this.SwitchBtnCheck(num,func)
|
||||
if num == -1 then
|
||||
this.IsLock = true
|
||||
if not QijieStage[this.curLockStageId - 1] then
|
||||
-- LogPink("最低层"..this.curLockStageId)
|
||||
if not QijieStage[this.curLevelId - 1] then
|
||||
return
|
||||
end
|
||||
this.curLockStageId = this.curLockStageId - 1
|
||||
this.curLevelId = this.curLevelId - 1
|
||||
elseif num == 1 then
|
||||
if not QijieStage[this.curLockStageId + 1] then
|
||||
-- LogPink("最高层"..this.curLockStageId)
|
||||
if not QijieStage[this.curLevelId + 1] then
|
||||
return
|
||||
end
|
||||
if this.curLockStageId + 1 > this.curMaxStage then
|
||||
-- LogPink("最大层"..this.curLockStageId.." "..this.curMaxStage)
|
||||
if this.curLevelId + 1 > this.curMaxStage then
|
||||
return
|
||||
end
|
||||
if this.curMaxStage == this.curLevelId then
|
||||
if this.curMaxStage == this.curLevelId + 1 then
|
||||
this.IsLock = false
|
||||
end
|
||||
this.curLockStageId = this.curLockStageId + 1
|
||||
this.curLevelId = this.curLevelId + 1
|
||||
end
|
||||
-- LogYellow("请求的Id:"..tostring(this.curLockStageId))
|
||||
NetManager.SevenWorldInfoRequest(this.curLockStageId,function ()
|
||||
-- LogYellow("请求的Id:"..tostring(this.curLevelId))
|
||||
NetManager.SevenWorldInfoRequest(this.curLevelId,function ()
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
|
|
|
@ -159,10 +159,9 @@ end
|
|||
--界面打开时调用(用于子类重写)
|
||||
function QiJieShiLianPanel:OnShow()
|
||||
if QiJieShiLianManager.IsLock then
|
||||
NetManager.SevenWorldInfoRequest(QiJieShiLianManager.curLockStageId)
|
||||
NetManager.SevenWorldInfoRequest(QiJieShiLianManager.curLevelId)
|
||||
else
|
||||
NetManager.SevenWorldInfoRequest(0)
|
||||
QiJieShiLianManager.curLockStageId = QiJieShiLianManager.curLevelId
|
||||
end
|
||||
self:Refresh()
|
||||
end
|
||||
|
@ -170,7 +169,7 @@ end
|
|||
function QiJieShiLianPanel:Refresh()
|
||||
self.qijieData = QiJieShiLianManager.GetQiJieData()
|
||||
self.configData = self.qijieData.curStageData
|
||||
-- LogGreen("当前层数Id:"..tostring(self.qijieData.curLevelId).." tempId:"..tostring(self.tempId))
|
||||
Log("当前层数Id:"..tostring(QiJieShiLianManager.curLevelId).." curMaxStage:"..tostring(QiJieShiLianManager.curMaxStage))
|
||||
local num = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,128).Value)
|
||||
self.giftBtn:SetActive(self.qijieData.curProgress >= num)
|
||||
self.lastBtn:SetActive(not not QijieStage[QiJieShiLianManager.curLevelId-1])
|
||||
|
|
Loading…
Reference in New Issue