Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev
commit
0456081d65
|
@ -458,12 +458,20 @@ function this.InitUpdateEquipData(id, upHeroDid)
|
|||
equipdata.frame = GetQuantityImageByquality(equipdata.equipConfig.Quality)
|
||||
equipdata.quality = equipdata.equipConfig.Quality
|
||||
equipdata.position = equipdata.equipConfig.Position
|
||||
|
||||
equipdata.mainAttribute = this.GetMainProList(equipdata.equipConfig)
|
||||
|
||||
equipdata.backData = equipdata
|
||||
|
||||
equipdata.star = equipStarsConfig[equipdata.equipConfig.Star].Stars
|
||||
|
||||
-- --摘星阁加持
|
||||
equipdata.HomeEquipLv = function()
|
||||
local data = HomeLandManager.EquipData[equipdata.position]
|
||||
if data and data.configData and data.configPro then
|
||||
return {data.configData.Level,data.configPro.Level}
|
||||
end
|
||||
return {0,0}
|
||||
end
|
||||
equipdata.homeEquipLv = equipdata.HomeEquipLv()
|
||||
|
||||
this.equipDatas[id] = equipdata
|
||||
if not this.equipDatas[id].upHeroDidList then
|
||||
this.equipDatas[id].upHeroDidList = {}
|
||||
|
@ -610,4 +618,19 @@ end
|
|||
function this.IsGongMing(_curHeroData)
|
||||
return this.IsChangeColor(_curHeroData.dynamicId) or (this:IsEnvoy(_curHeroData.dynamicId) and this:HongMengTowerUpLimit() ~= 0)
|
||||
end
|
||||
|
||||
|
||||
function this.updateHomeLandEquipLv()
|
||||
for key, value in pairs(this.equipDatas) do
|
||||
value.HomeEquipLv = function()
|
||||
local data = HomeLandManager.EquipData[value.position]
|
||||
if data and data.configData and data.configPro then
|
||||
return {data.configData.Level,data.configPro.Level}
|
||||
end
|
||||
return {0,0}
|
||||
end
|
||||
value.homeEquipLv = value.HomeEquipLv()
|
||||
end
|
||||
end
|
||||
|
||||
return HarmonyManager
|
|
@ -6494,6 +6494,7 @@ function NetManager.EquipIntensifyRequset(_type,func)
|
|||
msg:ParseFromString(data)
|
||||
HomeLandManager.GetServerEquipData(msg,function ()
|
||||
EquipManager.updateHomeLandEquipLv()
|
||||
HarmonyManager.updateHomeLandEquipLv()
|
||||
--设置脏数据
|
||||
HeroPropManager.SetAllHeroDirtyByType(Hero_Prop_Type.Equip)
|
||||
--获取新战力
|
||||
|
|
|
@ -115,19 +115,11 @@ function RoleEquipPanel:InitComponent()
|
|||
|
||||
this.ScrollBar = Util.GetGameObject(self.gameObject, "Scrollbar"):GetComponent("Scrollbar")
|
||||
local v2 = Util.GetGameObject(self.gameObject, "scroll"):GetComponent("RectTransform").rect
|
||||
this.ScrollView =
|
||||
SubUIManager.Open(
|
||||
SubUIConfig.ScrollCycleView,
|
||||
Util.GetGameObject(self.transform, "scroll").transform,
|
||||
this.equipPre,
|
||||
this.ScrollBar,
|
||||
Vector2.New(v2.width, v2.height),
|
||||
1,
|
||||
5,
|
||||
Vector2.New(40, 15)
|
||||
)
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.transform, "scroll").transform,
|
||||
this.equipPre, this.ScrollBar,Vector2.New(v2.width, v2.height),1 , 5, Vector2.New(40, 15))
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 1
|
||||
|
||||
Util.GetGameObject(self.transform, "powerBtn"):GetComponent("Image").sprite = this.spLoader:LoadSprite("t_tongyong-zhanli_zh")
|
||||
this.force = Util.GetGameObject(self.transform, "powerBtn/value"):GetComponent("Text")
|
||||
this.itemNumText = Util.GetGameObject(self.transform, "itemNumText"):GetComponent("Text")
|
||||
|
@ -160,92 +152,50 @@ end
|
|||
|
||||
--绑定事件(用于子类重写)
|
||||
function RoleEquipPanel:BindEvent()
|
||||
Util.AddClick(
|
||||
this.btnBack,
|
||||
function()
|
||||
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||
if openThisPanel.RefreshHeroDatas then
|
||||
openThisPanel:RefreshHeroDatas(curHeroData, HeroManager.heroSortedDatas)
|
||||
end
|
||||
self:ClosePanel()
|
||||
Util.AddClick(this.btnBack,function()
|
||||
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||
if openThisPanel.RefreshHeroDatas then
|
||||
openThisPanel:RefreshHeroDatas(curHeroData, HeroManager.heroSortedDatas)
|
||||
end
|
||||
)
|
||||
Util.AddClick(
|
||||
this.leftBtn,
|
||||
function()
|
||||
isPlayAnim = true
|
||||
this:LeftBtnOnClick()
|
||||
end
|
||||
)
|
||||
self:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(this.leftBtn,function()
|
||||
isPlayAnim = true
|
||||
this:LeftBtnOnClick()
|
||||
end)
|
||||
|
||||
Util.AddClick(
|
||||
this.rightBtn,
|
||||
function()
|
||||
isPlayAnim = true
|
||||
this:RightBtnOnClick()
|
||||
end
|
||||
)
|
||||
Util.AddOnceClick(
|
||||
this.allEquipUp,
|
||||
function()
|
||||
this:AllEquipUpBtnOnClick()
|
||||
end
|
||||
)
|
||||
Util.AddClick(this.rightBtn,function()
|
||||
isPlayAnim = true
|
||||
this:RightBtnOnClick()
|
||||
end)
|
||||
Util.AddOnceClick(this.allEquipUp,function()
|
||||
this:AllEquipUpBtnOnClick()
|
||||
end)
|
||||
|
||||
Util.AddOnceClick(
|
||||
this.allEquipDown,
|
||||
function()
|
||||
if HarmonyManager:IsShowGongMingEqiup(curHeroData.dynamicId) and curHeroData.harmonyGongMing then
|
||||
-- body
|
||||
PopupTipPanel.ShowTip(Language[12222])
|
||||
else
|
||||
this:AllEquipDownBtnOnClick()
|
||||
end
|
||||
|
||||
Util.AddOnceClick(this.allEquipDown,function()
|
||||
if HarmonyManager:IsShowGongMingEqiup(curHeroData.dynamicId) and curHeroData.harmonyGongMing then
|
||||
PopupTipPanel.ShowTip(Language[12222])
|
||||
else
|
||||
this:AllEquipDownBtnOnClick()
|
||||
end
|
||||
)
|
||||
end)
|
||||
for i = 1, 6 do
|
||||
Util.AddClick(
|
||||
tabs[i],
|
||||
function()
|
||||
isPlayAnim = true
|
||||
if i == indexBtnNum then
|
||||
return
|
||||
end
|
||||
indexBtnNum = i
|
||||
this:OnClickTabBtn(indexBtnNum)
|
||||
-- if indexBtnNum == PosIdConst.All then
|
||||
-- this:OnClickAllBtn()
|
||||
-- else
|
||||
-- this:OnClickTabBtn(indexBtnNum)
|
||||
-- end
|
||||
end
|
||||
)
|
||||
end
|
||||
Util.AddClick(
|
||||
this.equipTreasureBtn,
|
||||
function()
|
||||
if LengthOfTable(curEquipTreasureDatas) < 2 then
|
||||
PopupTipPanel.ShowTip(Language[11797])
|
||||
Util.AddClick(tabs[i],function()
|
||||
isPlayAnim = true
|
||||
if i == indexBtnNum then
|
||||
return
|
||||
end
|
||||
UIManager.OpenPanel(UIName.EquipTreasureResonancePanel, curHeroData)
|
||||
indexBtnNum = i
|
||||
this:OnClickTabBtn(indexBtnNum)
|
||||
end)
|
||||
end
|
||||
Util.AddClick(this.equipTreasureBtn,function()
|
||||
if LengthOfTable(curEquipTreasureDatas) < 2 then
|
||||
PopupTipPanel.ShowTip(Language[11797])
|
||||
return
|
||||
end
|
||||
)
|
||||
|
||||
-- Util.AddClick(
|
||||
-- this.equipBtn5,
|
||||
-- function()
|
||||
-- UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,9999,nil)
|
||||
-- end
|
||||
-- )
|
||||
|
||||
-- Util.AddClick(
|
||||
-- this.equipBtn6,
|
||||
-- function()
|
||||
-- UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,9998,nil)
|
||||
-- end
|
||||
-- )
|
||||
UIManager.OpenPanel(UIName.EquipTreasureResonancePanel, curHeroData)
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
|
@ -261,11 +211,6 @@ end
|
|||
function this.CurrEquipDataChange()
|
||||
this.ShowHeroEquip()
|
||||
this:OnClickTabBtn(indexBtnNum)
|
||||
-- if indexBtnNum == PosIdConst.All then
|
||||
-- this:OnClickAllBtn()
|
||||
-- else
|
||||
-- this:OnClickTabBtn(indexBtnNum)
|
||||
-- end
|
||||
this.CheckRedTab()
|
||||
end
|
||||
|
||||
|
@ -321,11 +266,6 @@ function this:RightBtnOnClick()
|
|||
this.ShowHeroEquip()
|
||||
this:OnClickTabBtn(indexBtnNum)
|
||||
this.CheckRedTab()
|
||||
-- if indexBtnNum == PosIdConst.All then
|
||||
-- this:OnClickAllBtn()
|
||||
-- else
|
||||
-- this:OnClickTabBtn(indexBtnNum)
|
||||
-- end
|
||||
end
|
||||
--左切换按钮点击
|
||||
function this:LeftBtnOnClick()
|
||||
|
@ -334,11 +274,6 @@ function this:LeftBtnOnClick()
|
|||
this.ShowHeroEquip()
|
||||
this:OnClickTabBtn(indexBtnNum)
|
||||
this.CheckRedTab()
|
||||
-- if indexBtnNum == PosIdConst.All then
|
||||
-- this:OnClickAllBtn()
|
||||
-- else
|
||||
-- this:OnClickTabBtn(indexBtnNum)
|
||||
-- end
|
||||
end
|
||||
|
||||
--一键装备
|
||||
|
@ -444,27 +379,18 @@ function this:AllEquipUpBtnOnClick()
|
|||
LogYellow("宝物:"..#allTreasureIds)
|
||||
LogYellow("isCanUpEquipTreasure:"..tostring(isCanUpEquipTreasure))
|
||||
if (allEquipIds and #allEquipIds > 0) or (isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0) then
|
||||
--isCanUpEquipTreasure
|
||||
if allEquipIds and #allEquipIds > 0 and not curHeroData.harmonyGongMing then
|
||||
-- for i = 1, #allEquipIds do
|
||||
-- --LogGreen("一键装备"..allEquipIds[i])
|
||||
-- end
|
||||
--穿装备协议
|
||||
NetManager.EquipWearRequest(
|
||||
curHeroData.dynamicId,
|
||||
allEquipIds,
|
||||
1,
|
||||
function()
|
||||
this.UpdateEquipPosHeroData(1, 4, allEquipIds)
|
||||
--特效播放
|
||||
if equipEffectPos then
|
||||
for i = 1, #equipEffectPos do
|
||||
effectList[equipEffectPos[i]]:SetActive(false)
|
||||
effectList[equipEffectPos[i]]:SetActive(true)
|
||||
end
|
||||
NetManager.EquipWearRequest(curHeroData.dynamicId,allEquipIds,1,function()
|
||||
this.UpdateEquipPosHeroData(1, 4, allEquipIds)
|
||||
--特效播放
|
||||
if equipEffectPos then
|
||||
for i = 1, #equipEffectPos do
|
||||
effectList[equipEffectPos[i]]:SetActive(false)
|
||||
effectList[equipEffectPos[i]]:SetActive(true)
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
end
|
||||
if curHeroData.harmonyGongMing then
|
||||
PopupTipPanel.ShowTip(Language[12223])
|
||||
|
@ -472,19 +398,14 @@ function this:AllEquipUpBtnOnClick()
|
|||
--穿戴宝物
|
||||
if isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0 then
|
||||
--穿装备协议
|
||||
NetManager.EquipWearRequest(
|
||||
curHeroData.dynamicId,
|
||||
allTreasureIds,
|
||||
2,
|
||||
function()
|
||||
this.UpdateEquipPosHeroData(2, 4, allTreasureIds)
|
||||
--特效播放
|
||||
for i, v in pairs(treasureEffectPos) do
|
||||
effectList[v]:SetActive(false)
|
||||
effectList[v]:SetActive(true)
|
||||
end
|
||||
NetManager.EquipWearRequest(curHeroData.dynamicId,allTreasureIds,2,function()
|
||||
this.UpdateEquipPosHeroData(2, 4, allTreasureIds)
|
||||
--特效播放
|
||||
for i, v in pairs(treasureEffectPos) do
|
||||
effectList[v]:SetActive(false)
|
||||
effectList[v]:SetActive(true)
|
||||
end
|
||||
)
|
||||
end)
|
||||
end
|
||||
else
|
||||
if not allEquipIds or #allEquipIds < 1 then
|
||||
|
@ -503,31 +424,18 @@ end
|
|||
|
||||
--一键卸下
|
||||
function this:AllEquipDownBtnOnClick()
|
||||
if
|
||||
(curHeroData.equipIdList and #curHeroData.equipIdList > 0) or
|
||||
(curHeroData.jewels and #curHeroData.jewels > 0 and isCanUpEquipTreasure)
|
||||
then
|
||||
if(curHeroData.equipIdList and #curHeroData.equipIdList > 0) or(curHeroData.jewels and #curHeroData.jewels > 0 and isCanUpEquipTreasure) then
|
||||
if curHeroData.equipIdList and #curHeroData.equipIdList > 0 then
|
||||
NetManager.EquipUnLoadOptRequest(
|
||||
curHeroData.dynamicId,
|
||||
curHeroData.equipIdList,
|
||||
1,
|
||||
function()
|
||||
this.UpdateEquipPosHeroData(1, 5, curHeroData.equipIdList)
|
||||
end
|
||||
)
|
||||
NetManager.EquipUnLoadOptRequest(curHeroData.dynamicId,curHeroData.equipIdList,1,function()
|
||||
this.UpdateEquipPosHeroData(1, 5, curHeroData.equipIdList)
|
||||
end)
|
||||
end
|
||||
--寶物
|
||||
if curHeroData.jewels and #curHeroData.jewels > 0 then
|
||||
-- 一键卸下音效
|
||||
NetManager.EquipUnLoadOptRequest(
|
||||
curHeroData.dynamicId,
|
||||
curHeroData.jewels,
|
||||
2,
|
||||
function()
|
||||
this.UpdateEquipPosHeroData(2, 5, curHeroData.jewels)
|
||||
end
|
||||
)
|
||||
NetManager.EquipUnLoadOptRequest(curHeroData.dynamicId,curHeroData.jewels,2,function()
|
||||
this.UpdateEquipPosHeroData(2, 5, curHeroData.jewels)
|
||||
end)
|
||||
end
|
||||
else
|
||||
PopupTipPanel.ShowTip(Language[11800])
|
||||
|
@ -634,6 +542,11 @@ function this:SingleDataShow(go,index)
|
|||
if curHeroEquipDatas[index] then
|
||||
this.equipPreList2[go].gameObject:SetActive(true)
|
||||
mask.gameObject:SetActive(false)
|
||||
-- if curHeroEquipDatas[index].homeEquipLv then
|
||||
-- LogRed("LV:"..tostring(curHeroEquipDatas[index].homeEquipLv[1]).." "..tostring(curHeroEquipDatas[index].homeEquipLv[2]))
|
||||
-- else
|
||||
-- LogError("无homeEquipLv")
|
||||
-- end
|
||||
this.equipPreList2[go]:OnOpen(false,{curHeroEquipDatas[index].id,0}, 1, false, false, false, 0,nil,curHeroEquipDatas[index])
|
||||
if HarmonyManager:IsShowGongMingEqiup(curHeroData.dynamicId) and curHeroData.harmonyGongMing then
|
||||
-- body
|
||||
|
@ -647,10 +560,8 @@ function this:SingleDataShow(go,index)
|
|||
this.equipPreList2[go]:OnOpen(false,{curEquipTreasureDatas[index].id,0}, 1, false, false, false, 0,curEquipTreasureDatas[index].idDyn)
|
||||
--鸿蒙阵 共享数据判断
|
||||
if HarmonyManager.IsInfo(curEquipTreasureDatas[index].upHeroDid) and curEquipTreasureDatas[index].equipType == 1 then
|
||||
--if HarmonyManager.IsInfo(curEquipTreasureDatas[index].upHeroDid) and HarmonyManager.GetSingleAdditions(HarmonyAddType.HunSoulPrint) ~= -1 and curEquipTreasureDatas[index].equipType == 1 then
|
||||
Util.GetGameObject(go.transform, "HongMenging"):SetActive(true)
|
||||
elseif HarmonyManager.IsInfo(curEquipTreasureDatas[index].upHeroDid) and curEquipTreasureDatas[index].equipType == 2 then
|
||||
--elseif HarmonyManager.IsInfo(curEquipTreasureDatas[index].upHeroDid) and HarmonyManager.GetSingleAdditions(HarmonyAddType.LingSoulPrint) ~= -1 and curEquipTreasureDatas[index].equipType == 2 then
|
||||
Util.GetGameObject(go.transform, "HongMenging"):SetActive(true)
|
||||
else
|
||||
Util.GetGameObject(go.transform, "HongMenging"):SetActive(false)
|
||||
|
@ -660,30 +571,27 @@ function this:SingleDataShow(go,index)
|
|||
mask.gameObject:SetActive(true)
|
||||
end
|
||||
local iconBtn = Util.GetGameObject(go.transform, "btn")
|
||||
Util.AddOnceClick(
|
||||
iconBtn,
|
||||
function()
|
||||
if curHeroEquipDatas[index] then
|
||||
curSelectEquipData = curHeroEquipDatas[index]
|
||||
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2, this,curHeroEquipDatas[index],2,false,nil,curHeroData)
|
||||
elseif curEquipTreasureDatas[index] then
|
||||
if itemConfig[curEquipTreasureDatas[index].id].ItemType == ItemType.EquipTreasure then
|
||||
local pos = 0
|
||||
local jewerConfig =
|
||||
ConfigManager.TryGetConfigData(ConfigName.JewelConfig, curEquipTreasureDatas[index].id)
|
||||
if jewerConfig then
|
||||
if jewerConfig.Location == 1 then
|
||||
pos = 5
|
||||
elseif jewerConfig.Location == 2 then
|
||||
pos = 6
|
||||
end
|
||||
-- UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,curEquipTreasureDatas[index],nil,pos)
|
||||
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup2,this,curEquipTreasureDatas[index],2,false,nil,curHeroData,pos)
|
||||
Util.AddOnceClick(iconBtn,function()
|
||||
if curHeroEquipDatas[index] then
|
||||
curSelectEquipData = curHeroEquipDatas[index]
|
||||
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2, this,curHeroEquipDatas[index],2,false,nil,curHeroData)
|
||||
elseif curEquipTreasureDatas[index] then
|
||||
if itemConfig[curEquipTreasureDatas[index].id].ItemType == ItemType.EquipTreasure then
|
||||
local pos = 0
|
||||
local jewerConfig =
|
||||
ConfigManager.TryGetConfigData(ConfigName.JewelConfig, curEquipTreasureDatas[index].id)
|
||||
if jewerConfig then
|
||||
if jewerConfig.Location == 1 then
|
||||
pos = 5
|
||||
elseif jewerConfig.Location == 2 then
|
||||
pos = 6
|
||||
end
|
||||
-- UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,curEquipTreasureDatas[index],nil,pos)--以前的,现在不用了
|
||||
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup2,this,curEquipTreasureDatas[index],2,false,nil,curHeroData,pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
end
|
||||
|
||||
function this:SetSelectBtn()
|
||||
|
@ -709,25 +617,6 @@ function this:OpenTips(nextEquipData,pos)
|
|||
end)
|
||||
end,Language[10731],Language[11934])
|
||||
end
|
||||
-- --点击全部按钮
|
||||
-- function this:OnClickAllBtn()
|
||||
-- this:SetSelectBtn()
|
||||
-- local itemData = BagManager.GetEquipDataByEquipPosition(curHeroData.heroConfig.Profession)
|
||||
-- this:SortEquipDatas(itemData)
|
||||
-- local count = 0
|
||||
-- for i=1,#itemData do
|
||||
-- count = count + 1--itemData[i].num
|
||||
-- end
|
||||
-- --加上宝器数据
|
||||
-- local curAllEquipTreasure = EquipTreasureManager.GetAllTreasures(curHeroData.heroConfig.PropertyName)
|
||||
-- --宝器排序
|
||||
-- for i = 1, #curAllEquipTreasure do
|
||||
-- table.insert(itemData, curAllEquipTreasure[i])
|
||||
-- end
|
||||
-- --"装备数量:"
|
||||
-- this.itemNumText.text = Language[12181] .. count + LengthOfTable(curAllEquipTreasure)
|
||||
-- this:SetItemData(itemData)
|
||||
-- end
|
||||
|
||||
--点击装备按钮
|
||||
function this:OnClickTabBtn(_index)
|
||||
|
@ -750,7 +639,6 @@ function this:OnClickTabBtn(_index)
|
|||
this.itemNumText.text = Language[12181] .. LengthOfTable(allEquipTreasure)
|
||||
this:SetItemData(allEquipTreasure)
|
||||
end
|
||||
|
||||
this.CheckRedTab()
|
||||
end
|
||||
|
||||
|
@ -772,18 +660,18 @@ function this:SetItemData(_itemDatas)
|
|||
this.SingleItemDataShow(go, _itemDatas[index])
|
||||
end
|
||||
)
|
||||
if isPlayAnim then
|
||||
if isPlayAnim then
|
||||
if isFristOpenTime then
|
||||
isFristOpenTime:Stop()
|
||||
isFristOpenTime = nil
|
||||
end
|
||||
isFristOpenTime = Timer.New(function()
|
||||
this.mask:SetActive(false)
|
||||
end, 0.3):Start()
|
||||
this.mask:SetActive(true)
|
||||
end, 0.3):Start()
|
||||
this.mask:SetActive(true)
|
||||
SecTorPlayAnimByScroll(this.ScrollView)
|
||||
isPlayAnim = false
|
||||
end
|
||||
end
|
||||
end
|
||||
function this.SingleItemDataShow(_go, _itemData)
|
||||
if not itemConfig[_itemData.id] then
|
||||
|
|
Loading…
Reference in New Issue