aaaa
parent
5af9e9f0ed
commit
16289857a5
|
@ -5514,8 +5514,9 @@ end
|
|||
|
||||
|
||||
--请求领取玉虚论道每日宝箱
|
||||
function NetManager.CrossYuXuLunDaoGetDailyRewardRequest(func)
|
||||
function NetManager.CrossYuXuLunDaoGetDailyRewardRequest(index,func)
|
||||
local data=ArenaInfoProto_pb.CrossYuXuLunDaoGetDailyRewardRequest()
|
||||
data.type=index
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.CrossYuXuLunDaoGetDailyRewardRequest, MessageTypeProto_pb.CrossYuXuLunDaoGetDailyRewardResponse, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
|
@ -5614,7 +5615,4 @@ function this.CrossYuXuLunDaoBattleRecordRequest(id,func)
|
|||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
return this
|
|
@ -90,8 +90,6 @@ local function OnEndDrag(self, Pointgo, data)
|
|||
curInfo:SetParent(obj.transform)
|
||||
curInfo.transform:SetSiblingIndex(1)
|
||||
curInfo.localPosition = Vector3.New(0,-67,0)
|
||||
|
||||
|
||||
LogError("起始id=="..currIndex.." 终点id=="..targetIndex)
|
||||
end
|
||||
--初始化组件(用于子类重写)
|
||||
|
@ -214,12 +212,18 @@ function WorldArenaBattleInfoPanel:BindEvent()
|
|||
return
|
||||
end
|
||||
local list={2001,2002,2003}
|
||||
NetManager.CrossYuXuLunDaoChallengeRequest(list,enemyId,1,function(msg)
|
||||
|
||||
local num=PrivilegeManager.GetPrivilegeRemainValue(2028)
|
||||
local type=0
|
||||
if num>0 then
|
||||
type=0
|
||||
else
|
||||
type=1
|
||||
end
|
||||
NetManager.CrossYuXuLunDaoChallengeRequest(list,enemyId,type,function(msg)
|
||||
LogError("战斗结束")
|
||||
resultList=msg.fightResult
|
||||
fightDataList=msg.fightData
|
||||
|
||||
|
||||
isAnim = true
|
||||
self:PlayFightAnim(this.leftTeam, this.rightTeam, 3, function(index)
|
||||
this.ShowBattleState(index,3)
|
||||
|
@ -238,13 +242,16 @@ function WorldArenaBattleInfoPanel:BindEvent()
|
|||
this.enScore.text= msg.defScore>0 and "积分+"..msg.defScore or "积分"..msg.defScore
|
||||
this.enScore.color = msg.defScore>0 and UIColor.GREEN or UIColor.RED
|
||||
WorldArenaManager.SetNewScore(msg.myNewScore)
|
||||
WorldArenaManager.SetMyData(msg.myRank,msg.changedTimes)
|
||||
WorldArenaManager.SetMyData(msg.myRank,WorldArenaManager.GetchallengeTimes()+1)
|
||||
LogError("myscore=="..msg.myScore.."defScore=="..msg.defScore.." rank=="..msg.myRank.." challengetime=="..msg.changedTimes.." myNewScore=="..msg.myNewScore)
|
||||
--添加奖励 --
|
||||
if msg.drop then
|
||||
LogError("掉落物品数量:"..#msg.drop)
|
||||
WorldArenaManager.AddReward(msg.drop)
|
||||
end
|
||||
if num>0 then
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(2028, 1)
|
||||
end
|
||||
-- for i = 1, #this.playBacks do
|
||||
-- this.playBacks[i]:SetActive(true)
|
||||
-- end
|
||||
|
@ -276,7 +283,7 @@ function WorldArenaBattleInfoPanel:BindEvent()
|
|||
-- end
|
||||
-- this.TimeCounter = Timer.New(_TimeUpdate,1.5, -1, true)
|
||||
-- this.TimeCounter:Start()
|
||||
|
||||
--
|
||||
end)
|
||||
end)
|
||||
|
||||
|
|
|
@ -187,12 +187,12 @@ function WorldArenaMainPanel:OnOpen(...)
|
|||
challengeTime=msg.changedTimes
|
||||
freeTimes=PrivilegeManager.GetPrivilegeRemainValue(2028)
|
||||
WorldArenaManager.SetNewScore(msg.newMyscore)
|
||||
WorldArenaManager.SetMyData(myRank,challengeTime)
|
||||
this.Integral.text="积分:"..msg.newMyscore
|
||||
this.SetStarShow(grid,self.sortingOrder)
|
||||
this.endTime.text="周日23:30赛季结束"
|
||||
this:RefreshEnemyData(msg.arenaEnemys)
|
||||
myRank=msg.myRank
|
||||
WorldArenaManager.SetMyData(myRank,challengeTime)
|
||||
LogError(" main panel".." battletime=="..challengeTime.." rank=="..myRank.."freeTimes=="..freeTimes)
|
||||
this.freeTimes.text = string.format("%s次", math.max(freeTimes, 0))
|
||||
--检测段位是否发生变化
|
||||
|
@ -228,7 +228,8 @@ function this.SetStarShow(grade,layer)
|
|||
--显示上边积分奖励
|
||||
function this.ShowRewardBoxProgressData()
|
||||
-- local baseData = ArenaManager.GetArenaBaseData()
|
||||
local allNums = challengeTime
|
||||
local allNums = WorldArenaManager.GetchallengeTimes()
|
||||
LogError("allnum============"..allNums)
|
||||
--宝箱领取状态
|
||||
local allBoxGetState = rewardState
|
||||
local maxNum = 0
|
||||
|
@ -246,13 +247,15 @@ function this.ShowRewardBoxProgressData()
|
|||
for i = 1, #rewardBoxBtn do
|
||||
if rewards[i] then
|
||||
local state = 1--1 未完成 2 未领取 3 已完成allNums >= arenaBattleReward[i].BattleTimes and false
|
||||
LogError("allnum=="..allNums.." rewards[i][1]== "..rewards[i][1].." boxstate=="..allBoxGetState[i])
|
||||
if allNums < rewards[i][1] then
|
||||
state = 1
|
||||
elseif allNums >= rewards[i][1] and not allBoxGetState[i]==1 then
|
||||
elseif allNums >= rewards[i][1] and allBoxGetState[i]~=2 then
|
||||
state = 2
|
||||
else
|
||||
state = 3
|
||||
end
|
||||
LogError("state=="..state)
|
||||
Util.GetGameObject(rewardBoxBtn[i], "redPoint"):SetActive(state == 2)
|
||||
Util.GetGameObject(rewardBoxBtn[i], "Text"):GetComponent("Text").text = rewards[i][1]..Language[10048]
|
||||
Util.GetGameObject(rewardBoxBtn[i], "getFinish"):SetActive(state == 3)
|
||||
|
@ -265,8 +268,10 @@ function this.ShowRewardBoxProgressData()
|
|||
return
|
||||
elseif state == 2 then
|
||||
NetManager.CrossYuXuLunDaoGetDailyRewardRequest(i, function(msg)
|
||||
allBoxGetState[i]=3
|
||||
this.ShowRewardBoxProgressData()
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1,function ()
|
||||
this.ShowRewardBoxProgressData()
|
||||
|
||||
CheckRedPointStatus(RedPointType.Arena_Reward)
|
||||
end)
|
||||
end)
|
||||
|
@ -307,11 +312,11 @@ function this:RefreshEnemyData(team)
|
|||
lv_name.text = PracticeManager.SetNameColor(JingJiShouWeiToEn(name),EnemyList[i].practiceLevel)
|
||||
integral:GetComponent("Text").text = Language[11693].. EnemyList[i].score
|
||||
power:GetComponent("Text").text = Language[12179]..EnemyList[i].totalForce
|
||||
btnText.gameObject:SetActive(leftTimes > 0)
|
||||
btnText.gameObject:SetActive(freeTimes > 0)
|
||||
btnText.text = Language[10099]
|
||||
|
||||
btnItem.gameObject:SetActive(leftTimes <= 0)
|
||||
if leftTimes <= 0 then
|
||||
btnItem.gameObject:SetActive(freeTimes <= 0)
|
||||
if freeTimes <= 0 then
|
||||
local itemId, needNum = WorldArenaManager.GetArenaChallengeCost()
|
||||
local haveNum = BagManager.GetItemCountById(itemId)
|
||||
btnItem.sprite = SetIcon(this.spLoader, itemId)
|
||||
|
@ -347,8 +352,11 @@ function WorldArenaMainPanel:OnFocus()
|
|||
grid,rankData=WorldArenaManager.GetRankImgByScore(newScore)
|
||||
this.SetStarShow(grid,self.sortingOrder)
|
||||
this.Integral.text="积分:"..newScore
|
||||
freeTimes=PrivilegeManager.GetPrivilegeRemainValue(2028)
|
||||
this.freeTimes.text = string.format("%s次", math.max(freeTimes, 0))
|
||||
this.CheckIsRankChange()
|
||||
this.ShowRewardBoxProgressData()
|
||||
|
||||
end
|
||||
|
||||
function this.CheckIsRankChange(resetData)
|
||||
|
|
|
@ -14,6 +14,10 @@ function this.Initialize()
|
|||
end
|
||||
|
||||
|
||||
function this.GetchallengeTimes()
|
||||
return challengeTime
|
||||
end
|
||||
|
||||
--添加奖励
|
||||
function this.AddReward(drop)
|
||||
if drop then
|
||||
|
|
Loading…
Reference in New Issue