【战力冲刺】调整

dev_chengFeng
张彪 2022-03-07 16:05:38 +08:00
parent 98443bbdb2
commit 22514fe5f7
3 changed files with 46 additions and 27 deletions

View File

@ -698,6 +698,7 @@ function this.ExecuteLoading()
--[[[54] =]]function() NetManager.RequestArenaRankData(1,LoadingPanel.OnStep) end, --获取竞技场数据
--[[[55] =]]function() HomeLandManager.GetData(LoadingPanel.OnStep) end, --家园获取数据
--[[[56] =]]function() NetManager.ExplorerMapInfoRequest(LoadingPanel.OnStep) end, --灵脉秘境
--[[[57] =]]function() CommonActPageManager.GetPowerRicePower(LoadingPanel.OnStep) end, --战力冲刺
function() -- 登录请求最终接口,所有请求放在此接口之前
-- 登录成功确认
NetManager.LoginConfimRequest()

View File

@ -4,6 +4,7 @@ local dataList = {}
this.TaSuiLingXiaoMsg = nil
this.TaSuiLingXiaoHistoryDmg = 0
this.DynamicActType = 0
this.powerRicePower = 0
function this.Initialize()
this.args = {}
@ -847,16 +848,28 @@ function this.ChaoZhiJiJin328Red()
return false
end
--获取战力冲刺战力
function this.GetPowerRicePower(func)
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.PowerRice) then
RankingManager.InitData(RANK_TYPE.POWER_RICE,function ()
local allRankData,myRankData = RankingManager.GetRankingInfo()
this.powerRicePower = myRankData.param1
if func then
func()
end
end,0)
end
end
function this.PowerRiceRedCheck()
local data = this.GetData(ActivityTypeDef.PowerRice)
if data then
for i = 1, #data.rewards do
if data.rewards[i].state == 0 and data.rewards[i].otherData.Values[1][1] <= PlayerManager.maxForce then
if data.rewards[i].state == 0 and data.rewards[i].otherData.Values[1][1] <= this.powerRicePower then
return true
end
end
return false
end
return false
end
return CommonActPageManager

View File

@ -6,6 +6,7 @@ local STATE = {
[0] = {Img = "s_slbz_1anniuhuangse",text = Language[10556]},
[1] = {Img = "s_slbz_1anniuongse",text = Language[11948]},
[2] = {Img = "s_slbz_1anniuhuise",text = Language[10101]},
[3] = {Img = "s_slbz_1anniuhuise",text = "已结束"},
}
local TabBoxRedPoints = {}
@ -103,8 +104,8 @@ end
--切换视图
function this.SwitchView(index)
--先执行上一面板关闭逻辑
curIndex = index
PowerRice:Refresh(curIndex,true,true)
curIndex = index
PowerRice:Refresh(curIndex,true,true)
end
--界面打开时调用(用于子类重写)
@ -113,37 +114,35 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function PowerRice:OnShow()
curIndex = 1
PowerRice:Refresh(curIndex,true,true)
if this.TabCtrl then
this.TabCtrl:ChangeTab(curIndex)
if curIndex ~= 1 then
this.TabCtrl:ChangeTab(1)
end
end
function PowerRice:Refresh(_curIndex,isTop,isAni)
CheckRedPointStatus(RedPointType.PowerRiceGool)
self.power.text = PlayerManager.maxForce
for index, value in ipairs(self.ScrollList) do
value.gameObject:SetActive(index == _curIndex)
end
if _curIndex == 1 then
RankingManager.InitData(RANK_TYPE.POWER_RICE,function ()
local allRankData,myRankData = RankingManager.GetRankingInfo()
self.myRank = myRankData.rank
self.myPower = myRankData.param1
CommonActPageManager.powerRicePower = myRankData.param1
self.actData = CommonActPageManager.GetData(ActivityTypeDef.PowerRice)
PowerRice:SetRewards1(isTop,isAni)
self.text1.text = "目标战力"
self.text2.text = "奖励 领取奖励"
elseif _curIndex == 2 then
self.text1.text = "名次"
self.text2.text = "奖励 战力要求"
RankingManager.InitData(RANK_TYPE.POWER_RICE,function ()
local allRankData,myRankData = RankingManager.GetRankingInfo()
self.myRank = myRankData.rank
if _curIndex == 1 then
PowerRice:SetRewards1(isTop,isAni)
self.text1.text = "目标战力"
self.text2.text = "奖励 领取奖励"
elseif _curIndex == 2 then
self.text1.text = "名次"
self.text2.text = "奖励 战力要求"
PowerRice:SetRewards2(isTop,isAni)
end,0)
end
PowerRice:SetTime()
PowerRice:SetLive2D()
end
PowerRice:SetTime()
PowerRice:SetLive2D()
CheckRedPointStatus(RedPointType.PowerRiceGool)
end,0)
end
function PowerRice:SetLive2D()
@ -167,12 +166,16 @@ function PowerRice:SingleDataShow(item,data,index)
local getBtn = Util.GetGameObject(item,"getBtn")
local btnImage = Util.GetGameObject(item,"getBtn"):GetComponent("Image")
local btnText = Util.GetGameObject(item,"getBtn/Text"):GetComponent("Text")
local gapTime = globalActConfig[self.actData.activityId].GapTime*86400
local state = 0
if data.state == 1 then
state = 2
elseif data.otherData.Values[1][1] > PlayerManager.maxForce then
elseif data.otherData.Values[1][1] > self.myPower then
state = 0
if self.actData.endTime - GetTimeStamp() < gapTime then
state = 3
end
else
state = 1
end
@ -199,6 +202,8 @@ function PowerRice:SingleDataShow(item,data,index)
PowerRice:Refresh(curIndex,false,false)
end)
end)
elseif state == 3 then
PopupTipPanel.ShowTip("活动已结束")
end
end)
getBtn:GetComponent("Button").interactable = state ~= 2
@ -291,7 +296,6 @@ function PowerRice:OnClose()
self.timer:Stop()
self.timer = nil
end
curIndex = 1
end
--界面销毁时调用(用于子类重写)
@ -309,6 +313,7 @@ function PowerRice:OnDestroy()
ClearRedPointObject(_TabData[i].redPointType,TabBoxRedPoints[i])
end
end
curIndex = 1
end
return PowerRice