法相升级升星提交

dev_chengFeng
wangzhenxing 2023-02-18 22:21:24 +08:00
parent 8cb653fcb4
commit 1f83739af1
5 changed files with 258 additions and 107 deletions

View File

@ -123,7 +123,7 @@ GameObject:
- component: {fileID: 223948366952411928}
- component: {fileID: 114771592580085644}
m_Layer: 5
m_Name: EquipTreasureStrongPopup
m_Name: FaXiangStrongPopup
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -532,7 +532,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -29.7, y: -19.7}
m_AnchoredPosition: {x: -29.699997, y: -19.7}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &981922444300259210
@ -650,7 +650,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u5F3A \u5316"
m_Text: "\u5347 \u7EA7"
LanguageIndex: 0
--- !u!1 &407103844882047403
GameObject:
@ -686,7 +686,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -29.3, y: -18.6}
m_AnchoredPosition: {x: -29.300003, y: -18.600002}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7007021155629448104
@ -802,8 +802,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -1.2075, y: 302.26}
m_SizeDelta: {x: 932.4, y: 518.89}
m_AnchoredPosition: {x: -1.2075, y: 384.9}
m_SizeDelta: {x: 932.4, y: 353.7}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1312853492439174918
GameObject:
@ -1582,7 +1582,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.47, y: 14.6}
m_AnchoredPosition: {x: -0.47, y: 182}
m_SizeDelta: {x: 927.41, y: 76.8}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4992443721524327437
@ -1700,7 +1700,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u7CBE \u70BC"
m_Text: "\u5347 \u661F"
LanguageIndex: 0
--- !u!1 &3543488216793568729
GameObject:
@ -1870,7 +1870,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u5F3A \u5316"
m_Text: "\u5347 \u7EA7"
LanguageIndex: 0
--- !u!1 &3783686479210395328
GameObject:
@ -1966,7 +1966,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u7CBE \u70BC"
m_Text: "\u5347 \u661F"
LanguageIndex: 0
--- !u!1 &3793340513267332292
GameObject:
@ -2002,7 +2002,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.29003906, y: 38.5}
m_AnchoredPosition: {x: -0.29003906, y: 206}
m_SizeDelta: {x: 898.92, y: 4.44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4897021660228937839
@ -2285,6 +2285,7 @@ RectTransform:
- {fileID: 6467057438910059460}
- {fileID: 8766961231832293434}
- {fileID: 6863185804939559100}
- {fileID: 3508980579412783191}
m_Father: {fileID: 224199271576904048}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -2335,7 +2336,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -28.5, y: -15.6}
m_AnchoredPosition: {x: -28.5, y: -15.599998}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7954594292029678291
@ -2570,7 +2571,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 1.99, y: -161.93}
m_AnchoredPosition: {x: 1.99, y: 8}
m_SizeDelta: {x: 912.8, y: 260.15}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1102433259614153313
@ -2674,7 +2675,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.28999758, y: -25.4}
m_AnchoredPosition: {x: -0.28999758, y: 145}
m_SizeDelta: {x: 898.92, y: 4.44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1957170809448953427
@ -3188,6 +3189,85 @@ MonoBehaviour:
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &7296169535383589910
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3508980579412783191}
- component: {fileID: 3716891711490907985}
- component: {fileID: 3975079200401291714}
m_Layer: 5
m_Name: skillInfo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3508980579412783191
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7296169535383589910}
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: 8601325964190918751}
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 5.2955, y: -144}
m_SizeDelta: {x: 919.39, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3716891711490907985
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7296169535383589910}
m_CullTransparentMesh: 0
--- !u!114 &3975079200401291714
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7296169535383589910}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.98823535, g: 0.7843138, b: 0.38823533, 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
m_FontData:
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
m_FontSize: 35
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: "\u7231\u56FD\u5927\u53A6\u89C4\u5212\u4EE8\u4E2A\u7535\u8BDD\u4EE8\u4E2A\u5927\u53F7\u4EE8\u4E2A\u5927\u53F7\u4FFA\u662F\u4E2A\u5927\u54C8\u4FFA\u662F\u4E2A\u5927\u54C8"
--- !u!1 &7400315987968953576
GameObject:
m_ObjectHideFlags: 0
@ -3400,7 +3480,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 469.4, y: -670.8}
m_AnchoredPosition: {x: 466, y: -501}
m_SizeDelta: {x: 912.8, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7669026485797189264
@ -4028,7 +4108,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -29.3, y: -18.6}
m_AnchoredPosition: {x: -29.300003, y: -18.600002}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &207568323831459994

View File

@ -753,6 +753,7 @@ STRONGTHENFAXIANGEQUIPREQUEST = protobuf.Descriptor();
STRONGTHENFAXIANGEQUIPREQUEST_FAXIANGID_FIELD = protobuf.FieldDescriptor();
STRONGTHENFAXIANGEQUIPREQUEST_TARGETLV_FIELD = protobuf.FieldDescriptor();
STRONGTHENFAXIANGEQUIPREQUEST_ACTION_FIELD = protobuf.FieldDescriptor();
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD = protobuf.FieldDescriptor();
GETALLFAXIANGEQUIPREQUEST = protobuf.Descriptor();
GETALLFAXIANGEQUIPREQUEST_PAGE_FIELD = protobuf.FieldDescriptor();
GETALLFAXIANGEQUIPRESPONSE = protobuf.Descriptor();
@ -7615,11 +7616,21 @@ STRONGTHENFAXIANGEQUIPREQUEST_ACTION_FIELD.default_value = 0
STRONGTHENFAXIANGEQUIPREQUEST_ACTION_FIELD.type = 5
STRONGTHENFAXIANGEQUIPREQUEST_ACTION_FIELD.cpp_type = 1
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.name = "costID"
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.full_name = ".rpc.protocols.StrongthenFaxiangEquipRequest.costID"
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.number = 4
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.index = 3
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.label = 3
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.has_default_value = false
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.default_value = {}
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.type = 9
STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD.cpp_type = 9
STRONGTHENFAXIANGEQUIPREQUEST.name = "StrongthenFaxiangEquipRequest"
STRONGTHENFAXIANGEQUIPREQUEST.full_name = ".rpc.protocols.StrongthenFaxiangEquipRequest"
STRONGTHENFAXIANGEQUIPREQUEST.nested_types = {}
STRONGTHENFAXIANGEQUIPREQUEST.enum_types = {}
STRONGTHENFAXIANGEQUIPREQUEST.fields = {STRONGTHENFAXIANGEQUIPREQUEST_FAXIANGID_FIELD, STRONGTHENFAXIANGEQUIPREQUEST_TARGETLV_FIELD, STRONGTHENFAXIANGEQUIPREQUEST_ACTION_FIELD}
STRONGTHENFAXIANGEQUIPREQUEST.fields = {STRONGTHENFAXIANGEQUIPREQUEST_FAXIANGID_FIELD, STRONGTHENFAXIANGEQUIPREQUEST_TARGETLV_FIELD, STRONGTHENFAXIANGEQUIPREQUEST_ACTION_FIELD, STRONGTHENFAXIANGEQUIPREQUEST_COSTID_FIELD}
STRONGTHENFAXIANGEQUIPREQUEST.is_extendable = false
STRONGTHENFAXIANGEQUIPREQUEST.extensions = {}
GETALLFAXIANGEQUIPREQUEST_PAGE_FIELD.name = "page"

View File

@ -634,20 +634,49 @@ function this.WearFaxiangEquipRequest(_heroId,_faxiangId,_type,func)
end
--请求法相升级升星
function this.StrongthenFaxiangEquipRequest(_faxiangId,_lv,_type,func)
local costItems=nil
function this.StrongthenFaxiangEquipRequest(_faxiangId,_lv,_type, _equipData,func)
local data = PlayerInfoProto_pb.StrongthenFaxiangEquipRequest()
data.faxiangID = _faxiangId
data.action =_type
data.action = _type
data.targetLv=_lv
if _type==2 then
costItems={}
local items,len=FaXiangManager.GetEnoughFaXiangItemById(_equipData.id)
local needNum=0
local starConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangStarConfig,"PoolId",_equipData.refinePool,"Level",_equipData.refineLv)
if starConfig then
for i = 1, #starConfig.PropList do
if starConfig.PropList[i][1]==0 then
needNum=starConfig.PropList[i][2]
end
end
end
LogError("neednum=="..needNum.." len=="..len)
if needNum>len then
LogError("不满足升级")
return
end
for i = 1, needNum do
data.costID:append(items[i].idDyn)
LogError("items[i].idDyn===="..items[i].idDyn)
table.insert(costItems,items[i].idDyn)
end
end
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.STRONGTHEN_FAXIANG_EQUIP_REQUEST, MessageTypeProto_pb.STRONGTHEN_FAXIANG_EQUIP_RESPONSE, msg, function(buffer)
local data = buffer:DataByte()
if costItems then
for i = 1, #costItems do
LogError("remove ===================")
FaXiangManager.RemoveTreasureByIdDyn(costItems[i])
end
end
costItems={}
--设置战斗力脏数据
if _type == 1 then
HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip)
else
HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.EquipTreasure)
if _equipData and _equipData.upHeroDid~=nil and _equipData.upHeroDid~="" then
HeroPropManager.SetDirtyByType(_equipData.upHeroDid, Hero_Prop_Type.FaXiang)
end
if func then
func(msg)

View File

@ -6,6 +6,7 @@ local faXiangConfig = ConfigManager.GetConfig(ConfigName.FaxiangConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local faxiangLevelConfig = ConfigManager.GetConfig(ConfigName.FaxiangLevelConfig)
local faxiangStarConfig = ConfigManager.GetConfig(ConfigName.FaxiangStarConfig)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
function this.Initialize()
this.TreasurePowerData = {}
end
@ -27,6 +28,7 @@ function this.InitSingleTreasureData(_singleData,notAdd)
local staticId = _singleData.equipId
LogError("starticid=="..staticId)
local currJewel = faXiangConfig[staticId]
single.faXiangConfig=currJewel
single.equipType = currJewel.Location
single.id = staticId
single.idDyn = _singleData.id
@ -46,19 +48,10 @@ function this.InitSingleTreasureData(_singleData,notAdd)
single.refinePool = currJewel.Star
single.equipType = currJewel.Type
local quantity = currJewel.Level
-- if currJewel.Location == 1 then
-- single.type = Language[10552]
-- else
-- single.type = Language[10553]
-- end
single.icon = GetResourcePath(itemConfig[staticId].ResourceID)
single.strongConfig = this.GetCurrTreasureLvConfig(currJewel.LevelUpPool, _singleData.exp)
-- single.refineConfig = this.GetCurrTreasureLvConfig(2, currJewel.Star, _singleData.rebuildLevel)
-- if notAdd then
-- return single
-- else
allTreasures[_singleData.id] = single
single.refineConfig = this.GetCurrTreasureLvConfig(2, currJewel.Star, _singleData.rebuildLevel)
allTreasures[_singleData.id] = single
-- end
end
@ -75,10 +68,10 @@ function this.GetAllHeroEquipedTreasureData()
return equips
end
function this.GetFaXiangItemById(_id)
function this.GetEnoughFaXiangItemById(_id)
local equips={}
for i, v in pairs(allTreasures) do
if (v.upHeroDid == 0 or v.upHeroDid == "0") and v.id==_id then
if (v.upHeroDid == nil or v.upHeroDid =="" or v.upHeroDid == 0 or v.upHeroDid == "0") and v.id==_id and v.lv==0 and v.refineLv==0 then
table.insert(equips, v)
end
end
@ -86,6 +79,16 @@ function this.GetFaXiangItemById(_id)
end
function this.RemoveTreasureByIdDyn(_idDyn)
if allTreasures == nil then
return
end
if allTreasures[_idDyn] then
allTreasures[_idDyn] = nil
end
end
--设置装备穿戴的英雄
function this.SetEquipTreasureUpHeroDid(_equipTreasureDid, _heroDid)
if allTreasures[_equipTreasureDid] then
@ -199,7 +202,7 @@ function this.GetCurrStarAndNextStarPropertyValue(_id, _lv,_data)
local nexLvConfig = nil
local Para=0
local nextPara=0
LogError("lv======================".._lv)
local starConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangStarConfig,"PoolId",_data.refinePool,"Level",_data.refineLv)
if starConfig then
LogError("starConfig.id=="..starConfig.Id)
@ -214,12 +217,12 @@ function this.GetCurrStarAndNextStarPropertyValue(_id, _lv,_data)
end
--获取当前等级属性加成
for _, configInfo in ConfigPairs(faxiangLevelConfig) do
if configInfo.PoolId == _id and configInfo.Level == _lv then
if configInfo.PoolId == _data.levelPool and configInfo.Level == _lv then
lvConfig = configInfo
break
end
end
LogError("lvConfig.id========="..lvConfig.Id)
local proList = {}
if lvConfig then
for i = 1, table.getn(lvConfig.LevelPara) do
@ -288,7 +291,7 @@ function this.GetFaXiangStarCost(_poolId,_star,_data)
item.id=_data.id
item.icon=_data.icon
item.frame=_data.frame
local equips,num=FaXiangManager.GetFaXiangItemById(_data.id)
local equips,num=FaXiangManager.GetEnoughFaXiangItemById(_data.id)
if equips then
item.haveNum= num
else
@ -366,6 +369,50 @@ function this.CalculateWarForceBase(sId, lv, rlv, curTreasure)
end
function this.CalculateAllFaXiangAddPro(_heroData)
-- LogGreen("sId:"..sId.." lv:"..lv.." rlv:"..rlv.." tlv:"..tlv)
LogError("===============================获取英雄法相添加的属性")
local allProVal = {}
if _heroData==nil then
return allProVal
end
for i, v in ConfigPairs(propertyConfig) do
allProVal[i] = 0
end
local list=_heroData.faxiang
if list and #list>0 then
for i = 1, #list do
local addProList={}
local idDyn=list[i]
local faxiang=allTreasures[idDyn]
if faxiang then
local levelConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangLevelConfig,"PoolId",faxiang.levelPool,"Level",faxiang.lv)
if levelConfig then
for j = 1, #levelConfig.LevelPara do
local pro=levelConfig.LevelPara[j][1]
addProList[pro]=levelConfig.LevelPara[j][2]
end
end
local starConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangStarConfig,"PoolId",faxiang.refinePool,"Level",faxiang.refineLv)
if starConfig then
for j = 1, #addProList do
local Para=starConfig.StarPara/10000
addProList[j]=math.floor(addProList[j] * (1 + Para))
end
end
end
for key, value in pairs(addProList) do
LogError("key========="..key.." value=="..value)
allProVal[key]=allProVal[key]+value
end
end
end
return allProVal
end
--获取消耗物品数据
function this.GetCostItems(_config)
@ -521,7 +568,7 @@ function this.CalculateWarForceBase(sId, lv, rlv, tlv,curTreasure)
local starConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangStarConfig,"PoolId",curEuipTreaSureConfig.Star,"Level",rlv)
if starConfig then
LogError("starConfig.id=="..starConfig.Id)
--LogError("starConfig.id=="..starConfig.Id)
local Para=starConfig.StarPara/10000
for key, value in pairs(addAllProVal) do
addEndAllProVal[key] = math.floor(value * (1 + Para))

View File

@ -20,6 +20,7 @@ function FaXiangStrongPopup:InitComponent()
this.content = Util.GetGameObject(self.transform, "bg/content")
this.btnBack= Util.GetGameObject(this.content,"btnBack")
this.titleTxt=Util.GetGameObject(this.content,"name"):GetComponent("Text")
this.skillInfo=Util.GetGameObject(this.content,"skillInfo"):GetComponent("Text")
this.itemPre = Util.GetGameObject(this.content,"itemView")
this.firstScroll=Util.GetGameObject(this.content,"firstScroll")
this.secondScroll=Util.GetGameObject(this.content,"secondScroll")
@ -29,6 +30,7 @@ function FaXiangStrongPopup:InitComponent()
this.costPreList = {}
this.costItemGrid=Util.GetGameObject(this.content,"costGrid")
this.hintTxt=Util.GetGameObject(this.content,"hintTxt"):GetComponent("Text")
this.hintTxt.gameObject:SetActive(false)
this.btnGrid=Util.GetGameObject(this.content,"btnGrid")
this.btnRefine=Util.GetGameObject(this.btnGrid,"btnRefine")
this.btnRefineText = Util.GetGameObject(this.btnRefine,"Text"):GetComponent("Text")
@ -43,6 +45,7 @@ function FaXiangStrongPopup:InitComponent()
this.btn_refinePageRed=Util.GetGameObject(this.btn_refinePage,"red")
this.btn_shenyingPageRed=Util.GetGameObject(this.btn_shenyingPage,"red")
this.selectBtn=Util.GetGameObject(this.content,"btnList/selectBtn")
this.selectText = Util.GetGameObject(this.selectBtn,"Text"):GetComponent("Text")
this.treasureDatas = {}
this.treasureDatas2 = {}
@ -74,7 +77,7 @@ function FaXiangStrongPopup:BindEvent()
return
end
this:SetWindShow(1,0)
-- this:RefreshRedPoint(0,false)
this:RefreshRedPoint(0,false)
end)
--精炼页签
Util.AddClick(this.btn_refinePage, function()
@ -82,7 +85,7 @@ function FaXiangStrongPopup:BindEvent()
return
end
this:SetWindShow(2,0)
--this:RefreshRedPoint(0,false)
this:RefreshRedPoint(0,false)
end)
--神应页签
@ -98,7 +101,7 @@ function FaXiangStrongPopup:BindEvent()
--如果强化界面 强化到最高等级谈提示 精炼界面 就切界面
if type==1 then
if isMax then
PopupTipPanel.ShowTip(Language[11770])
PopupTipPanel.ShowTip("法相以达最大等级")
return
end
else
@ -110,11 +113,12 @@ function FaXiangStrongPopup:BindEvent()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,matId)
return
end
LogError("curEquipData.lv====="..curEquipData.lv)
NetManager.StrongthenFaxiangEquipRequest(curEquipData.idDyn,curEquipData.lv+1,1,curEquipData,function (msg)
FaXiangManager.ChangeTreasureLv(curEquipData.idDyn,1)
this.treasureDatas[curIndex]:OnOpen(false, {curEquipData.id,0}, 1, false, false, false, 0,curEquipData.idDyn)
this:SetWindShow(type,0)
this:RefreshRedPoint(0,true)
--this:RefreshRedPoint(0,true)
if isMax then
PopupTipPanel.ShowTip(Language[11772])
else
@ -129,12 +133,12 @@ function FaXiangStrongPopup:BindEvent()
end)
end)
--精炼按钮
--升星按钮
Util.AddClick(this.btnRefine, function()
--如果精炼界面 精炼到最高等级谈提示 否 强化界面 就切界面
if type==2 then
if isMax then
PopupTipPanel.ShowTip(Language[11773])
PopupTipPanel.ShowTip("法相以达最大星级")
return
end
else
@ -145,49 +149,20 @@ function FaXiangStrongPopup:BindEvent()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,matId)
return
end
local maters={}
if curEquipData.refineConfig.JewelExpend then
for i = 1, #curEquipData.refineConfig.JewelExpend do
local id = curEquipData.refineConfig.JewelExpend[i]
local type = id[1]
local equips,num=EquipTreasureManager.GetEnoughRefineTreasure(type,curEquipData.idDyn)
local equipValue={}
equipValue.equip=equips
equipValue.needNum=id[2]
haveTreasures[type]=equipValue
end
end
if haveTreasures then
for i, v in pairs(haveTreasures) do
local index=1
if v.equip then
for i, value in pairs(v.equip) do
if #maters < v.needNum then
maters[index]=value.idDyn
index=index+1
end
end
end
end
end
NetManager.EquipTreasureBuildRequest(curEquipData.idDyn,2,maters,function (msg)
if maters then
for i = 1, #maters do
EquipTreasureManager.RemoveTreasureByIdDyn(maters[i])
end
end
EquipTreasureManager.ChangeTreasureLv(curEquipData.idDyn,type)
this:SetWindShow(type,0)
this:RefreshRedPoint(0,true)
NetManager.StrongthenFaxiangEquipRequest(curEquipData.idDyn,curEquipData.refineLv+1,2,curEquipData,function (msg)
FaXiangManager.ChangeTreasureLv(curEquipData.idDyn,2)
this:SetWindShow(2,0)
--this:RefreshRedPoint(0,true)
this.treasureDatas[curIndex]:OnOpen(false, {curEquipData.id,0}, 1, false, false, false, 0,curEquipData.idDyn)
if isMax then
PopupTipPanel.ShowTip(Language[11774])
else
--PopupTipPanel.ShowTip("精炼成功")
end
local oldWarPowerValue = EquipTreasureManager.CalculateWarForceBySid(curEquipData.id,curEquipData.lv ,curEquipData.refineLv - 1,curEquipData.treeLv)
local newWarPowerValue = EquipTreasureManager.CalculateWarForceBySid(curEquipData.id,curEquipData.lv,curEquipData.refineLv,curEquipData.treeLv)
local oldWarPowerValue = FaXiangManager.CalculateWarForceBySid(curEquipData.id,curEquipData.lv,curEquipData.refineLv-1)
local newWarPowerValue = FaXiangManager.CalculateWarForceBySid(curEquipData.id,curEquipData.lv,curEquipData.refineLv+1)
if oldWarPowerValue ~= newWarPowerValue then
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue})
end
@ -204,18 +179,16 @@ end
function FaXiangStrongPopup:RefreshRedPoint(delta,isRefreshTabRed)
Timer.New(function()
for k,v in pairs(this.treasureDatas2) do
local redShow = HeroManager.CheckIsUpTreasure(v.data.idDyn,type)
v.red.gameObject:SetActive(redShow)
end
-- for k,v in pairs(this.treasureDatas2) do
-- local redShow = HeroManager.CheckIsUpTreasure(v.data.idDyn,type)
-- v.red.gameObject:SetActive(redShow)
-- end
this.select.transform:SetParent(curIndex.transform)
this.select:GetComponent("RectTransform").anchoredPosition3D = Vector3.New(-8.5,5.04,0)
if type==1 then
this.selectText.text="强 化"
this.selectText.text="升 级"
elseif type==2 then
this.selectText.text="精 炼"
else
this.selectText.text="神 应"
this.selectText.text="升 星"
end
-- this.selectText.text = type == 1 and "强 化" or "精 炼"
this.select.transform.localScale = Vector3.one
@ -364,12 +337,14 @@ function FaXiangStrongPopup:SetWindShow(_index)
LogError("curEquipData.strongConfig.id=="..curEquipData.strongConfig.Id)
--items = FaXiangManager.GetCostItems(curEquipData.idDyn,curEquipData.strongConfig)
items = FaXiangManager.GetFaXiangLevelCost(curEquipData.levelPool,curEquipData.lv)
if curEquipData.quantity == 6 then
this.hintTxt.text = "强化等级已达上限"
else
this.hintTxt.text = Language[11778]
end
local skills=curEquipData.faXiangConfig.PassiveSkill
local skillId=skills[curEquipData.refineLv+1]
local des=""
for i = 1, #skillId do
des= des..ConfigManager.GetConfigData(ConfigName.PassiveSkillConfig,skillId[i]).Desc
end
this.skillInfo.text= "<color=#4BAB60>".."法相技能: ".."</color>"..des
elseif _index == 2 then
this.titleTxt.text="法相升星"
this.btnRefine:SetActive(true)
@ -385,13 +360,22 @@ function FaXiangStrongPopup:SetWindShow(_index)
this.btnRefineText.text=Language[11781]
this.properList[0].rightTxt.text = string.format( "%d/%s",curEquipData.refineLv+1,curEquipData.maxRefineLv)
end
propertyShow = FaXiangManager.GetCurrStarAndNextStarPropertyValue(2,curEquipData.refineLv,curEquipData)
propertyShow = FaXiangManager.GetCurrStarAndNextStarPropertyValue(2,curEquipData.lv,curEquipData)
items = FaXiangManager.GetFaXiangStarCost(curEquipData.refinePool,curEquipData.refineLv,curEquipData)
if curEquipData.quantity == 6 then
this.hintTxt.text = "精炼等级已达上限"
local skills=curEquipData.faXiangConfig.PassiveSkill
local lv=0
if isMax then
lv=curEquipData.refineLv+1
else
this.hintTxt.text=Language[11782]
lv=curEquipData.refineLv+2
end
local skillId=skills[lv]
local des=""
for i = 1, #skillId do
des= des..ConfigManager.GetConfigData(ConfigName.PassiveSkillConfig,skillId[i]).Desc
end
this.skillInfo.text= "<color=#4BAB60>".."技能预览: ".."</color>"..des
end
isGongMing = false
@ -404,7 +388,7 @@ function FaXiangStrongPopup:SetWindShow(_index)
this.costItemGrid.gameObject:SetActive(false)
this.btnGrid.gameObject:SetActive(false)
else
this.hintTxt.gameObject:SetActive(isMax)
-- this.hintTxt.gameObject:SetActive(isMax)
this.Image2.gameObject:SetActive(not isMax)
this.costItemGrid.gameObject:SetActive(not isMax)
this.btnGrid.gameObject:SetActive(not isMax)
@ -453,11 +437,11 @@ end
--设置属性的显示
function FaXiangStrongPopup:SetPropertyShow(_infos)
if this.hintTxt.gameObject.activeInHierarchy then
-- this.properList[0].go.gameObject:SetActive(false)
this.propertyGrid.gameObject:SetActive(false)
return
end
-- if this.hintTxt.gameObject.activeInHierarchy then
-- -- this.properList[0].go.gameObject:SetActive(false)
-- this.propertyGrid.gameObject:SetActive(false)
-- return
-- end
this.propertyGrid.gameObject:SetActive(true)
if isGongMing then
for i = 0, #this.properList do