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.prefabdev_chengFeng
commit
5f556b7b5c
|
@ -376,7 +376,7 @@ end
|
|||
function this.AllFormationDeleCurHeroId(heroDid)
|
||||
for i, team in pairs(this.formationList) 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
|
||||
end
|
||||
end
|
||||
|
|
|
@ -223,7 +223,7 @@ function this:OnOpen(_panelType,...)
|
|||
this.failText:SetActive(false)
|
||||
this.formTip:SetActive(false)
|
||||
this.empty:SetActive(false)
|
||||
|
||||
LogPink("_panelType ".._panelType)
|
||||
this.opView = require(this.PanelOptionView[_panelType])
|
||||
this.opView.Init(this, ...)
|
||||
this.curFormationIndex = this.opView.GetFormationIndex()
|
||||
|
@ -688,11 +688,11 @@ end
|
|||
--计算上阵空余位置 返回所有位置列表
|
||||
function this.GetPosList()
|
||||
local data={}
|
||||
for i = 1, 6 do
|
||||
if heroListGo[i].gameObject.activeSelf then
|
||||
table.insert(data,i,i)
|
||||
end
|
||||
end
|
||||
-- for i = 1, 6 do
|
||||
-- if heroListGo[i].gameObject.activeSelf then
|
||||
-- table.insert(data,i,i)
|
||||
-- end
|
||||
-- end
|
||||
local list={}
|
||||
for j = 1, 6 do
|
||||
if data[j]==nil then
|
||||
|
@ -835,9 +835,9 @@ end
|
|||
function this.SetOneKeyGo()
|
||||
--获取需要上阵的位置
|
||||
local posArr=this.GetPosList()
|
||||
-- for i = 1, #posArr do
|
||||
-- Log("可上阵位置索引"..posArr[i])
|
||||
-- end
|
||||
for i = 1, #posArr do
|
||||
Log("可上阵位置索引"..posArr[i])
|
||||
end
|
||||
if #posArr==0 then
|
||||
PopupTipPanel.ShowTip(Language[10692])
|
||||
return
|
||||
|
@ -869,6 +869,7 @@ function this.SetOneKeyGo()
|
|||
-- end
|
||||
--修改 upHeroSidTable 静态id 存储 有则跳过
|
||||
local upHeroSidTable = {}
|
||||
this.choosedList = {}
|
||||
for j = 1, #this.choosedList do
|
||||
local curSingleherodata = HeroManager.GetSingleHeroData(this.choosedList[j].heroId)
|
||||
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
|
||||
|
@ -876,10 +877,10 @@ function this.SetOneKeyGo()
|
|||
for k, v in ipairs(heros) do
|
||||
local curSingleherodata = HeroManager.GetSingleHeroData(v.dynamicId)
|
||||
if not upHeroSidTable[curSingleherodata.id] then
|
||||
-- LogGreen("this.choosedList "..#this.choosedList)
|
||||
LogGreen("this.choosedList "..#this.choosedList)
|
||||
if #this.choosedList < 6 then
|
||||
for n = 1, #posArr do
|
||||
-- LogGreen("n posArr[n] "..n.." "..posArr[n])
|
||||
LogGreen("n posArr[n] "..n.." "..posArr[n])
|
||||
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
|
||||
table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]})
|
||||
table.remove(posArr,n)
|
||||
|
|
|
@ -17,7 +17,7 @@ function this.GetFormationIndex()
|
|||
return FormationManager.curFormationIndex
|
||||
end
|
||||
--- btn1点击回调事件
|
||||
function this.On_Btn1_Click()
|
||||
function this.On_Btn2_Click()
|
||||
if not hadClick then
|
||||
hadClick = true
|
||||
-- 编队为空
|
||||
|
@ -44,8 +44,9 @@ end
|
|||
-- 初始化界面显示
|
||||
function this.InitView()
|
||||
this.root.btn_1:SetActive(true)
|
||||
this.root.btn_2:SetActive(false)
|
||||
this.root.btn_1_lab.text = Language[10708]
|
||||
this.root.btn_2:SetActive(true)
|
||||
this.root.btn_1_lab.text=Language[10743]
|
||||
this.root.btn_2_lab.text=Language[10708]
|
||||
this.root.passBattle0.gameObject:SetActive(false)
|
||||
this.root.passBattle1.gameObject:SetActive(false)
|
||||
MapManager.isCarbonEnter = false
|
||||
|
@ -80,5 +81,8 @@ function this.StartFight()
|
|||
this.root:ClosePanel()
|
||||
end)
|
||||
end
|
||||
function this.On_Btn1_Click()
|
||||
this.root.SetOneKeyGo()
|
||||
end
|
||||
|
||||
return this
|
|
@ -21,7 +21,10 @@ local _rightStar=0
|
|||
function HandBookHeroInfoPanel:InitComponent()
|
||||
|
||||
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.leftObj= Util.GetGameObject(self.transform, "leftObj")
|
||||
self.rightObj= Util.GetGameObject(self.transform, "rightObj")
|
||||
|
@ -182,14 +185,11 @@ function HandBookHeroInfoPanel:OnShow()
|
|||
self:SetSelectBtn(self.btnStart, Language[11097])
|
||||
--self.curLiveObj = self:LoadHerolive(heroConFigData,self.curObj)
|
||||
self.dragView:SetDragGO(this.curLiveObj)
|
||||
|
||||
self.bgImage.sprite = Util.LoadSprite(HeroPanelBgByPropertyName[heroConFigData.PropertyName])
|
||||
this.SetPanelBg(heroConFigData)
|
||||
end
|
||||
--展示英雄信息 第一个参数1 属性面板 2 故事面板 第二个参数 1初始 2 6星和10星 第三个参数 显示星级
|
||||
function HandBookHeroInfoPanel:OnShowHeroData(_type,_starType,_star)
|
||||
|
||||
|
||||
self.bgImage.sprite = Util.LoadSprite(HeroPanelBgByPropertyName[heroConFigData.PropertyName])
|
||||
|
||||
self.dragView:SetDragGO(this.curLiveObj)
|
||||
|
||||
type = _type
|
||||
|
@ -414,6 +414,7 @@ function HandBookHeroInfoPanel:RightBtnOnClick()
|
|||
heroDatas = PlayerManager.heroHandBookListData[_curStar]
|
||||
end
|
||||
heroConFigData = heroDatas[index]
|
||||
this.SetPanelBg(heroConFigData)
|
||||
if this.leftLiveObj then
|
||||
poolManager:UnLoadLive(GetResourcePath(leftHeroData.Live), this.leftLiveObj)
|
||||
this.leftLiveObj = nil
|
||||
|
@ -457,7 +458,7 @@ function HandBookHeroInfoPanel:LeftBtnOnClick()
|
|||
heroDatas = PlayerManager.heroHandBookListData[_curStar]
|
||||
end
|
||||
heroConFigData = heroDatas[index]
|
||||
|
||||
this.SetPanelBg(heroConFigData)
|
||||
if this.rightLiveObj then
|
||||
poolManager:UnLoadLive(GetResourcePath(rightHeroData.Live), this.rightLiveObj)
|
||||
this.rightLiveObj = nil
|
||||
|
@ -542,6 +543,15 @@ function HandBookHeroInfoPanel:SortHeroNatural(heroList)
|
|||
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()
|
||||
|
||||
|
|
|
@ -44,7 +44,10 @@ local pinjieImage={"r_hero_pinjiebiao_01","r_hero_pinjiebiao_02"} --该死的品
|
|||
function RoleInfoPanel:InitComponent()
|
||||
|
||||
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.helpBtn = Util.GetGameObject(this.optionUp, "helpBtn")
|
||||
this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition
|
||||
|
@ -375,6 +378,7 @@ function RoleInfoPanel:OnShow()
|
|||
RoleInfoPanel:OnClickBtnInfo()--初始化是默认显示详情
|
||||
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.RoleInfo })
|
||||
FixedUpdateBeat:Add(this.OnUpdate, self)--长按方法注册
|
||||
this.SetPanelBg(curHeroData.heroConfig)
|
||||
end
|
||||
|
||||
--刷新面板
|
||||
|
@ -426,7 +430,6 @@ function this:UpdatePanelData()
|
|||
RoleInfoPanel:SetSelectBtn(self.btnInfo, Language[11836])
|
||||
return
|
||||
end
|
||||
self.bgImage.sprite = Util.LoadSprite(HeroPanelBgByPropertyName[curHeroData.heroConfig.PropertyName])
|
||||
end
|
||||
--更新英雄情报数据
|
||||
function this:UpdateHeroInfoData()
|
||||
|
@ -1118,6 +1121,7 @@ function this:RightBtnOnClick()
|
|||
local oldIndexConfigData = heroDatas[index]
|
||||
index = (index + 1 <= #heroDatas and index + 1 or 1)
|
||||
curHeroData = heroDatas[index]
|
||||
this.SetPanelBg(curHeroData.heroConfig)
|
||||
if this.leftLiveObj then
|
||||
poolManager:UnLoadLive(leftHeroData.live, this.leftLiveObj)
|
||||
this.leftLiveObj = nil
|
||||
|
@ -1147,6 +1151,7 @@ function this:LeftBtnOnClick()
|
|||
local oldIndexConfigData = heroDatas[index]
|
||||
index = (index - 1 > 0 and index - 1 or #heroDatas)
|
||||
curHeroData = heroDatas[index]
|
||||
this.SetPanelBg(curHeroData.heroConfig)
|
||||
if this.rightLiveObj then
|
||||
poolManager:UnLoadLive(rightHeroData.live, this.rightLiveObj)
|
||||
this.rightLiveObj = nil
|
||||
|
@ -1557,6 +1562,15 @@ function RoleInfoPanel:OnEndDrag(Pointgo, data)
|
|||
end
|
||||
distance=0
|
||||
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()
|
||||
-- --是否为最大等级
|
||||
|
|
Loading…
Reference in New Issue