【修行】提交

dev_chengFeng
ZhangBiao 2021-05-17 09:50:32 +08:00
parent 87f18cb049
commit b13dabcad2
2 changed files with 60 additions and 34 deletions

View File

@ -100,7 +100,6 @@ function PracticeImprint:SetSingleImprint(_go,_imprintId)
stateImg.sprite = Util.LoadSprite("t_tianshumijuan_yijihuo_zh")
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)
@ -118,6 +117,8 @@ end
--设置下方神印信息界面
function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
LogYellow("_imprintId:".._serverData.id.." subId:".._serverData.subId)
--title显示
if _configData.Type == 0 then
self.leftTitle.text = string.format("通用神印·%s",_configData.Name)
@ -133,7 +134,7 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
self.rightInfo:SetActive(false)
elseif _configData.Type == 1 then
self.rightInfo:SetActive(true)
self.curHeroId = PracticeManager.ImprintServerData[_configData.Id].subId
-- self.curHeroId = PracticeManager.ImprintServerData[_configData.Id].subId
end
if _serverData.state == 0 then
self.doBtnText.text = "选择神印"
@ -152,7 +153,11 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
if _configData.Type == 0 then
sub = ""
elseif _configData.Type == 1 then
sub = self.curHeroId
sub = _serverData.subId--self.curHeroId
if _serverData.subId == "" or _serverData.subId == "nil" or not _serverData.subId then
PopupTipPanel.ShowTip("请先选择附身神将!")
return
end
end
-- LogRed("old:"..tostring(old).." new:"..tostring(new).." sub:"..tostring(sub))
NetManager.PracticeImprintRequest(old,new,tostring(sub),function ()
@ -201,7 +206,7 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
lv.text = _heroData.lv
proIcon.sprite = Util.LoadSprite(GetProStrImageByProNum(_heroData.heroConfig.PropertyName))
SetHeroStars(starGrid, _heroData.star)
self.curHeroId = tostring(_heroData.dynamicId)
-- self.curHeroId = tostring(_heroData.dynamicId)
--刷新
self:Refresh(true,true,function ()

View File

@ -2,6 +2,9 @@ local Practice = quick_class("Practice", BasePanel)
local orginLayer
local XinXianConfig = ConfigManager.GetConfig(ConfigName.XiuXianConfig)
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local oldPower = 0
local newPower = 0
local oldBigLevel = 0
function Practice:InitComponent()
orginLayer = 0
@ -63,6 +66,12 @@ function Practice:BindEvent()
Util.AddClick(self.button, function()
if self:UpgradeCheck() then return end
NetManager.UpPracticeLevelRequest(function ()
newPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldPower,newValue = newPower})
oldPower = newPower
if PracticeManager.PracticeBigLevel - oldBigLevel == 1 then
PopupTipPanel.ShowTip(string.format("恭喜突破至%s期",self.curLevelConfig.RealmName))
end
self:OnShow()
end)
end)
@ -113,6 +122,8 @@ function Practice:OnShow()
FormationManager.RefreshMainFormationPower()
self.curLevelConfig = PracticeManager.GetCurConfigData()
LogYellow("PracticeLevel:"..tostring(PracticeManager.PracticeLevel))
oldPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
oldBigLevel = PracticeManager.PracticeBigLevel
self:RefreshMid()
self:RefreshPoints()
self:RefreshBtn()
@ -128,42 +139,52 @@ function Practice:RefreshPoints()
end
function Practice:RefreshBtn()
if self.curLevelConfig.LevelUpCost then--如果下级消耗不为空则为突破阶段
if not self.itemList then
self.itemList = {}
end
for k,v in ipairs(self.itemList) do
v.gameObject:SetActive(false)
end
for i = 1, #self.curLevelConfig.LevelUpCost do
local data = self.curLevelConfig.LevelUpCost[i]
if not self.itemList[i] then
self.itemList[i] = newObject(self.needPre)
self.itemList[i].transform:SetParent(self.needs.transform)
self.itemList[i].transform.localScale = Vector3.one
self.itemList[i].transform.localPosition = Vector3.zero
if XinXianConfig[PracticeManager.PracticeLevel + 1] then
self.button:SetActive(true)
if self.curLevelConfig.LevelUpCost then--如果下级消耗不为空则为突破阶段
if not self.itemList then
self.itemList = {}
end
local icon = Util.GetGameObject(self.itemList[i],"icon"):GetComponent("Image")
local num = Util.GetGameObject(self.itemList[i],"num"):GetComponent("Text")
icon.sprite = Util.LoadSprite(GetSpriteNameByItemId(data[1]))
num.text = data[2]
if BagManager.GetTotalItemNum(data[1]) < data[2] then
num.text = string.format("<color=red>%s</color>",data[2])
for k,v in ipairs(self.itemList) do
v.gameObject:SetActive(false)
end
for i = 1, #self.curLevelConfig.LevelUpCost do
local data = self.curLevelConfig.LevelUpCost[i]
if not self.itemList[i] then
self.itemList[i] = newObject(self.needPre)
self.itemList[i].transform:SetParent(self.needs.transform)
self.itemList[i].transform.localScale = Vector3.one
self.itemList[i].transform.localPosition = Vector3.zero
end
local icon = Util.GetGameObject(self.itemList[i],"icon"):GetComponent("Image")
local num = Util.GetGameObject(self.itemList[i],"num"):GetComponent("Text")
icon.sprite = Util.LoadSprite(GetSpriteNameByItemId(data[1]))
num.text = data[2]
if BagManager.GetTotalItemNum(data[1]) < data[2] then
num.text = string.format("<color=red>%s</color>",data[2])
end
self.itemList[i]:SetActive(true)
end
self.itemList[i]:SetActive(true)
end
self.needs:SetActive(true)
self.content:SetActive(false)
self.buttonText.text = Language[11805]
self.needs:SetActive(true)
self.content:SetActive(false)
self.buttonText.text = Language[11805]
else
self.needs:SetActive(false)
self.content:SetActive(true)
self.needStar.text = self.curLevelConfig.NeedStarNum
if self.curLevelConfig.NeedStarNum > PlayerManager.level then
self.needStar.text = string.format("<color=red>%s</color>",self.curLevelConfig.NeedStarNum)
end
self.buttonText.text = "破 境"
end
else
self.button:SetActive(false)
self.needs:SetActive(false)
self.content:SetActive(true)
self.needStar.text = self.curLevelConfig.NeedStarNum
if self.curLevelConfig.NeedStarNum > PlayerManager.level then
self.needStar.text = string.format("<color=red>%s</color>",self.curLevelConfig.NeedStarNum)
end
self.buttonText.text = "破 境"
Util.GetGameObject(self.content,"Text"):SetActive(false)
Util.GetGameObject(self.content,"Image"):SetActive(false)
self.needStar.text = "恭喜你已修行至世间巅峰"
end
end