命格修改提交
parent
18e10b4fb6
commit
0e083205a3
|
@ -8,6 +8,7 @@ function this.Initialize()
|
|||
this.myGemList = {}--我穿戴命石的id
|
||||
this.sperGemList ={} --高级命石
|
||||
this.typeGemList = {}
|
||||
this.timer=nil
|
||||
end
|
||||
|
||||
--初始化命石
|
||||
|
@ -51,6 +52,14 @@ function this.InitGemsInfo(msg)
|
|||
this.sperGemList[config.Type]=gemsData
|
||||
end
|
||||
end
|
||||
if this.timer~=nil then
|
||||
this.timer:Stop()
|
||||
this.timer=nil
|
||||
end
|
||||
this.timer = Timer.New(function ()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Gem.RefreshPanel)
|
||||
end, 1, -1, true)
|
||||
this.timer:Start()
|
||||
end
|
||||
|
||||
function this.ChangeOneGemData(_gem)
|
||||
|
|
|
@ -172,9 +172,11 @@ function Gem:UpdatePanelData(_type)
|
|||
if actconfigs then
|
||||
for i = 1,#actconfigs.mission do
|
||||
progresss=actconfigs.mission[i].progress
|
||||
local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",curType,"Level",actconfigs.mission[i].missionId)
|
||||
LogError("progress================"..progresss)
|
||||
--LogError("curtype==============="..curType)
|
||||
local config=ConfigManager.GetConfigData(ConfigName.GemLotteryConfig,actconfigs.mission[i].missionId) --ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",curType,"Level",actconfigs.mission[i].missionId)
|
||||
if actconfigs.mission[i].state==0 and progresss>=config.LibraryNumber then
|
||||
LogError("-------------------------------------------------")
|
||||
--LogError("-------------------------------------------------")
|
||||
isCan=true
|
||||
break
|
||||
end
|
||||
|
@ -183,15 +185,28 @@ function Gem:UpdatePanelData(_type)
|
|||
local nextNum=0
|
||||
--LogError("progress==============="..progresss)
|
||||
self.boxIcon:GetComponent("Animator").enabled = isCan
|
||||
for i, v in ConfigPairs(gemLottery) do
|
||||
if v.Library==_type and progresss>= v.LibraryNumber then
|
||||
wishLv=v.Level
|
||||
else
|
||||
nextNum=v.LibraryNumber
|
||||
break
|
||||
local curBoxConfig=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.GemLotteryConfig,"Library",_type)
|
||||
if curBoxConfig then
|
||||
for i=1,#curBoxConfig do
|
||||
if curBoxConfig[i].Library==_type and progresss>= curBoxConfig[i].LibraryNumber then
|
||||
wishLv=curBoxConfig[i].Level
|
||||
else
|
||||
nextNum=curBoxConfig[i].LibraryNumber
|
||||
break
|
||||
end
|
||||
end
|
||||
-- for i, v in ConfigPairs(curBoxConfig) do
|
||||
-- if v.Library==_type and progresss>= v.LibraryNumber then
|
||||
-- wishLv=v.Level
|
||||
-- else
|
||||
-- nextNum=v.LibraryNumber
|
||||
-- break
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
|
||||
self.boxLv.text="宝箱等级:"..wishLv
|
||||
LogError("nextnum==="..nextNum.." progersss=="..progresss)
|
||||
if nextNum==0 and progresss~=0 then
|
||||
self.boxProgress.text="宝箱已达最大等级"
|
||||
else
|
||||
|
@ -222,12 +237,16 @@ function Gem:UpdatePanelData(_type)
|
|||
--命石显示
|
||||
local list=GemNewManager.GetGemListByType(_type)
|
||||
for i=1,#self.gemPosList do
|
||||
if list[i] then
|
||||
local index=i
|
||||
if _type==2 then
|
||||
index=i+8
|
||||
end
|
||||
if list[index] then
|
||||
self.gemPosList[i].icon.gameObject:SetActive(true)
|
||||
self.gemPosList[i].frame.sprite=self.spLoader:LoadSprite(list[i].frame)
|
||||
self.gemPosList[i].icon.sprite=self.spLoader:LoadSprite(list[i].icon)
|
||||
self.gemPosList[i].frame.sprite=self.spLoader:LoadSprite(list[index].frame)
|
||||
self.gemPosList[i].icon.sprite=self.spLoader:LoadSprite(list[index].icon)
|
||||
Util.AddClick(self.gemPosList[i].btn, function()
|
||||
UIManager.OpenPanel(UIName.RewardGemSingleShowPopup,list[i],3)
|
||||
UIManager.OpenPanel(UIName.RewardGemSingleShowPopup,list[index],3)
|
||||
end)
|
||||
else
|
||||
self.gemPosList[i].frame.sprite=self.spLoader:LoadSprite("r_characterbg_gray")
|
||||
|
@ -312,6 +331,7 @@ function Gem:OnOpen()
|
|||
self.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.XiuXing })
|
||||
self.BtView:OnOpen(self,{ sortOrder = self.sortingOrder, panelType = PanelTypeView.Practice })
|
||||
local oldWarPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||
self.TabCtrl:Init(self.tab, _TabData,2)
|
||||
end
|
||||
|
||||
function Gem:OnSortingOrderChange()
|
||||
|
@ -326,7 +346,6 @@ end
|
|||
|
||||
function Gem:OnShow()
|
||||
self.playerInfoView:OnShow()
|
||||
self.TabCtrl:Init(self.tab, _TabData,2)
|
||||
Util.SetParticleSortLayer(self.fx_ui_xiuxingshengxin_cangzhu, self.sortingOrder + 1)
|
||||
--self:Refresh()
|
||||
--self:UpdatePanelData(1)
|
||||
|
|
|
@ -104,7 +104,7 @@ function GemRewardInfoPanel:CheckReward()
|
|||
rewardConfig=nil
|
||||
if actconfigs then
|
||||
for i = 1,#actconfigs.mission do
|
||||
local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",curType,"Level",actconfigs.mission[i].missionId)
|
||||
local config=ConfigManager.TryGetConfigData(ConfigName.GemLotteryConfig,actconfigs.mission[i].missionId)--ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",curType,"Level",actconfigs.mission[i].missionId)
|
||||
LogError("config.id==="..config.Id)
|
||||
if actconfigs.mission[i].state==0 and config.Reward and #config.Reward>0 and tonumber(config.Reward[1][1])~=nil then
|
||||
rewardConfig=config
|
||||
|
|
|
@ -174,7 +174,7 @@ function this.NewGemInfoIndition(buff)
|
|||
msg:ParseFromString(data)
|
||||
LogError("接受到新的命石的 indition")
|
||||
GemNewManager.InitGemsInfo(msg)
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Gem.RefreshPanel)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ function WishGemBuyOnePanel:OnShow()
|
|||
if actconfigs then
|
||||
for i = 1,#actconfigs.mission do
|
||||
progresss=actconfigs.mission[i].progress
|
||||
local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",this.recruitType,"Level",actconfigs.mission[i].missionId)
|
||||
local config=ConfigManager.TryGetConfigData(ConfigName.GemLotteryConfig,actconfigs.mission[i].missionId) --ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",this.recruitType,"Level",actconfigs.mission[i].missionId)
|
||||
if actconfigs.mission[i].state==0 and progresss>=config.LibraryNumber then
|
||||
lv=config.Level
|
||||
end
|
||||
|
@ -140,7 +140,8 @@ end
|
|||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function WishGemBuyOnePanel:OnClose()
|
||||
|
||||
--LogError("单抽界面关闭------------------------------------")
|
||||
--Game.GlobalEvent:DispatchEvent(GameEvent.Gem.RefreshPanel)
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
|
@ -108,7 +108,7 @@ function WishGemBuyTenPanel:OnOpen(...)
|
|||
if actconfigs then
|
||||
for i = 1,#actconfigs.mission do
|
||||
progresss=actconfigs.mission[i].progress
|
||||
local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",this.recruitType ,"Level",actconfigs.mission[i].missionId)
|
||||
local config=ConfigManager.TryGetConfigData(ConfigName.GemLotteryConfig,actconfigs.mission[i].missionId)--ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.GemLotteryConfig,"Library",this.recruitType ,"Level",actconfigs.mission[i].missionId)
|
||||
if actconfigs.mission[i].state==0 and progresss>=config.LibraryNumber then
|
||||
lv=config.Level
|
||||
end
|
||||
|
@ -167,7 +167,7 @@ end
|
|||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function WishGemBuyTenPanel:OnClose()
|
||||
|
||||
--Game.GlobalEvent:DispatchEvent(GameEvent.Gem.RefreshPanel)
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
Loading…
Reference in New Issue