miduo_client/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_RoleGodSoul...

504 lines
23 KiB
Lua
Raw Normal View History

2021-10-22 15:47:59 +08:00
local GeneralBigPopup_RoleGodSoulUp = {}
--传入父脚本模块
local parent
--传入特效层级
local sortingOrder=0
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
2021-10-26 16:00:31 +08:00
local curList = {}
2021-11-01 19:11:59 +08:00
local oldSelect = 0
2021-10-22 15:47:59 +08:00
--初始化组件(用于子类重写)
function GeneralBigPopup_RoleGodSoulUp:InitComponent(gameObject)
self.spLoader = SpriteLoader.New()
self.Scroll = Util.GetGameObject(gameObject,"Scroll")
self.itemPre = Util.GetGameObject(gameObject,"itemPre")
local rootHight = self.Scroll.transform.rect.height
local width = self.Scroll.transform.rect.width
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.Scroll.transform,
self.itemPre,nil, Vector2.New(width, rootHight), 1, 5,Vector2.New(20, 10))
self.ScrollView.moveTween.MomentumAmount = 1
self.ScrollView.moveTween.Strength = 2
self.ScrollView.elastic = false
self.costItemPre = Util.GetGameObject(gameObject, "costPre")
2021-10-28 16:19:59 +08:00
self.costItem1 = Util.GetGameObject(gameObject, "costItem")
2021-10-22 15:47:59 +08:00
self.costGrid = Util.GetGameObject(gameObject, "costItem/costGrid")
self.oneKeyBtn = Util.GetGameObject(gameObject, "oneKey")
self.sureBtn = Util.GetGameObject(gameObject, "sure")
2021-11-01 19:11:59 +08:00
self.bglist = Util.GetGameObject(gameObject,"bglist")
self.heroSelect = Util.GetGameObject(gameObject,"heroSelect")
self.select = Util.GetGameObject(gameObject,"select")
self.reSelectList = {}
for i = 1,self.bglist.transform.childCount do
if not self.reSelectList[i] then
self.reSelectList[i] = {}
end
self.reSelectList[i].go = Util.GetGameObject(self.bglist,"itemPre"..i)
self.reSelectList[i].btn = Util.GetGameObject(self.reSelectList[i].go,"HeroPre")
self.reSelectList[i].frame = Util.GetGameObject(self.reSelectList[i].btn,"frame"):GetComponent("Image")
self.reSelectList[i].icon = Util.GetGameObject(self.reSelectList[i].btn,"icon"):GetComponent("Image")
self.reSelectList[i].posIcon = Util.GetGameObject(self.reSelectList[i].btn,"posIcon"):GetComponent("Image")
self.reSelectList[i].proIcon = Util.GetGameObject(self.reSelectList[i].btn,"proIcon"):GetComponent("Image")
self.reSelectList[i].star = Util.GetGameObject(self.reSelectList[i].btn,"star")
self.reSelectList[i].name = Util.GetGameObject(self.reSelectList[i].btn,"name"):GetComponent("Text")
end
2021-10-22 15:47:59 +08:00
self.itemlist = {}
self.costItemlist = {}
self.choosedIdList = {}
end
--绑定事件(用于子类重写)
function GeneralBigPopup_RoleGodSoulUp:BindEvent()
2021-11-01 19:11:59 +08:00
-- Util.AddClick(self.oneKeyBtn,function ()
-- local isenuough,enoughNums,enoughDatas,oldEnoughDatas = false,nil,nil,nil
-- self.choosedIdList = {}
-- for i = 1,#self.allDatas do
-- table.insert(self.choosedIdList,self.allDatas[i].herodata.dynamicId)
-- isenuough,enoughNums,enoughDatas = GodSoulManager.CheckCanUpGodSoul(self.curHeroData,self.lv,self.choosedIdList)
-- if isenuough then
-- self:RefreshCostItemNums()
-- self:RefreshItemDatas()
-- break
-- else
-- if not oldEnoughDatas then
-- oldEnoughDatas = enoughDatas
-- else
-- local ismove = true
-- for k,v in pairs(oldEnoughDatas) do
-- if v ~= enoughDatas[k] then
-- ismove = false
-- break
-- end
-- end
-- if ismove then
-- table.remove(self.choosedIdList,#self.choosedIdList)
-- end
-- oldEnoughDatas = enoughDatas
-- end
-- end
-- end
-- if not isenuough then
-- PopupTipPanel.ShowTip("无法满足激活条件!")
-- return
-- end
-- end)
2021-11-03 18:11:08 +08:00
Util.AddClick(self.sureBtn,function()
if self:CheckEmptyList() then
PopupTipPanel.ShowTip("请选择神将!")
return
end
2021-11-03 18:16:26 +08:00
if self:CheckHaveEmptyValue() then
2021-11-03 18:11:08 +08:00
PopupTipPanel.ShowTip("所选神将无法激活神魂效果!")
return
end
2021-10-26 16:00:31 +08:00
local isSave = false
2021-11-03 10:13:44 +08:00
--已激活
if #curList > 0 then
2021-11-03 18:11:08 +08:00
if #curList == LengthOfTable(self.choosedIdList) then
for i = 1,#curList do
if self:CheckIsChooseId(curList[i]) < 1 then
2021-10-26 16:00:31 +08:00
isSave = true
2021-11-03 18:11:08 +08:00
break
2021-11-03 10:13:44 +08:00
end
end
2021-10-26 16:00:31 +08:00
else
2021-11-03 18:11:08 +08:00
isSave = true
end
if isSave then
NetManager.HeroGodSoulBindRequest(self.curHeroData.dynamicId,self.lv,self.choosedIdList,function()
parent:ClosePanel()
end)
else
parent:ClosePanel()
2021-10-26 16:00:31 +08:00
end
2021-11-03 18:11:08 +08:00
else
NetManager.HeroGodSoulBindRequest(self.curHeroData.dynamicId,self.lv,self.choosedIdList,function()
parent:ClosePanel()
end)
2021-11-03 10:13:44 +08:00
end
2021-10-22 15:47:59 +08:00
end)
2021-11-01 19:11:59 +08:00
for i = 1,self.bglist.transform.childCount do
Util.AddClick(self.reSelectList[i].btn,function()
if i == self.curPage then
return
end
self.curPage = i
self:SetSeclet(self.select,self.reSelectList[self.curPage].go.transform,Vector3.New(0,-75,0))
self:Refresh(true,false)
end)
end
2021-10-22 15:47:59 +08:00
end
2021-11-03 10:13:44 +08:00
function GeneralBigPopup_RoleGodSoulUp:CheckHaveEmptyValue()
for k,v in pairs(self.choosedIdList) do
if not v or v == "" then
return true
end
end
return false
end
function GeneralBigPopup_RoleGodSoulUp:CheckEmptyList()
for k,v in pairs(self.choosedIdList) do
2021-11-03 18:16:26 +08:00
if v and v ~= "" then
2021-11-03 10:13:44 +08:00
return false
end
end
return true
end
2021-10-22 15:47:59 +08:00
--添加事件监听(用于子类重写)
function GeneralBigPopup_RoleGodSoulUp:AddListener()
end
--移除事件监听(用于子类重写)
function GeneralBigPopup_RoleGodSoulUp:RemoveListener()
end
--界面打开时调用(用于子类重写)
function GeneralBigPopup_RoleGodSoulUp:OnShow(_parent,_Data)
parent =_parent
sortingOrder = _parent.sortingOrder
self.costItems = _Data[1]
self.curHeroData = _Data[2]
self.lv = _Data[3]
2021-11-01 19:11:59 +08:00
self.curPage = _Data[4] or 1
2021-10-22 15:47:59 +08:00
self.choosedIdList = GodSoulManager.GetBindHeroDatasByLevel(self.curHeroData.dynamicId,self.lv)
2021-11-03 11:18:37 +08:00
if LengthOfTable(self.choosedIdList) < 1 then
for i = 1,#self.costItems do
self.choosedIdList[i] = ""
end
end
2021-10-26 16:00:31 +08:00
curList = GodSoulManager.GetBindHeroDatasByLevel(self.curHeroData.dynamicId,self.lv)
2021-10-22 15:47:59 +08:00
self:Refresh(true,true)
2021-11-01 19:11:59 +08:00
self:SetCostItem(true)
self:SetSeclet(self.select,self.reSelectList[self.curPage].go.transform,Vector3.New(0,-75,0))
end
function GeneralBigPopup_RoleGodSoulUp:SetCostItem(isAllRefresh)
for i = 1, math.max(#self.reSelectList,#self.costItems) do
if not self.costItems[i] then
self.reSelectList[i].go.gameObject:SetActive(false)
else
if not self.reSelectList[i] then
self.reSelectList[i] = {}
self.reSelectList[i].go = newObjToParent(self.reSelectList[1].go,self.bglist.transform)
self.reSelectList[i].btn = Util.GetGameObject(self.reSelectList[i].go,"HeroPre")
self.reSelectList[i].frame = Util.GetGameObject(self.reSelectList[i].btn,"frame"):GetComponent("Image")
self.reSelectList[i].icon = Util.GetGameObject(self.reSelectList[i].btn,"icon"):GetComponent("Image")
self.reSelectList[i].posIcon = Util.GetGameObject(self.reSelectList[i].btn,"posIcon"):GetComponent("Image")
self.reSelectList[i].proIcon = Util.GetGameObject(self.reSelectList[i].btn,"proIcon"):GetComponent("Image")
self.reSelectList[i].star = Util.GetGameObject(self.reSelectList[i].btn,"star")
self.reSelectList[i].name = Util.GetGameObject(self.reSelectList[i].btn,"name"):GetComponent("Text")
end
self.reSelectList[i].go.gameObject:SetActive(true)
end
end
self:RefreshCostItemNums2(true)
end
function GeneralBigPopup_RoleGodSoulUp:SetSeclet(select,selectPar,pos)
select.gameObject:SetActive(true)
select.transform:SetParent(selectPar)
select.gameObject:GetComponent("RectTransform").anchoredPosition3D = pos
select.transform.localScale = Vector3.one
2021-10-22 15:47:59 +08:00
end
function GeneralBigPopup_RoleGodSoulUp:Refresh(isTop,isAni)
2021-11-01 19:11:59 +08:00
self.allDatas = GodSoulManager.GetGodSoulData(self.curHeroData,self.lv,self.curPage)
if self.choosedIdList[self.curPage] and self.choosedIdList[self.curPage] ~= "" then
for i = 1,#self.allDatas do
if self.allDatas[i].herodata.dynamicId == self.choosedIdList[self.curPage] then
self.allDatas[i].state = 999
end
end
table.sort(self.allDatas,function(a,b)
if a.state == b.state then
if a.herodata.star == b.herodata.star then
return a.herodata.star > b.herodata.star
end
return a.herodata.heroConfig.Sort < b.herodata.heroConfig.Sort
end
return a.state > b.state
end)
end
2021-10-22 15:47:59 +08:00
if not self.itemlist then
self.itemlist = {}
end
for k,v in ipairs(self.itemlist) do
v.go.gameObject:SetActive(false)
end
self.ScrollView:SetData(self.allDatas, function(index, go)
self:SetSingleData(index,go,self.allDatas[index])
2021-11-01 19:11:59 +08:00
end,not isTop,not isAni)
2021-10-22 15:47:59 +08:00
end
2021-10-26 16:00:31 +08:00
function GeneralBigPopup_RoleGodSoulUp:RefreshItemDatas()
for k,v in ipairs(self.itemlist) do
if self:CheckIsChooseId(v.data.dynamicId) > 0 then
v.select.gameObject:SetActive(true)
else
v.select.gameObject:SetActive(false)
end
end
end
2021-10-22 15:47:59 +08:00
function GeneralBigPopup_RoleGodSoulUp:SetSingleData(index,go,heroData)
if not self.itemlist[index] then
self.itemlist[index] = {}
self.itemlist[index].go = go
self.itemlist[index].mask = Util.GetGameObject(go,"mask")
2021-11-01 19:11:59 +08:00
self.itemlist[index].allSelect = Util.GetGameObject(go,"allSelect")
2021-10-22 15:47:59 +08:00
self.itemlist[index].select = Util.GetGameObject(go,"select")
self.itemlist[index].using = Util.GetGameObject(go,"using")
self.itemlist[index]._go = Util.GetGameObject(go,"HeroPre")
self.itemlist[index].frame = Util.GetGameObject(self.itemlist[index]._go,"frame"):GetComponent("Image")
self.itemlist[index].icon = Util.GetGameObject(self.itemlist[index]._go, "icon"):GetComponent("Image")
self.itemlist[index].pos = Util.GetGameObject(self.itemlist[index]._go, "posIcon"):GetComponent("Image")
self.itemlist[index].pro = Util.GetGameObject(self.itemlist[index]._go, "proIcon"):GetComponent("Image")
self.itemlist[index].lv = Util.GetGameObject(self.itemlist[index]._go, "lv/Text"):GetComponent("Text")
self.itemlist[index].name = Util.GetGameObject(self.itemlist[index]._go, "name"):GetComponent("Text")
self.itemlist[index].starGrid = Util.GetGameObject(self.itemlist[index]._go, "star")
end
2021-10-26 16:00:31 +08:00
self.itemlist[index]._data = heroData
self.itemlist[index].data = heroData.herodata
self.itemlist[index].frame.sprite=self.spLoader:LoadSprite(GetHeroQuantityImageByquality(self.itemlist[index].data.heroConfig.Quality,self.itemlist[index].data.star))
2021-11-01 19:11:59 +08:00
SetHeroIcon(self.spLoader,self.itemlist[index]._data,self.itemlist[index].icon,self.itemlist[index].data.heroConfig)
2021-10-22 15:47:59 +08:00
self.itemlist[index].go.gameObject:SetActive(true)
2021-10-26 16:00:31 +08:00
if HarmonyManager.IsChangeColor(self.itemlist[index].data.dynamicId) then
self.itemlist[index].lv.text="<color=#0f0>"..self.itemlist[index].data.lv.."</color>"
elseif HarmonyManager:IsEnvoy(self.itemlist[index].data.dynamicId) and HarmonyManager:HongMengTowerUpLimit() >= HarmonyManager.TowerStartLimit then
self.itemlist[index].lv.text="<color=#ffbe22>"..self.itemlist[index].data.lv.."</color>"
2021-10-22 15:47:59 +08:00
else
2021-10-26 16:00:31 +08:00
self.itemlist[index].lv.text = self.itemlist[index].data.lv
2021-10-22 15:47:59 +08:00
end
2021-10-26 16:00:31 +08:00
self.itemlist[index].name.text = self.itemlist[index].data.heroConfig.ReadingName
self.itemlist[index].pro.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(self.itemlist[index].data.heroConfig.PropertyName))
self.itemlist[index].pos.sprite = self.spLoader:LoadSprite(self.itemlist[index].data.professionIcon)
2021-10-22 15:47:59 +08:00
2021-10-26 16:00:31 +08:00
local star,starType = self.itemlist[index].data.GetStar(1)
2021-10-27 12:50:15 +08:00
local starSize = Vector2.New(30,30)
local starScale = -8
if starType == 3 then
starSize = Vector2.New(33.43,83.61)
2021-10-28 11:07:50 +08:00
starScale = -13.77
2021-11-03 10:13:44 +08:00
elseif starType == 2 then
starSize = Vector2.New(60,57)
2021-10-27 12:50:15 +08:00
end
SetHeroStars(self.spLoader, self.itemlist[index].starGrid, star,starType,starSize,starScale)
2021-10-22 15:47:59 +08:00
2021-10-26 16:00:31 +08:00
self.itemlist[index].mask.gameObject:SetActive(false)
self.itemlist[index].using.gameObject:SetActive(false)
2021-11-01 19:11:59 +08:00
self.itemlist[index].allSelect.gameObject:SetActive(false)
self.itemlist[index].select.gameObject:SetActive(false)
local location = self:CheckIsChooseId(self.itemlist[index].data.dynamicId)
if location > 0 and location == self.curPage then
oldSelect = index
self:SetSeclet(self.itemlist[index].select,self.itemlist[index].go.transform,Vector3.New(0,-75,0))
elseif location > 0 then
self.itemlist[index].allSelect.gameObject:SetActive(true)
2021-10-26 16:00:31 +08:00
elseif self.itemlist[index]._data.state == -1 then
self.itemlist[index].mask.gameObject:SetActive(true)
elseif self.itemlist[index]._data.state == 0 or self.itemlist[index]._data.state == 664 then
self.itemlist[index].using.gameObject:SetActive(true)
2021-10-28 16:19:59 +08:00
self.itemlist[index].mask.gameObject:SetActive(true)
2021-11-01 19:11:59 +08:00
else
2021-10-22 15:47:59 +08:00
end
-- 点击事件
Util.AddOnceClick(self.itemlist[index]._go, function()
2021-10-26 16:00:31 +08:00
if self.itemlist[index]._data.state == -1 then
2021-11-01 19:11:59 +08:00
PopupTipPanel.ShowTip("该神将无法放入所选格子中!")
2021-10-26 16:00:31 +08:00
return
end
if self.itemlist[index]._data.state == 0 or self.itemlist[index]._data.state == 664 then
PopupTipPanel.ShowTip("该神将已用于激活其他等级的神魂!")
return
end
local isChoosed = self:CheckIsChooseId(self.itemlist[index].data.dynamicId)
2021-11-01 19:11:59 +08:00
if isChoosed > 0 and isChoosed ~= self.curPage then
PopupTipPanel.ShowTip("该神将正处于其他格子中,无法选择!")
return
end
2021-10-26 16:00:31 +08:00
if isChoosed > 0 then
2021-11-01 19:11:59 +08:00
self.choosedIdList[self.curPage] = ""
2021-10-22 15:47:59 +08:00
self.itemlist[index].select.gameObject:SetActive(false)
else
2021-11-01 19:11:59 +08:00
self.choosedIdList[self.curPage] = self.itemlist[index].data.dynamicId
if self.itemlist[oldSelect] then
self.itemlist[oldSelect].select.gameObject:SetActive(false)
end
oldSelect = index
self:SetSeclet(self.itemlist[index].select,self.itemlist[index].go.transform,Vector3.New(0,-72,0))
2021-10-22 15:47:59 +08:00
end
2021-11-01 19:11:59 +08:00
self:RefreshCostItemNums2(false)
2021-11-03 10:13:44 +08:00
if self.choosedIdList[self.curPage] ~= "" then
for m = self.curPage + 1,#self.costItems do
if not self.choosedIdList[m] or self.choosedIdList[m] == "" then
self.curPage = m
self:SetSeclet(self.select,self.reSelectList[self.curPage].go.transform,Vector3.New(0,-75,0))
self:Refresh(true,false)
break
end
end
end
2021-10-22 15:47:59 +08:00
end)
Util.AddLongPressClick(self.itemlist[index]._go, function()
end, 0.5)
end
function GeneralBigPopup_RoleGodSoulUp:CheckIsChooseId(heroId)
2021-10-26 16:00:31 +08:00
local index = 0
2021-11-01 19:11:59 +08:00
for k,v in pairs(self.choosedIdList) do
if heroId == v then
index = k
2021-10-26 16:00:31 +08:00
return index
2021-10-22 15:47:59 +08:00
end
end
2021-10-26 16:00:31 +08:00
return index
2021-10-22 15:47:59 +08:00
end
function GeneralBigPopup_RoleGodSoulUp:UpdateCostItem()
for i = 1,math.max(#self.costItemlist,#self.costItems) do
if not self.costItems[i] then
self.costItemlist[i].go.gameObject:SetActive(false)
else
if not self.costItemlist[i] then
self.costItemlist[i] = {}
self.costItemlist[i].go = newObjToParent(self.costItemPre,self.costGrid)
self.costItemlist[i].frame = Util.GetGameObject(self.costItemlist[i].go,"frame"):GetComponent("Image")
self.costItemlist[i].icon = Util.GetGameObject(self.costItemlist[i].frame.transform,"icon"):GetComponent("Image")
self.costItemlist[i].num = Util.GetGameObject(self.costItemlist[i].go,"num"):GetComponent("Text")
end
self.costItemlist[i].go.gameObject:SetActive(true)
if self.costItems[i].id > 0 then
2021-10-26 16:00:31 +08:00
if self.costItems[i].star > 10 then
self.costItemlist[i].frame.sprite = self.spLoader:LoadSprite("s_shenhunxitong_zuanshitouxiangkuang")
else
self.costItemlist[i].frame.sprite = self.spLoader:LoadSprite("s_shenhunxitong_hong")
end
2021-10-22 15:47:59 +08:00
self.costItemlist[i].icon.gameObject:SetActive(true)
self.costItemlist[i].icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroConfig[self.costItems[i].id].Icon))
elseif self.costItems[i].property > 0 then
self.costItemlist[i].icon.gameObject:SetActive(false)
2021-10-26 16:00:31 +08:00
self.costItemlist[i].frame.sprite = self.spLoader:LoadSprite(PropertySmallIcon[self.costItems[i].star][self.costItems[i].property])
2021-10-22 15:47:59 +08:00
elseif self.costItems[i].profession > 0 then
self.costItemlist[i].icon.gameObject:SetActive(false)
2021-10-26 16:00:31 +08:00
self.costItemlist[i].frame.sprite = self.spLoader:LoadSprite(GodSoulProfession[self.costItems[i].star][self.costItems[i].profession])
else
self.costItemlist[i].icon.gameObject:SetActive(false)
self.costItemlist[i].frame.sprite = self.spLoader:LoadSprite(StarImage[self.costItems[i].star])
2021-10-22 15:47:59 +08:00
end
end
end
self:RefreshCostItemNums()
end
function GeneralBigPopup_RoleGodSoulUp:RefreshCostItemNums()
self.isenuough,self.enoughNums = GodSoulManager.CheckCanUpGodSoul(self.curHeroData,self.lv,self.choosedIdList)
for i = 1,#self.enoughNums do
if self.isenuough then
2021-10-26 16:00:31 +08:00
self.costItemlist[i].num.text = string.format("<color=#00FF00>×%s</color>",self.costItems[i].num)
2021-10-22 15:47:59 +08:00
else
if self.enoughNums[i] >= self.costItems[i].num then
2021-10-26 16:00:31 +08:00
self.costItemlist[i].num.text = string.format("<color=#00FF00>×%s</color>",self.costItems[i].num)
2021-10-22 15:47:59 +08:00
else
2021-10-26 16:00:31 +08:00
self.costItemlist[i].num.text = string.format("<color=#FF0000>×%s</color>",self.costItems[i].num)
2021-10-22 15:47:59 +08:00
end
end
end
2021-10-28 16:19:59 +08:00
ForceRebuildLayout(self.costItem1.transform)
2021-10-22 15:47:59 +08:00
end
2021-11-01 19:11:59 +08:00
function GeneralBigPopup_RoleGodSoulUp:RefreshCostItemNums2(isAllRefresh)
for i = 1, #self.costItems do
if isAllRefresh or (not isAllRefresh and i == self.curPage) then
local str = ""
2021-11-03 10:13:44 +08:00
if self.costItems[i].star > 10 then
2021-11-01 19:11:59 +08:00
str = "觉醒"
else
str = "十星"
end
if self.costItems[i].id > 0 then
str = str..heroConfig[self.costItems[i].id].ReadingName
elseif self.costItems[i].property > 0 then
str = PropertyType[self.costItems[i].property]..str.."神将"
elseif self.costItems[i].profession > 0 then
str = str..ProfessionType[self.costItems[i].profession].."神将"
else
str = "任意"..str.."神将"
end
if self.choosedIdList[self.curPage] and self.choosedIdList[self.curPage] ~= "" then
self.reSelectList[i].name.text = string.format("<color=#00FF00>%s</color>",str)
self.reSelectList[i].posIcon.gameObject:SetActive(true)
self.reSelectList[i].proIcon.gameObject:SetActive(true)
local tempHeroData = HeroManager.GetSingleHeroData(self.choosedIdList[i])
self.reSelectList[i].frame.sprite = self.spLoader:LoadSprite(GetHeroQuantityImageByquality(tempHeroData.heroConfig.Quality,tempHeroData.star))
SetHeroIcon(self.spLoader,tempHeroData,self.reSelectList[i].icon,tempHeroData.heroConfig)
local star,starType = tempHeroData.GetStar(1)
2021-11-03 10:13:44 +08:00
local starSize = Vector2.New(60,60)
2021-11-01 19:11:59 +08:00
local starScale = -8
if starType == 3 then
starSize = Vector2.New(33.43,83.61)
starScale = -13.77
2021-11-03 11:18:37 +08:00
elseif starType == 2 then
starSize = Vector2.New(60,57)
2021-11-01 19:11:59 +08:00
end
SetHeroStars(self.spLoader,self.reSelectList[i].star,star,starType)
self.reSelectList[i].proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(tempHeroData.heroConfig.PropertyName))
self.reSelectList[i].posIcon.sprite = self.spLoader:LoadSprite(tempHeroData.professionIcon)
2021-11-03 11:18:37 +08:00
Util.SetGray(self.reSelectList[i].icon.gameObject,false)
Util.SetGray(self.reSelectList[i].name.gameObject,false)
2021-11-03 10:13:44 +08:00
else
2021-11-01 19:11:59 +08:00
self.reSelectList[i].name.text = string.format("<color=#FFE18D>%s</color>",str)
self.reSelectList[i].frame.sprite = self.spLoader:LoadSprite(GetHeroQuantityImageByquality(self.costItems[i].star,self.costItems[i].star))
2021-11-03 11:18:37 +08:00
SetHeroStars(self.spLoader,self.reSelectList[i].star,self.costItems[i].star,1,Vector2.New(60,57))
2021-11-01 19:11:59 +08:00
self.reSelectList[i].posIcon.gameObject:SetActive(false)
self.reSelectList[i].proIcon.gameObject:SetActive(false)
if self.costItems[i].id > 0 then
2021-11-03 11:18:37 +08:00
self.reSelectList[i].icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroConfig[self.costItems[i].id].Icon))
Util.SetGray(self.reSelectList[i].icon.gameObject,true)
2021-11-01 19:11:59 +08:00
else
self.reSelectList[i].icon.sprite = self.spLoader:LoadSprite("r_hero_jinjie-touxiang2")
if self.costItems[i].property > 0 then
self.reSelectList[i].proIcon.gameObject:SetActive(true)
self.reSelectList[i].proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(self.costItems[i].property))
elseif self.costItems[i].profession > 0 then
self.reSelectList[i].posIcon.gameObject:SetActive(true)
self.reSelectList[i].posIcon.sprite = self.spLoader:LoadSprite(GetHeroPosStr(self.costItems[i].profession))
else
end
2021-11-03 11:18:37 +08:00
Util.SetGray(self.reSelectList[i].icon.gameObject,false)
2021-11-01 19:11:59 +08:00
end
2021-11-03 11:18:37 +08:00
Util.SetGray(self.reSelectList[i].name.gameObject,true)
2021-11-01 19:11:59 +08:00
end
end
end
end
2021-10-22 15:47:59 +08:00
--界面关闭时调用(用于子类重写)
function GeneralBigPopup_RoleGodSoulUp:OnClose()
2021-11-01 19:11:59 +08:00
self.heroSelect.gameObject:SetActive(false)
self.select.gameObject:SetActive(false)
self.choosedIdList = {}
2021-10-22 15:47:59 +08:00
end
--界面销毁时调用(用于子类重写)
function GeneralBigPopup_RoleGodSoulUp:OnDestroy()
self.spLoader:Destroy()
self.itemlist = {}
self.costItemlist = {}
end
return GeneralBigPopup_RoleGodSoulUp