|
|
|
@ -2,25 +2,25 @@
|
|
|
|
RoleGiftPanel = Inherit(BasePanel)
|
|
|
|
RoleGiftPanel = Inherit(BasePanel)
|
|
|
|
local spcialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
|
|
|
|
local spcialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
|
|
|
|
local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
|
|
|
|
local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
|
|
|
|
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
|
|
|
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
|
|
|
RoleGiftPanel = Inherit(BasePanel)
|
|
|
|
RoleGiftPanel = Inherit(BasePanel)
|
|
|
|
local isGonming = 0
|
|
|
|
local isGonming = 0
|
|
|
|
local tableName={ "礼物","碎片"}
|
|
|
|
local tableName = { "礼物", "碎片" }
|
|
|
|
local isUpZhen = false
|
|
|
|
local isUpZhen = false
|
|
|
|
local this = RoleGiftPanel
|
|
|
|
local this = RoleGiftPanel
|
|
|
|
local indexBtnNum=0
|
|
|
|
local indexBtnNum = 0
|
|
|
|
local tabs={}
|
|
|
|
local tabs = {}
|
|
|
|
local redTabs={}
|
|
|
|
local redTabs = {}
|
|
|
|
local curHeroData=nil
|
|
|
|
local curHeroData = nil
|
|
|
|
local teamHero
|
|
|
|
local teamHero
|
|
|
|
local v1
|
|
|
|
local v1
|
|
|
|
local allUpIds={}
|
|
|
|
local allUpIds = {}
|
|
|
|
local upSuitId={}
|
|
|
|
local upSuitId = {}
|
|
|
|
local allEquip={}
|
|
|
|
local allEquip = {}
|
|
|
|
local index=0
|
|
|
|
local index = 0
|
|
|
|
local lv,curNum,maxNum
|
|
|
|
local lv, curNum, maxNum
|
|
|
|
local heroListData
|
|
|
|
local heroListData
|
|
|
|
local isDown=false
|
|
|
|
local isDown = false
|
|
|
|
--初始化组件(用于子类重写)RoleEquipChangePopup
|
|
|
|
--初始化组件(用于子类重写)RoleEquipChangePopup
|
|
|
|
function RoleGiftPanel:InitComponent()
|
|
|
|
function RoleGiftPanel:InitComponent()
|
|
|
|
--this.spLoader = SpriteLoader.New()
|
|
|
|
--this.spLoader = SpriteLoader.New()
|
|
|
|
@ -31,17 +31,17 @@ function RoleGiftPanel:InitComponent()
|
|
|
|
|
|
|
|
|
|
|
|
for i = 1, 2 do
|
|
|
|
for i = 1, 2 do
|
|
|
|
tabs[i] = Util.GetGameObject(self.transform, "Tabs/Btn" .. i)
|
|
|
|
tabs[i] = Util.GetGameObject(self.transform, "Tabs/Btn" .. i)
|
|
|
|
local nameTxt=Util.GetGameObject(tabs[i], "Text"):GetComponent("Text")
|
|
|
|
local nameTxt = Util.GetGameObject(tabs[i], "Text"):GetComponent("Text")
|
|
|
|
nameTxt.fontSize = GetCurLanguage() == 0 and 48 or 40
|
|
|
|
nameTxt.fontSize = GetCurLanguage() == 0 and 48 or 40
|
|
|
|
nameTxt.text=tableName[i]
|
|
|
|
nameTxt.text = tableName[i]
|
|
|
|
redTabs[i] = Util.GetGameObject(tabs[i], "red")
|
|
|
|
redTabs[i] = Util.GetGameObject(tabs[i], "red")
|
|
|
|
if i==2 then
|
|
|
|
if i == 2 then
|
|
|
|
tabs[i]:SetActive(false)
|
|
|
|
tabs[i]:SetActive(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
--effectList[i] = Util.GetGameObject(self.transform, "bg/equipInfo/equip" .. i .. "/effect")
|
|
|
|
--effectList[i] = Util.GetGameObject(self.transform, "bg/equipInfo/equip" .. i .. "/effect")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
this.titleTxt=Util.GetGameObject(self.gameObject, "title"):GetComponent("Text")
|
|
|
|
this.titleTxt = Util.GetGameObject(self.gameObject, "title"):GetComponent("Text")
|
|
|
|
this.titleTxt.text="英雄礼物"
|
|
|
|
this.titleTxt.text = "英雄礼物"
|
|
|
|
this.selectBtn = Util.GetGameObject(self.gameObject, "selectBtn")
|
|
|
|
this.selectBtn = Util.GetGameObject(self.gameObject, "selectBtn")
|
|
|
|
this.btnPrant = Util.GetGameObject(self.gameObject, "Tabs")
|
|
|
|
this.btnPrant = Util.GetGameObject(self.gameObject, "Tabs")
|
|
|
|
this.equipPreList2 = {}
|
|
|
|
this.equipPreList2 = {}
|
|
|
|
@ -59,54 +59,57 @@ function RoleGiftPanel:InitComponent()
|
|
|
|
this.allEquipUpRedPoint:SetActive(false)
|
|
|
|
this.allEquipUpRedPoint:SetActive(false)
|
|
|
|
this.ScrollBar = Util.GetGameObject(self.gameObject, "listObj/bg/Scrollbar"):GetComponent("Scrollbar")
|
|
|
|
this.ScrollBar = Util.GetGameObject(self.gameObject, "listObj/bg/Scrollbar"):GetComponent("Scrollbar")
|
|
|
|
local v2 = Util.GetGameObject(self.gameObject, "listObj/bg/scroll"):GetComponent("RectTransform").rect
|
|
|
|
local v2 = Util.GetGameObject(self.gameObject, "listObj/bg/scroll"):GetComponent("RectTransform").rect
|
|
|
|
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.transform, "listObj/bg/scroll").transform,
|
|
|
|
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,
|
|
|
|
this.equipPre, this.ScrollBar,Vector2.New(v2.width, v2.height),1 , 4, Vector2.New(40, 25))
|
|
|
|
Util.GetGameObject(self.transform, "listObj/bg/scroll").transform,
|
|
|
|
|
|
|
|
this.equipPre, this.ScrollBar, Vector2.New(v2.width, v2.height), 1, 4, Vector2.New(40, 25))
|
|
|
|
this.ScrollView.moveTween.MomentumAmount = 1
|
|
|
|
this.ScrollView.moveTween.MomentumAmount = 1
|
|
|
|
this.ScrollView.moveTween.Strength = 1
|
|
|
|
this.ScrollView.moveTween.Strength = 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v1 = Util.GetGameObject(self.gameObject, "upScroll"):GetComponent("RectTransform").rect
|
|
|
|
v1 = Util.GetGameObject(self.gameObject, "upScroll"):GetComponent("RectTransform").rect
|
|
|
|
this.UpScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.transform, "upScroll").transform,this.upItemPre, nil,Vector2.New(v1.width,v1.height),1 ,4, Vector2.New(50,65))
|
|
|
|
this.UpScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,
|
|
|
|
|
|
|
|
Util.GetGameObject(self.transform, "upScroll").transform, this.upItemPre, nil, Vector2.New(v1.width, v1.height),
|
|
|
|
|
|
|
|
1, 4, Vector2.New(50, 65))
|
|
|
|
this.UpScrollView.moveTween.MomentumAmount = 1
|
|
|
|
this.UpScrollView.moveTween.MomentumAmount = 1
|
|
|
|
this.UpScrollView.moveTween.Strength = 1
|
|
|
|
this.UpScrollView.moveTween.Strength = 1
|
|
|
|
Util.GetGameObject(self.transform, "powerBtn"):GetComponent("Image").sprite = Util.LoadSprite("UI_hz_shenjiang_15_zh")
|
|
|
|
Util.GetGameObject(self.transform, "powerBtn"):GetComponent("Image").sprite = Util.LoadSprite(
|
|
|
|
|
|
|
|
"UI_hz_shenjiang_15_zh")
|
|
|
|
this.force = Util.GetGameObject(self.transform, "powerBtn/value"):GetComponent("Text")
|
|
|
|
this.force = Util.GetGameObject(self.transform, "powerBtn/value"):GetComponent("Text")
|
|
|
|
this.itemNumText = Util.GetGameObject(self.transform, "itemNumText"):GetComponent("Text")
|
|
|
|
this.itemNumText = Util.GetGameObject(self.transform, "itemNumText"):GetComponent("Text")
|
|
|
|
this.upLvEffect = Util.GetGameObject(self.transform, "powerBtn/effect")
|
|
|
|
this.upLvEffect = Util.GetGameObject(self.transform, "powerBtn/effect")
|
|
|
|
|
|
|
|
|
|
|
|
this.emptyObj = Util.GetGameObject(self.transform, "listObj/bg/emptyObj")
|
|
|
|
this.emptyObj = Util.GetGameObject(self.transform, "listObj/bg/emptyObj")
|
|
|
|
this.emptyObj.gameObject:SetActive(false)
|
|
|
|
this.emptyObj.gameObject:SetActive(false)
|
|
|
|
this.mask = Util.GetGameObject(self.gameObject, "mask")
|
|
|
|
this.mask = Util.GetGameObject(self.gameObject, "mask")
|
|
|
|
this.mask:SetActive(false)
|
|
|
|
this.mask:SetActive(false)
|
|
|
|
this.collectImg=Util.GetGameObject(self.gameObject, "collectImg"):GetComponent("Image")
|
|
|
|
this.collectImg = Util.GetGameObject(self.gameObject, "collectImg"):GetComponent("Image")
|
|
|
|
this.lvTxt=Util.GetGameObject(self.gameObject, "lvTxt"):GetComponent("Text")
|
|
|
|
this.lvTxt = Util.GetGameObject(self.gameObject, "lvTxt"):GetComponent("Text")
|
|
|
|
--this.collectImg.sprite=Util.LoadSprite("gh_tt_8")
|
|
|
|
--this.collectImg.sprite=Util.LoadSprite("gh_tt_8")
|
|
|
|
|
|
|
|
|
|
|
|
this.btn_help=Util.GetGameObject(self.gameObject, "btn_help")
|
|
|
|
this.btn_help = Util.GetGameObject(self.gameObject, "btn_help")
|
|
|
|
this.listObj = Util.GetGameObject(self.transform, "listObj")
|
|
|
|
this.listObj = Util.GetGameObject(self.transform, "listObj")
|
|
|
|
this.listCloseBtn = Util.GetGameObject(self.transform, "listObj/bg/btn_close")
|
|
|
|
this.listCloseBtn = Util.GetGameObject(self.transform, "listObj/bg/btn_close")
|
|
|
|
Util.GetGameObject(self.transform, "listObj/bg/title (1)"):GetComponent("Text").text="神将礼物"
|
|
|
|
Util.GetGameObject(self.transform, "listObj/bg/title (1)"):GetComponent("Text").text = "神将礼物"
|
|
|
|
this.proTitle = Util.GetGameObject(self.transform, "proTitle/name/text"):GetComponent("Text")
|
|
|
|
this.proTitle = Util.GetGameObject(self.transform, "proTitle/name/text"):GetComponent("Text")
|
|
|
|
this.proTitle.text="当前礼物加成"
|
|
|
|
this.proTitle.text = "当前礼物加成"
|
|
|
|
this.proGrid = Util.GetGameObject(self.transform, "pro")
|
|
|
|
this.proGrid = Util.GetGameObject(self.transform, "pro")
|
|
|
|
this.proPre=Util.GetGameObject(self.transform, "pro/name")
|
|
|
|
this.proPre = Util.GetGameObject(self.transform, "pro/name")
|
|
|
|
--this.tipInfo = Util.GetGameObject(self.transform, "tipInfo"):GetComponent("Text")
|
|
|
|
--this.tipInfo = Util.GetGameObject(self.transform, "tipInfo"):GetComponent("Text")
|
|
|
|
|
|
|
|
|
|
|
|
this.proEmptyObj = Util.GetGameObject(self.transform, "proEmptyObj")
|
|
|
|
this.proEmptyObj = Util.GetGameObject(self.transform, "proEmptyObj")
|
|
|
|
Util.GetGameObject(self.transform, "proEmptyObj/Text"):GetComponent("Text").text="暂无加成属性"
|
|
|
|
Util.GetGameObject(self.transform, "proEmptyObj/Text"):GetComponent("Text").text = "暂无加成属性"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
function RoleGiftPanel:BindEvent()
|
|
|
|
function RoleGiftPanel:BindEvent()
|
|
|
|
|
|
|
|
Util.AddClick(this.listCloseBtn, function()
|
|
|
|
Util.AddClick(this.listCloseBtn,function()
|
|
|
|
|
|
|
|
this.listObj:SetActive(false)
|
|
|
|
this.listObj:SetActive(false)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
Util.AddClick(this.btn_help,function()
|
|
|
|
Util.AddClick(this.btn_help, function()
|
|
|
|
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.Gift,-150,0)
|
|
|
|
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.Gift, -150, 0)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
Util.AddClick(this.collectImg.gameObject,function()
|
|
|
|
Util.AddClick(this.collectImg.gameObject, function()
|
|
|
|
-- local data = {}
|
|
|
|
-- local data = {}
|
|
|
|
-- local singData = {}
|
|
|
|
-- local singData = {}
|
|
|
|
-- singData.title = "当前礼物总加成"
|
|
|
|
-- singData.title = "当前礼物总加成"
|
|
|
|
@ -115,54 +118,54 @@ function RoleGiftPanel:BindEvent()
|
|
|
|
-- table.insert(data,singData)
|
|
|
|
-- table.insert(data,singData)
|
|
|
|
-- UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.IncarnationDes,data)
|
|
|
|
-- UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.IncarnationDes,data)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
Util.AddClick(this.btnBack,function()
|
|
|
|
Util.AddClick(this.btnBack, function()
|
|
|
|
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
|
|
|
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
|
|
|
self:ClosePanel()
|
|
|
|
self:ClosePanel()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
Util.AddClick(this.leftBtn,function()
|
|
|
|
Util.AddClick(this.leftBtn, function()
|
|
|
|
index = (index - 1 > 0 and index - 1 or #heroListData)
|
|
|
|
index = (index - 1 > 0 and index - 1 or #heroListData)
|
|
|
|
curHeroData = heroListData[index]
|
|
|
|
curHeroData = heroListData[index]
|
|
|
|
this.RefreshWindowData()
|
|
|
|
this.RefreshWindowData()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
Util.AddClick(this.rightBtn,function()
|
|
|
|
Util.AddClick(this.rightBtn, function()
|
|
|
|
index = (index + 1 <= #heroListData and index + 1 or 1)
|
|
|
|
index = (index + 1 <= #heroListData and index + 1 or 1)
|
|
|
|
curHeroData = heroListData[index]
|
|
|
|
curHeroData = heroListData[index]
|
|
|
|
this.RefreshWindowData()
|
|
|
|
this.RefreshWindowData()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
Util.AddOnceClick(this.allEquipUp,function()
|
|
|
|
Util.AddOnceClick(this.allEquipUp, function()
|
|
|
|
local canNum=curNum-#allUpIds
|
|
|
|
local canNum = curNum - #allUpIds
|
|
|
|
if canNum>0 then
|
|
|
|
if canNum > 0 then
|
|
|
|
local list={}
|
|
|
|
local list = {}
|
|
|
|
table.sort(allEquip,function(a,b)
|
|
|
|
table.sort(allEquip, function(a, b)
|
|
|
|
return equipConfig[a.id].Quality>equipConfig[b.id].Quality
|
|
|
|
return equipConfig[a.id].Quality > equipConfig[b.id].Quality
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
for i=1,#allEquip do
|
|
|
|
for i = 1, #allEquip do
|
|
|
|
if i<=canNum then
|
|
|
|
if i <= canNum then
|
|
|
|
if CheckListIsContainValue1(allUpIds,allEquip[i].id)==false and CheckListIsContainValue1(upSuitId,equipConfig[allEquip[i].id].SuiteID)==false then
|
|
|
|
if CheckListIsContainValue1(allUpIds, allEquip[i].id) == false and CheckListIsContainValue1(upSuitId, equipConfig[allEquip[i].id].SuiteID) == false then
|
|
|
|
table.insert(list,allEquip[i].id)
|
|
|
|
table.insert(list, allEquip[i].id)
|
|
|
|
table.insert(upSuitId,equipConfig[allEquip[i].id].SuiteID)
|
|
|
|
table.insert(upSuitId, equipConfig[allEquip[i].id].SuiteID)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
NetManager.GiftEquipWearRequest(1,curHeroData.dynamicId,list,function()
|
|
|
|
NetManager.GiftEquipWearRequest(1, curHeroData.dynamicId, list, function()
|
|
|
|
GiftManager.SetHeroGift(curHeroData.dynamicId,list,1)
|
|
|
|
GiftManager.SetHeroGift(curHeroData.dynamicId, list, 1)
|
|
|
|
this.RefreshWindowData()
|
|
|
|
this.RefreshWindowData()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
Util.AddOnceClick(this.allEquipDown,function()
|
|
|
|
Util.AddOnceClick(this.allEquipDown, function()
|
|
|
|
isDown=true
|
|
|
|
isDown = true
|
|
|
|
NetManager.GiftEquipWearRequest(2,curHeroData.dynamicId,allUpIds,function()
|
|
|
|
NetManager.GiftEquipWearRequest(2, curHeroData.dynamicId, allUpIds, function()
|
|
|
|
isDown=false
|
|
|
|
isDown = false
|
|
|
|
GiftManager.SetHeroGift(curHeroData.dynamicId,allUpIds,2)
|
|
|
|
GiftManager.SetHeroGift(curHeroData.dynamicId, allUpIds, 2)
|
|
|
|
this.RefreshWindowData()
|
|
|
|
this.RefreshWindowData()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
for i = 1, 2 do
|
|
|
|
for i = 1, 2 do
|
|
|
|
Util.AddClick(tabs[i],function()
|
|
|
|
Util.AddClick(tabs[i], function()
|
|
|
|
-- isPlayAnim = true
|
|
|
|
-- isPlayAnim = true
|
|
|
|
if i == indexBtnNum then
|
|
|
|
if i == indexBtnNum then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
@ -171,7 +174,6 @@ function RoleGiftPanel:BindEvent()
|
|
|
|
this:OnClickTabBtn(indexBtnNum)
|
|
|
|
this:OnClickTabBtn(indexBtnNum)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
@ -184,12 +186,10 @@ function RoleGiftPanel:RemoveListener()
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.RefreshWindowData)
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.RefreshWindowData)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
|
|
function RoleGiftPanel:OnOpen(...)
|
|
|
|
function RoleGiftPanel:OnOpen(...)
|
|
|
|
local data = {...}
|
|
|
|
local data = { ... }
|
|
|
|
curHeroData=data[1]
|
|
|
|
curHeroData = data[1]
|
|
|
|
if data[2] then
|
|
|
|
if data[2] then
|
|
|
|
heroListData = data[2]
|
|
|
|
heroListData = data[2]
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -197,6 +197,7 @@ function RoleGiftPanel:OnOpen(...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
this.listObj:SetActive(false)
|
|
|
|
this.listObj:SetActive(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function RoleGiftPanel:OnShow()
|
|
|
|
function RoleGiftPanel:OnShow()
|
|
|
|
for i = 1, #heroListData do
|
|
|
|
for i = 1, #heroListData do
|
|
|
|
if curHeroData == heroListData[i] then
|
|
|
|
if curHeroData == heroListData[i] then
|
|
|
|
@ -208,17 +209,15 @@ function RoleGiftPanel:OnShow()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function this:OnSortingOrderChange()
|
|
|
|
function this:OnSortingOrderChange()
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function this.RefreshWindowData()
|
|
|
|
function this.RefreshWindowData()
|
|
|
|
local WarPower = 0
|
|
|
|
local WarPower = 0
|
|
|
|
if isDown then
|
|
|
|
if isDown then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
isUpZhen=teamHero[curHeroData.dynamicId]
|
|
|
|
isUpZhen = teamHero[curHeroData.dynamicId]
|
|
|
|
--[[
|
|
|
|
--[[
|
|
|
|
if isUpZhen then
|
|
|
|
if isUpZhen then
|
|
|
|
WarPower = HeroPowerManager.GetHeroPower(curHeroData.dynamicId, FormationTypeDef.FORMATION_NORMAL)
|
|
|
|
WarPower = HeroPowerManager.GetHeroPower(curHeroData.dynamicId, FormationTypeDef.FORMATION_NORMAL)
|
|
|
|
@ -229,80 +228,80 @@ function this.RefreshWindowData()
|
|
|
|
|
|
|
|
|
|
|
|
]]
|
|
|
|
]]
|
|
|
|
this.force.text = ""
|
|
|
|
this.force.text = ""
|
|
|
|
--显示上面赠送的
|
|
|
|
--显示上面赠送的
|
|
|
|
local list=GiftManager.GetHeroGifts(curHeroData.dynamicId)
|
|
|
|
local list = GiftManager.GetHeroGifts(curHeroData.dynamicId)
|
|
|
|
lv,curNum,maxNum=GiftManager.GetCollectLvAndNum()
|
|
|
|
lv, curNum, maxNum = GiftManager.GetCollectLvAndNum()
|
|
|
|
--if #list>=50 then
|
|
|
|
--if #list>=50 then
|
|
|
|
--curNum=#list+6
|
|
|
|
--curNum=#list+6
|
|
|
|
--maxNum=#list+6
|
|
|
|
--maxNum=#list+6
|
|
|
|
--else
|
|
|
|
--else
|
|
|
|
curNum=12
|
|
|
|
curNum = 12
|
|
|
|
maxNum=12
|
|
|
|
maxNum = 12
|
|
|
|
--end
|
|
|
|
--end
|
|
|
|
this.lvTxt.text="收集度"..lv.."级"
|
|
|
|
this.lvTxt.text = "收集度" .. lv .. "级"
|
|
|
|
--LogError("lv========="..lv.." curnum=="..curNum.." maxNum=="..maxNum)
|
|
|
|
--LogError("lv========="..lv.." curnum=="..curNum.." maxNum=="..maxNum)
|
|
|
|
--maxNum=0
|
|
|
|
--maxNum=0
|
|
|
|
local giftDatas={}
|
|
|
|
local giftDatas = {}
|
|
|
|
allUpIds={}
|
|
|
|
allUpIds = {}
|
|
|
|
upSuitId={}
|
|
|
|
upSuitId = {}
|
|
|
|
for i=1,maxNum do
|
|
|
|
for i = 1, maxNum do
|
|
|
|
local data={}
|
|
|
|
local data = {}
|
|
|
|
data.type=1
|
|
|
|
data.type = 1
|
|
|
|
data.qua=0
|
|
|
|
data.qua = 0
|
|
|
|
data.id=0
|
|
|
|
data.id = 0
|
|
|
|
data.isRed=false
|
|
|
|
data.isRed = false
|
|
|
|
if i<=#list then
|
|
|
|
if i <= #list then
|
|
|
|
data.type=2
|
|
|
|
data.type = 2
|
|
|
|
data.id=list[i]
|
|
|
|
data.id = list[i]
|
|
|
|
data.qua=itemConfig[list[i]].Quantity
|
|
|
|
data.qua = itemConfig[list[i]].Quantity
|
|
|
|
table.insert(allUpIds,data.id)
|
|
|
|
table.insert(allUpIds, data.id)
|
|
|
|
table.insert(upSuitId,equipConfig[data.id].SuiteID)
|
|
|
|
table.insert(upSuitId, equipConfig[data.id].SuiteID)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
data.isRed=GiftManager.CheckRoleRedPointById(curHeroData.dynamicId)
|
|
|
|
data.isRed = GiftManager.CheckRoleRedPointById(curHeroData.dynamicId)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
table.insert(giftDatas,data)
|
|
|
|
table.insert(giftDatas, data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
table.sort(giftDatas,function(a,b)
|
|
|
|
table.sort(giftDatas, function(a, b)
|
|
|
|
if a.type==b.type then
|
|
|
|
if a.type == b.type then
|
|
|
|
if a.qua and a.qua==b.qua then
|
|
|
|
if a.qua and a.qua == b.qua then
|
|
|
|
return a.id<b.id
|
|
|
|
return a.id < b.id
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return a.qua>b.qua
|
|
|
|
return a.qua > b.qua
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return a.type>b.type
|
|
|
|
return a.type > b.type
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
--LogError("当前礼物数量:"..#list)
|
|
|
|
--LogError("当前礼物数量:"..#list)
|
|
|
|
this.UpScrollView:SetData(giftDatas,
|
|
|
|
this.UpScrollView:SetData(giftDatas,
|
|
|
|
|
|
|
|
function(index, go)
|
|
|
|
function(index, go)
|
|
|
|
this.SingleUpItemShow(go, giftDatas[index],index)
|
|
|
|
this.SingleUpItemShow(go, giftDatas[index], index)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
local proList=GiftManager.GetHeroGiftAddPro(curHeroData.dynamicId)
|
|
|
|
local proList = GiftManager.GetHeroGiftAddPro(curHeroData.dynamicId)
|
|
|
|
table.insert(proList,string.format("英雄潜能等级+%s",GiftManager.GetHeroGiftAddPotencyLv(curHeroData.dynamicId)))
|
|
|
|
table.insert(proList, string.format("英雄潜能等级+%s", GiftManager.GetHeroGiftAddPotencyLv(curHeroData.dynamicId)))
|
|
|
|
local originalList=GiftManager.GetHeroGiftAddOriginalPro(curHeroData.dynamicId)
|
|
|
|
local originalList = GiftManager.GetHeroGiftAddOriginalPro(curHeroData.dynamicId)
|
|
|
|
if proList and #proList>0 then
|
|
|
|
if proList and #proList > 0 then
|
|
|
|
this.proGrid:SetActive(true)
|
|
|
|
this.proGrid:SetActive(true)
|
|
|
|
this.proEmptyObj:SetActive(false)
|
|
|
|
this.proEmptyObj:SetActive(false)
|
|
|
|
local len=this.proGrid.transform.childCount
|
|
|
|
local len = this.proGrid.transform.childCount
|
|
|
|
local create=#proList-len
|
|
|
|
local create = #proList - len
|
|
|
|
if create>0 then
|
|
|
|
if create > 0 then
|
|
|
|
for i=1,create do
|
|
|
|
for i = 1, create do
|
|
|
|
newObjToParent(this.proPre,this.proGrid)
|
|
|
|
newObjToParent(this.proPre, this.proGrid)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
len=this.proGrid.transform.childCount
|
|
|
|
len = this.proGrid.transform.childCount
|
|
|
|
for i=1,len do
|
|
|
|
for i = 1, len do
|
|
|
|
if i<=#proList then
|
|
|
|
if i <= #proList then
|
|
|
|
--this.proGrid.transform:GetChild(i-1).gameObject:SetActive(true)
|
|
|
|
--this.proGrid.transform:GetChild(i-1).gameObject:SetActive(true)
|
|
|
|
--LogError("originalList[i]======================"..originalList[i])
|
|
|
|
--LogError("originalList[i]======================"..originalList[i])
|
|
|
|
--this.proGrid.transform:GetChild(i-1):GetComponent("Text").text=proList[i]
|
|
|
|
--this.proGrid.transform:GetChild(i-1):GetComponent("Text").text=proList[i]
|
|
|
|
this.SingleProShowData({proId=i,proVal=proList[i]},this.proGrid.transform:GetChild(i-1).gameObject)
|
|
|
|
this.SingleProShowData({ proId = i, proVal = proList[i] },
|
|
|
|
|
|
|
|
this.proGrid.transform:GetChild(i - 1).gameObject)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
this.proGrid.transform:GetChild(i-1).gameObject:SetActive(false)
|
|
|
|
this.proGrid.transform:GetChild(i - 1).gameObject:SetActive(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -313,27 +312,29 @@ function this.RefreshWindowData()
|
|
|
|
--显示下面可赠送的
|
|
|
|
--显示下面可赠送的
|
|
|
|
this:OnClickTabBtn(1)
|
|
|
|
this:OnClickTabBtn(1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
function this.SingleProShowData(data,go)
|
|
|
|
|
|
|
|
|
|
|
|
function this.SingleProShowData(data, go)
|
|
|
|
go:SetActive(true)
|
|
|
|
go:SetActive(true)
|
|
|
|
for i = 1, 2 do
|
|
|
|
for i = 1, 2 do
|
|
|
|
local curGo = go .transform:GetChild(i-1).gameObject
|
|
|
|
local curGo = go.transform:GetChild(i - 1).gameObject
|
|
|
|
if #data > 1 then
|
|
|
|
if #data > 1 then
|
|
|
|
curGo:SetActive(true)
|
|
|
|
curGo:SetActive(true)
|
|
|
|
Util.GetGameObject(curGo, "proName"):GetComponent("Text").text = GetLanguageStrById(propertyConfig[data[i].proId].Info)..":"
|
|
|
|
Util.GetGameObject(curGo, "proName"):GetComponent("Text").text = GetLanguageStrById(propertyConfig
|
|
|
|
|
|
|
|
[data[i].proId].Info) .. ":"
|
|
|
|
local proVale = Util.GetGameObject(curGo, "proVale"):GetComponent("Text")
|
|
|
|
local proVale = Util.GetGameObject(curGo, "proVale"):GetComponent("Text")
|
|
|
|
if propertyConfig[data[i].proId].Style == 1 then--绝对值
|
|
|
|
if propertyConfig[data[i].proId].Style == 1 then --绝对值
|
|
|
|
proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal)
|
|
|
|
proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal)
|
|
|
|
elseif propertyConfig[data[i].proId].Style == 2 then--百分百
|
|
|
|
elseif propertyConfig[data[i].proId].Style == 2 then --百分百
|
|
|
|
-- 暴击默认 10% 前端加显示
|
|
|
|
-- 暴击默认 10% 前端加显示
|
|
|
|
-- LogError("str:"..data[i].proId.." ".. GetLanguageStrById(propertyConfig[data[i].proId].Info))
|
|
|
|
-- LogError("str:"..data[i].proId.." ".. GetLanguageStrById(propertyConfig[data[i].proId].Info))
|
|
|
|
if data[i].proId == 55 then
|
|
|
|
if data[i].proId == 55 then
|
|
|
|
proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal*100 + 1000)
|
|
|
|
proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal * 100 + 1000)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal*100)
|
|
|
|
proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal * 100)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Util.GetGameObject(curGo, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(propertyConfig[data[i].proId].Icon)
|
|
|
|
Util.GetGameObject(curGo, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(propertyConfig
|
|
|
|
|
|
|
|
[data[i].proId].Icon)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
curGo:SetActive(false)
|
|
|
|
curGo:SetActive(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@ -341,60 +342,59 @@ function this.SingleProShowData(data,go)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--显示上面几个
|
|
|
|
--显示上面几个
|
|
|
|
function this.SingleUpItemShow(_go,data,_index)
|
|
|
|
function this.SingleUpItemShow(_go, data, _index)
|
|
|
|
_go:SetActive(true)
|
|
|
|
_go:SetActive(true)
|
|
|
|
_go.transform:SetAsFirstSibling()
|
|
|
|
_go.transform:SetAsFirstSibling()
|
|
|
|
--local frame=_go:GetComponent("Image")
|
|
|
|
--local frame=_go:GetComponent("Image")
|
|
|
|
local frame=Util.GetGameObject(_go,"Image"):GetComponent("Image")
|
|
|
|
local frame = Util.GetGameObject(_go, "Image"):GetComponent("Image")
|
|
|
|
local icon=Util.GetGameObject(_go,"icon"):GetComponent("Image")
|
|
|
|
local icon = Util.GetGameObject(_go, "icon"):GetComponent("Image")
|
|
|
|
local name=Util.GetGameObject(_go,"name"):GetComponent("Text")
|
|
|
|
local name = Util.GetGameObject(_go, "name"):GetComponent("Text")
|
|
|
|
local lockObj=Util.GetGameObject(_go,"lock")
|
|
|
|
local lockObj = Util.GetGameObject(_go, "lock")
|
|
|
|
local lockText=Util.GetGameObject(_go,"Text"):GetComponent("Text")
|
|
|
|
local lockText = Util.GetGameObject(_go, "Text"):GetComponent("Text")
|
|
|
|
local add=Util.GetGameObject(_go,"add")
|
|
|
|
local add = Util.GetGameObject(_go, "add")
|
|
|
|
local red=Util.GetGameObject(_go,"red")
|
|
|
|
local red = Util.GetGameObject(_go, "red")
|
|
|
|
local starGrid=Util.GetGameObject(_go,"starGrid")
|
|
|
|
local starGrid = Util.GetGameObject(_go, "starGrid")
|
|
|
|
if data.id and data.id~=0 then
|
|
|
|
if data.id and data.id ~= 0 then
|
|
|
|
red:SetActive(false)
|
|
|
|
red:SetActive(false)
|
|
|
|
frame.sprite=Util.LoadSprite(GetQuantityImageByquality(itemConfig[data.id].Quantity))
|
|
|
|
frame.sprite = Util.LoadSprite(GetQuantityImageByquality(itemConfig[data.id].Quantity))
|
|
|
|
icon.gameObject:SetActive(true)
|
|
|
|
icon.gameObject:SetActive(true)
|
|
|
|
name.gameObject:SetActive(true)
|
|
|
|
name.gameObject:SetActive(true)
|
|
|
|
lockObj:SetActive(false)
|
|
|
|
lockObj:SetActive(false)
|
|
|
|
starGrid:SetActive(true)
|
|
|
|
starGrid:SetActive(true)
|
|
|
|
lockText.gameObject:SetActive(false)
|
|
|
|
lockText.gameObject:SetActive(false)
|
|
|
|
add:SetActive(false)
|
|
|
|
add:SetActive(false)
|
|
|
|
name.text= GetLanguageStrById(itemConfig[data.id].Name)
|
|
|
|
name.text = GetLanguageStrById(itemConfig[data.id].Name)
|
|
|
|
icon.sprite=Util.LoadSprite(GetResourcePath(itemConfig[data.id].ResourceID))
|
|
|
|
icon.sprite = Util.LoadSprite(GetResourcePath(itemConfig[data.id].ResourceID))
|
|
|
|
SetHeroStars(starGrid,equipConfig[data.id].Star,1,nil,-15)
|
|
|
|
SetHeroStars(starGrid, equipConfig[data.id].Star, 1, nil, -15)
|
|
|
|
Util.AddOnceClick(icon.gameObject,function()
|
|
|
|
Util.AddOnceClick(icon.gameObject, function()
|
|
|
|
if curHeroData==nil then
|
|
|
|
if curHeroData == nil then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
BagManager.isBagPanel=false
|
|
|
|
|
|
|
|
--UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,data,2,false,nil,curHeroData,4)
|
|
|
|
|
|
|
|
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,data,nil,false,false,true)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
BagManager.isBagPanel = false
|
|
|
|
|
|
|
|
--UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,data,2,false,nil,curHeroData,4)
|
|
|
|
|
|
|
|
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this, data,curHeroData, nil, false, false, true)
|
|
|
|
|
|
|
|
end
|
|
|
|
)
|
|
|
|
)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
frame.sprite=Util.LoadSprite("X1_tongyong_daojukuang_07")
|
|
|
|
frame.sprite = Util.LoadSprite("X1_tongyong_daojukuang_07")
|
|
|
|
--frame.gameObject:SetActive(false)
|
|
|
|
--frame.gameObject:SetActive(false)
|
|
|
|
icon.gameObject:SetActive(false)
|
|
|
|
icon.gameObject:SetActive(false)
|
|
|
|
name.gameObject:SetActive(false)
|
|
|
|
name.gameObject:SetActive(false)
|
|
|
|
starGrid:SetActive(false)
|
|
|
|
starGrid:SetActive(false)
|
|
|
|
if _index>curNum then
|
|
|
|
if _index > curNum then
|
|
|
|
lockObj:SetActive(true)
|
|
|
|
lockObj:SetActive(true)
|
|
|
|
add:SetActive(false)
|
|
|
|
add:SetActive(false)
|
|
|
|
red:SetActive(false)
|
|
|
|
red:SetActive(false)
|
|
|
|
lockText.gameObject:SetActive(true)
|
|
|
|
lockText.gameObject:SetActive(true)
|
|
|
|
lockText.text="收集度"..lv+1 .."级解锁"
|
|
|
|
lockText.text = "收集度" .. lv + 1 .. "级解锁"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
lockObj:SetActive(false)
|
|
|
|
lockObj:SetActive(false)
|
|
|
|
lockText.gameObject:SetActive(false)
|
|
|
|
lockText.gameObject:SetActive(false)
|
|
|
|
add:SetActive(true)
|
|
|
|
add:SetActive(true)
|
|
|
|
red:SetActive(data.isRed)
|
|
|
|
red:SetActive(data.isRed)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Util.AddOnceClick(add,function()
|
|
|
|
Util.AddOnceClick(add, function()
|
|
|
|
this.listObj:SetActive(true)
|
|
|
|
this.listObj:SetActive(true)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@ -405,45 +405,43 @@ function this:OnClickTabBtn(_index)
|
|
|
|
this:SetSelectBtn()
|
|
|
|
this:SetSelectBtn()
|
|
|
|
allEquip = BagManager.GetBagItemDataByItemType(ItemBaseType.HeroGift)
|
|
|
|
allEquip = BagManager.GetBagItemDataByItemType(ItemBaseType.HeroGift)
|
|
|
|
-- this:SortEquipDatas(allEquip)
|
|
|
|
-- this:SortEquipDatas(allEquip)
|
|
|
|
local count = 0
|
|
|
|
local count = 0
|
|
|
|
for i=1,#allEquip do
|
|
|
|
for i = 1, #allEquip do
|
|
|
|
count = count + 1
|
|
|
|
count = count + 1
|
|
|
|
if CheckListIsContainValue1(allUpIds,allEquip[i].id) or CheckListIsContainValue1(upSuitId,equipConfig[allEquip[i].id].SuiteID) then
|
|
|
|
if CheckListIsContainValue1(allUpIds, allEquip[i].id) or CheckListIsContainValue1(upSuitId, equipConfig[allEquip[i].id].SuiteID) then
|
|
|
|
allEquip[i].isUp=1
|
|
|
|
allEquip[i].isUp = 1
|
|
|
|
--LogError("rrrrrrrrrrrrrrrr:"..tostring(allEquip[i].id).."/"..tostring(equipConfig[allEquip[i].id].SuiteID))
|
|
|
|
--LogError("rrrrrrrrrrrrrrrr:"..tostring(allEquip[i].id).."/"..tostring(equipConfig[allEquip[i].id].SuiteID))
|
|
|
|
else
|
|
|
|
else
|
|
|
|
allEquip[i].isUp=2
|
|
|
|
allEquip[i].isUp = 2
|
|
|
|
--LogError("bbbbbbbbbbbbbbbb:"..tostring(allEquip[i].id).."/"..tostring(equipConfig[allEquip[i].id].SuiteID))
|
|
|
|
--LogError("bbbbbbbbbbbbbbbb:"..tostring(allEquip[i].id).."/"..tostring(equipConfig[allEquip[i].id].SuiteID))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
table.sort(allEquip,function(a,b)
|
|
|
|
table.sort(allEquip, function(a, b)
|
|
|
|
if a.isUp==b.isUp then
|
|
|
|
if a.isUp == b.isUp then
|
|
|
|
if a.quality==b.quality then
|
|
|
|
if a.quality == b.quality then
|
|
|
|
return a.id<b.id
|
|
|
|
return a.id < b.id
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return a.quality>b.quality
|
|
|
|
return a.quality > b.quality
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return a.isUp > b.isUp
|
|
|
|
return a.isUp > b.isUp
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
--"装备数量:"
|
|
|
|
--"装备数量:"
|
|
|
|
this.itemNumText.text = "礼物种类:" .. count
|
|
|
|
this.itemNumText.text = "礼物种类:" .. count
|
|
|
|
--LogError("xxxxxxxxxxxxxxxxxxxx"..#allEquip)
|
|
|
|
--LogError("xxxxxxxxxxxxxxxxxxxx"..#allEquip)
|
|
|
|
this:SetItemData(allEquip)
|
|
|
|
this:SetItemData(allEquip)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--this.CheckRedTab()
|
|
|
|
--this.CheckRedTab()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function this:SetItemData(_itemDatas)
|
|
|
|
function this:SetItemData(_itemDatas)
|
|
|
|
|
|
|
|
if LengthOfTable(_itemDatas) == 0 then
|
|
|
|
if LengthOfTable(_itemDatas) == 0 then
|
|
|
|
this.emptyObj.gameObject:SetActive(true)
|
|
|
|
this.emptyObj.gameObject:SetActive(true)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
this.emptyObj.gameObject:SetActive(false)
|
|
|
|
this.emptyObj.gameObject:SetActive(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
for k,v in pairs(this.equipPreList) do
|
|
|
|
for k, v in pairs(this.equipPreList) do
|
|
|
|
v.gameObject:SetActive(false)
|
|
|
|
v.gameObject:SetActive(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
this.ScrollView:SetData(
|
|
|
|
this.ScrollView:SetData(
|
|
|
|
@ -452,7 +450,6 @@ function this:SetItemData(_itemDatas)
|
|
|
|
this.SingleItemDataShow(go, _itemDatas[index])
|
|
|
|
this.SingleItemDataShow(go, _itemDatas[index])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function this.SingleItemDataShow(_go, _itemData)
|
|
|
|
function this.SingleItemDataShow(_go, _itemData)
|
|
|
|
@ -460,32 +457,33 @@ function this.SingleItemDataShow(_go, _itemData)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if not this.equipPreList[_go] then
|
|
|
|
if not this.equipPreList[_go] then
|
|
|
|
this.equipPreList[_go] = SubUIManager.Open(SubUIConfig.ItemView,_go.transform)
|
|
|
|
this.equipPreList[_go] = SubUIManager.Open(SubUIConfig.ItemView, _go.transform)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
local redPoint = Util.GetGameObject(_go.transform, "redPoint")
|
|
|
|
local redPoint = Util.GetGameObject(_go.transform, "redPoint")
|
|
|
|
local tip=Util.GetGameObject(_go.transform, "tip")
|
|
|
|
local tip = Util.GetGameObject(_go.transform, "tip")
|
|
|
|
tip:SetActive(_itemData.isUp==1)
|
|
|
|
tip:SetActive(_itemData.isUp == 1)
|
|
|
|
local isHave=CheckListIsContainValue1(allUpIds,_itemData.id) or CheckListIsContainValue1(upSuitId,equipConfig[_itemData.id].SuiteID)
|
|
|
|
local isHave = CheckListIsContainValue1(allUpIds, _itemData.id) or
|
|
|
|
redPoint:SetActive(isHave==false and curNum>#allUpIds)
|
|
|
|
CheckListIsContainValue1(upSuitId, equipConfig[_itemData.id].SuiteID)
|
|
|
|
|
|
|
|
redPoint:SetActive(isHave == false and curNum > #allUpIds)
|
|
|
|
this.equipPreList[_go].gameObject:SetActive(true)
|
|
|
|
this.equipPreList[_go].gameObject:SetActive(true)
|
|
|
|
this.equipPreList[_go].transform:SetAsFirstSibling()
|
|
|
|
this.equipPreList[_go].transform:SetAsFirstSibling()
|
|
|
|
this.equipPreList[_go]:ResetNameColor(Color.New(178/255,85/255,55/255,1))
|
|
|
|
this.equipPreList[_go]:ResetNameColor(Color.New(178 / 255, 85 / 255, 55 / 255, 1))
|
|
|
|
--if itemConfig[_itemData.id].ItemType == ItemType.Equip then
|
|
|
|
--if itemConfig[_itemData.id].ItemType == ItemType.Equip then
|
|
|
|
this.equipPreList[_go]:OnOpen(false,{_itemData.id,_itemData.num}, 1.1, true, false, false, this.sortingOrder+1,_itemData.idDyn)
|
|
|
|
this.equipPreList[_go]:OnOpen(false, { _itemData.id, _itemData.num }, 1.1, false, false, false, this.sortingOrder + 1,
|
|
|
|
-- 0.查看属性 1.穿戴 2.卸下 3.交换
|
|
|
|
_itemData.idDyn)
|
|
|
|
--宝物界面
|
|
|
|
-- 0.查看属性 1.穿戴 2.卸下 3.交换
|
|
|
|
Util.AddOnceClick(Util.GetGameObject(_go.transform, "mask"),function()
|
|
|
|
--宝物界面
|
|
|
|
BagManager.isBagPanel=true
|
|
|
|
Util.AddOnceClick(Util.GetGameObject(_go.transform, "mask"), function()
|
|
|
|
if isHave then
|
|
|
|
BagManager.isBagPanel = true
|
|
|
|
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,_itemData,6,false,nil,curHeroData,4)
|
|
|
|
if isHave then
|
|
|
|
else
|
|
|
|
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this, _itemData,curHeroData, nil, false, false, true)
|
|
|
|
--UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,_itemData,3,false,nil,curHeroData,4)
|
|
|
|
else
|
|
|
|
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,_itemData,false,true)
|
|
|
|
--UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,_itemData,3,false,nil,curHeroData,4)
|
|
|
|
end
|
|
|
|
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this, _itemData,curHeroData, nil, false, true, false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
)
|
|
|
|
--end
|
|
|
|
--end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function this:SetSelectBtn()
|
|
|
|
function this:SetSelectBtn()
|
|
|
|
@ -493,7 +491,8 @@ function this:SetSelectBtn()
|
|
|
|
this.selectBtn.transform:SetParent(tabs[indexBtnNum].transform)
|
|
|
|
this.selectBtn.transform:SetParent(tabs[indexBtnNum].transform)
|
|
|
|
this.selectBtn:GetComponent("RectTransform").anchoredPosition3D = Vector3(-12.28, 1.08, 0)
|
|
|
|
this.selectBtn:GetComponent("RectTransform").anchoredPosition3D = Vector3(-12.28, 1.08, 0)
|
|
|
|
this.selectBtn.transform:SetSiblingIndex(1)
|
|
|
|
this.selectBtn.transform:SetSiblingIndex(1)
|
|
|
|
Util.GetGameObject(this.selectBtn.transform, "Text"):GetComponent("Text").text = GetCurLanguage() == 0 and tableName[indexBtnNum] or "<size=40>"..tableName[indexBtnNum].."</size>"--typeTab[indexBtnNum]
|
|
|
|
Util.GetGameObject(this.selectBtn.transform, "Text"):GetComponent("Text").text = GetCurLanguage() == 0 and
|
|
|
|
|
|
|
|
tableName[indexBtnNum] or "<size=40>" .. tableName[indexBtnNum] .. "</size>" --typeTab[indexBtnNum]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--选择图片设置父级
|
|
|
|
--选择图片设置父级
|
|
|
|
@ -503,14 +502,15 @@ function this.SelectImageSetParent(_objPoint)
|
|
|
|
this.selsectSkillImage.transform.localScale = Vector3.one
|
|
|
|
this.selsectSkillImage.transform.localScale = Vector3.one
|
|
|
|
this.selsectSkillImage.transform.localPosition = Vector3.zero
|
|
|
|
this.selsectSkillImage.transform.localPosition = Vector3.zero
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
function RoleGiftPanel:OnClose()
|
|
|
|
function RoleGiftPanel:OnClose()
|
|
|
|
BagManager.isBagPanel=false
|
|
|
|
BagManager.isBagPanel = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
function RoleGiftPanel:OnDestroy()
|
|
|
|
function RoleGiftPanel:OnDestroy()
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return RoleGiftPanel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return RoleGiftPanel
|
|
|
|
|