Merge branch '0功能/玉虚论道' of http://60.1.1.230/gaoxin/JL_Client into 0功能/玉虚论道
commit
1094c3678a
|
|
@ -11,10 +11,21 @@ local type=0
|
||||||
local enemyId=0
|
local enemyId=0
|
||||||
local myInfoData=nil
|
local myInfoData=nil
|
||||||
local enInfoData=nil
|
local enInfoData=nil
|
||||||
|
|
||||||
|
local targetIndex=0
|
||||||
|
local currIndex=0
|
||||||
local function OnBeginDrag(self, Pointgo, data)
|
local function OnBeginDrag(self, Pointgo, data)
|
||||||
if state~=1 then
|
if state~=1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local num=999
|
||||||
|
for i = 1, 3 do
|
||||||
|
local dis = math.abs(Pointgo.transform.parent.parent.localPosition.y - this.leftTeam[i].transform.localPosition.y )
|
||||||
|
if dis <= num then
|
||||||
|
num = dis
|
||||||
|
currIndex=i
|
||||||
|
end
|
||||||
|
end
|
||||||
self.oldGrid = Pointgo.transform.parent.parent
|
self.oldGrid = Pointgo.transform.parent.parent
|
||||||
self.tempInfo.transform.localPosition = Pointgo.transform.parent.parent.localPosition
|
self.tempInfo.transform.localPosition = Pointgo.transform.parent.parent.localPosition
|
||||||
Pointgo.transform.parent:SetParent(self.tempInfo.transform)
|
Pointgo.transform.parent:SetParent(self.tempInfo.transform)
|
||||||
|
|
@ -25,7 +36,7 @@ local function OnDrag(self, Pointgo, data)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local pos = self.tempInfo.transform.localPosition
|
local pos = self.tempInfo.transform.localPosition
|
||||||
local y = pos.y + data.delta.y >= -300 and pos.y + data.delta.y or -300
|
local y = pos.y + data.delta.y >= -400 and pos.y + data.delta.y or -400
|
||||||
y = y <= 450 and y or 450
|
y = y <= 450 and y or 450
|
||||||
self.tempInfo.transform.localPosition = Vector2.New(pos.x , y)
|
self.tempInfo.transform.localPosition = Vector2.New(pos.x , y)
|
||||||
end
|
end
|
||||||
|
|
@ -36,17 +47,19 @@ local function OnEndDrag(self, Pointgo, data)
|
||||||
--Pointgo.transform.parent.localPosition = Vector3.zero
|
--Pointgo.transform.parent.localPosition = Vector3.zero
|
||||||
local num = 999
|
local num = 999
|
||||||
local obj = nil
|
local obj = nil
|
||||||
|
|
||||||
for i = 1, 3 do
|
for i = 1, 3 do
|
||||||
local dis = math.abs( self.tempInfo.transform.localPosition.y - this.leftTeam[i].transform.localPosition.y )
|
local dis = math.abs( self.tempInfo.transform.localPosition.y - this.leftTeam[i].transform.localPosition.y )
|
||||||
LogError(" temp y=="..self.tempInfo.transform.localPosition.y.." leftteam y=="..this.leftTeam[i].transform.localPosition.y)
|
--LogError(" temp y=="..self.tempInfo.transform.localPosition.y.." leftteam y=="..this.leftTeam[i].transform.localPosition.y)
|
||||||
if dis <= num then
|
if dis <= num then
|
||||||
num = dis
|
num = dis
|
||||||
obj = this.leftTeam[i]
|
obj = this.leftTeam[i]
|
||||||
|
targetIndex=i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--如果滑动距离太短,阵容放回原来的地方
|
--如果滑动距离太短,阵容放回原来的地方
|
||||||
LogError(" num=="..num)
|
LogError(" num=="..num)
|
||||||
if num<60 then
|
if num>100 then
|
||||||
LogError("**********")
|
LogError("**********")
|
||||||
local target=Util.GetGameObject(self.tempInfo.transform, "Demons")
|
local target=Util.GetGameObject(self.tempInfo.transform, "Demons")
|
||||||
target.transform:SetParent(self.oldGrid.transform)
|
target.transform:SetParent(self.oldGrid.transform)
|
||||||
|
|
@ -55,13 +68,16 @@ local function OnEndDrag(self, Pointgo, data)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if obj.transform.childCount > 0 then
|
if obj.transform.childCount > 0 then
|
||||||
--local targetInfo = obj.transform:GetChild(0)
|
|
||||||
local targetInfo=Util.GetGameObject(obj.transform, "Demons")
|
local targetInfo=Util.GetGameObject(obj.transform, "Demons")
|
||||||
-- LogError("targetInfo name=="..targetInfo.name)
|
if targetInfo then
|
||||||
targetInfo.transform:SetParent(self.oldGrid.transform)
|
targetInfo.transform:SetParent(self.oldGrid.transform)
|
||||||
targetInfo.transform:SetSiblingIndex(1)
|
targetInfo.transform:SetSiblingIndex(1)
|
||||||
--targetInfo.localPosition = Vector3.zero
|
targetInfo.transform.localPosition=Vector3.New(0,-67,0)
|
||||||
targetInfo.transform.localPosition=Vector3.New(0,-67,0)
|
else
|
||||||
|
LogError("targetInfo==nil")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
obj = self.oldGrid
|
obj = self.oldGrid
|
||||||
end
|
end
|
||||||
|
|
@ -70,11 +86,9 @@ local function OnEndDrag(self, Pointgo, data)
|
||||||
curInfo:SetParent(obj.transform)
|
curInfo:SetParent(obj.transform)
|
||||||
curInfo.transform:SetSiblingIndex(1)
|
curInfo.transform:SetSiblingIndex(1)
|
||||||
curInfo.localPosition = Vector3.New(0,-67,0)
|
curInfo.localPosition = Vector3.New(0,-67,0)
|
||||||
|
|
||||||
|
|
||||||
for i = 1, 3 do
|
LogError("起始id=="..currIndex.." 终点id=="..targetIndex)
|
||||||
self.InfoList[i] = Util.GetGameObject(self.Content, "Grid ("..i..")/Info")
|
|
||||||
-- WorldArenaMyTeamPanel:Refresh()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
--初始化组件(用于子类重写)
|
--初始化组件(用于子类重写)
|
||||||
function WorldArenaBattleInfoPanel:InitComponent()
|
function WorldArenaBattleInfoPanel:InitComponent()
|
||||||
|
|
@ -183,14 +197,19 @@ function WorldArenaBattleInfoPanel:BindEvent()
|
||||||
end
|
end
|
||||||
local currIndex=1
|
local currIndex=1
|
||||||
local _TimeUpdate=function()
|
local _TimeUpdate=function()
|
||||||
LogError("currrindex=="..currIndex)
|
|
||||||
this.leftTeam[currIndex]:GetComponent("RectTransform").localPosition=Vector3.New(278,this.leftTeam[currIndex].transform.localPosition.y,0)
|
this.rightTeam[currIndex]:GetComponent("RectTransform").anchoredPosition=Vector3.New(101,this.rightTeam[currIndex]:GetComponent("RectTransform").anchoredPosition.y,0)
|
||||||
this.rightTeam[currIndex]:GetComponent("RectTransform").localPosition=Vector3.New(101,this.rightTeam[currIndex].transform.localPosition.y,0)
|
this.leftTeam[currIndex]:GetComponent("RectTransform").anchoredPosition=Vector3.New(278,this.leftTeam[currIndex]:GetComponent("RectTransform").anchoredPosition.y,0)
|
||||||
this.leftTeam[currIndex]:GetComponent("RectTransform").localPosition=Vector3.New(192.5,this.leftTeam[currIndex].transform.localPosition.y,0)
|
LogError("left pos.x=="..this.leftTeam[currIndex].transform.localPosition.x)
|
||||||
this.rightTeam[currIndex]:GetComponent("RectTransform").localPosition=Vector3.New(192.5,this.rightTeam[currIndex].transform.localPosition.y,0)
|
LogError("right pos.x=="..this.rightTeam[currIndex].transform.localPosition.x)
|
||||||
this.playBacks[currIndex]:SetActive(true)
|
this.playBacks[currIndex]:SetActive(true)
|
||||||
|
this.ShowBattleState(currIndex,3)
|
||||||
currIndex=currIndex+1
|
this.leftTeam[currIndex]:GetComponent("RectTransform").anchoredPosition=Vector3.New(192,this.leftTeam[currIndex]:GetComponent("RectTransform").anchoredPosition.y,0)
|
||||||
|
this.rightTeam[currIndex]:GetComponent("RectTransform").anchoredPosition=Vector3.New(192,this.rightTeam[currIndex]:GetComponent("RectTransform").anchoredPosition.y,0)
|
||||||
|
LogError("left pos.x=="..this.leftTeam[currIndex].transform.localPosition.x)
|
||||||
|
LogError("right pos.x=="..this.rightTeam[currIndex].transform.localPosition.x)
|
||||||
|
LogError("--------------")
|
||||||
|
currIndex=currIndex+1
|
||||||
if this.TimeCounter and currIndex>3 then
|
if this.TimeCounter and currIndex>3 then
|
||||||
this.TimeCounter:Stop()
|
this.TimeCounter:Stop()
|
||||||
this.TimeCounter = nil
|
this.TimeCounter = nil
|
||||||
|
|
@ -199,21 +218,13 @@ function WorldArenaBattleInfoPanel:BindEvent()
|
||||||
this.TimeCounter = Timer.New(_TimeUpdate,1.5, -1, true)
|
this.TimeCounter = Timer.New(_TimeUpdate,1.5, -1, true)
|
||||||
this.TimeCounter:Start()
|
this.TimeCounter:Start()
|
||||||
end)
|
end)
|
||||||
-- state=3
|
|
||||||
-- this.ShowBattleState()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--PlayUIAnim(this.leftTeam[1].gameObject)
|
|
||||||
--PlayUIAnim(this.rightTeam[1].gameObject)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--回放按钮点击事件
|
--回放按钮点击事件
|
||||||
for i = 1, #this.playBacks do
|
for i = 1, #this.playBacks do
|
||||||
Util.AddClick(this.playBacks[i],function()
|
Util.AddClick(this.playBacks[i],function()
|
||||||
local nameStr = myInfoData.name.."|"..enInfoData.name
|
local nameStr = myInfoData.name.."|"..enInfoData.name
|
||||||
local realResult = (resultList[i] + 1) % 2 -- 服务器返回的是我的结果,转换为真实结果
|
local realResult = resultList[i] --(resultList[i] + 1) % 2 -- 服务器返回的是我的结果,转换为真实结果
|
||||||
this.RequestReplayRecord(realResult,fightDataList[i], nameStr,function()
|
this.RequestReplayRecord(realResult,fightDataList[i], nameStr,function()
|
||||||
this:ClosePanel()
|
this:ClosePanel()
|
||||||
--构建显示结果数据(我永远在蓝方)
|
--构建显示结果数据(我永远在蓝方)
|
||||||
|
|
@ -323,20 +334,20 @@ function this.ShowInfo(msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
LogError("myteam len=="..#msg.myTeamInfo.crossTeam[1].team)
|
LogError("myteam len=="..#msg.myTeamInfo.crossTeam[1].team)
|
||||||
this.SetTeamInfo(this.myTeamInfo,msg.myTeamInfo.crossTeam)
|
this.SetTeamInfo(this.myTeamInfo,msg.myTeamInfo.crossTeam,1)
|
||||||
this.SetTeamInfo(this.enTeamInfo,msg.defTeamInfo.crossTeam)
|
this.SetTeamInfo(this.enTeamInfo,msg.defTeamInfo.crossTeam)
|
||||||
|
|
||||||
end
|
end
|
||||||
function this.ShowBattleState()
|
function this.ShowBattleState(index,state)
|
||||||
for i = 1, 3 do
|
--for i = 1, 3 do
|
||||||
Util.GetGameObject(this.leftTeam[i], "Text").gameObject:SetActive(state~=3)
|
Util.GetGameObject(this.leftTeam[index], "Text").gameObject:SetActive(state~=3)
|
||||||
Util.GetGameObject(this.rightTeam[i], "Text").gameObject:SetActive(state~=3)
|
Util.GetGameObject(this.rightTeam[index], "Text").gameObject:SetActive(state~=3)
|
||||||
local leftImg=Util.GetGameObject(this.leftTeam[i], "Image"):GetComponent("Image")
|
local leftImg=Util.GetGameObject(this.leftTeam[index], "Image"):GetComponent("Image")
|
||||||
local rightImg=Util.GetGameObject(this.rightTeam[i], "Image"):GetComponent("Image")
|
local rightImg=Util.GetGameObject(this.rightTeam[index], "Image"):GetComponent("Image")
|
||||||
leftImg.gameObject:SetActive(state==3)
|
leftImg.gameObject:SetActive(state==3)
|
||||||
rightImg.gameObject:SetActive(state==3)
|
rightImg.gameObject:SetActive(state==3)
|
||||||
if state==3 then
|
if state==3 then
|
||||||
if resultList[i]==1 then
|
if resultList[index]==1 then
|
||||||
leftImg.sprite=this.spLoader:LoadSprite("UI_effect_JJC_JieSuan_ShengLi_png_zh")
|
leftImg.sprite=this.spLoader:LoadSprite("UI_effect_JJC_JieSuan_ShengLi_png_zh")
|
||||||
rightImg.sprite=this.spLoader:LoadSprite("UI_effect_JJC_JieSuan_ShiBai_png_zh")
|
rightImg.sprite=this.spLoader:LoadSprite("UI_effect_JJC_JieSuan_ShiBai_png_zh")
|
||||||
else
|
else
|
||||||
|
|
@ -345,14 +356,15 @@ function this.ShowBattleState()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
--end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--编队信息
|
--编队信息
|
||||||
function this.SetTeamInfo(_go,teamData)
|
local allTeams={}
|
||||||
|
function this.SetTeamInfo(_go,teamData,type)
|
||||||
for index = 1, 3 do
|
for index = 1, 3 do
|
||||||
local go = Util.GetGameObject(_go,"defendbox"..index)
|
local go = Util.GetGameObject(_go,"defendbox"..index)
|
||||||
local data = teamData[index]
|
local data = teamData[index]
|
||||||
|
|
@ -370,6 +382,7 @@ function this.SetTeamInfo(_go,teamData)
|
||||||
Util.GetGameObject(demon, "hero"):SetActive(false)
|
Util.GetGameObject(demon, "hero"):SetActive(false)
|
||||||
end
|
end
|
||||||
--队伍阵容
|
--队伍阵容
|
||||||
|
local heroList={}
|
||||||
for i, hero in ipairs(data.team) do
|
for i, hero in ipairs(data.team) do
|
||||||
local heroTid = data.team[i].heroTid
|
local heroTid = data.team[i].heroTid
|
||||||
if heroTid then
|
if heroTid then
|
||||||
|
|
@ -383,20 +396,26 @@ function this.SetTeamInfo(_go,teamData)
|
||||||
Util.GetGameObject(teamList[hero.position], "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(heroConfig.Quality, hero.star))
|
Util.GetGameObject(teamList[hero.position], "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(heroConfig.Quality, hero.star))
|
||||||
SetHeroIcon(this.spLoader, hero,Util.GetGameObject(heroGo, "icon"):GetComponent("Image"),heroConfig)
|
SetHeroIcon(this.spLoader, hero,Util.GetGameObject(heroGo, "icon"):GetComponent("Image"),heroConfig)
|
||||||
local frameBtn = Util.GetGameObject(teamList[hero.position], "frame")
|
local frameBtn = Util.GetGameObject(teamList[hero.position], "frame")
|
||||||
local heroData = {}
|
--local heroData = {}
|
||||||
Util.AddOnceClick(frameBtn, function()
|
-- Util.AddOnceClick(frameBtn, function()
|
||||||
NetManager.ViewHeroInfoRequest(self.playerId,hero.heroid,1,PLAYER_INFO_VIEW_TYPE.NORMAL,function(msg)
|
-- NetManager.ViewHeroInfoRequest(self.playerId,hero.heroid,1,PLAYER_INFO_VIEW_TYPE.NORMAL,function(msg)
|
||||||
if not hero.heroid then
|
-- if not hero.heroid then
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
heroData= GoodFriendManager.GetHeroDatas(msg.hero,msg.force,msg.SpecialEffects,msg.guildSkill)
|
-- heroData= GoodFriendManager.GetHeroDatas(msg.hero,msg.force,msg.SpecialEffects,msg.guildSkill)
|
||||||
GoodFriendManager.InitEquipData(msg.equip,heroData)
|
-- GoodFriendManager.InitEquipData(msg.equip,heroData)
|
||||||
UIManager.OpenPanel(UIName.RoleInfoPopup, heroData,true)
|
-- UIManager.OpenPanel(UIName.RoleInfoPopup, heroData,true)
|
||||||
end)
|
-- end)
|
||||||
end)
|
-- end)
|
||||||
|
if type and type==1 then
|
||||||
|
table.insert(heroList,{heroId=heroTid,position=hero.position})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if type and type==1 then
|
||||||
|
allTeams[index]=heroList
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ function WorldArenaMainPanel:OnOpen(...)
|
||||||
leftTimes=msg.freeTimes
|
leftTimes=msg.freeTimes
|
||||||
WorldArenaManager.SetFreeTime(leftTimes)
|
WorldArenaManager.SetFreeTime(leftTimes)
|
||||||
this.Integral.text="积分:"..msg.newMyscore
|
this.Integral.text="积分:"..msg.newMyscore
|
||||||
this.SetStarShow(rankData.RankLevel,grid,self.sortingOrder)
|
this.SetStarShow(grid,self.sortingOrder)
|
||||||
this.endTime.text="周日23:30赛季结束"
|
this.endTime.text="周日23:30赛季结束"
|
||||||
LogError("len==="..#msg.arenaEnemys)
|
LogError("len==="..#msg.arenaEnemys)
|
||||||
this:RefreshEnemyData(msg.arenaEnemys)
|
this:RefreshEnemyData(msg.arenaEnemys)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue