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

dev_chengFeng
jiaoyangna 2020-08-13 14:21:50 +08:00
commit beaaeed139
13 changed files with 165 additions and 136 deletions

View File

@ -7522,7 +7522,7 @@ MonoBehaviour:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 5b66d1c9ba827e84594d3e818587992c, type: 3}
m_Sprite: {fileID: 21300000, guid: c2deb0354e0aadd49a714702fde2d57e, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
@ -13850,6 +13850,11 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 2788795870374661697}
m_Modifications:
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_Name
value: Hero1
objectReference: {fileID: 0}
- target: {fileID: 2535060995107670383, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_LocalPosition.x
@ -13955,25 +13960,20 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_Name
value: Hero1
objectReference: {fileID: 0}
- target: {fileID: 2320031819680067764, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2320031819931042899, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031818352649172, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16.999998
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031819902321005, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031818794305969, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16.999998
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031819195525549, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
@ -13990,15 +13990,15 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031818794305969, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031819902321005, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 3.2600002
value: -16.999998
objectReference: {fileID: 0}
- target: {fileID: 2320031818352649172, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031819931042899, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 3.2600002
value: -16.999998
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e356d5948e4971f499cfe38db3551f59, type: 3}
@ -14015,6 +14015,16 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 4396491572209410414}
m_Modifications:
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_Name
value: Hero
objectReference: {fileID: 0}
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2535060995107670383, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_LocalPosition.x
@ -14120,25 +14130,15 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_Name
value: Hero
objectReference: {fileID: 0}
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2320031819931042899, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031818352649172, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16.999998
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031819902321005, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031818794305969, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16.999998
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031819195525549, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
@ -14155,15 +14155,15 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031818794305969, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031819902321005, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 3.2600002
value: -16.999998
objectReference: {fileID: 0}
- target: {fileID: 2320031818352649172, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031819931042899, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 3.2600002
value: -16.999998
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e356d5948e4971f499cfe38db3551f59, type: 3}
@ -14180,6 +14180,11 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 2800534487435427715}
m_Modifications:
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_Name
value: Hero1
objectReference: {fileID: 0}
- target: {fileID: 2535060995107670383, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_LocalPosition.x
@ -14285,25 +14290,20 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2321054590987622477, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_Name
value: Hero1
objectReference: {fileID: 0}
- target: {fileID: 2320031819680067764, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2320031819931042899, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031818352649172, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16.999998
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031819902321005, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031818794305969, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16.999998
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031819195525549, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
@ -14320,15 +14320,15 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 3.2600002
objectReference: {fileID: 0}
- target: {fileID: 2320031818794305969, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031819902321005, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 3.2600002
value: -16.999998
objectReference: {fileID: 0}
- target: {fileID: 2320031818352649172, guid: e356d5948e4971f499cfe38db3551f59,
- target: {fileID: 2320031819931042899, guid: e356d5948e4971f499cfe38db3551f59,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 3.2600002
value: -16.999998
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e356d5948e4971f499cfe38db3551f59, type: 3}

View File

@ -43197,7 +43197,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &4712277445214281097
RectTransform:
m_ObjectHideFlags: 0

View File

@ -67,18 +67,18 @@ function CompoundHeroFirstUpStarListPanel:OnOpen(heroData,_openThisPanel,_curHer
curSelectHeroList = {}
if _curHeroData.dynamicId then curSelectHeroList[_curHeroData.dynamicId] = _curHeroData end
this.HeroSortData(heroDataList)
for i, v in pairs(heroDataList) do
for n,w in pairs(FormationManager.formationList) do
if HeroManager.heroResolveLicence[n] then
for m = 1, #w.teamHeroInfos do
if v.dynamicId==w.teamHeroInfos[m].heroId then
local isFormationStr = HeroManager.GetHeroFormationStr(n)
v.isFormation = isFormationStr
end
end
end
end
end
-- for i, v in pairs(heroDataList) do
-- for n,w in pairs(FormationManager.formationList) do
-- if HeroManager.heroResolveLicence[n] then
-- for m = 1, #w.teamHeroInfos do
-- if v.dynamicId==w.teamHeroInfos[m].heroId then
-- local isFormationStr = HeroManager.GetHeroFormationStr(n)
-- v.isFormation = isFormationStr
-- end
-- end
-- end
-- end
-- end
this.ScrollView:SetData(heroDataList, function (index, go)
this.OnShowSingleCardData(go, heroDataList[index])
end)
@ -111,13 +111,14 @@ function this.OnClickEnterHero(go,heroData,type)
this.OnShowSingleCardData(go,heroData,type)
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
end
local oldSelectGo
function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
local choosed = Util.GetGameObject(go.transform, "choosed")
choosed:SetActive(false)
if curSelectHeroList[heroData.dynamicId] then
curSelectHeroList[heroData.dynamicId]=heroData
choosed:SetActive(true)
oldSelectGo = choosed
end
Util.GetGameObject(go.transform, "frame"):GetComponent("Image").sprite = Util.LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
@ -126,9 +127,9 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
Util.GetGameObject(go.transform, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
local formationMask = Util.GetGameObject(go.transform, "formationMask")
-- formationMask:SetActive(false)
formationMask:SetActive((heroData.isFormation ~= "" and heroData.isFormation ~= Language[11108]) or heroData.lockState == 1)
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(heroData.isFormation ~= "" )
Util.GetGameObject(formationMask.transform, "lockImage"):SetActive( heroData.lockState == 1)
formationMask:SetActive(false)-- LengthOfTable(heroData.formationList) ~= 0 or heroData.lockState == 1)
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(false)--(LengthOfTable(heroData.formationList) ~= 0 )
Util.GetGameObject(formationMask.transform, "lockImage"):SetActive(false)--( heroData.lockState == 1)
Util.GetGameObject(go.transform, "noumenon"):SetActive( heroData.id == curHeroData.id )
local starGrid = Util.GetGameObject(go.transform, "star")
SetHeroStars(starGrid, heroData.star,1,nil,nil,Vector2.New(0,1))
@ -140,61 +141,66 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
return
end
if LengthOfTable(curSelectHeroList)>=curNeedRoleNum then
PopupTipPanel.ShowTip(Language[10660])
return
-- if LengthOfTable(curSelectHeroList)>=curNeedRoleNum then
-- PopupTipPanel.ShowTip(Language[10660])
-- return
-- end
if oldSelectGo then
oldSelectGo:SetActive(false)
end
curSelectHeroList = {}
curSelectHeroList[heroData.dynamicId]=heroData
choosed:SetActive(true)
oldSelectGo = choosed
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
end)
Util.AddOnceClick(formationMask, function()
if #heroData.formationList ~= 0 then
local text = ""
for index, value in ipairs(heroData.formationList) do
text = HeroManager.GetHeroFormationStr(index)
end
PopupTipPanel.ShowTip(text)
return
end
if heroData.lockState == 1 then
PopupTipPanel.ShowTip(Language[11776])
return
end
end)
-- Util.AddOnceClick(formationMask, function()
-- if #heroData.formationList ~= 0 then
-- local text = ""
-- for index, value in ipairs(heroData.formationList) do
-- text = HeroManager.GetHeroFormationStr(index)
-- end
-- PopupTipPanel.ShowTip(text)
-- return
-- end
-- if heroData.lockState == 1 then
-- PopupTipPanel.ShowTip(Language[11776])
-- return
-- end
-- end)
end
function this.HeroSortData(heroData)
Log("#heroData "..#heroData)
-- Log("#heroData "..#heroData)
--Language[11108]
table.sort(heroData, function(a, b)
if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormation == Language[11108]))
or (a.isFormation ~= "" and a.isFormation ~= Language[11108]) and (b.isFormation ~= "" and b.isFormation ~= Language[11108]) then
if a.lockState == b.lockState then
if a.heroConfig.Star == b.heroConfig.Star then
if a.lv == b.lv then
if a.id ~= curHeroData.id and b.id ~= curHeroData.id or a.id == curHeroData.id and b.id == curHeroData.id then
return a.id > b.id
else
return not a.id ~= curHeroData.id and b.id == curHeroData.id
end
else
return a.lv < b.lv
end
else
return a.heroConfig.Star < b.heroConfig.Star
end
else
return a.lockState < b.lockState
end
else
return (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (not b.dynamicId ~= "" and b.isFormation ~= Language[11108])
end
-- if (LengthOfTable( a.formationList) == 0 and LengthOfTable( b.formationList) == 0)
-- or (LengthOfTable(a.formationList) > 0) and (LengthOfTable(b.formationList) > 0) then
-- if a.lockState == b.lockState then
-- if a.heroConfig.Star == b.heroConfig.Star then
-- if a.lv == b.lv then
-- -- if a.id ~= curHeroData.Id and b.id ~= curHeroData.Id or a.id == curHeroData.Id and b.id == curHeroData.Id then
-- return a.id > b.id
-- -- else
-- -- return not a.id ~= curHeroData.Id and b.id == curHeroData.Id
-- -- end
-- else
return a.lv > b.lv
-- end
-- else
-- return a.heroConfig.Star < b.heroConfig.Star
-- end
-- else
-- return a.lockState < b.lockState
-- end
-- else
-- return LengthOfTable( a.formationList) == 0 and LengthOfTable(b.formationList) > 0
-- end
end)
end
function CompoundHeroFirstUpStarListPanel:AutoSelectHero()
curSelectHeroList = {}
for i = 1, #heroDataList do
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 then--
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and LengthOfTable(heroDataList[i].formationList) == 0 and heroDataList[i].lockState == 0 then--
curSelectHeroList[heroDataList[i].dynamicId]=heroDataList[i]
end
end

View File

@ -139,8 +139,8 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
Util.GetGameObject(go.transform, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
local formationMask = Util.GetGameObject(go.transform, "formationMask")
-- formationMask:SetActive(false)
formationMask:SetActive((heroData.isFormation ~= "" and heroData.isFormation ~= Language[11108]) or heroData.lockState == 1)
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(heroData.isFormation ~= "" )
formationMask:SetActive( #heroData.formationList ~= 0 or heroData.lockState == 1)--(heroData.isFormation ~= "" and heroData.isFormation ~= Language[11108])
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(#heroData.formationList ~= 0)
Util.GetGameObject(formationMask.transform, "lockImage"):SetActive( heroData.lockState == 1)
Util.GetGameObject(go.transform, "noumenon"):SetActive( heroData.id == curHeroData.Id )
local starGrid = Util.GetGameObject(go.transform, "star")
@ -178,11 +178,11 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
end)
end
function this.HeroSortData(heroData)
Log("#heroData "..#heroData)
-- Log("#heroData "..#heroData)
--Language[11108]
table.sort(heroData, function(a, b)
if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormation == Language[11108]))
or (a.isFormation ~= "" and a.isFormation ~= Language[11108]) and (b.isFormation ~= "" and b.isFormation ~= Language[11108]) then
if (LengthOfTable( a.formationList) == 0 and LengthOfTable( b.formationList) == 0)
or (LengthOfTable(a.formationList) > 0) and (LengthOfTable(b.formationList) > 0) then
if a.lockState == b.lockState then
if a.heroConfig.Star == b.heroConfig.Star then
if a.lv == b.lv then
@ -201,7 +201,7 @@ function this.HeroSortData(heroData)
return a.lockState < b.lockState
end
else
return (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (not b.dynamicId ~= "" and b.isFormation ~= Language[11108])
return LengthOfTable( a.formationList) == 0 and LengthOfTable(b.formationList) > 0
end
end)
end
@ -209,7 +209,7 @@ function CompoundHeroUpStarListPanel:AutoSelectHero()
LogGreen("sssssssssssssssssssss")
curSelectHeroList = {}
for i = 1, #heroDataList do
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 then--
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and #heroDataList[i].formationList == 0 and heroDataList[i].lockState == 0 then--
LogGreen("heroDataList[i].dynamicId "..heroDataList[i].dynamicId)
curSelectHeroList[heroDataList[i].dynamicId]=heroDataList[i]
end

View File

@ -308,7 +308,7 @@ function this.UpdateUpStarPosHeroData(curSelectHeroList,_upStarData,go)
else
upStarMaterialIsAll[upStarData[2]]=1
Util.GetGameObject(curGo.transform,"add/add"):SetActive(false)
Util.GetGameObject(curGo.transform,"num"):GetComponent("Text").text=string.format("<color=#FFFFFFFF>%s/%s</color>", LengthOfTable(curSelectHeroList),upStarData[4])
Util.GetGameObject(curGo.transform,"num"):GetComponent("Text").text=string.format("<color=#00FF06>%s/%s</color>", LengthOfTable(curSelectHeroList),upStarData[4])
end
local curUpStarConsumeMaterial={}
for i, v in pairs(curSelectHeroList) do
@ -345,7 +345,7 @@ function this.UpdateUpStarPosHeroData2(curSelectHeroList)
local _curUpStarData = this.GetAllHeroCompoundData2(curSelectHeroConfig.config,curSelectHeroConfig,true)
if curSelectHero then this.UpdateHeroUpStarData(_curUpStarData) end
Util.GetGameObject(curSelectUpStarGo.transform,"add/add"):SetActive(false)
Util.GetGameObject(curSelectUpStarGo.transform,"num"):GetComponent("Text").text=string.format("<color=#FFFFFFFF>%s/%s</color>", LengthOfTable(curSelectHeroList),1)
Util.GetGameObject(curSelectUpStarGo.transform,"num"):GetComponent("Text").text=string.format("<color=#00FF06>%s/%s</color>", LengthOfTable(curSelectHeroList),1)
end
end
@ -372,7 +372,7 @@ function this.UpdateFirstHeroUpStarData(curHeroCompoundData)
proImage:GetComponent("Image").sprite=Util.LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
SetHeroStars(starGrid, heroConfig.Star,1,nil,-15.3)
if curSelectHero and curSelectHero.heroConfig then
num:GetComponent("Text").text=string.format("<color=#FFFFFF>%s/%s</color>",1,1)
num:GetComponent("Text").text=string.format("<color=#00FF06>%s/%s</color>",1,1)
else
num:GetComponent("Text").text=string.format("<color=#FF0000FF>%s/%s</color>",0,1)
end

View File

@ -37,6 +37,7 @@ function this:InitComponent(gameObject)
this.text = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/heros/content/Text")
this.cost = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/heros/content/cost")
this.costImage = Util.GetGameObject(this.cost, "Image"):GetComponent("Image")
this.costText = Util.GetGameObject(this.cost,"Text"):GetComponent("Text")
end
@ -57,7 +58,7 @@ function this:BindEvent()
this.text:SetActive(false)
this.cost:SetActive(false)
local value = this.RebuildData(msg.heroTempId)
local value = this.RebuildData(msg.heroTempId,curSelectHero)
this.SetHero(this.replaceHero,value)
end)
else
@ -70,19 +71,15 @@ function this:BindEvent()
HeroManager.ResetHeroChangeId(curSelectHero.dynamicId)--改变英雄changeId
this.replaceHero:SetActive(false)
this.needHero:SetActive(false)
this.needHero:SetActive(true)
this.cancelBtn:SetActive(false)
this.replaceBtn:SetActive(true)
this.saveBtn:SetActive(false)
this.needBg:SetActive(true)
this.needBg:SetActive(false)
this.replaceBg:SetActive(true)
this.text:SetActive(true)
this.cost:SetActive(false)
this.text:SetActive(false)
this.cost:SetActive(true)
curSelectHero = {}
for i = 1, #heroDatas do
heroSelectBtn[i]:SetActive(heroDatas[i].dynamicId == curSelectHero.dynamicId)
end
end)
end)
--保存置换
@ -97,22 +94,30 @@ function this:BindEvent()
this.cost:SetActive(false)
HeroManager.DeleteHeroDatas({curSelectHero.dynamicId})
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop,1,function()
this.ShowCurrPosHeroReplace(curIndex)
end)
for i = 1, #msg.drop.Hero do
HeroManager.UpdateHeroDatas(msg.drop.Hero[i])
end
curSelectHero = HeroManager.GetSingleHeroData(msg.drop.Hero[1].id)
this.ShowCurrPosHeroReplace(curIndex)
for i = 1, #heroDatas do
if heroSelectBtn[i] and heroDatas[i] then
heroSelectBtn[i]:SetActive(heroDatas[i].dynamicId == curSelectHero.dynamicId)
end
end
end)
end)
end
--通过Id 重新组成数据
function this.RebuildData(id)
function this.RebuildData(id,curHero)
local herodata = {}
herodata.id = HeroConfig[id].Id
herodata.name = HeroConfig[id].ReadingName
herodata.live = GetResourcePath(HeroConfig[id].Live)
herodata.star = HeroConfig[id].Star
herodata.lv = 1
herodata.lv = curHero.lv
herodata.quality = HeroConfig[id].Quality
herodata.profession = HeroConfig[id].Profession
herodata.scale = HeroConfig[id].Scale
@ -148,8 +153,6 @@ function this:OnShow(...)
end)
end
this.HeroReplaceBtnClick(tabs[1],curIndex)
end
--英雄类型按钮点击事件
@ -193,9 +196,10 @@ function this.SingleHeroDataShow(_go,_heroData)
Util.GetGameObject(go.transform, "posIcon"):SetActive(false)
Util.GetGameObject(go.transform, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(HeroConfig[heroData.id].PropertyName))
Util.GetGameObject(go.transform, "Text"):GetComponent("Text").text = heroData.name
local formationMask = Util.GetGameObject(go.transform, "formationMask")
local formationImage = Util.GetGameObject(go.transform, "formationMask/formationImage/upImage"):GetComponent("Image")
if #heroData.formationList ~= 0 then
if LengthOfTable(heroData.formationList) ~= 0 then
formationMask:SetActive(true)
formationImage.sprite = Util.LoadSprite("t_tongyong-yishangzheng")
elseif heroData.lockState == 1 then
@ -204,6 +208,7 @@ function this.SingleHeroDataShow(_go,_heroData)
else
formationMask:SetActive(false)
end
local starGrid = Util.GetGameObject(go.transform, "star")
SetHeroStars(starGrid, heroData.star,1,nil,nil,Vector2.New(0,1))
@ -219,6 +224,18 @@ function this.SingleHeroDataShow(_go,_heroData)
this.text:SetActive(true)
this.cost:SetActive(false)
if curSelectHero.id then
this.SetHero(this.needHero,curSelectHero)
choosed:SetActive(true)
this.ShowCostInfo()
this.needHero:SetActive(true)
this.replaceHero:SetActive(false)
this.needBg:SetActive(false)
this.replaceBg:SetActive(true)
this.text:SetActive(false)
this.cost:SetActive(true)
end
Util.AddOnceClick(cardBtn, function()
if heroData.dynamicId == curSelectHero.dynamicId then
choosed:SetActive(false)
@ -258,7 +275,7 @@ function this.SingleHeroDataShow(_go,_heroData)
this.text:SetActive(false)
this.cost:SetActive(false)
local data = this.RebuildData(curSelectHero.changeId)
local data = this.RebuildData(curSelectHero.changeId,curSelectHero)
this.SetHero(this.replaceHero,data)
else
@ -283,10 +300,10 @@ function this.SingleHeroDataShow(_go,_heroData)
end)
Util.AddOnceClick(formationMask, function()
if #heroData.formationList ~= 0 then
if LengthOfTable(heroData.formationList) ~= 0 then
local text = ""
for index, value in ipairs(heroData.formationList) do
text = HeroManager.GetHeroFormationStr(index)
for key, value in pairs(heroData.formationList) do
text = "该神将在"..HeroManager.GetHeroFormationStr2(key).."中已上阵"
end
PopupTipPanel.ShowTip(text)
return
@ -371,8 +388,9 @@ function this.ShowCostInfo()
local replaceItemIdConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,68)
local replaceCostConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,69)
if replaceItemIdConfig then
this.text:GetComponent("Text").text = BagManager.GetItemCountById(tonumber(replaceItemIdConfig.Value))
this.costImage:GetComponent("Image").sprite = SetIcon(tonumber(replaceItemIdConfig.Value))
end
if curSelectHero and replaceCostConfig then
local getCostByStar = string.split(replaceCostConfig.Value,"|")
if curSelectHero.star == 4 then

View File

@ -42,6 +42,10 @@ this.heroResolveLicence = {}
--this.allHeroProVal = {}--团体加成
--this.specialProVal = {}--减乘
function this.Initialize()
local hero_resolve_licence = string.split(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 36).Value, "#")
for i = 1, #hero_resolve_licence do
this.heroResolveLicence[tonumber(hero_resolve_licence[i])] = tonumber(hero_resolve_licence[i])
end
for i = 1, WarPowerTypeAllNum do
this.allProVal[i] = {
singleHeroProVal = {},
@ -163,7 +167,8 @@ function this.UpdateHeroDatas(_msgHeroData, isFindHandBook)
end
function this.SetHeroFormationList(heroDid,teamId,isAddOrDel)
if isAddOrDel then
if isAddOrDel and this.heroResolveLicence[teamId] then
heroDatas[heroDid].formationList[teamId] = teamId
else
heroDatas[heroDid].formationList[teamId] = nil

Binary file not shown.