【皮肤】提交
parent
3bc2b74ce5
commit
5026bdd0c3
|
|
@ -297,6 +297,43 @@ function this.GetHeroDataByHeroSIdAndMinSortId(_heroSId)
|
||||||
end
|
end
|
||||||
return heroData
|
return heroData
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--获取该静态id 没有穿皮肤的 sortid最小的英雄信息
|
||||||
|
function this.GetHeroDataByHeroSIdAndMinSortIdAndSkinId(_heroSId,_skinId)
|
||||||
|
local heroData = {}
|
||||||
|
|
||||||
|
local formationList = FormationManager.GetAllFormationHeroId()
|
||||||
|
for i, v in pairs(formationList) do
|
||||||
|
if heroDatas[i] then
|
||||||
|
local curData = heroDatas[i]
|
||||||
|
if curData.id == _heroSId and curData.skinId ~= _skinId then
|
||||||
|
if heroData and heroData.id then
|
||||||
|
if curData.sortId < heroData.sortId then
|
||||||
|
heroData = curData
|
||||||
|
end
|
||||||
|
else
|
||||||
|
heroData = curData
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if heroData and heroData.id then
|
||||||
|
return heroData
|
||||||
|
end
|
||||||
|
for i, v in pairs(heroDatas) do
|
||||||
|
if v.id == _heroSId and v.skinId ~= _skinId then
|
||||||
|
if heroData and heroData.id then
|
||||||
|
if v.sortId < heroData.sortId then
|
||||||
|
heroData = v
|
||||||
|
end
|
||||||
|
else
|
||||||
|
heroData = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
LogPink("heroData.dynamicId:"..heroData.dynamicId)
|
||||||
|
return heroData
|
||||||
|
end
|
||||||
--获取所有英雄信息(分解 回溯用 )
|
--获取所有英雄信息(分解 回溯用 )
|
||||||
function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) --0全部 1-6属性 7-9 3、4、5星
|
function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) --0全部 1-6属性 7-9 3、4、5星
|
||||||
local heros = {}
|
local heros = {}
|
||||||
|
|
@ -3301,6 +3338,7 @@ end
|
||||||
function this.ChangeDownSkinId(heroSId,skinId)
|
function this.ChangeDownSkinId(heroSId,skinId)
|
||||||
for k,v in pairs(heroDatas) do
|
for k,v in pairs(heroDatas) do
|
||||||
if v.id == heroSId and v.skinId == skinId then
|
if v.id == heroSId and v.skinId == skinId then
|
||||||
|
NetManager.ChangeHeroSkin(v.dynamicId,0,function() end)
|
||||||
v.skinId = 0
|
v.skinId = 0
|
||||||
v.skinConfig = heroConfig[v.id]
|
v.skinConfig = heroConfig[v.id]
|
||||||
v.live = GetResourcePath(v.skinConfig.Live)
|
v.live = GetResourcePath(v.skinConfig.Live)
|
||||||
|
|
|
||||||
|
|
@ -94,15 +94,21 @@ function RewardItemSingleShowPopup:BindEvent()
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.btnJump, function()
|
Util.AddClick(this.btnJump, function()
|
||||||
if itemConfigData.ItemType == ItemType.Skin then
|
if itemConfigData.ItemType == ItemType.Skin then
|
||||||
local skinId = ConfigManager.GetConfigData(ConfigName.HeroSkin,itemSid).Type
|
local skinConfig = ConfigManager.GetConfigData(ConfigName.HeroSkin,itemSid)
|
||||||
if HeroSkinManager.IsExist(skinId) then
|
if HeroSkinManager.IsExist(skinConfig.Type) then
|
||||||
PopupTipPanel.ShowTip("已解锁该皮肤,请在皮肤有效期之后再解锁")
|
PopupTipPanel.ShowTip("已解锁该皮肤,请在皮肤有效期之后再解锁")
|
||||||
else
|
else
|
||||||
local curResolveAllItemList = {}
|
local curResolveAllItemList = {}
|
||||||
table.insert(curResolveAllItemList,{itemId = itemSid,itemNum = 1})
|
table.insert(curResolveAllItemList,{itemId = itemSid,itemNum = 1})
|
||||||
NetManager.UseAndPriceItemRequest(0,curResolveAllItemList,function (drop)
|
NetManager.UseAndPriceItemRequest(0,curResolveAllItemList,function (drop)
|
||||||
PopupTipPanel.ShowTip("已成功解锁该皮肤,请去神将界面穿戴")
|
|
||||||
self:ClosePanel()
|
self:ClosePanel()
|
||||||
|
if HeroManager.GetCurHeroIsHaveBySid(skinConfig.HeroId) then
|
||||||
|
MsgPanel.ShowTwo(string.format("成功解锁皮肤%s,是否前往更换?",skinConfig.ReadingName),function() end,function()
|
||||||
|
local herodata = HeroManager.GetHeroDataByHeroSIdAndMinSortIdAndSkinId(skinConfig.HeroId,skinConfig.Type)
|
||||||
|
LogGreen("herodata.dynamicId:"..tostring(herodata.dynamicId))
|
||||||
|
UIManager.OpenPanel(UIName.RoleInfoPanel,herodata, HeroManager.GetAllHeroDatas(),true,4)
|
||||||
|
end,"取消","确定","",false,"")
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
elseif itemConfigData then
|
elseif itemConfigData then
|
||||||
|
|
@ -227,13 +233,13 @@ function RewardItemSingleShowPopup:OnShow()
|
||||||
for i = 1, #jumpSortData do
|
for i = 1, #jumpSortData do
|
||||||
if jumpSortData[i].id > 0 then
|
if jumpSortData[i].id > 0 then
|
||||||
if not RECHARGEABLE then--(是否开启充值)
|
if not RECHARGEABLE then--(是否开启充值)
|
||||||
if this.isRewardItemPop == true or itemConfigData.Id == 61 or itemConfigData.Id == 19 then
|
if this.isRewardItemPop == true or itemConfigData.Id == 61 or itemConfigData.Id == 19 or itemConfigData.ItemType == 17 then
|
||||||
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,false)
|
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,false)
|
||||||
else
|
else
|
||||||
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,true)
|
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,true)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if this.isRewardItemPop == true then
|
if this.isRewardItemPop == true or itemConfigData.ItemType == 17 then
|
||||||
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,false)
|
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,false)
|
||||||
else
|
else
|
||||||
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,true)
|
SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,true)
|
||||||
|
|
|
||||||
|
|
@ -208,8 +208,13 @@ function RoleInfoPanel:RemoveListener()
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function RoleInfoPanel:OnOpen(_curHeroData, _heroDatas,_isUpZhen)
|
function RoleInfoPanel:OnOpen(_curHeroData, _heroDatas,_isUpZhen,_index)
|
||||||
curHeroData, heroDatas,isUpZhen = _curHeroData, _heroDatas,_isUpZhen
|
curHeroData, heroDatas,isUpZhen = _curHeroData, _heroDatas,_isUpZhen
|
||||||
|
if _index and _index > 0 then
|
||||||
|
_CurPageIndex = _index
|
||||||
|
else
|
||||||
|
_CurPageIndex = 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 打开,重新打开时回调
|
-- 打开,重新打开时回调
|
||||||
|
|
@ -219,7 +224,7 @@ function RoleInfoPanel:OnShow()
|
||||||
isClickLeftOrRightBtn = true
|
isClickLeftOrRightBtn = true
|
||||||
this.upLvEffect:SetActive(false)
|
this.upLvEffect:SetActive(false)
|
||||||
for i = 1, #heroDatas do
|
for i = 1, #heroDatas do
|
||||||
if curHeroData == heroDatas[i] then
|
if curHeroData.dynamicId == heroDatas[i].dynamicId then
|
||||||
index = i
|
index = i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -89,44 +89,46 @@ function RoleSkinPanel:SetSingleData(go,data)
|
||||||
porpertys[go][1].gameObject:SetActive(true)
|
porpertys[go][1].gameObject:SetActive(true)
|
||||||
Util.GetGameObject(porpertys[go][1],"info"):GetComponent("Text").text = "获取途径"
|
Util.GetGameObject(porpertys[go][1],"info"):GetComponent("Text").text = "获取途径"
|
||||||
Util.AddOnceClick(porpertys[go][1].gameObject,function()
|
Util.AddOnceClick(porpertys[go][1].gameObject,function()
|
||||||
|
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, data.Id,function() end)
|
||||||
end)
|
end)
|
||||||
lock.gameObject:SetActive(true)
|
lock.gameObject:SetActive(true)
|
||||||
end
|
end
|
||||||
if data.Type == curHeroData.skinId or (curHeroData.skinId == 0 and data.IsDefault == 1) then
|
if data.Type == curHeroData.skinId or (curHeroData.skinId == 0 and data.IsDefault == 1) then
|
||||||
self.Select.transform:SetParent(Util.GetGameObject(go,"skinState").transform)
|
self.Select.transform:SetParent(Util.GetGameObject(go,"skinState").transform)
|
||||||
self.Select:GetComponent("RectTransform").localPosition = Vector3.zero
|
self.Select:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||||
elseif HeroSkinManager.IsExist(data.Type) or data.IsDefault == 1 then
|
|
||||||
local changeSkinId = data.IsDefault == 1 and 0 or data.Type
|
|
||||||
Util.AddOnceClick(go.gameObject,function()
|
|
||||||
NetManager.ChangeHeroSkin(curHeroData.dynamicId,changeSkinId,function()
|
|
||||||
poolManager:UnLoadLive(curHeroData.live, parent.curLiveObj)
|
|
||||||
HeroManager.ChangeSkinId(curHeroData.dynamicId,changeSkinId)
|
|
||||||
curHeroData = HeroManager.GetSingleHeroData(curHeroData.dynamicId)
|
|
||||||
curLiveName = curHeroData.Live
|
|
||||||
parent.curLiveObj = HeroManager.LoadHerolive(curHeroData,parent.curObj)
|
|
||||||
PopupTipPanel.ShowTip("已更换皮肤!")
|
|
||||||
isUnLoadLive = false
|
|
||||||
this:OnShow(0,parent,curHeroData)
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
Util.AddOnceClick(go.gameObject,function()
|
|
||||||
poolManager:UnLoadLive(curHeroData.live, parent.curLiveObj)
|
|
||||||
curLiveName = GetResourcePath(data.Live)
|
|
||||||
parent.curLiveObj = poolManager:LoadLive(GetResourcePath(data.Live), parent.curObj.transform,
|
|
||||||
Vector3.one * data.Scale, Vector3.New(data.Position[1], data.Position[2], 0))
|
|
||||||
PopupTipPanel.ShowTip("未获得此皮肤!")
|
|
||||||
isUnLoadLive = true
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
Util.AddOnceClick(go.gameObject,function()
|
||||||
|
local skinId = data.IsDefault == 1 and 0 or data.Type
|
||||||
|
this:BtnAction(skinId,data)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function RoleSkinPanel:BtnAction(skinId,data)
|
||||||
|
if skinId == curHeroData.skinId then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if HeroSkinManager.IsExist(skinId) or skinId == 0 then
|
||||||
|
NetManager.ChangeHeroSkin(curHeroData.dynamicId,skinId,function()
|
||||||
|
poolManager:UnLoadLive(curHeroData.live, parent.curLiveObj)
|
||||||
|
HeroManager.ChangeSkinId(curHeroData.dynamicId,skinId)
|
||||||
|
local tempdata = HeroManager.GetSingleHeroData(curHeroData.dynamicId)
|
||||||
|
curLiveName = tempdata.Live
|
||||||
|
parent.curLiveObj = HeroManager.LoadHerolive(tempdata,parent.curObj)
|
||||||
|
PopupTipPanel.ShowTip("已更换皮肤!")
|
||||||
|
this:OnShow(0,parent,tempdata)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
poolManager:UnLoadLive(curHeroData.live, parent.curLiveObj)
|
||||||
|
curLiveName = GetResourcePath(data.Live)
|
||||||
|
parent.curLiveObj = poolManager:LoadLive(GetResourcePath(data.Live), parent.curObj.transform,
|
||||||
|
Vector3.one * data.Scale, Vector3.New(data.Position[1], data.Position[2], 0))
|
||||||
|
PopupTipPanel.ShowTip("未获得此皮肤!")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
function RoleSkinPanel:OnHide()
|
function RoleSkinPanel:OnHide()
|
||||||
this.gameObject:SetActive(false)
|
this.gameObject:SetActive(false)
|
||||||
-- if isUnLoadLive then
|
|
||||||
-- poolManager:UnLoadLive(curLiveName, parent.curLiveObj)
|
|
||||||
-- parent.curLiveObj = HeroManager.LoadHerolive(curHeroData,parent.curObj)
|
|
||||||
-- isUnLoadLive = false
|
|
||||||
-- end
|
|
||||||
end
|
end
|
||||||
function RoleSkinPanel:OnClose()
|
function RoleSkinPanel:OnClose()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue