神魂提交
parent
93d0f294e0
commit
681f8d5a57
|
|
@ -6,7 +6,7 @@ AnimationClip:
|
|||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: fx_yujiantongxing_xiaoluo
|
||||
m_Name: fx_yujiantongxing_xiaoluo_control
|
||||
serializedVersion: 6
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -123,6 +123,7 @@ RectTransform:
|
|||
- {fileID: 2338646928782581046}
|
||||
- {fileID: 5299528613146693474}
|
||||
- {fileID: 2913791122365382009}
|
||||
- {fileID: 5757746324695005508}
|
||||
- {fileID: 458271444932364388}
|
||||
- {fileID: 3260307931949129323}
|
||||
- {fileID: 1973877883734817856}
|
||||
|
|
@ -259,7 +260,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 164915241442772717}
|
||||
m_RootOrder: 15
|
||||
m_RootOrder: 16
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
|
|
@ -1390,7 +1391,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 164915241442772717}
|
||||
m_RootOrder: 14
|
||||
m_RootOrder: 15
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
|
|
@ -1966,7 +1967,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 164915241442772717}
|
||||
m_RootOrder: 13
|
||||
m_RootOrder: 14
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
|
|
@ -2135,6 +2136,135 @@ MonoBehaviour:
|
|||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &4322159500556799371
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5757746324695005508}
|
||||
- component: {fileID: 2770635795068010243}
|
||||
- component: {fileID: 930000514029454794}
|
||||
- component: {fileID: 8886609709524833980}
|
||||
- component: {fileID: 6760833606992696957}
|
||||
m_Layer: 5
|
||||
m_Name: godSoulBtn
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5757746324695005508
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4322159500556799371}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8456097512916616778}
|
||||
m_Father: {fileID: 164915241442772717}
|
||||
m_RootOrder: 12
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 113.994995, y: -1246.9}
|
||||
m_SizeDelta: {x: 148, y: 158}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2770635795068010243
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4322159500556799371}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &930000514029454794
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4322159500556799371}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 3
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 6760833606992696957}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!95 &8886609709524833980
|
||||
Animator:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4322159500556799371}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 6ffe000b5a58aac48a9d130543849d76, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorControllerStateOnDisable: 0
|
||||
--- !u!114 &6760833606992696957
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4322159500556799371}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e459a084d8e15a240b58db751097122b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
--- !u!1 &4398139783457145947
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -2243,6 +2373,80 @@ MonoBehaviour:
|
|||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!1 &4451079537609682547
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8456097512916616778}
|
||||
- component: {fileID: 3309159485644247932}
|
||||
- component: {fileID: 6606901905864062125}
|
||||
m_Layer: 5
|
||||
m_Name: icon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8456097512916616778
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4451079537609682547}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5757746324695005508}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -80.1}
|
||||
m_SizeDelta: {x: 148, y: 158}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3309159485644247932
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4451079537609682547}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &6606901905864062125
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4451079537609682547}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 21300000, guid: db6fe3e950012f644b3aaf02debee77a, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &4575798417533267614
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -2355,7 +2559,7 @@ RectTransform:
|
|||
- {fileID: 7502473627380909813}
|
||||
- {fileID: 8222799376925158843}
|
||||
m_Father: {fileID: 164915241442772717}
|
||||
m_RootOrder: 12
|
||||
m_RootOrder: 13
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -2907,6 +2907,13 @@ PropertyType = {
|
|||
[4] = "道系",
|
||||
}
|
||||
|
||||
ProfessionType = {
|
||||
[1] = "肉盾",
|
||||
[2] = "输出",
|
||||
[3] = "控制",
|
||||
[4] = "辅助",
|
||||
}
|
||||
|
||||
PropertyTypeImageBySiYuan = {
|
||||
[1] = {image3 = "y_yuansu_ren01_zh",Image1 = "y_yuansu_ren",property = "人"},
|
||||
[2] = {image3 = "y_yuansu_fou01_zh",Image1 = "y_yuansu_fou",property = "佛"},
|
||||
|
|
|
|||
|
|
@ -484,6 +484,7 @@ function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rot
|
|||
for i = 1, 23 do
|
||||
if i == star - 4 then
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
starPre.transform:GetChild(i - 1):GetComponent("RectTransform").sizeDelta = starSize
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
|
|
@ -492,6 +493,7 @@ function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rot
|
|||
for i = 1, 23 do
|
||||
if i > 11 and i == star + 2 then
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
starPre.transform:GetChild(i - 1):GetComponent("RectTransform").sizeDelta = starSize
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
|
|
@ -500,6 +502,7 @@ function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rot
|
|||
for i = 1, 23 do
|
||||
if i == star - 4 then
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
starPre.transform:GetChild(i - 1):GetComponent("RectTransform").sizeDelta = starSize
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -425,6 +425,7 @@ UIName = {
|
|||
TreasureStoreSeason2 = 431,--新百宝商会
|
||||
PracticeSkillInfoPanel = 430, --修行主角技能信息界面
|
||||
DemonSlayerNewPanel = 432, --新版三界降魔
|
||||
RoleGodSoulLayout = 434,
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ local parent
|
|||
local sortingOrder=0
|
||||
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||
local curList = {}
|
||||
local oldSelect = 0
|
||||
--初始化组件(用于子类重写)
|
||||
function GeneralBigPopup_RoleGodSoulUp:InitComponent(gameObject)
|
||||
self.spLoader = SpriteLoader.New()
|
||||
|
|
@ -25,6 +26,23 @@ function GeneralBigPopup_RoleGodSoulUp:InitComponent(gameObject)
|
|||
self.oneKeyBtn = Util.GetGameObject(gameObject, "oneKey")
|
||||
self.sureBtn = Util.GetGameObject(gameObject, "sure")
|
||||
|
||||
self.bglist = Util.GetGameObject(gameObject,"bglist")
|
||||
self.heroSelect = Util.GetGameObject(gameObject,"heroSelect")
|
||||
self.select = Util.GetGameObject(gameObject,"select")
|
||||
self.reSelectList = {}
|
||||
for i = 1,self.bglist.transform.childCount do
|
||||
if not self.reSelectList[i] then
|
||||
self.reSelectList[i] = {}
|
||||
end
|
||||
self.reSelectList[i].go = Util.GetGameObject(self.bglist,"itemPre"..i)
|
||||
self.reSelectList[i].btn = Util.GetGameObject(self.reSelectList[i].go,"HeroPre")
|
||||
self.reSelectList[i].frame = Util.GetGameObject(self.reSelectList[i].btn,"frame"):GetComponent("Image")
|
||||
self.reSelectList[i].icon = Util.GetGameObject(self.reSelectList[i].btn,"icon"):GetComponent("Image")
|
||||
self.reSelectList[i].posIcon = Util.GetGameObject(self.reSelectList[i].btn,"posIcon"):GetComponent("Image")
|
||||
self.reSelectList[i].proIcon = Util.GetGameObject(self.reSelectList[i].btn,"proIcon"):GetComponent("Image")
|
||||
self.reSelectList[i].star = Util.GetGameObject(self.reSelectList[i].btn,"star")
|
||||
self.reSelectList[i].name = Util.GetGameObject(self.reSelectList[i].btn,"name"):GetComponent("Text")
|
||||
end
|
||||
self.itemlist = {}
|
||||
self.costItemlist = {}
|
||||
self.choosedIdList = {}
|
||||
|
|
@ -32,43 +50,43 @@ end
|
|||
|
||||
--绑定事件(用于子类重写)
|
||||
function GeneralBigPopup_RoleGodSoulUp:BindEvent()
|
||||
Util.AddClick(self.oneKeyBtn,function ()
|
||||
local isenuough,enoughNums,enoughDatas,oldEnoughDatas = false,nil,nil,nil
|
||||
self.choosedIdList = {}
|
||||
for i = 1,#self.allDatas do
|
||||
table.insert(self.choosedIdList,self.allDatas[i].herodata.dynamicId)
|
||||
isenuough,enoughNums,enoughDatas = GodSoulManager.CheckCanUpGodSoul(self.curHeroData,self.lv,self.choosedIdList)
|
||||
if isenuough then
|
||||
self:RefreshCostItemNums()
|
||||
self:RefreshItemDatas()
|
||||
break
|
||||
else
|
||||
if not oldEnoughDatas then
|
||||
oldEnoughDatas = enoughDatas
|
||||
else
|
||||
local ismove = true
|
||||
for k,v in pairs(oldEnoughDatas) do
|
||||
if v ~= enoughDatas[k] then
|
||||
ismove = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if ismove then
|
||||
table.remove(self.choosedIdList,#self.choosedIdList)
|
||||
end
|
||||
oldEnoughDatas = enoughDatas
|
||||
end
|
||||
end
|
||||
end
|
||||
if not isenuough then
|
||||
PopupTipPanel.ShowTip("无法满足激活条件!")
|
||||
return
|
||||
end
|
||||
end)
|
||||
-- Util.AddClick(self.oneKeyBtn,function ()
|
||||
-- local isenuough,enoughNums,enoughDatas,oldEnoughDatas = false,nil,nil,nil
|
||||
-- self.choosedIdList = {}
|
||||
-- for i = 1,#self.allDatas do
|
||||
-- table.insert(self.choosedIdList,self.allDatas[i].herodata.dynamicId)
|
||||
-- isenuough,enoughNums,enoughDatas = GodSoulManager.CheckCanUpGodSoul(self.curHeroData,self.lv,self.choosedIdList)
|
||||
-- if isenuough then
|
||||
-- self:RefreshCostItemNums()
|
||||
-- self:RefreshItemDatas()
|
||||
-- break
|
||||
-- else
|
||||
-- if not oldEnoughDatas then
|
||||
-- oldEnoughDatas = enoughDatas
|
||||
-- else
|
||||
-- local ismove = true
|
||||
-- for k,v in pairs(oldEnoughDatas) do
|
||||
-- if v ~= enoughDatas[k] then
|
||||
-- ismove = false
|
||||
-- break
|
||||
-- end
|
||||
-- end
|
||||
-- if ismove then
|
||||
-- table.remove(self.choosedIdList,#self.choosedIdList)
|
||||
-- end
|
||||
-- oldEnoughDatas = enoughDatas
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- if not isenuough then
|
||||
-- PopupTipPanel.ShowTip("无法满足激活条件!")
|
||||
-- return
|
||||
-- end
|
||||
-- end)
|
||||
Util.AddClick(self.sureBtn,function()
|
||||
local isSave = false
|
||||
if self.isenuough then
|
||||
if #curList == #self.choosedIdList then
|
||||
if LengthOfTable(self.choosedIdList) >= #self.costItems then
|
||||
if #curList == LengthOfTable(self.choosedIdList) then
|
||||
for i = 1,#curList do
|
||||
if self:CheckIsChooseId(curList[i]) < 1 then
|
||||
isSave = true
|
||||
|
|
@ -85,12 +103,23 @@ function GeneralBigPopup_RoleGodSoulUp:BindEvent()
|
|||
else
|
||||
parent:ClosePanel()
|
||||
end
|
||||
elseif #self.choosedIdList == 0 then
|
||||
elseif LengthOfTable(self.choosedIdList) == 0 then
|
||||
PopupTipPanel.ShowTip("请选择神将!")
|
||||
else
|
||||
PopupTipPanel.ShowTip("所选神将无法激活神魂效果!")
|
||||
end
|
||||
end)
|
||||
|
||||
for i = 1,self.bglist.transform.childCount do
|
||||
Util.AddClick(self.reSelectList[i].btn,function()
|
||||
if i == self.curPage then
|
||||
return
|
||||
end
|
||||
self.curPage = i
|
||||
self:SetSeclet(self.select,self.reSelectList[self.curPage].go.transform,Vector3.New(0,-75,0))
|
||||
self:Refresh(true,false)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
|
|
@ -110,13 +139,62 @@ function GeneralBigPopup_RoleGodSoulUp:OnShow(_parent,_Data)
|
|||
self.costItems = _Data[1]
|
||||
self.curHeroData = _Data[2]
|
||||
self.lv = _Data[3]
|
||||
self.allDatas = GodSoulManager.GetGodSoulData(self.curHeroData,self.lv)
|
||||
self.curPage = _Data[4] or 1
|
||||
self.choosedIdList = GodSoulManager.GetBindHeroDatasByLevel(self.curHeroData.dynamicId,self.lv)
|
||||
curList = GodSoulManager.GetBindHeroDatasByLevel(self.curHeroData.dynamicId,self.lv)
|
||||
self:Refresh(true,true)
|
||||
self:SetCostItem(true)
|
||||
self:SetSeclet(self.select,self.reSelectList[self.curPage].go.transform,Vector3.New(0,-75,0))
|
||||
end
|
||||
|
||||
function GeneralBigPopup_RoleGodSoulUp:SetCostItem(isAllRefresh)
|
||||
for i = 1, math.max(#self.reSelectList,#self.costItems) do
|
||||
if not self.costItems[i] then
|
||||
self.reSelectList[i].go.gameObject:SetActive(false)
|
||||
else
|
||||
if not self.reSelectList[i] then
|
||||
self.reSelectList[i] = {}
|
||||
self.reSelectList[i].go = newObjToParent(self.reSelectList[1].go,self.bglist.transform)
|
||||
self.reSelectList[i].btn = Util.GetGameObject(self.reSelectList[i].go,"HeroPre")
|
||||
self.reSelectList[i].frame = Util.GetGameObject(self.reSelectList[i].btn,"frame"):GetComponent("Image")
|
||||
self.reSelectList[i].icon = Util.GetGameObject(self.reSelectList[i].btn,"icon"):GetComponent("Image")
|
||||
self.reSelectList[i].posIcon = Util.GetGameObject(self.reSelectList[i].btn,"posIcon"):GetComponent("Image")
|
||||
self.reSelectList[i].proIcon = Util.GetGameObject(self.reSelectList[i].btn,"proIcon"):GetComponent("Image")
|
||||
self.reSelectList[i].star = Util.GetGameObject(self.reSelectList[i].btn,"star")
|
||||
self.reSelectList[i].name = Util.GetGameObject(self.reSelectList[i].btn,"name"):GetComponent("Text")
|
||||
end
|
||||
self.reSelectList[i].go.gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
self:RefreshCostItemNums2(true)
|
||||
end
|
||||
|
||||
function GeneralBigPopup_RoleGodSoulUp:SetSeclet(select,selectPar,pos)
|
||||
select.gameObject:SetActive(true)
|
||||
select.transform:SetParent(selectPar)
|
||||
select.gameObject:GetComponent("RectTransform").anchoredPosition3D = pos
|
||||
select.transform.localScale = Vector3.one
|
||||
end
|
||||
|
||||
function GeneralBigPopup_RoleGodSoulUp:Refresh(isTop,isAni)
|
||||
self.allDatas = GodSoulManager.GetGodSoulData(self.curHeroData,self.lv,self.curPage)
|
||||
if self.choosedIdList[self.curPage] and self.choosedIdList[self.curPage] ~= "" then
|
||||
for i = 1,#self.allDatas do
|
||||
if self.allDatas[i].herodata.dynamicId == self.choosedIdList[self.curPage] then
|
||||
self.allDatas[i].state = 999
|
||||
end
|
||||
end
|
||||
table.sort(self.allDatas,function(a,b)
|
||||
if a.state == b.state then
|
||||
if a.herodata.star == b.herodata.star then
|
||||
return a.herodata.star > b.herodata.star
|
||||
end
|
||||
return a.herodata.heroConfig.Sort < b.herodata.heroConfig.Sort
|
||||
end
|
||||
return a.state > b.state
|
||||
end)
|
||||
end
|
||||
|
||||
if not self.itemlist then
|
||||
self.itemlist = {}
|
||||
end
|
||||
|
|
@ -125,8 +203,7 @@ function GeneralBigPopup_RoleGodSoulUp:Refresh(isTop,isAni)
|
|||
end
|
||||
self.ScrollView:SetData(self.allDatas, function(index, go)
|
||||
self:SetSingleData(index,go,self.allDatas[index])
|
||||
end,not isTop,not isAni)
|
||||
self:UpdateCostItem()
|
||||
end,not isTop,not isAni)
|
||||
end
|
||||
|
||||
function GeneralBigPopup_RoleGodSoulUp:RefreshItemDatas()
|
||||
|
|
@ -144,6 +221,7 @@ function GeneralBigPopup_RoleGodSoulUp:SetSingleData(index,go,heroData)
|
|||
self.itemlist[index] = {}
|
||||
self.itemlist[index].go = go
|
||||
self.itemlist[index].mask = Util.GetGameObject(go,"mask")
|
||||
self.itemlist[index].allSelect = Util.GetGameObject(go,"allSelect")
|
||||
self.itemlist[index].select = Util.GetGameObject(go,"select")
|
||||
self.itemlist[index].using = Util.GetGameObject(go,"using")
|
||||
self.itemlist[index]._go = Util.GetGameObject(go,"HeroPre")
|
||||
|
|
@ -158,7 +236,7 @@ function GeneralBigPopup_RoleGodSoulUp:SetSingleData(index,go,heroData)
|
|||
self.itemlist[index]._data = heroData
|
||||
self.itemlist[index].data = heroData.herodata
|
||||
self.itemlist[index].frame.sprite=self.spLoader:LoadSprite(GetHeroQuantityImageByquality(self.itemlist[index].data.heroConfig.Quality,self.itemlist[index].data.star))
|
||||
self.itemlist[index].icon.sprite=self.spLoader:LoadSprite(self.itemlist[index].data.icon)
|
||||
SetHeroIcon(self.spLoader,self.itemlist[index]._data,self.itemlist[index].icon,self.itemlist[index].data.heroConfig)
|
||||
self.itemlist[index].go.gameObject:SetActive(true)
|
||||
if HarmonyManager.IsChangeColor(self.itemlist[index].data.dynamicId) then
|
||||
self.itemlist[index].lv.text="<color=#0f0>"..self.itemlist[index].data.lv.."</color>"
|
||||
|
|
@ -180,22 +258,29 @@ function GeneralBigPopup_RoleGodSoulUp:SetSingleData(index,go,heroData)
|
|||
end
|
||||
SetHeroStars(self.spLoader, self.itemlist[index].starGrid, star,starType,starSize,starScale)
|
||||
|
||||
self.itemlist[index].select.gameObject:SetActive(false)
|
||||
self.itemlist[index].mask.gameObject:SetActive(false)
|
||||
self.itemlist[index].using.gameObject:SetActive(false)
|
||||
if self:CheckIsChooseId(self.itemlist[index].data.dynamicId) > 0 then
|
||||
self.itemlist[index].select.gameObject:SetActive(true)
|
||||
self.itemlist[index].allSelect.gameObject:SetActive(false)
|
||||
self.itemlist[index].select.gameObject:SetActive(false)
|
||||
local location = self:CheckIsChooseId(self.itemlist[index].data.dynamicId)
|
||||
if location > 0 and location == self.curPage then
|
||||
oldSelect = index
|
||||
self:SetSeclet(self.itemlist[index].select,self.itemlist[index].go.transform,Vector3.New(0,-75,0))
|
||||
elseif location > 0 then
|
||||
self.itemlist[index].allSelect.gameObject:SetActive(true)
|
||||
elseif self.itemlist[index]._data.state == -1 then
|
||||
self.itemlist[index].mask.gameObject:SetActive(true)
|
||||
elseif self.itemlist[index]._data.state == 0 or self.itemlist[index]._data.state == 664 then
|
||||
self.itemlist[index].using.gameObject:SetActive(true)
|
||||
self.itemlist[index].mask.gameObject:SetActive(true)
|
||||
else
|
||||
|
||||
end
|
||||
|
||||
-- 点击事件
|
||||
Util.AddOnceClick(self.itemlist[index]._go, function()
|
||||
if self.itemlist[index]._data.state == -1 then
|
||||
PopupTipPanel.ShowTip("该神将不满足神魂激活条件!")
|
||||
PopupTipPanel.ShowTip("该神将无法放入所选格子中!")
|
||||
return
|
||||
end
|
||||
if self.itemlist[index]._data.state == 0 or self.itemlist[index]._data.state == 664 then
|
||||
|
|
@ -203,14 +288,23 @@ function GeneralBigPopup_RoleGodSoulUp:SetSingleData(index,go,heroData)
|
|||
return
|
||||
end
|
||||
local isChoosed = self:CheckIsChooseId(self.itemlist[index].data.dynamicId)
|
||||
if isChoosed > 0 and isChoosed ~= self.curPage then
|
||||
PopupTipPanel.ShowTip("该神将正处于其他格子中,无法选择!")
|
||||
return
|
||||
end
|
||||
|
||||
if isChoosed > 0 then
|
||||
table.remove(self.choosedIdList,isChoosed)
|
||||
self.choosedIdList[self.curPage] = ""
|
||||
self.itemlist[index].select.gameObject:SetActive(false)
|
||||
else
|
||||
table.insert(self.choosedIdList,self.itemlist[index].data.dynamicId)
|
||||
self.itemlist[index].select.gameObject:SetActive(true)
|
||||
self.choosedIdList[self.curPage] = self.itemlist[index].data.dynamicId
|
||||
if self.itemlist[oldSelect] then
|
||||
self.itemlist[oldSelect].select.gameObject:SetActive(false)
|
||||
end
|
||||
oldSelect = index
|
||||
self:SetSeclet(self.itemlist[index].select,self.itemlist[index].go.transform,Vector3.New(0,-72,0))
|
||||
end
|
||||
self:RefreshCostItemNums()
|
||||
self:RefreshCostItemNums2(false)
|
||||
end)
|
||||
|
||||
Util.AddLongPressClick(self.itemlist[index]._go, function()
|
||||
|
|
@ -220,9 +314,9 @@ end
|
|||
|
||||
function GeneralBigPopup_RoleGodSoulUp:CheckIsChooseId(heroId)
|
||||
local index = 0
|
||||
for i = 1,#self.choosedIdList do
|
||||
if heroId == self.choosedIdList[i] then
|
||||
index = i
|
||||
for k,v in pairs(self.choosedIdList) do
|
||||
if heroId == v then
|
||||
index = k
|
||||
return index
|
||||
end
|
||||
end
|
||||
|
|
@ -282,9 +376,70 @@ function GeneralBigPopup_RoleGodSoulUp:RefreshCostItemNums()
|
|||
ForceRebuildLayout(self.costItem1.transform)
|
||||
end
|
||||
|
||||
function GeneralBigPopup_RoleGodSoulUp:RefreshCostItemNums2(isAllRefresh)
|
||||
for i = 1, #self.costItems do
|
||||
if isAllRefresh or (not isAllRefresh and i == self.curPage) then
|
||||
local str = ""
|
||||
if self.costItems[i].star > 11 then
|
||||
str = "觉醒"
|
||||
else
|
||||
str = "十星"
|
||||
end
|
||||
if self.costItems[i].id > 0 then
|
||||
str = str..heroConfig[self.costItems[i].id].ReadingName
|
||||
elseif self.costItems[i].property > 0 then
|
||||
str = PropertyType[self.costItems[i].property]..str.."神将"
|
||||
elseif self.costItems[i].profession > 0 then
|
||||
str = str..ProfessionType[self.costItems[i].profession].."神将"
|
||||
else
|
||||
str = "任意"..str.."神将"
|
||||
end
|
||||
if self.choosedIdList[self.curPage] and self.choosedIdList[self.curPage] ~= "" then
|
||||
self.reSelectList[i].name.text = string.format("<color=#00FF00>%s</color>",str)
|
||||
self.reSelectList[i].posIcon.gameObject:SetActive(true)
|
||||
self.reSelectList[i].proIcon.gameObject:SetActive(true)
|
||||
local tempHeroData = HeroManager.GetSingleHeroData(self.choosedIdList[i])
|
||||
self.reSelectList[i].frame.sprite = self.spLoader:LoadSprite(GetHeroQuantityImageByquality(tempHeroData.heroConfig.Quality,tempHeroData.star))
|
||||
SetHeroIcon(self.spLoader,tempHeroData,self.reSelectList[i].icon,tempHeroData.heroConfig)
|
||||
local star,starType = tempHeroData.GetStar(1)
|
||||
local starSize = Vector2.New(30,30)
|
||||
local starScale = -8
|
||||
if starType == 3 then
|
||||
starSize = Vector2.New(33.43,83.61)
|
||||
starScale = -13.77
|
||||
end
|
||||
SetHeroStars(self.spLoader,self.reSelectList[i].star,star,starType)
|
||||
self.reSelectList[i].proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(tempHeroData.heroConfig.PropertyName))
|
||||
self.reSelectList[i].posIcon.sprite = self.spLoader:LoadSprite(tempHeroData.professionIcon)
|
||||
else
|
||||
self.reSelectList[i].name.text = string.format("<color=#FFE18D>%s</color>",str)
|
||||
self.reSelectList[i].frame.sprite = self.spLoader:LoadSprite(GetHeroQuantityImageByquality(self.costItems[i].star,self.costItems[i].star))
|
||||
SetHeroStars(self.spLoader,self.reSelectList[i].star,self.costItems[i].star,1)
|
||||
self.reSelectList[i].posIcon.gameObject:SetActive(false)
|
||||
self.reSelectList[i].proIcon.gameObject:SetActive(false)
|
||||
if self.costItems[i].id > 0 then
|
||||
self.reSelectList[i].icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroConfig[self.costItems[i].id].Icon))
|
||||
else
|
||||
self.reSelectList[i].icon.sprite = self.spLoader:LoadSprite("r_hero_jinjie-touxiang2")
|
||||
if self.costItems[i].property > 0 then
|
||||
self.reSelectList[i].proIcon.gameObject:SetActive(true)
|
||||
self.reSelectList[i].proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(self.costItems[i].property))
|
||||
elseif self.costItems[i].profession > 0 then
|
||||
self.reSelectList[i].posIcon.gameObject:SetActive(true)
|
||||
self.reSelectList[i].posIcon.sprite = self.spLoader:LoadSprite(GetHeroPosStr(self.costItems[i].profession))
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function GeneralBigPopup_RoleGodSoulUp:OnClose()
|
||||
|
||||
self.heroSelect.gameObject:SetActive(false)
|
||||
self.select.gameObject:SetActive(false)
|
||||
self.choosedIdList = {}
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function this.InitializeTableData()
|
|||
end
|
||||
local data = {}
|
||||
data.index = v.Soul[i][2]
|
||||
data.num = v.Soul[i][4]
|
||||
data.num = 1 --v.Soul[i][4]
|
||||
local config = heroRankupGroup[v.Soul[i][3]]
|
||||
if config.Issame == 1 then
|
||||
data.id = v.Id
|
||||
|
|
@ -53,7 +53,9 @@ function this.InitializeTableData()
|
|||
end
|
||||
end
|
||||
data.star = config.StarLimit
|
||||
table.insert(this.GodSoulTableData[v.Id][v.Soul[i][1]],data)
|
||||
for j = 1,v.Soul[i][4] do
|
||||
table.insert(this.GodSoulTableData[v.Id][v.Soul[i][1]],data)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -193,7 +195,7 @@ function this.DeleteHeroId(heroId)
|
|||
end
|
||||
|
||||
--获取id,lv级绑定的神将
|
||||
function this.GetBindHeroDatasByLevel(id,lv)
|
||||
function this.GetBindHeroDatasByLevel(id,lv,conditionIndex)
|
||||
local data = {}
|
||||
if not this.heroDatas[id] then
|
||||
return data
|
||||
|
|
@ -204,7 +206,11 @@ function this.GetBindHeroDatasByLevel(id,lv)
|
|||
for k,v in pairs(this.heroDatas[id].BindHeroDatas) do
|
||||
if k == lv then
|
||||
for i = 1,#v do
|
||||
table.insert(data,v[i])
|
||||
if conditionIndex and i == conditionIndex then
|
||||
table.insert(data,v[i])
|
||||
elseif not conditionIndex then
|
||||
table.insert(data,v[i])
|
||||
end
|
||||
end
|
||||
break
|
||||
end
|
||||
|
|
@ -213,12 +219,17 @@ function this.GetBindHeroDatasByLevel(id,lv)
|
|||
end
|
||||
|
||||
--获取激活神魂所需的神将条件
|
||||
function this.GetGodSoulDataByLv(id,lv)
|
||||
function this.GetGodSoulDataByLv(id,lv,conditionIndex)
|
||||
if lv == 0 then
|
||||
return this.GodSoulTableData[id] or {}
|
||||
end
|
||||
if this.GodSoulTableData[id] and this.GodSoulTableData[id][lv] and #this.GodSoulTableData[id][lv] > 0 then
|
||||
return this.GodSoulTableData[id][lv]
|
||||
if conditionIndex and conditionIndex > 0 then
|
||||
return {this.GodSoulTableData[id][lv][conditionIndex]}
|
||||
else
|
||||
return this.GodSoulTableData[id][lv]
|
||||
end
|
||||
|
||||
end
|
||||
return {}
|
||||
end
|
||||
|
|
@ -235,9 +246,9 @@ function this.CheckRedPointGodSoul(curHeroData)
|
|||
end
|
||||
|
||||
--筛选符合条件的所有神将
|
||||
function this.GetGodSoulData(curHeroData,lv)
|
||||
function this.GetGodSoulData(curHeroData,lv,conditionIndex)
|
||||
local datas = HeroManager.GetAllHeroList()
|
||||
local godData = this.GetGodSoulDataByLv(curHeroData.heroConfig.Id,lv)
|
||||
local godData = this.GetGodSoulDataByLv(curHeroData.heroConfig.Id,lv,conditionIndex)
|
||||
local haveDatas = {}
|
||||
if godData then
|
||||
for k,v in pairs(datas) do
|
||||
|
|
@ -245,7 +256,6 @@ function this.GetGodSoulData(curHeroData,lv)
|
|||
local index = -1 --无法使用
|
||||
for j = 1,#godData do
|
||||
local isChoosed = this.CheckExistBindHeroDataByDid(curHeroData.dynamicId,v.dynamicId)
|
||||
--LogGreen("isChoosed:"..isChoosed.." lv:"..lv.." v.heroConfig.Id:"..v.heroConfig.Id.." index:"..index)
|
||||
if godData[j].id > 0 and v.heroConfig.Id == godData[j].id then
|
||||
if isChoosed and isChoosed == lv then
|
||||
index = 666
|
||||
|
|
@ -256,10 +266,9 @@ function this.GetGodSoulData(curHeroData,lv)
|
|||
end
|
||||
break
|
||||
elseif isChoosed > 0 and isChoosed ~= lv then
|
||||
--LogYellow("isChoosed:"..isChoosed.." lv:"..lv.." v.heroConfig.Id:"..v.heroConfig.Id.." index:"..index)
|
||||
index = 0
|
||||
break
|
||||
elseif (v.star >= godData[j].star) then
|
||||
elseif (v.star >= godData[j].star) and godData[j].id < 1 then
|
||||
if (godData[j].property > 0 and v.property == godData[j].property)
|
||||
or (godData[j].profession > 0 and v.profession == godData[j].profession)
|
||||
or (godData[j].property == 0 and godData[j].profession == 0) then
|
||||
|
|
@ -278,7 +287,6 @@ function this.GetGodSoulData(curHeroData,lv)
|
|||
|
||||
end
|
||||
end
|
||||
--LogGreen("index:"..index.." v.heroConfig.Id:"..v.heroConfig.Id)
|
||||
table.insert(haveDatas,{state = index,herodata = v})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -79,6 +79,10 @@ function HandBookHeroInfoPanel:InitComponent()
|
|||
|
||||
this.btnMask = Util.GetGameObject(self.transform, "btnMask")
|
||||
this.btnMask.gameObject:SetActive(false)
|
||||
|
||||
--神魂
|
||||
this.godSoulBtn=Util.GetGameObject(self.transform,"godSoulBtn")
|
||||
this.godSoulBtnIcon=Util.GetGameObject(this.godSoulBtn,"icon"):GetComponent("Image")
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
|
|
@ -103,6 +107,10 @@ function HandBookHeroInfoPanel:BindEvent()
|
|||
Util.AddClick(this.posBtn, function()
|
||||
UIManager.OpenPanel(UIName.RolePosInfoPopup,heroConFigData,_curStar)
|
||||
end)
|
||||
|
||||
Util.AddClick(this.godSoulBtn,function()
|
||||
UIManager.OpenPanel(UIName.RoleGodSoulLayout,heroConFigData)
|
||||
end)
|
||||
end
|
||||
|
||||
local heroDatas = {}
|
||||
|
|
@ -245,6 +253,7 @@ function this:UpdateHeroInfoData()
|
|||
elseif _CurPageIndex == RoleInfoPanelIndex.shenhun then
|
||||
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.shenhun)
|
||||
and heroConFigData.IsSoulOpen == 1 and _curStar > 10 then
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
else
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
end
|
||||
|
|
@ -288,7 +297,7 @@ function HandBookHeroInfoPanel:UpdateBtnList()
|
|||
elseif k == RoleInfoPanelIndex.shenhun then
|
||||
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.shenhun)
|
||||
and heroConFigData.IsSoulOpen == 1 and _curStar > 10 then
|
||||
tabsList[k].gameObject:SetActive(true)
|
||||
tabsList[k].gameObject:SetActive(false)
|
||||
else
|
||||
tabsList[k].gameObject:SetActive(false)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,55 +1,71 @@
|
|||
require("Base/BasePanel")
|
||||
RoleGodSoulLayout = Inherit(BasePanel)
|
||||
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||
function RoleGodSoulLayout:New(gameObject)
|
||||
local b = {}
|
||||
b.gameObject = gameObject
|
||||
b.transform = gameObject.transform
|
||||
setmetatable(b, { __index = RoleGodSoulLayout })
|
||||
return b
|
||||
end
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function RoleGodSoulLayout:InitComponent()
|
||||
self.spLoader = SpriteLoader.New()
|
||||
self.help = Util.GetGameObject(self.gameObject,"bgdi/help")
|
||||
self.closeBtn = Util.GetGameObject(self.gameObject,"mask")
|
||||
|
||||
self.help = Util.GetGameObject(self.gameObject,"bgdi/topLayout/help")
|
||||
self.helpPosition = self.help:GetComponent("RectTransform").localPosition
|
||||
self.curHeroName = Util.GetGameObject(self.gameObject,"bgdi/topLayout/name"):GetComponent("Text")
|
||||
self.curHeroGo = Util.GetGameObject(self.gameObject,"bgdi/topLayout/itemPre/HeroPre")
|
||||
|
||||
self.godPre = Util.GetGameObject(self.gameObject,"bgdi/godPre")
|
||||
self.costPre = Util.GetGameObject(self.gameObject,"bgdi/costPre")
|
||||
self.heroPre = Util.GetGameObject(self.gameObject,"bgdi/HeroPre")
|
||||
self.singlePre = Util.GetGameObject(self.gameObject,"bgdi/singlePre")
|
||||
self.grid = Util.GetGameObject(self.gameObject,"bgdi/scroll/grid")
|
||||
self.gridPos = self.grid:GetComponent("RectTransform").anchoredPosition
|
||||
self.gridList = {}
|
||||
end
|
||||
|
||||
function RoleGodSoulLayout:OnSortingOrderChange()
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function RoleGodSoulLayout:BindEvent()
|
||||
Util.AddClick(self.help, function()
|
||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.shenhun,self.helpPosition.x,self.helpPosition.y - 500)
|
||||
end)
|
||||
Util.AddClick(self.closeBtn, function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function RoleGodSoulLayout:AddListener()
|
||||
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Role.UpdateSodSoulLayout, self.SetData,self)
|
||||
end
|
||||
--移除事件监听(用于子类重写)
|
||||
function RoleGodSoulLayout:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Role.UpdateSodSoulLayout, self.SetData,self)
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function RoleGodSoulLayout:OnOpen(_curHerodata)
|
||||
self.curHeroData = _curHerodata
|
||||
if self.curHeroData.dynamicId then
|
||||
self.lv = GodSoulManager.GetGodSoulLv(self.curHeroData.dynamicId)
|
||||
self.addShow = true
|
||||
self.heroConfig = self.curHeroData.heroConfig
|
||||
else
|
||||
self.lv = 0
|
||||
self.addShow = false
|
||||
self.heroConfig = self.curHeroData
|
||||
end
|
||||
end
|
||||
|
||||
function RoleGodSoulLayout:OnShow()
|
||||
self.gameObject:SetActive(true)
|
||||
self:SetData()
|
||||
end
|
||||
|
||||
function RoleGodSoulLayout:SetData(_sortinglayer,_parent,_curHerodata,_isUpZhen,_heroDatas)
|
||||
self.sortingOrder = _sortinglayer
|
||||
self.curHeroData = _curHerodata
|
||||
self.parent = _parent
|
||||
self.isUpZhen = _isUpZhen
|
||||
self.herodatas = _heroDatas
|
||||
function RoleGodSoulLayout:SetData()
|
||||
self:UpdateGodList()
|
||||
self:SetHeroData(self.curHeroGo,self.curHeroData,true)
|
||||
self.curHeroName.text = self.heroConfig.ReadingName
|
||||
local pos = Vector3.New(self.gridPos.x,self.gridPos.y,self.gridPos.z)
|
||||
for i = 1,self.lv - 1 do
|
||||
pos.y = pos.y + GetPreferredHeight(self.gridList[i].go.transform)
|
||||
|
|
@ -60,19 +76,41 @@ function RoleGodSoulLayout:SetData(_sortinglayer,_parent,_curHerodata,_isUpZhen,
|
|||
end
|
||||
end
|
||||
|
||||
function RoleGodSoulLayout:UpdateGodList()
|
||||
if self.curHeroData.dynamicId then
|
||||
self.lv = GodSoulManager.GetGodSoulLv(self.curHeroData.dynamicId)
|
||||
self.addShow = true
|
||||
self.heroConfig = self.curHeroData.heroConfig
|
||||
function RoleGodSoulLayout:SetHeroData(heroGo,heroData,isCur)
|
||||
local frame = Util.GetGameObject(heroGo,"frame"):GetComponent("Image")
|
||||
local icon = Util.GetGameObject(heroGo,"icon"):GetComponent("Image")
|
||||
local proIcon = Util.GetGameObject(heroGo,"proIcon"):GetComponent("Image")
|
||||
local starGrid = Util.GetGameObject(heroGo,"star")
|
||||
if self.addShow then
|
||||
if isCur then
|
||||
local lv = Util.GetGameObject(heroGo,"lv/Text"):GetComponent("Text")
|
||||
lv.text = heroData.lv
|
||||
end
|
||||
frame.sprite = self.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
|
||||
proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
|
||||
SetHeroIcon(self.spLoader,heroData,icon,heroData.heroConfig)
|
||||
local star,starType = heroData.GetStar(1)
|
||||
local starSize = Vector2.New(30,30)
|
||||
local starScale = -8
|
||||
if starType == 3 then
|
||||
starSize = Vector2.New(33.43,83.61)
|
||||
starScale = -13.77
|
||||
end
|
||||
SetHeroStars(self.spLoader, starGrid, star,starType,starSize,starScale)
|
||||
else
|
||||
self.lv = 0
|
||||
self.addShow = false
|
||||
self.heroConfig = self.curHeroData
|
||||
local lv = Util.GetGameObject(heroGo,"lv/Text"):GetComponent("Text")
|
||||
lv.text = heroData.Level
|
||||
frame.sprite = self.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.Quality,heroData.star))
|
||||
proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(heroData.PropertyName))
|
||||
SetHeroIcon(self.spLoader,heroData,icon,heroData)
|
||||
SetHeroStars(self.spLoader, starGrid, heroData.Star,1)
|
||||
end
|
||||
end
|
||||
|
||||
function RoleGodSoulLayout:UpdateGodList()
|
||||
|
||||
|
||||
self.godDatas = GodSoulManager.GetGodSoulDataByLv(self.heroConfig.Id,0)
|
||||
|
||||
if not self.gridList then
|
||||
self.gridList = {}
|
||||
end
|
||||
|
|
@ -92,6 +130,13 @@ function RoleGodSoulLayout:UpdateGodList()
|
|||
self.gridList[i].red = Util.GetGameObject(self.gridList[i].add,"red")
|
||||
self.gridList[i].red.gameObject:SetActive(false)
|
||||
self.gridList[i].des = Util.GetGameObject(self.gridList[i].go,"bottom/des"):GetComponent("Text")
|
||||
self.gridList[i].upHero = Util.GetGameObject(self.gridList[i].go,"upHero")
|
||||
self.gridList[i].upHeroList = {}
|
||||
end
|
||||
if self.addShow then
|
||||
self.gridList[i].upHeroDataList = GodSoulManager.GetBindHeroDatasByLevel(self.curHeroData.dynamicId,i)
|
||||
else
|
||||
self.gridList[i].upHeroDataList = {}
|
||||
end
|
||||
self.gridList[i].go.gameObject:SetActive(true)
|
||||
self:UpdataSingleGod(i)
|
||||
|
|
@ -111,8 +156,9 @@ function RoleGodSoulLayout:UpdataSingleGod(index)
|
|||
end
|
||||
end
|
||||
--绿色
|
||||
|
||||
self.gridList[index].tip.text = string.format("<color=#B5AA95>需要:</color>")
|
||||
for i = 1,math.max(#self.gridList[index].costList,#self.godDatas[index]) do
|
||||
--LogGreen("#self.godDatas[index]:"..#self.godDatas[index])
|
||||
if not self.godDatas[index][i] then
|
||||
self.gridList[index].costList[i].go.gameObject:SetActive(false)
|
||||
else
|
||||
|
|
@ -146,7 +192,7 @@ function RoleGodSoulLayout:UpdataSingleGod(index)
|
|||
if not self.addShow then
|
||||
self.gridList[index].costList[i].num.text = string.format("<color=#B5AA95>×%s</color>",self.godDatas[index][i].num)
|
||||
Util.SetGray(self.gridList[index].costList[i].frame.gameObject,false)
|
||||
elseif index == self.lv + 1 then --未激活时红色,图标置灰
|
||||
elseif index >= self.lv + 1 then --未激活时红色,图标置灰
|
||||
self.gridList[index].costList[i].num.text = string.format("<color=#FF0000>×%s</color>",self.godDatas[index][i].num)
|
||||
Util.SetGray(self.gridList[index].costList[i].frame.gameObject,true)
|
||||
else --激活时绿色,图标不置灰
|
||||
|
|
@ -155,17 +201,39 @@ function RoleGodSoulLayout:UpdataSingleGod(index)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
if self.addShow then
|
||||
if #self.gridList[index].upHeroDataList < 1 then
|
||||
self.gridList[index].upHero.gameObject:SetActive(false)
|
||||
else
|
||||
self.gridList[index].upHero.gameObject:SetActive(true)
|
||||
for i = 1,math.max(#self.gridList[index].upHeroList,#self.gridList[index].upHeroDataList) do
|
||||
if not self.gridList[index].upHeroDataList[i] then
|
||||
self.gridList[index].upHeroList[i].gameObject:SetActive(false)
|
||||
else
|
||||
if not self.gridList[index].upHeroList[i] then
|
||||
self.gridList[index].upHeroList[i] = newObjToParent(self.heroPre,self.gridList[index].upHero)
|
||||
end
|
||||
self.gridList[index].upHeroList[i].gameObject:SetActive(true)
|
||||
local tempHeroData = HeroManager.GetSingleHeroData(self.gridList[index].upHeroDataList[i])
|
||||
self:SetHeroData(self.gridList[index].upHeroList[i],tempHeroData,false)
|
||||
Util.AddOnceClick(self.gridList[index].upHeroList[i],function()
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.ShenHun,self.godDatas[index],self.curHeroData,index,i)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
self.gridList[index].upHero.gameObject:SetActive(false)
|
||||
end
|
||||
|
||||
self.gridList[index].red.gameObject:SetActive(false)
|
||||
if not self.addShow then
|
||||
self.gridList[index].tip.text = "<color=#B5AA95>需要:</color>" --未解锁红色
|
||||
self.gridList[index].costGrid.gameObject:SetActive(true)
|
||||
self.gridList[index].add.gameObject:SetActive(false)
|
||||
Util.SetGray(self.gridList[index].godGrid,false)
|
||||
--Util.SetGray(self.gridList[index].des.gameObject,false)
|
||||
self.gridList[index].des.text = string.format("<color=#B5AA95>%s</color>",self.godDatas[index].skill) --神魂效果 绿色 未激活时置灰
|
||||
elseif index <= self.lv + 1 then
|
||||
self.gridList[index].tip.text = "<color=#B5AA95>需要:</color>" --未解锁红色
|
||||
self.gridList[index].costGrid.gameObject:SetActive(true)
|
||||
self.gridList[index].add.gameObject:SetActive(true)
|
||||
if index == self.lv + 1 then
|
||||
Util.SetGray(self.gridList[index].godGrid,true) --勾魂图标 未激活时置灰
|
||||
|
|
@ -180,10 +248,8 @@ function RoleGodSoulLayout:UpdataSingleGod(index)
|
|||
end
|
||||
Util.SetGray(self.gridList[index].add,false)
|
||||
else
|
||||
self.gridList[index].costGrid.gameObject:SetActive(false)
|
||||
self.gridList[index].add.gameObject:SetActive(true)
|
||||
--红色
|
||||
self.gridList[index].tip.text = string.format("<color=#FF0000>激活%s级神魂后解锁:</color>",index - 1)
|
||||
Util.SetGray(self.gridList[index].godGrid,true)
|
||||
--Util.SetGray(self.gridList[index].des.gameObject,true)
|
||||
self.gridList[index].des.text = string.format("<color=#B5AA95>%s</color>",self.godDatas[index].skill) --神魂效果 绿色 未激活时置灰
|
||||
|
|
@ -194,7 +260,7 @@ function RoleGodSoulLayout:UpdataSingleGod(index)
|
|||
if index <= self.lv + 1 then
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.ShenHun,self.godDatas[index],self.curHeroData,index)
|
||||
else
|
||||
PopupTipPanel.ShowTip("所选神魂尚未解锁!")
|
||||
PopupTipPanel.ShowTip("需要激活上一个神魂才可解锁!")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
@ -203,8 +269,12 @@ function RoleGodSoulLayout:OnHide()
|
|||
self.gameObject:SetActive(false)
|
||||
end
|
||||
|
||||
function RoleGodSoulLayout:OnClose()
|
||||
function RoleGodSoulLayout:OnDestroy()
|
||||
self.gridList = {}
|
||||
end
|
||||
|
||||
function RoleGodSoulLayout:OnClose()
|
||||
self.gameObject:SetActive(false)
|
||||
end
|
||||
|
||||
return RoleGodSoulLayout
|
||||
|
|
@ -98,13 +98,15 @@ function RoleInfoPanel:InitComponent()
|
|||
this.lockImage:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_tongyong_suoding_zh")
|
||||
this.unlockImage=Util.GetGameObject(this.lockBtn.transform,"unlock")
|
||||
this.unlockImage:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_tongyong_jiesuo_zh")
|
||||
this.talentBtn=Util.GetGameObject(self.transform,"talentBtn")
|
||||
this.talentProgress=Util.GetGameObject(self.transform,"talentBtn/progress"):GetComponent("Text")
|
||||
this.talentTipStr=Util.GetGameObject(self.transform,"talentBtn/tipStr"):GetComponent("Text")
|
||||
this.talentTipStrGo=Util.GetGameObject(self.transform,"talentBtn/tipStr")
|
||||
this.talentBtn=Util.GetGameObject(self.transform,"leftGrid/talentBtn")
|
||||
this.talentBtnIcon=Util.GetGameObject(this.talentBtn,"icon"):GetComponent("Image")
|
||||
this.talentProgress=Util.GetGameObject(this.talentBtn,"progress"):GetComponent("Text")
|
||||
this.talentTipStr=Util.GetGameObject(this.talentBtn,"tipStr"):GetComponent("Text")
|
||||
this.talentTipStrGo=Util.GetGameObject(this.talentBtn,"tipStr")
|
||||
--神印
|
||||
this.imprintBtn=Util.GetGameObject(self.transform,"imprintBtn")
|
||||
this.imprintImg=Util.GetGameObject(self.transform,"imprintBtn/Image"):GetComponent("Image")
|
||||
this.imprintBtn=Util.GetGameObject(self.transform,"leftGrid/imprintBtn")
|
||||
this.imprintBtnIcon=Util.GetGameObject(this.imprintBtn,"icon"):GetComponent("Image")
|
||||
this.imprintImg=Util.GetGameObject(this.imprintBtn,"Image"):GetComponent("Image")
|
||||
|
||||
this.force = Util.GetGameObject(self.transform, "powerBtn/value"):GetComponent("Text")
|
||||
Util.GetGameObject(self.transform, "powerBtn"):GetComponent("Image").sprite = this.spLoader:LoadSprite("t_tongyong-zhanli_zh")
|
||||
|
|
@ -137,6 +139,12 @@ function RoleInfoPanel:InitComponent()
|
|||
|
||||
this.btnMask = Util.GetGameObject(self.transform, "btnMask")
|
||||
this.btnMask.gameObject:SetActive(false)
|
||||
|
||||
|
||||
--神魂
|
||||
this.godSoulBtn=Util.GetGameObject(self.transform,"leftGrid/godSoulBtn")
|
||||
this.godSoulBtnIcon=Util.GetGameObject(this.godSoulBtn,"icon"):GetComponent("Image")
|
||||
this.godSoulBtnRed=Util.GetGameObject(this.godSoulBtn,"redPoint"):GetComponent("Image")
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
|
|
@ -230,6 +238,9 @@ function RoleInfoPanel:BindEvent()
|
|||
Util.AddClick(this.talentBtn,function()
|
||||
UIManager.OpenPanel(UIName.RoleTalentPopup,curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
|
||||
end)
|
||||
Util.AddClick(this.godSoulBtn,function()
|
||||
UIManager.OpenPanel(UIName.RoleGodSoulLayout,curHeroData)
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
|
|
@ -259,7 +270,7 @@ function RoleInfoPanel:OnOpen(_curHeroData, _heroDatas,_isUpZhen,_index)
|
|||
if _index and _index > 0 then
|
||||
_CurPageIndex = _index
|
||||
else
|
||||
_CurPageIndex = 1
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -454,7 +465,7 @@ function this:UpdateBtnList()
|
|||
elseif k == RoleInfoPanelIndex.shenhun then
|
||||
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.shenhun)
|
||||
and curHeroData.heroConfig.IsSoulOpen == 1 and curHeroData.star > 10 then
|
||||
tabsList[k].gameObject:SetActive(true)
|
||||
tabsList[k].gameObject:SetActive(false)
|
||||
else
|
||||
tabsList[k].gameObject:SetActive(false)
|
||||
end
|
||||
|
|
@ -510,9 +521,9 @@ function this:SetSelectBtn(index)
|
|||
this.selectBtn.transform.localPosition=Vector3.zero
|
||||
this.selectBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_hero_xuanze_001")
|
||||
Util.GetGameObject(this.selectBtn.transform, "Text"):GetComponent("Text").text = GetCurLanguage() == 0 and tabs[index].title or "<size=45>"..tabs[index].title.."</size>"--tabs[index].title--
|
||||
Util.GetGameObject(self.transform,"talentBtn/tipStr"):SetActive(false)
|
||||
this.talentTipStrGo:SetActive(false)
|
||||
if index == RoleInfoPanelIndex.jinjie then
|
||||
Util.GetGameObject(self.transform,"talentBtn/tipStr"):SetActive(true)
|
||||
this.talentTipStrGo:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -549,23 +560,24 @@ function this:UpdateHeroInfoData()
|
|||
end
|
||||
end
|
||||
if LengthOfTable(HeoSkin) < 2 then
|
||||
_CurPageIndex = 1
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
end
|
||||
elseif _CurPageIndex == RoleInfoPanelIndex.jinjie then
|
||||
if (curHeroData.star == 10 and curHeroData.heroConfig.MaxRank > curHeroData.star and ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.RoleAwake))
|
||||
or (not (curHeroData.star < 10)) then
|
||||
_CurPageIndex = 1
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
end
|
||||
elseif _CurPageIndex == RoleInfoPanelIndex.juexing then
|
||||
if (curHeroData.star < 10) or
|
||||
not (curHeroData.star == 10 and curHeroData.heroConfig.MaxRank > curHeroData.star and ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.RoleAwake)) then
|
||||
_CurPageIndex = 1
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
end
|
||||
elseif _CurPageIndex == RoleInfoPanelIndex.shenhun then
|
||||
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.shenhun)
|
||||
and curHeroData.heroConfig.IsSoulOpen == 1 and curHeroData.star > 10 then
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
else
|
||||
_CurPageIndex = 1
|
||||
_CurPageIndex = RoleInfoPanelIndex.qingbao
|
||||
end
|
||||
end
|
||||
this:SetSelectBtn(_CurPageIndex)
|
||||
|
|
@ -657,7 +669,7 @@ function this:UpdateHeroInfoData()
|
|||
--天赋
|
||||
this.talentBtn:SetActive(curHeroData.heroConfig.OpenPassiveSkillRules ~= nil)
|
||||
local talentBtnImage = curHeroData.star == HeroManager.awakeNextStarIndex and "r_hero_tianfu2_zh" or "r_hero_tianfu1_zh"
|
||||
this.talentBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite(talentBtnImage)
|
||||
this.talentBtnIcon.sprite = this.spLoader:LoadSprite(talentBtnImage)
|
||||
local OpenPassiveSkillRules = curHeroData.star == HeroManager.awakeNextStarIndex and curHeroData.heroConfig.Awaken or curHeroData.heroConfig.OpenPassiveSkillRules
|
||||
if OpenPassiveSkillRules then
|
||||
local openlists,compoundOpenNum,compoundNum,allUpStarOpenData = HeroManager.GetAllPassiveSkillIds(curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
|
||||
|
|
@ -688,6 +700,10 @@ function this:UpdateHeroInfoData()
|
|||
this.imprintBtn:SetActive(false)
|
||||
end
|
||||
ForceRebuildLayout(this.starGrid.transform)
|
||||
|
||||
this.godSoulBtn.gameObject:SetActive(ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.shenhun) and curHeroData.heroConfig.IsSoulOpen == 1 and curHeroData.star > 10)
|
||||
local upStarRedPointState = GodSoulManager.CheckRedPointGodSoul(curHeroData)
|
||||
this.godSoulBtnRed.gameObject:SetActive(upStarRedPointState)
|
||||
end
|
||||
|
||||
function this:ChangeCurentHeroSkinLive(herodata)
|
||||
|
|
|
|||
Loading…
Reference in New Issue