2021-11-09 11:42:19 +08:00
require ( " Base/BasePanel " )
local RewardTalismanSingleShowPopup2 = Inherit ( BasePanel )
local itemConfig = ConfigManager.GetConfig ( ConfigName.ItemConfig )
local propertyConfig = ConfigManager.GetConfig ( ConfigName.PropertyConfig )
2021-11-09 17:06:47 +08:00
local spcialConfig = ConfigManager.GetConfig ( ConfigName.SpecialConfig )
2021-11-09 11:42:19 +08:00
local passiveSkillConfig = ConfigManager.GetConfig ( ConfigName.PassiveSkillConfig )
2023-02-17 19:43:00 +08:00
local equipConfigData
2021-11-09 17:06:47 +08:00
local isGongMing = false
2021-11-09 11:42:19 +08:00
local typeToUpdate = {
2021-11-09 17:06:47 +08:00
-- [1] = 3,--已穿戴->卸载单件
2021-11-09 11:42:19 +08:00
[ 2 ] = 2 , --已穿戴->卸载单件
[ 3 ] = 1 , --未穿戴->穿单件
[ 4 ] = 3 , --未穿戴->替换单件
}
--初始化组件(用于子类重写)
function RewardTalismanSingleShowPopup2 : InitComponent ( )
self.spLoader = SpriteLoader.New ( )
self.mask = Util.GetGameObject ( self.transform , " mask " )
self.content = Util.GetGameObject ( self.transform , " Content " )
2021-11-09 14:39:27 +08:00
self.textPre = Util.GetGameObject ( self.transform , " TextPre " )
2022-11-18 17:35:05 +08:00
self.skillPre = Util.GetGameObject ( self.transform , " proPre " )
2021-11-09 14:39:27 +08:00
self.linePre = Util.GetGameObject ( self.transform , " line " )
--topBar
2021-11-09 11:42:19 +08:00
self.topBar = Util.GetGameObject ( self.transform , " Content/topBar " )
2021-11-09 14:39:27 +08:00
--装备详情
2021-11-09 11:42:19 +08:00
self.eqiopName = Util.GetGameObject ( self.topBar , " name " ) : GetComponent ( " Text " )
self.icon = Util.GetGameObject ( self.topBar , " icon " )
self.equipType = Util.GetGameObject ( self.topBar , " equipType " ) : GetComponent ( " Text " )
self.equipQuaText = Util.GetGameObject ( self.topBar , " equipQuaText " ) : GetComponent ( " Text " )
self.equipInfoText = Util.GetGameObject ( self.topBar , " equipInfoText " ) : GetComponent ( " Text " )
self.powerNum = Util.GetGameObject ( self.topBar , " powerNum " ) : GetComponent ( " Text " )
2021-11-09 17:35:27 +08:00
self.powerNumUpDown = Util.GetGameObject ( self.topBar , " powerUPorDown " ) : GetComponent ( " Image " )
2021-11-09 14:39:27 +08:00
2021-11-09 11:42:19 +08:00
--装备属性--midBar
2021-11-09 17:06:47 +08:00
self.mid = Util.GetGameObject ( self.transform , " Content/midBar " )
2021-11-09 14:39:27 +08:00
self.midBar = Util.GetGameObject ( self.transform , " Content/midBar/Grid " )
--baseAttri
self.baseAttri = Util.GetGameObject ( self.midBar , " baseAttri " )
2022-11-18 17:35:05 +08:00
self.skillPro = Util.GetGameObject ( self.midBar , " suitPro " )
self.skillGrid = Util.GetGameObject ( self.midBar , " suitPro/proGrid " )
2021-11-09 14:39:27 +08:00
self.baseName = Util.GetGameObject ( self.baseAttri , " baseName/attriName " ) : GetComponent ( " Text " )
self.baseLevel = Util.GetGameObject ( self.baseAttri , " baseName/attriNum " ) : GetComponent ( " Text " )
self.baseGrid = Util.GetGameObject ( self.baseAttri , " grid " )
self.baseMaster = Util.GetGameObject ( self.midBar , " baseMasterAttri " )
self.baseMasterName = Util.GetGameObject ( self.baseMaster , " baseMaster/attriName " ) : GetComponent ( " Text " )
self.baseMasterGrid = Util.GetGameObject ( self.baseMaster , " gridMaster " )
--refineAttri
self.refineAttri = Util.GetGameObject ( self.midBar , " refineAttri " )
self.refineName = Util.GetGameObject ( self.refineAttri , " refineName/attriName " ) : GetComponent ( " Text " )
self.refineLevel = Util.GetGameObject ( self.refineAttri , " refineName/attriNum " ) : GetComponent ( " Text " )
self.refineGrid = Util.GetGameObject ( self.refineAttri , " grid " )
2021-11-09 17:06:47 +08:00
self.refineMaster = Util.GetGameObject ( self.midBar , " refineMasterAttri " )
self.refineMasterName = Util.GetGameObject ( self.refineMaster , " refineMaster/attriName " ) : GetComponent ( " Text " )
self.refineMasterGrid = Util.GetGameObject ( self.refineMaster , " gridMaster " )
2021-11-09 14:39:27 +08:00
--treeAttri
self.treeAttri = Util.GetGameObject ( self.midBar , " treeAttri " )
self.treeName = Util.GetGameObject ( self.treeAttri , " treeName/attriName " ) : GetComponent ( " Text " )
self.treeLevel = Util.GetGameObject ( self.treeAttri , " treeName/attriNum " ) : GetComponent ( " Text " )
self.treeGrid = Util.GetGameObject ( self.treeAttri , " grid " )
2023-02-17 19:43:00 +08:00
self.skillNameInfo = Util.GetGameObject ( self.midBar , " suitPro/PropertyName " ) : GetComponent ( " Text " )
2021-11-09 11:42:19 +08:00
--分解按钮--btmBar
self.btmBar = Util.GetGameObject ( self.transform , " Content/btmBar " )
self.howGet = Util.GetGameObject ( self.btmBar , " howGet " )
self.btnGrid = Util.GetGameObject ( self.btmBar , " btnGrid " )
self.btnSure = Util.GetGameObject ( self.btnGrid , " btnSure " )
self.btnJump = Util.GetGameObject ( self.btnGrid , " btnJump " )
self.btnWear = Util.GetGameObject ( self.btnGrid , " btnWear " )
self.btnDown = Util.GetGameObject ( self.btnGrid , " btnDown " )
self.btnSwitch = Util.GetGameObject ( self.btnGrid , " btnSwitch " )
2021-11-09 14:39:27 +08:00
self.btnUpgrade = Util.GetGameObject ( self.btnGrid , " btnUpgrade " )
2023-02-19 20:08:48 +08:00
self.btnUpgradeTxt = Util.GetGameObject ( self.btnGrid , " btnUpgrade/Text " ) : GetComponent ( " Text " )
2021-11-09 14:39:27 +08:00
self.btnUpstar = Util.GetGameObject ( self.btnGrid , " btnUpstar " )
2023-02-19 20:08:48 +08:00
self.btnUpstarTxt = Util.GetGameObject ( self.btnGrid , " btnUpstar/Text " ) : GetComponent ( " Text " )
2022-09-06 10:16:57 +08:00
self.btnShenYing = Util.GetGameObject ( self.btnGrid , " btnShenYing " )
2021-11-09 17:06:47 +08:00
self.upgradeRed = Util.GetGameObject ( self.btnUpgrade , " red " )
self.upstarRed = Util.GetGameObject ( self.btnUpstar , " red " )
2022-09-06 10:16:57 +08:00
self.shenyingRed = Util.GetGameObject ( self.btnShenYing , " red " )
2021-11-09 11:42:19 +08:00
--装备获取途径--btmBar
self.canGetPre = Util.GetGameObject ( self.btmBar , " scroll/canGetPre " )
self.canGetGrid = Util.GetGameObject ( self.btmBar , " scroll " )
self.canGetScrollView = SubUIManager.Open ( SubUIConfig.ScrollCycleView , self.canGetGrid . transform , self.canGetPre , nil ,
Vector2.New ( self.canGetGrid . transform.rect . width , self.canGetGrid . transform.rect . height ) , 1 , 1 , Vector2.New ( 0 , 0 ) )
self.canGetScrollView . moveTween.MomentumAmount = 1
self.canGetScrollView . moveTween.Strength = 2
self.canGetScrollView . elastic = false
2021-11-09 14:39:27 +08:00
--跳转itemlist
2021-11-09 11:42:19 +08:00
self.jumpViewList = { }
2021-11-09 14:39:27 +08:00
--装备icon
self.itemPre = nil
self.BaseAttriList = { } --基础属性对象
self.RefineAttriList = { } --精炼属性对象
2021-11-09 17:06:47 +08:00
self.TreeAttriList = { } --神应属性对象
self.TreeAttriList2 = { } --神应属性对象2
self.BaseMasterList = { } --强化大师
self.RefineMasterList = { } --精炼大师
2022-11-18 17:35:05 +08:00
self.skillList = { } --技能属性
2021-11-09 11:42:19 +08:00
end
--绑定事件(用于子类重写)
function RewardTalismanSingleShowPopup2 : BindEvent ( )
Util.AddClick ( self.mask , function ( )
PlaySoundWithoutClick ( SoundConfig.Sound_UICancel )
self : ClosePanel ( )
end )
--跳转
Util.AddClick ( self.btnJump , function ( )
JumpManager.GoJump ( 22001 )
end )
--分解
Util.AddClick ( self.btnSure , function ( )
self : ClosePanel ( )
JumpManager.GoJump ( 24005 )
end )
--穿戴
Util.AddClick ( self.btnWear , function ( )
2023-02-17 19:43:00 +08:00
local config
if self.position > 6 then
if equipConfigData.Profession ~= 0 then
if self.curHeroData . heroConfig.Profession ~= equipConfigData.Profession then
PopupTipPanel.ShowTip ( " 该英雄无法装备此法相 " )
return
end
2023-02-21 14:20:46 +08:00
if not CheckListIsContainValue1 ( equipConfigData.Job , self.curHeroData . heroConfig.Job ) then
2023-02-17 19:43:00 +08:00
PopupTipPanel.ShowTip ( " 该英雄无法装备此法相 " )
return
end
end
else
config = spcialConfig [ 40 ]
end
2021-11-09 17:06:47 +08:00
if config then
local limits = string.split ( config.Value , " | " )
if limits then
local heroConfig = ConfigManager.GetConfigData ( ConfigName.HeroConfig , self.curHeroData . id )
local lvs = string.split ( limits [ 1 ] , " # " )
local stars = string.split ( limits [ 2 ] , " # " )
local lv = tonumber ( lvs [ 2 ] )
if PlayerManager.level < lv then
PopupTipPanel.ShowTip ( string.format ( Language [ 11801 ] , lv ) )
return
else
local star = tonumber ( stars [ 2 ] )
if heroConfig ~= nil and self.curHeroData . star < star then
PopupTipPanel.ShowTip ( string.format ( Language [ 11802 ] , star ) )
return
end
end
end
end
local equipIdList = { }
local equipDataList = { }
table.insert ( equipIdList , self.equipData . idDyn )
table.insert ( equipDataList , self.equipData )
2023-02-17 19:43:00 +08:00
--法相穿戴
if self.position > 6 then
2023-02-19 20:08:48 +08:00
NetManager.WearFaxiangEquipRequest ( self.curHeroData . dynamicId , equipIdList , 1 , function ( )
2023-02-17 19:43:00 +08:00
self : ClosePanel ( )
self.parent . UpdateEquipPosHeroData ( 3 , typeToUpdate [ self.openType ] , equipDataList , 0 , self.position )
2023-02-20 11:44:20 +08:00
HeroPropManager.SetDirtyByType ( self.curHeroData . dynamicId , Hero_Prop_Type.FaXiang )
2023-02-17 19:43:00 +08:00
end )
else
NetManager.EquipWearRequest ( self.curHeroData . dynamicId , equipIdList , 2 , function ( )
self : ClosePanel ( )
self.parent . UpdateEquipPosHeroData ( 2 , typeToUpdate [ self.openType ] , equipDataList , 0 , self.position )
end )
end
2021-11-09 11:42:19 +08:00
end )
--卸下
Util.AddClick ( self.btnDown , function ( )
2021-11-09 17:06:47 +08:00
local equipIdList = { }
local equipDataList = { }
table.insert ( equipIdList , self.equipData . idDyn )
table.insert ( equipDataList , self.equipData )
2023-02-17 19:43:00 +08:00
if self.position > 6 then
2023-02-19 20:08:48 +08:00
NetManager.WearFaxiangEquipRequest ( self.curHeroData . dynamicId , equipIdList , 2 , function ( )
2023-02-17 19:43:00 +08:00
self : ClosePanel ( )
self.parent . UpdateEquipPosHeroData ( 3 , typeToUpdate [ self.openType ] , equipDataList )
2023-02-20 11:44:20 +08:00
HeroPropManager.SetDirtyByType ( self.curHeroData . dynamicId , Hero_Prop_Type.FaXiang )
2023-02-17 19:43:00 +08:00
end )
else
NetManager.EquipUnLoadOptRequest ( self.curHeroData . dynamicId , equipIdList , 2 , function ( )
self : ClosePanel ( )
self.parent . UpdateEquipPosHeroData ( 2 , typeToUpdate [ self.openType ] , equipDataList )
end )
end
2021-11-09 11:42:19 +08:00
end )
--替换
Util.AddClick ( self.btnSwitch , function ( )
2021-11-09 17:06:47 +08:00
local equipIdList = { }
local equipDataList = { }
table.insert ( equipIdList , self.equipData . idDyn )
table.insert ( equipDataList , self.equipData )
2023-02-17 19:43:00 +08:00
if self.position > 6 then
if equipConfigData.Profession ~= 0 then
if self.curHeroData . heroConfig.Profession ~= equipConfigData.Profession then
PopupTipPanel.ShowTip ( " 该英雄无法装备此法相 " )
return
end
2023-02-21 14:20:46 +08:00
if not CheckListIsContainValue1 ( equipConfigData.Job , self.curHeroData . heroConfig.Job ) then
PopupTipPanel.ShowTip ( " 该英雄无法装备此法相 " )
return
2023-02-17 19:43:00 +08:00
end
end
2023-02-19 20:08:48 +08:00
NetManager.WearFaxiangEquipRequest ( self.curHeroData . dynamicId , equipIdList , 3 , function ( )
2023-02-17 19:43:00 +08:00
self : ClosePanel ( )
self.parent . UpdateEquipPosHeroData ( 3 , typeToUpdate [ self.openType ] , equipDataList , self.nextEquip , self.position )
2023-02-20 11:44:20 +08:00
HeroPropManager.SetDirtyByType ( self.curHeroData . dynamicId , Hero_Prop_Type.FaXiang )
2023-02-17 19:43:00 +08:00
end )
else
NetManager.EquipWearRequest ( self.curHeroData . dynamicId , equipIdList , 2 , function ( )
self : ClosePanel ( )
self.parent . UpdateEquipPosHeroData ( 2 , typeToUpdate [ self.openType ] , equipDataList , self.nextEquip , self.position )
end )
end
2021-11-09 17:06:47 +08:00
end )
Util.AddClick ( self.btnUpgrade , function ( )
2023-02-17 19:43:00 +08:00
if self.position > 6 then
UIManager.OpenPanel ( UIName.FaXiangStrongPopup , self.equipData , 1 )
self : ClosePanel ( )
2021-11-09 17:06:47 +08:00
else
2023-02-17 19:43:00 +08:00
if isGongMing then
PopupTipPanel.ShowTip ( Language [ 12184 ] )
else
UIManager.OpenPanel ( UIName.EquipTreasureStrongPopup , self.equipData , 1 )
self : ClosePanel ( )
end
2021-11-09 17:06:47 +08:00
end
2023-02-17 19:43:00 +08:00
2021-11-09 17:06:47 +08:00
end )
Util.AddClick ( self.btnUpstar , function ( )
2023-02-18 15:57:20 +08:00
if self.position > 6 then
UIManager.OpenPanel ( UIName.FaXiangStrongPopup , self.equipData , 2 )
else
UIManager.OpenPanel ( UIName.EquipTreasureStrongPopup , self.equipData , 2 )
end
2021-11-09 17:06:47 +08:00
self : ClosePanel ( )
2021-11-09 11:42:19 +08:00
end )
2022-09-06 10:16:57 +08:00
Util.AddClick ( self.btnShenYing , function ( )
UIManager.OpenPanel ( UIName.EquipTreasureStrongPopup , self.equipData , 3 )
self : ClosePanel ( )
end )
2021-11-09 11:42:19 +08:00
end
--添加事件监听(用于子类重写)
function RewardTalismanSingleShowPopup2 : AddListener ( )
end
--移除事件监听(用于子类重写)
function RewardTalismanSingleShowPopup2 : RemoveListener ( )
end
--界面打开时调用(用于子类重写)
function RewardTalismanSingleShowPopup2 : OnOpen ( _parent , _equipData , _openType , _isShowGet , _isShowGo , _curHeroData , _position , _targetEquipData , _func )
if not _equipData then
return
end
2021-11-09 14:39:27 +08:00
self.parent = _parent --父界面
self.equipData = _equipData --当前装备数据
self.openType = _openType --0不显示按钮、1背包、2已穿戴( 显示卸下) 、3未穿戴( 显示穿戴) 、4未穿戴( 显示替换)
2021-11-09 17:06:47 +08:00
self.isShowGet = _isShowGet
2021-11-09 14:39:27 +08:00
self.howGet : SetActive ( _isShowGet and true or false ) --是否显示获取途径
self.btnGrid : SetActive ( self.openType ~= 0 )
self.curHeroData = _curHeroData --装备了该装备的英雄数据
2021-11-09 17:06:47 +08:00
self.position = _position
2021-11-09 14:39:27 +08:00
self.nextEquip = _targetEquipData --要替换的目标装备
self.isShowGo = _isShowGo and _isShowGo or false --是否显示跳转按钮
self.func = _func
2021-11-09 11:42:19 +08:00
end
function RewardTalismanSingleShowPopup2 : SetBtns ( )
2023-02-18 15:52:52 +08:00
Log ( " self.equipData.id: " .. self.equipData . id )
2021-11-09 11:42:19 +08:00
local itemConfigData = ConfigManager.GetConfigData ( ConfigName.ItemConfig , tonumber ( self.equipData . id ) )
2021-11-09 17:06:47 +08:00
self.btnSure : SetActive ( itemConfigData.IfResolve == 1 and BagManager.isBagPanel )
2021-11-09 14:39:27 +08:00
self.btnJump : SetActive ( BagManager.isBagPanel )
2021-11-09 11:42:19 +08:00
self.btnWear : SetActive ( self.openType == 3 )
self.btnDown : SetActive ( self.openType == 2 )
self.btnSwitch : SetActive ( self.openType == 4 )
2021-11-09 14:39:27 +08:00
self.btnUpgrade : SetActive ( self.openType == 2 )
self.btnUpstar : SetActive ( self.openType == 2 )
2023-02-17 19:43:00 +08:00
self.btnShenYing : SetActive ( self.openType == 2 and CheckFunctionOpen ( 84 ) and self.position < 7 ) --对标建木神树功能开启
2023-02-19 20:08:48 +08:00
if self.position and self.position > 6 then
self.btnUpgradeTxt . text = " 升 级 "
self.btnUpstarTxt . text = " 升 星 "
else
self.btnUpgradeTxt . text = " 强 化 "
self.btnUpstarTxt . text = " 精 炼 "
end
2021-11-09 17:06:47 +08:00
if self.equipData and self.equipData ~= 0 then
isGongMing = HarmonyManager.IsInfo ( self.equipData . upHeroDid )
Util.SetGray ( self.btnUpgrade , isGongMing )
end
2021-11-09 11:42:19 +08:00
end
function RewardTalismanSingleShowPopup2 : OnShow ( )
2021-11-09 14:39:27 +08:00
self : SetBtns ( )
--=============================上部装备基础信息============================
2023-02-17 19:43:00 +08:00
--法相
if self.position > 6 then
equipConfigData = ConfigManager.GetConfigData ( ConfigName.FaxiangConfig , self.equipData . id )
else
equipConfigData = ConfigManager.GetConfigData ( ConfigName.JewelConfig , self.equipData . id )
end
2021-11-09 14:39:27 +08:00
local itemConfigData = ConfigManager.GetConfigData ( ConfigName.ItemConfig , self.equipData . id )
--魂灵宝Icon
if not self.itemPre then
self.itemPre = SubUIManager.Open ( SubUIConfig.ItemView , self.icon . transform )
end
self.itemPre : OnOpen ( false , { equipConfigData.Id , 0 } , 1 , false , false , false , 0 , self.equipData . idDyn )
--装备描述
self.equipInfoText . text = GetLanguageStrById ( itemConfigData.ItemDescribe )
--品质
2023-02-17 19:43:00 +08:00
self.equipQuaText . text = GetStringByEquipQua ( itemConfigData.Quantity , GetQuaStringByEquipQua ( itemConfigData.Quantity ) )
2021-11-09 14:39:27 +08:00
--装备名称
self.eqiopName . text = GetStringByEquipQua ( itemConfigData.Quantity , GetLanguageStrById ( itemConfigData.Name ) )
2023-02-17 19:43:00 +08:00
--上方底图
2023-11-07 15:56:30 +08:00
self.topBar : GetComponent ( " Image " ) . sprite = self.spLoader : LoadSprite ( " Bg_hz_beibao_pinjise_0 " .. itemConfigData.Quantity )
2023-02-17 19:43:00 +08:00
--计算战力
2021-11-09 14:39:27 +08:00
local Power = 0
2023-02-17 19:43:00 +08:00
if itemConfigData.ItemType == ItemType.FaXiang then
self.equipType . text = " 道具种类:法相 "
self.skillNameInfo . text = " 技能详情 "
Power = equipConfigData.Score
2021-11-09 14:39:27 +08:00
else
2023-02-17 19:43:00 +08:00
if not self.equipData . idDyn then
Power = EquipTreasureManager.CalculateWarForceBySid ( self.equipData . id , self.equipData . lv , self.equipData . refineLv , self.equipData . treeLv )
else
Power = EquipTreasureManager.CalculateWarForce ( self.equipData . idDyn )
end
self.skillNameInfo . text = " 精炼技能: "
self.equipType . text = string.format ( " 宝物类型:%s " , EquipTreasureTypeStr [ equipConfigData.Location ] )
2021-11-09 14:39:27 +08:00
end
2023-02-17 19:43:00 +08:00
2021-11-09 14:39:27 +08:00
self.powerNum . text = Power
2021-11-09 17:35:27 +08:00
if self.openType == 4 then
self.powerNumUpDown . gameObject : SetActive ( true )
local Power2 = EquipTreasureManager.CalculateWarForce ( self.nextEquip . idDyn )
if ( Power > Power2 ) then
self.powerNumUpDown . sprite = self.spLoader : LoadSprite ( PowerChangeIconDef [ 1 ] )
elseif ( Power < Power2 ) then
self.powerNumUpDown . sprite = self.spLoader : LoadSprite ( PowerChangeIconDef [ 2 ] )
else
self.powerNumUpDown . gameObject : SetActive ( false )
end
else
self.powerNumUpDown . gameObject : SetActive ( false )
end
2021-11-09 14:39:27 +08:00
--=============================中部========================================
2021-11-09 17:06:47 +08:00
2021-11-09 14:39:27 +08:00
--(基础属性)
2023-02-17 19:43:00 +08:00
local baseInfo = nil
local skills = nil
if self.position > 6 then
2023-02-20 18:49:34 +08:00
baseInfo = FaXiangManager.GetCurLvPropertyValue ( self.equipData . levelPool , self.equipData . lv , self.equipData . refinePool , self.equipData . refineLv )
2023-02-17 19:43:00 +08:00
self.treeAttri : SetActive ( false )
2021-11-09 14:39:27 +08:00
self.refineAttri : SetActive ( false )
2023-02-17 19:43:00 +08:00
if equipConfigData.PassiveSkill and # equipConfigData.PassiveSkill > 0 then
skills = { }
for i = 1 , # equipConfigData.PassiveSkill do
local skilldata = { }
skilldata.PassiveSkillId = equipConfigData.PassiveSkill [ i ] [ 1 ]
skilldata.Level = i - 1
table.insert ( skills , skilldata )
end
end
--skills=ConfigManager.TryGetAllConfigsDataByDoubleKey(ConfigName.JewelRankupConfig,"Type",2,"PoolID",equipConfigData.RankupPool)
2021-11-09 14:39:27 +08:00
else
2023-02-17 19:43:00 +08:00
baseInfo = EquipTreasureManager.GetCurLvPropertyValue ( 1 , self.equipData . levelPool , self.equipData . lv )
--(精炼属性)
local refineInfo = EquipTreasureManager.GetCurLvPropertyValue ( 2 , self.equipData . refinePool , self.equipData . refineLv , true )
self.refineLevel . text = string.format ( " [精炼等级:%s/%s] " , self.equipData . refineLv , self.equipData . maxRefineLv )
if LengthOfTable ( refineInfo ) == 0 or refineInfo == nil then
self.refineAttri : SetActive ( false )
else
self.refineAttri : SetActive ( true )
self : SetPropertyShow1 ( refineInfo , self.RefineAttriList , self.refineGrid )
end
--(神应属性)
local treeInfo = SacredTreeManager.GetCurLvPropertyValue ( 3 , self.equipData . treePool , self.equipData . treeLv or 0 )
self.treeLevel . text = string.format ( " [神应等级:%s/%s] " , self.equipData . treeLv , self.equipData . maxTreeLv )
if self.openType == 2 and CheckFunctionOpen ( 84 ) then
self.treeAttri : SetActive ( true )
self : SetPropertyShow2 ( treeInfo , self.TreeAttriList , self.treeGrid , self.TreeAttriList2 )
else
self.treeAttri : SetActive ( false )
end
--精炼技能
skills = ConfigManager.TryGetAllConfigsDataByDoubleKey ( ConfigName.JewelRankupConfig , " Type " , 2 , " PoolID " , equipConfigData.RankupPool )
2021-11-09 17:06:47 +08:00
end
2023-02-17 19:43:00 +08:00
self.baseLevel . text = string.format ( " [强化等级:%s/%s] " , self.equipData . lv , self.equipData . maxLv )
self : SetPropertyShow1 ( baseInfo , self.BaseAttriList , self.baseGrid )
2022-11-18 17:35:05 +08:00
if skills and # skills > 0 then
local skillIds = { }
local skillInfos = { }
for i = 1 , # skills do
if skills [ i ] . PassiveSkillId and skills [ i ] . PassiveSkillId > 0 then
if not BattleUtil.ChecklistIsContainValue ( skillIds , skills [ i ] . PassiveSkillId ) then
table.insert ( skillIds , skills [ i ] . PassiveSkillId )
table.insert ( skillInfos , { id = skills [ i ] . PassiveSkillId , lv = skills [ i ] . Level } )
LogError ( " skills[i].PassiveSkillId== " .. skills [ i ] . PassiveSkillId )
end
end
end
LogError ( " skillids== " .. # skillIds )
if # skillInfos > 0 then
self.skillPro : SetActive ( true )
self : SetSkillShow ( skillInfos , self.skillList , self.skillGrid , self.equipData . refineLv )
else
self.skillPro : SetActive ( false )
end
end
2021-11-09 17:06:47 +08:00
--大师属性
2023-02-20 11:23:50 +08:00
if self.equipData . upHeroDid == " " or self.equipData . upHeroDid == " 0 " or self.position > 6 then
2021-11-09 17:06:47 +08:00
self.baseMaster : SetActive ( false )
self.refineMaster : SetActive ( false )
else
--强化共鸣
self : GongMingSetData ( 1 , self.BaseMasterList , self.baseMasterGrid , self.baseMasterName , self.baseMaster )
--精炼共鸣
self : GongMingSetData ( 2 , self.RefineMasterList , self.refineMasterGrid , self.refineMasterName , self.refineMaster )
end
if self.openType == 2 then
2023-02-17 19:43:00 +08:00
if self.position > 6 then
2023-02-20 17:38:59 +08:00
self.upgradeRed : SetActive ( FaXiangManager.CheckIsShowRed ( self.equipData . idDyn , 1 ) )
self.upstarRed : SetActive ( FaXiangManager.CheckIsShowRed ( self.equipData . idDyn , 2 ) )
2023-02-17 19:43:00 +08:00
self.shenyingRed : SetActive ( false )
else
self.upgradeRed : SetActive ( HeroManager.CheckIsUpTreasure ( self.equipData . idDyn , 1 ) )
self.upstarRed : SetActive ( HeroManager.CheckIsUpTreasure ( self.equipData . idDyn , 2 ) )
self.shenyingRed : SetActive ( HeroManager.CheckIsUpTreasure ( self.equipData . idDyn , 3 ) )
end
2021-11-09 14:39:27 +08:00
end
2021-11-09 11:42:19 +08:00
2021-11-09 14:39:27 +08:00
--=============================下部=========================================
--获取途径
if self.jumpViewList and # self.jumpViewList > 0 then
for i = 1 , # self.jumpViewList do
SubUIManager.Close ( self.jumpViewList [ i ] )
end
end
local curitemData = itemConfig [ tonumber ( self.equipData . id ) ]
if curitemData and curitemData.Jump then
if curitemData.Jump and # curitemData.Jump > 0 then
self.canGetScrollView : SetData ( curitemData.Jump , function ( index , item )
local tempView = nil
if self.isShowGo then
tempView = SubUIManager.Open ( SubUIConfig.JumpView , item.transform , curitemData.Jump [ index ] , true )
else
tempView = SubUIManager.Open ( SubUIConfig.JumpView , item.transform , curitemData.Jump [ index ] , false )
end
table.insert ( self.jumpViewList , tempView )
end , true , true )
end
end
2021-11-09 11:42:19 +08:00
2021-11-09 14:39:27 +08:00
--(此处需要三遍才能完全打开)
ForceRebuildLayout ( self.midBar . transform )
ForceRebuildLayout ( self.midBar . transform )
ForceRebuildLayout ( self.midBar . transform )
2021-11-12 11:26:02 +08:00
2021-11-09 14:39:27 +08:00
2021-11-12 11:26:02 +08:00
local maxHeight = self.isShowGet and 250 or 850
local sizeDelta = GetPreferredHeight ( self.midBar . transform )
if sizeDelta >= maxHeight then
self.mid : GetComponent ( " LayoutElement " ) . minHeight = maxHeight
2021-11-12 11:14:26 +08:00
else
2021-11-12 11:26:02 +08:00
self.mid : GetComponent ( " LayoutElement " ) . minHeight = sizeDelta
2021-11-12 11:14:26 +08:00
end
2021-11-12 11:26:02 +08:00
2021-11-09 14:39:27 +08:00
if self.func then
self.func ( )
end
end
2022-11-18 17:35:05 +08:00
function RewardTalismanSingleShowPopup2 : SetSkillShow ( _infos , _preList , _grid , _lv )
local dataCount = LengthOfTable ( _infos )
local preCount =# _preList
for i = 1 , dataCount - preCount do
local go = newObject ( self.skillPre )
go.transform : SetParent ( _grid.transform )
go.transform . localScale = Vector3.one
go.transform . localPosition = Vector3.zero
go.gameObject : SetActive ( false )
table.insert ( _preList , go )
end
local index = 1
for key , value in pairs ( _infos ) do
local obj = _preList [ index ]
local proper = passiveSkillConfig [ value.id ]
local str = " "
2023-02-17 19:43:00 +08:00
if self.position > 6 then
if value.lv <= _lv then
str = " <color=#66FF00> " .. proper.Desc .. " ( " .. value.lv .. " 星解锁) " .. " </color> "
else
str = " <color=#828282> " .. proper.Desc .. " ( " .. value.lv .. " 星解锁) " .. " </color> "
end
2022-11-18 17:35:05 +08:00
else
2023-02-17 19:43:00 +08:00
if value.lv <= _lv then
str = " <color=#66FF00> " .. proper.Desc .. " (精炼 " .. value.lv .. " 级解锁) " .. " </color> "
else
str = " <color=#828282> " .. proper.Desc .. " (精炼 " .. value.lv .. " 级解锁) " .. " </color> "
end
2022-11-18 17:35:05 +08:00
end
2023-02-17 19:43:00 +08:00
2022-11-18 17:35:05 +08:00
obj : GetComponent ( " Text " ) . text = str
obj.gameObject : SetActive ( true )
index = index + 1
end
for i = 1 , # _preList do
if i >= index then
_preList [ i ] : SetActive ( false )
end
end
end
2021-11-09 14:39:27 +08:00
--基础和精炼属性专用
function RewardTalismanSingleShowPopup2 : SetPropertyShow1 ( _infos , _preList , _grid )
local dataCount = LengthOfTable ( _infos )
local preCount =# _preList
for i = 1 , dataCount - preCount do
local go = newObject ( self.textPre )
go.transform : SetParent ( _grid.transform )
go.transform . localScale = Vector3.one
go.transform . localPosition = Vector3.zero
go.gameObject : SetActive ( false )
table.insert ( _preList , go )
end
local index = 1
for key , value in pairs ( _infos ) do
local obj = _preList [ index ]
local proper = propertyConfig [ key ]
if proper.Style == 1 then
obj.transform : GetComponent ( " Text " ) . text = GetLanguageStrById ( proper.Info ) .. " + " .. value.currValue
else
obj.transform : GetComponent ( " Text " ) . text = GetLanguageStrById ( proper.Info ) .. " + " .. value.currValue / 100 .. " % "
end
obj.gameObject : SetActive ( true )
index = index + 1
end
for i = 1 , # _preList do
if i >= index then
_preList [ i ] : SetActive ( false )
end
end
end
--神应专用
function RewardTalismanSingleShowPopup2 : SetPropertyShow2 ( _infos , _preList , _grid , _preList2 )
local curTree = SacredTreeManager.CulAttri ( self.equipData )
local attriConfig = ConfigManager.GetConfigDataByKey ( ConfigName.GodHoodTreeSetting , " Id " , 0 ) . PropertyUnlcokLevelForClient
local dataCount = LengthOfTable ( _infos )
local preCount =# _preList ---行数
for i = 1 , math.ceil ( dataCount / 2 ) - preCount do
local go = newObject ( self.linePre )
go.transform : SetParent ( _grid.transform )
go.transform . localScale = Vector3.one
go.transform . localPosition = Vector3.zero
go.gameObject : SetActive ( false )
table.insert ( _preList , go )
end
preCount = # _preList2
for i = 1 , dataCount - preCount do
local go = newObject ( self.textPre )
table.insert ( _preList2 , go )
go.transform : SetParent ( _preList [ math.ceil ( # _preList2 / 2 ) ] . transform )
go.transform . localScale = Vector3.one
go.transform . localPosition = Vector3.zero
go.gameObject : SetActive ( false )
end
local index = 1
for key , value in pairs ( attriConfig ) do
local obj = _preList2 [ index ]
_preList [ math.ceil ( index / 2 ) ] . gameObject : SetActive ( true )
local proper = propertyConfig [ value [ 1 ] ]
local string = " "
if _infos [ value [ 1 ] ] then
if proper.Style == 1 then
string = GetLanguageStrById ( proper.Info ) .. " + " .. _infos [ value [ 1 ] ] . currValue --value.currValue
else
string = GetLanguageStrById ( proper.Info ) .. " + " .. _infos [ value [ 1 ] ] . currValue / 100 .. " % "
end
end
if index <= curTree then
string = " <color=#66FF00> " .. string .. " </color> "
else
string = " <color=#828282> " .. string .. " \n " .. " <size=25> " .. string.format ( " (四灵试炼%s层解锁) " , attriConfig [ index ] [ 2 ] ) .. " </size></color> "
end
obj.transform : GetComponent ( " Text " ) . text = string
obj.gameObject : SetActive ( true )
index = index + 1
end
for i = 1 , # _preList2 do
if i >= index then
_preList2 [ i ] : SetActive ( false )
end
end
for i = 1 , # _preList do
if i > math.ceil ( index / 2 ) then
_preList [ i ] : SetActive ( false )
end
end
end
--大师判断
function RewardTalismanSingleShowPopup2 : GongMingSetData ( curTabIndex , proPreList , grid , title , go )
--获取穿戴宝物强化/精炼的最小等级
local minLv --最小等级
local maxlv --最大等级
2023-02-18 15:52:52 +08:00
if self.curHeroData == nil then
self.baseMaster : SetActive ( false )
self.refineMaster : SetActive ( false )
return
end
2021-11-09 17:06:47 +08:00
if # self.curHeroData . jewels < 2 then
2021-11-09 14:39:27 +08:00
go.gameObject : SetActive ( false )
return
end
go.gameObject : SetActive ( true )
2021-11-09 17:06:47 +08:00
for i = 1 , # self.curHeroData . jewels do
local curEquipTreasureData = EquipTreasureManager.GetTreasureData ( self.curHeroData . jewels [ i ] )
2021-11-09 14:39:27 +08:00
if curTabIndex == 1 then
if minLv then
if curEquipTreasureData.lv < minLv then
minLv = curEquipTreasureData.lv
end
else
minLv = curEquipTreasureData.lv
end
if maxlv then
if curEquipTreasureData.maxLv < maxlv then
maxlv = curEquipTreasureData.maxLv
end
else
maxlv = curEquipTreasureData.maxLv
end
elseif curTabIndex == 2 then
if minLv then
if curEquipTreasureData.refineLv < minLv then
minLv = curEquipTreasureData.refineLv
end
else
minLv = curEquipTreasureData.refineLv
end
if maxlv then
if curEquipTreasureData.maxRefineLv < maxlv then
maxlv = curEquipTreasureData.maxRefineLv
end
else
maxlv = curEquipTreasureData.maxRefineLv
end
end
end
local curJewelResonanceConfig = nil
local allCurTypeJewelResonanceConfig = ConfigManager.GetAllConfigsDataByKey ( ConfigName.JewelResonanceConfig , " Type " , curTabIndex )
table.sort ( allCurTypeJewelResonanceConfig , function ( a , b )
return a.SortId < b.SortId
end )
for i = 1 , # allCurTypeJewelResonanceConfig do
--获取当前强化/精炼 大师等级数据
if allCurTypeJewelResonanceConfig [ i ] . Level <= minLv then
if curJewelResonanceConfig then
if curJewelResonanceConfig.SortId < allCurTypeJewelResonanceConfig [ i ] . SortId then
curJewelResonanceConfig = allCurTypeJewelResonanceConfig [ i ]
end
else
curJewelResonanceConfig = allCurTypeJewelResonanceConfig [ i ]
end
end
end
2023-10-16 15:12:47 +08:00
if curJewelResonanceConfig and curJewelResonanceConfig.SortId < 1 then
2021-11-09 14:39:27 +08:00
go.gameObject : SetActive ( false )
return
end
go.gameObject : SetActive ( true )
2023-10-16 15:12:47 +08:00
-- if curTabIndex == 1 then
-- title.text = string.format("<color=#FE2F33>强化大师%s级</color>",curJewelResonanceConfig.SortId)
-- else
-- title.text = string.format("<color=#FE2F33>精炼大师%s级</color>",curJewelResonanceConfig.SortId)
-- end
title.gameObject : SetActive ( false )
-- for i = 1, math.max(#curJewelResonanceConfig.Property,#proPreList) do
-- if not curJewelResonanceConfig.Property[i] then
-- proPreList[i].gameObject:SetActive(false)
-- else
-- if not proPreList[i] then
-- proPreList[i] = newObjToParent(self.textPre,grid.transform)
-- end
-- proPreList[i].gameObject:SetActive(true)
-- local str = GetLanguageStrById(propertyConfig[curJewelResonanceConfig.Property[i][1]].Info).."+"..GetPropertyFormatStr(propertyConfig[curJewelResonanceConfig.Property[i][1]].Style,curJewelResonanceConfig.Property[i][2])
-- proPreList[i].transform:GetComponent("Text").text = string.format("<color=#66FF00>%s</color>",str)
-- end
-- end
2021-11-09 14:39:27 +08:00
return true
2021-11-09 11:42:19 +08:00
end
--界面关闭时调用(用于子类重写)
function RewardTalismanSingleShowPopup2 : OnClose ( )
if self.jumpViewList then
for i = 1 , # self.jumpViewList do
destroy ( self.jumpViewList [ i ] . gameObject )
end
end
end
--界面销毁时调用(用于子类重写)
function RewardTalismanSingleShowPopup2 : OnDestroy ( )
self.spLoader : Destroy ( )
2021-11-09 14:39:27 +08:00
self.BaseAttriList = { } --基础属性对象
self.RefineAttriList = { } --精炼属性对象
2021-11-09 17:06:47 +08:00
self.TreeAttriList = { } --神应属性对象
self.TreeAttriList2 = { } --神应属性对象2
self.BaseMasterList = { } --强化大师
self.RefineMasterList = { } --精炼大师
2021-11-09 11:42:19 +08:00
self.jumpViewList = { }
2022-11-18 17:35:05 +08:00
self.skillList = { }
2021-11-09 14:39:27 +08:00
self.itemPre = nil
2021-11-09 11:42:19 +08:00
end
return RewardTalismanSingleShowPopup2