diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_XiuXingSelectHero.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_XiuXingSelectHero.lua index 5f00cebb4d..de2b86d5d9 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_XiuXingSelectHero.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_XiuXingSelectHero.lua @@ -68,7 +68,7 @@ function this:Refresh(isTop,isAni) for i = 1, #self.itemList do self.itemList[i].gameObject:SetActive(false) end - LogRed("#self.heroList:"..tostring(#self.heroList)) + -- LogRed("#self.heroList:"..tostring(#self.heroList)) self.scrollView:SetData(self.heroList, function (index, item) this:ShowSingleData(item, self.heroList[index],index) end,not isTop,not isAni) @@ -92,12 +92,12 @@ function this:ShowSingleData(go,heroData,index) local starGrid = Util.GetGameObject(go, "star") local starPre = Util.GetGameObject(go, "starPre") self.maskList[index] = Util.GetGameObject(go, "choosed") - LogGreen("data.UnlockId:"..tostring(data.UnlockId)) + -- LogGreen("data.UnlockId:"..tostring(data.UnlockId)) self.maskList[index]:SetActive(tostring(PracticeManager.ImprintServerData[data.Id].subId) == tostring(heroData.dynamicId)) SetHeroStars(starGrid, heroData.star) Util.AddOnceClick(go, function() - LogGreen("subId:"..tostring(PracticeManager.ImprintServerData[data.Id].subId).." did:"..tostring(heroData.dynamicId)) + -- LogGreen("subId:"..tostring(PracticeManager.ImprintServerData[data.Id].subId).." did:"..tostring(heroData.dynamicId)) for i = 1, #self.maskList do self.maskList[i]:SetActive(false) end diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeImprintPanel.lua b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeImprintPanel.lua index a4a1db207a..7afc6d062d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeImprintPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeImprintPanel.lua @@ -54,11 +54,18 @@ function PracticeImprint:OnSortingOrderChange() end function PracticeImprint:OnShow() + self:Refresh(true,false) +end + +function PracticeImprint:Refresh(isTop,isAni,func) self.allImprintData = PracticeManager.GetAllImprintData() self.ImprintInfo:SetActive(false) self.ScrollView:SetData(self.allImprintData, function(index, go) self:SetPre(index,go,self.allImprintData[index]) - end) + end,isTop,isAni) + if func then + func() + end end --设置每一期的三个神印 @@ -87,11 +94,17 @@ function PracticeImprint:SetSingleImprint(_go,_imprintId) -- LogGreen(" _imprintId:"..tostring(_imprintId).." serverData.state:"..tostring(serverData.state)) if serverData.state == 0 then--未使用 stateImg.gameObject:SetActive(false) - heroImg.gameObject:SetActive(false) + -- heroImg.gameObject:SetActive(false) elseif serverData.state == 1 then--已使用 stateImg.gameObject:SetActive(true) stateImg.sprite = Util.LoadSprite("t_tianshumijuan_yijihuo_zh") - heroImg.gameObject:SetActive(serverData.subId ~= "") + end + heroImg.gameObject:SetActive(serverData.subId ~= nil and serverData.subId ~= "" and serverData.subId ~= "nil") + -- LogYellow(_imprintId.." :"..serverData.subId..": s") + if serverData.subId ~= nil and serverData.subId ~= "" and serverData.subId ~= "nil" then + -- LogRed("serverData.subId:"..tostring(serverData.subId)) + -- LogGreen(HeroManager.GetSingleHeroData(tostring(serverData.subId)).id) + heroImg.sprite = Util.LoadSprite(GetSpriteNameByItemId(HeroManager.GetSingleHeroData(tostring(serverData.subId)).id)) end end icon.sprite = Util.LoadSprite(GetResourcePath(configData.Icon)) @@ -115,12 +128,12 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData) if not _serverData then self.rightInfo:SetActive(false) self.doBtnText.text = string.format("%s解锁",_configData.Unlock) - self.curHeroId = PracticeManager.ImprintServerData[_configData.UnlockId].subId else if _configData.Type == 0 then self.rightInfo:SetActive(false) elseif _configData.Type == 1 then self.rightInfo:SetActive(true) + self.curHeroId = PracticeManager.ImprintServerData[_configData.Id].subId end if _serverData.state == 0 then self.doBtnText.text = "选择神印" @@ -136,9 +149,17 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData) local old,new,sub = 0,0,"" old = PracticeManager.BigLevelImprintList[_configData.UnlockId] new = _configData.Id - sub = self.curHeroId + if _configData.Type == 0 then + sub = "" + elseif _configData.Type == 1 then + sub = self.curHeroId + end + -- LogRed("old:"..tostring(old).." new:"..tostring(new).." sub:"..tostring(sub)) NetManager.PracticeImprintRequest(old,new,tostring(sub),function () - self:OnShow() + self:Refresh(true,true,function () + self.ImprintInfo:SetActive(true) + self:ShowSingleImprintInfoLayout(PracticeManager.GetSingleImprintData(new)) + end) end) end end) @@ -156,13 +177,16 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData) if _serverData and _configData.Type == 1 then self.Add:SetActive(true) self.Hero:SetActive(false) - LogRed("Id:"..tostring(_serverData.id).." _serverData.subId:"..tostring(_serverData.subId)) - if tostring(_serverData.subId) ~= nil and tostring(_serverData.subId) ~= "" then + -- LogRed("Id:"..tostring(_serverData.id).." _serverData.subId:"..tostring(_serverData.subId)) + -- LogRed(tostring(not _serverData.subId)) + -- LogRed(tostring(_serverData.subId ~= nil)) + -- LogRed(tostring(tostring(_serverData.subId) ~= "")) + if _serverData.subId ~= nil and _serverData.subId ~= "" and _serverData.subId ~= "nil" then self.Add:SetActive(false) self.Hero:SetActive(true) --英雄图标 - heroData = HeroManager.GetSingleHeroData(_serverData.subId) - LogGreen("heroData:"..tostring(heroData)) + heroData = HeroManager.GetSingleHeroData(tostring(_serverData.subId)) + -- LogGreen("heroData:"..tostring(heroData)) frame.sprite = Util.LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star)) icon.sprite = Util.LoadSprite(heroData.icon) lv.text = heroData.lv @@ -178,6 +202,12 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData) proIcon.sprite = Util.LoadSprite(GetProStrImageByProNum(_heroData.heroConfig.PropertyName)) SetHeroStars(starGrid, _heroData.star) self.curHeroId = tostring(_heroData.dynamicId) + + --刷新 + self:Refresh(true,true,function () + self.ImprintInfo:SetActive(true) + self:ShowSingleImprintInfoLayout(PracticeManager.GetSingleImprintData(_configData.Id)) + end) end) end) end) diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua index 4f4416274a..9d3894aa51 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua @@ -161,10 +161,10 @@ function this.UpdataImprintDataFromServer(_imprintList) this.ImprintServerData[value.id].type = value.type this.ImprintServerData[value.id].subId = value.subId this.ImprintServerData[value.id].state = value.state - LogPink("value.id:"..tostring(value.id).." value.type:"..tostring(value.type).." value.subId:"..tostring(value.subId).." value.state:"..tostring(value.state)) + LogBlue("value.id:"..tostring(value.id).." value.type:"..tostring(value.type).." value.subId:"..tostring(value.subId).." value.state:"..tostring(value.state)) if value.state == 1 then this.BigLevelImprintList[XiuXianSkillConfig[value.id].UnlockId] = value.id - LogBlue("大境界Id:"..tostring(XiuXianSkillConfig[value.id].UnlockId).."对应的神印:"..tostring(value.id)) + -- LogBlue("大境界Id:"..tostring(XiuXianSkillConfig[value.id].UnlockId).."对应的神印:"..tostring(value.id)) end end end @@ -174,9 +174,9 @@ end function this.BigLevelWithImprint() for i, v in ConfigPairs(XiuXianSkillConfig) do if v.UnlockId > 0 then - this.BigLevelImprintList[v.UnlockId] = {} - this.BigLevelImprintList[v.UnlockId].id = 0 - this.BigLevelImprintList[v.UnlockId].subId = "" + this.BigLevelImprintList[v.UnlockId] = 0 + -- this.BigLevelImprintList[v.UnlockId].id = 0 + -- this.BigLevelImprintList[v.UnlockId].subId = "" end end end