Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop

# Conflicts:
#	Assets/ManagedResources/Prefabs/UI/HandBook/HandBookHeroInfoPanel.prefab
#	Assets/ManagedResources/Prefabs/UI/RoleInfo/RoleInfoPanel.prefab
dev_chengFeng
jiaoyangna 2020-07-25 13:22:33 +08:00
commit 5f556b7b5c
5 changed files with 53 additions and 24 deletions

View File

@ -376,7 +376,7 @@ end
function this.AllFormationDeleCurHeroId(heroDid) function this.AllFormationDeleCurHeroId(heroDid)
for i, team in pairs(this.formationList) do for i, team in pairs(this.formationList) do
for j = 1, #team.teamHeroInfos do for j = 1, #team.teamHeroInfos do
if team.teamHeroInfos[j].heroId == heroDid then if team.teamHeroInfos[j] and team.teamHeroInfos[j].heroId == heroDid then
team.teamHeroInfos[j] = nil team.teamHeroInfos[j] = nil
end end
end end

View File

@ -223,7 +223,7 @@ function this:OnOpen(_panelType,...)
this.failText:SetActive(false) this.failText:SetActive(false)
this.formTip:SetActive(false) this.formTip:SetActive(false)
this.empty:SetActive(false) this.empty:SetActive(false)
LogPink("_panelType ".._panelType)
this.opView = require(this.PanelOptionView[_panelType]) this.opView = require(this.PanelOptionView[_panelType])
this.opView.Init(this, ...) this.opView.Init(this, ...)
this.curFormationIndex = this.opView.GetFormationIndex() this.curFormationIndex = this.opView.GetFormationIndex()
@ -688,11 +688,11 @@ end
--计算上阵空余位置 返回所有位置列表 --计算上阵空余位置 返回所有位置列表
function this.GetPosList() function this.GetPosList()
local data={} local data={}
for i = 1, 6 do -- for i = 1, 6 do
if heroListGo[i].gameObject.activeSelf then -- if heroListGo[i].gameObject.activeSelf then
table.insert(data,i,i) -- table.insert(data,i,i)
end -- end
end -- end
local list={} local list={}
for j = 1, 6 do for j = 1, 6 do
if data[j]==nil then if data[j]==nil then
@ -835,9 +835,9 @@ end
function this.SetOneKeyGo() function this.SetOneKeyGo()
--获取需要上阵的位置 --获取需要上阵的位置
local posArr=this.GetPosList() local posArr=this.GetPosList()
-- for i = 1, #posArr do for i = 1, #posArr do
-- Log("可上阵位置索引"..posArr[i]) Log("可上阵位置索引"..posArr[i])
-- end end
if #posArr==0 then if #posArr==0 then
PopupTipPanel.ShowTip(Language[10692]) PopupTipPanel.ShowTip(Language[10692])
return return
@ -869,6 +869,7 @@ function this.SetOneKeyGo()
-- end -- end
--修改 upHeroSidTable 静态id 存储 有则跳过 --修改 upHeroSidTable 静态id 存储 有则跳过
local upHeroSidTable = {} local upHeroSidTable = {}
this.choosedList = {}
for j = 1, #this.choosedList do for j = 1, #this.choosedList do
local curSingleherodata = HeroManager.GetSingleHeroData(this.choosedList[j].heroId) local curSingleherodata = HeroManager.GetSingleHeroData(this.choosedList[j].heroId)
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
@ -876,10 +877,10 @@ function this.SetOneKeyGo()
for k, v in ipairs(heros) do for k, v in ipairs(heros) do
local curSingleherodata = HeroManager.GetSingleHeroData(v.dynamicId) local curSingleherodata = HeroManager.GetSingleHeroData(v.dynamicId)
if not upHeroSidTable[curSingleherodata.id] then if not upHeroSidTable[curSingleherodata.id] then
-- LogGreen("this.choosedList "..#this.choosedList) LogGreen("this.choosedList "..#this.choosedList)
if #this.choosedList < 6 then if #this.choosedList < 6 then
for n = 1, #posArr do for n = 1, #posArr do
-- LogGreen("n posArr[n] "..n.." "..posArr[n]) LogGreen("n posArr[n] "..n.." "..posArr[n])
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]}) table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]})
table.remove(posArr,n) table.remove(posArr,n)

View File

@ -17,7 +17,7 @@ function this.GetFormationIndex()
return FormationManager.curFormationIndex return FormationManager.curFormationIndex
end end
--- btn1点击回调事件 --- btn1点击回调事件
function this.On_Btn1_Click() function this.On_Btn2_Click()
if not hadClick then if not hadClick then
hadClick = true hadClick = true
-- 编队为空 -- 编队为空
@ -44,8 +44,9 @@ end
-- 初始化界面显示 -- 初始化界面显示
function this.InitView() function this.InitView()
this.root.btn_1:SetActive(true) this.root.btn_1:SetActive(true)
this.root.btn_2:SetActive(false) this.root.btn_2:SetActive(true)
this.root.btn_1_lab.text = Language[10708] this.root.btn_1_lab.text=Language[10743]
this.root.btn_2_lab.text=Language[10708]
this.root.passBattle0.gameObject:SetActive(false) this.root.passBattle0.gameObject:SetActive(false)
this.root.passBattle1.gameObject:SetActive(false) this.root.passBattle1.gameObject:SetActive(false)
MapManager.isCarbonEnter = false MapManager.isCarbonEnter = false
@ -80,5 +81,8 @@ function this.StartFight()
this.root:ClosePanel() this.root:ClosePanel()
end) end)
end end
function this.On_Btn1_Click()
this.root.SetOneKeyGo()
end
return this return this

View File

@ -21,7 +21,10 @@ local _rightStar=0
function HandBookHeroInfoPanel:InitComponent() function HandBookHeroInfoPanel:InitComponent()
self.btnBack = Util.GetGameObject(self.transform, "btnBack") self.btnBack = Util.GetGameObject(self.transform, "btnBack")
self.bgImage = Util.GetGameObject(self.transform, "bg/bg"):GetComponent("Image") this.bgImageList = {}
for i = 1, 4 do
this.bgImageList[i] = Util.GetGameObject(self.transform, "bg/di ("..i..")")
end
self.curObj= Util.GetGameObject(self.transform, "curObj") self.curObj= Util.GetGameObject(self.transform, "curObj")
self.leftObj= Util.GetGameObject(self.transform, "leftObj") self.leftObj= Util.GetGameObject(self.transform, "leftObj")
self.rightObj= Util.GetGameObject(self.transform, "rightObj") self.rightObj= Util.GetGameObject(self.transform, "rightObj")
@ -182,14 +185,11 @@ function HandBookHeroInfoPanel:OnShow()
self:SetSelectBtn(self.btnStart, Language[11097]) self:SetSelectBtn(self.btnStart, Language[11097])
--self.curLiveObj = self:LoadHerolive(heroConFigData,self.curObj) --self.curLiveObj = self:LoadHerolive(heroConFigData,self.curObj)
self.dragView:SetDragGO(this.curLiveObj) self.dragView:SetDragGO(this.curLiveObj)
this.SetPanelBg(heroConFigData)
self.bgImage.sprite = Util.LoadSprite(HeroPanelBgByPropertyName[heroConFigData.PropertyName])
end end
--展示英雄信息 第一个参数1 属性面板 2 故事面板 第二个参数 1初始 2 6星和10星 第三个参数 显示星级 --展示英雄信息 第一个参数1 属性面板 2 故事面板 第二个参数 1初始 2 6星和10星 第三个参数 显示星级
function HandBookHeroInfoPanel:OnShowHeroData(_type,_starType,_star) function HandBookHeroInfoPanel:OnShowHeroData(_type,_starType,_star)
self.bgImage.sprite = Util.LoadSprite(HeroPanelBgByPropertyName[heroConFigData.PropertyName])
self.dragView:SetDragGO(this.curLiveObj) self.dragView:SetDragGO(this.curLiveObj)
type = _type type = _type
@ -414,6 +414,7 @@ function HandBookHeroInfoPanel:RightBtnOnClick()
heroDatas = PlayerManager.heroHandBookListData[_curStar] heroDatas = PlayerManager.heroHandBookListData[_curStar]
end end
heroConFigData = heroDatas[index] heroConFigData = heroDatas[index]
this.SetPanelBg(heroConFigData)
if this.leftLiveObj then if this.leftLiveObj then
poolManager:UnLoadLive(GetResourcePath(leftHeroData.Live), this.leftLiveObj) poolManager:UnLoadLive(GetResourcePath(leftHeroData.Live), this.leftLiveObj)
this.leftLiveObj = nil this.leftLiveObj = nil
@ -457,7 +458,7 @@ function HandBookHeroInfoPanel:LeftBtnOnClick()
heroDatas = PlayerManager.heroHandBookListData[_curStar] heroDatas = PlayerManager.heroHandBookListData[_curStar]
end end
heroConFigData = heroDatas[index] heroConFigData = heroDatas[index]
this.SetPanelBg(heroConFigData)
if this.rightLiveObj then if this.rightLiveObj then
poolManager:UnLoadLive(GetResourcePath(rightHeroData.Live), this.rightLiveObj) poolManager:UnLoadLive(GetResourcePath(rightHeroData.Live), this.rightLiveObj)
this.rightLiveObj = nil this.rightLiveObj = nil
@ -542,6 +543,15 @@ function HandBookHeroInfoPanel:SortHeroNatural(heroList)
end end
end) end)
end end
function this.SetPanelBg(heroData)
for i = 1, 4 do
if heroData.PropertyName == i then
this.bgImageList[i]:SetActive(true)
else
this.bgImageList[i]:SetActive(false)
end
end
end
--界面销毁时调用(用于子类重写) --界面销毁时调用(用于子类重写)
function HandBookHeroInfoPanel:OnDestroy() function HandBookHeroInfoPanel:OnDestroy()

View File

@ -44,7 +44,10 @@ local pinjieImage={"r_hero_pinjiebiao_01","r_hero_pinjiebiao_02"} --该死的品
function RoleInfoPanel:InitComponent() function RoleInfoPanel:InitComponent()
self.BtnBack = Util.GetGameObject(self.transform, "btnBack") self.BtnBack = Util.GetGameObject(self.transform, "btnBack")
self.bgImage = Util.GetGameObject(self.transform, "bg/di2"):GetComponent("Image") this.bgImageList = {}
for i = 1, 4 do
this.bgImageList[i] = Util.GetGameObject(self.transform, "bg/di ("..i..")")
end
this.optionUp=Util.GetGameObject(self.gameObject,"optionUp")--上部按钮组 this.optionUp=Util.GetGameObject(self.gameObject,"optionUp")--上部按钮组
this.helpBtn = Util.GetGameObject(this.optionUp, "helpBtn") this.helpBtn = Util.GetGameObject(this.optionUp, "helpBtn")
this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition
@ -375,6 +378,7 @@ function RoleInfoPanel:OnShow()
RoleInfoPanel:OnClickBtnInfo()--初始化是默认显示详情 RoleInfoPanel:OnClickBtnInfo()--初始化是默认显示详情
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.RoleInfo }) this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.RoleInfo })
FixedUpdateBeat:Add(this.OnUpdate, self)--长按方法注册 FixedUpdateBeat:Add(this.OnUpdate, self)--长按方法注册
this.SetPanelBg(curHeroData.heroConfig)
end end
--刷新面板 --刷新面板
@ -426,7 +430,6 @@ function this:UpdatePanelData()
RoleInfoPanel:SetSelectBtn(self.btnInfo, Language[11836]) RoleInfoPanel:SetSelectBtn(self.btnInfo, Language[11836])
return return
end end
self.bgImage.sprite = Util.LoadSprite(HeroPanelBgByPropertyName[curHeroData.heroConfig.PropertyName])
end end
--更新英雄情报数据 --更新英雄情报数据
function this:UpdateHeroInfoData() function this:UpdateHeroInfoData()
@ -1118,6 +1121,7 @@ function this:RightBtnOnClick()
local oldIndexConfigData = heroDatas[index] local oldIndexConfigData = heroDatas[index]
index = (index + 1 <= #heroDatas and index + 1 or 1) index = (index + 1 <= #heroDatas and index + 1 or 1)
curHeroData = heroDatas[index] curHeroData = heroDatas[index]
this.SetPanelBg(curHeroData.heroConfig)
if this.leftLiveObj then if this.leftLiveObj then
poolManager:UnLoadLive(leftHeroData.live, this.leftLiveObj) poolManager:UnLoadLive(leftHeroData.live, this.leftLiveObj)
this.leftLiveObj = nil this.leftLiveObj = nil
@ -1147,6 +1151,7 @@ function this:LeftBtnOnClick()
local oldIndexConfigData = heroDatas[index] local oldIndexConfigData = heroDatas[index]
index = (index - 1 > 0 and index - 1 or #heroDatas) index = (index - 1 > 0 and index - 1 or #heroDatas)
curHeroData = heroDatas[index] curHeroData = heroDatas[index]
this.SetPanelBg(curHeroData.heroConfig)
if this.rightLiveObj then if this.rightLiveObj then
poolManager:UnLoadLive(rightHeroData.live, this.rightLiveObj) poolManager:UnLoadLive(rightHeroData.live, this.rightLiveObj)
this.rightLiveObj = nil this.rightLiveObj = nil
@ -1557,6 +1562,15 @@ function RoleInfoPanel:OnEndDrag(Pointgo, data)
end end
distance=0 distance=0
end end
function this.SetPanelBg(heroData)
for i = 1, 4 do
if heroData.PropertyName == i then
this.bgImageList[i]:SetActive(true)
else
this.bgImageList[i]:SetActive(false)
end
end
end
--升级红点 --升级红点
--function RoleInfoPanel:LvUpBtnRedPoint() --function RoleInfoPanel:LvUpBtnRedPoint()
-- --是否为最大等级 -- --是否为最大等级