From e372c84cdbfec2c8f72e68421f93a23a3d8c8613 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Wed, 12 Aug 2020 13:34:07 +0800 Subject: [PATCH] xuanyuan --- .../~Lua/Modules/Carbon/CarbonTypePanelV2.lua | 2 +- .../Modules/Carbon/XuanYuanMirrorManager.lua | 53 ++-- .../Modules/Carbon/XuanYuanMirrorPanel.lua | 22 +- .../Carbon/XuanYuanMirrorPanelList.lua | 271 ++++++++++++------ .../View/XuanYuanMirrorFormation.lua | 5 +- 5 files changed, 218 insertions(+), 135 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua index 1d3c6d2c9b..b6c0eaa600 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua @@ -146,7 +146,7 @@ function CarbonTypePanelV2:BindEvent() Util.AddClick( this.backBtn, function() - this:ClosePanel() + this:OnClose() end ) diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorManager.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorManager.lua index d039456407..b0f9398213 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorManager.lua @@ -5,10 +5,15 @@ local this = XuanYuanMirrorManager this.levelData = {} this.buyTime = 0 this.freeTime = 0 +this.buyTimeId = 0 +this.freeTimeId = 0 this.curType = 0 function this.Initialize() raceTowerConfig = ConfigManager.GetConfig(ConfigName.RaceTowerConfig) raceTowerRewardConfig = ConfigManager.GetConfig(ConfigName.RaceTowerRewardConfig) + local config = raceTowerConfig[1].Privilege + this.buyTimeId= config[2] + this.freeTimeId = config[1] this.InitMirrorData() end @@ -78,12 +83,12 @@ function this.UpdateMirrorState(msg) this.UpdateLevelState(v.id) end end - for k,v in pairs(this.levelData) do - LogYellow("v.id:"..k.." state:"..v.state.." v.overTime:"..v.endingTime.." v.data:"..#v.data) - for n,m in ipairs(v.data) do - LogGreen("m.id:"..m.id.." state:"..m.state.." 组队条件:"..m.condition.. " 奖励预览:"..#m.rewardList) - end - end + -- for k,v in pairs(this.levelData) do + -- LogYellow("v.id:"..k.." state:"..v.state.." v.overTime:"..v.endingTime.." v.data:"..#v.data) + -- for n,m in ipairs(v.data) do + -- LogGreen("m.id:"..m.id.." state:"..m.state.." 组队条件:"..m.condition.. " 奖励预览:"..#m.rewardList) + -- end + -- end end function this.UpdateLevelState(type) @@ -133,23 +138,32 @@ function this.PropertyName(_type) end --设置剩余次数 -function this.GetTimeTip() - local config = raceTowerConfig[1].Privilege - local storeData=ConfigManager.GetConfigDataByDoubleKey(ConfigName.StoreConfig,"StoreId",7,"Limit",config[2])--商店表数据 - local buyTimeId= config[2] - local freeTimeId = config[1] - this.buyTime= ShopManager.GetShopItemRemainBuyTimes(SHOP_TYPE.FUNCTION_SHOP,storeData.Id) --购买次数 - this.freeTime=PrivilegeManager.GetPrivilegeRemainValue(freeTimeId) --免费次数 +function this.GetTimeTip() + + -- LogBlue("购买总次数:"..PrivilegeManager.GetPrivilegeNumber(this.buyTimeId)) + -- LogBlue("购买使用的次数:"..PrivilegeManager.GetPrivilegeUsedTimes(this.buyTimeId)) + -- LogBlue("免费总次数:"..PrivilegeManager.GetPrivilegeNumber(this.freeTimeId)) + -- LogBlue("免费使用次数:"..PrivilegeManager.GetPrivilegeUsedTimes(this.freeTimeId)) + this.buyTime = PrivilegeManager.GetPrivilegeRemainValue(this.buyTimeId) + --LogBlue("购买剩余次数:"..this.buyTime) + this.freeTime= PrivilegeManager.GetPrivilegeRemainValue(this.freeTimeId) --免费次数 + --LogBlue("免费剩余次数:"..this.buyTime) local str="" - if this.freeTime>0 then + if this.freeTime > 0 then str=string.format(Language[10344],tostring(this.freeTime)) else str=string.format(Language[10345],tostring(this.buyTime)) end - LogBlue(str) return str end +function this.GetBuyTimesTip() + local config = raceTowerConfig[1].Privilege + local rechargeCommodityConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.RechargeCommodityConfig,"Id",4003) + local rechargeId =tonumber(rechargeCommodityConfig.OpenPrivilege[1]) + return PrivilegeManager.GetPrivilegeOpenStatusById(rechargeId) +end + function this.GetMirrorLevelData(_type) if this.levelData[_type] then local temp = {} @@ -212,8 +226,13 @@ function this.ExecuteFightBattle(id,type,func) if result.result ==0 then elseif result.result==1 then UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() - if this.levelData[this.curType] == 1 then - UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,this.curType,XuanYuanMirrorManager.GetMirrorLevelData(this.curType)) + this.levelData[this.curType].passId = id + this.UpdateLevelState(this.curType) + PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.freeTimeId, 1) + if this.levelData[this.curType].state == 1 then + UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,this.curType) + else + UIManager.OpenPanel(UIName.XuanYuanMirrorPanel) end end) end diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua index deb4b38031..b8ef04c67c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua @@ -134,7 +134,6 @@ this.UpdateCarbonContent = function() BindRedPointObject(v.redPointType, Util.GetGameObject(go, "redPoint")) go:GetComponent("Image").sprite = Util.LoadSprite(v.bg) Util.GetGameObject(go, "titileBg/Text"):GetComponent("Text").text =v.name - LogGreen("k.state:"..XuanYuanMirrorManager.GetMirrorState(k)) local state = XuanYuanMirrorManager.GetMirrorState(k) == 1 if not state then local timeStr = this:GetOpenTime(k) @@ -146,7 +145,7 @@ this.UpdateCarbonContent = function() Util.SetGray(go,not state) Util.AddOnceClick(go ,function() if state then - UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,k,XuanYuanMirrorManager.GetMirrorLevelData(k)) + UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,k) else PopupTipPanel.ShowTip(type[k].neme.."未开启!") end @@ -165,8 +164,6 @@ end function this:PlayAni() - -- 启动定时器 - this.StartCountTime() -- 开门音效 if not this.isPlayDoorAudio then this.isPlayDoorAudio = true @@ -187,23 +184,6 @@ function this.PlayScaleAnim() end end -function this.StartCountTime() - -end - -function this.FreshIconShow(id) - if not hasFresh then - hasFresh = true - - this.refreshTimer = nil - this.refreshTimer = Timer.New(function () - Util.SetGray(this.btnDaoxuan, not ActTimeCtrlManager.SingleFuncState(46)) - this.StartCountTime() - end, 1) - this.refreshTimer:Start() - end -end - --界面关闭时调用(用于子类重写) function this:OnClose() this.isPlayDoorAudio = false diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua index 118b2fa41c..236106e1fb 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua @@ -1,69 +1,105 @@ require("Base/BasePanel") XuanYuanMirrorPanelList = Inherit(BasePanel) +local raceTowerConfig = ConfigManager.GetConfig(ConfigName.RaceTowerConfig) +local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) local this = XuanYuanMirrorPanelList local hasFresh = false local orginLayer = 0 local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig) +local costNum = 0 +local storeData = {} local mirrors = { - [1] = { - id = "人杰宝镜", --人杰 - bg = "x_xianyuan_renjietu01", - tip = string.format("%s",specialConfig[71].Value), + [1] = { + id = "人杰宝镜", --人杰 + bg = "x_xianyuan_renjietu01", + tip = string.format("%s", specialConfig[71].Value) }, [2] = { - id = "佛禅宝镜", --佛禅 + id = "佛禅宝镜", --佛禅 bg = "x_xianyuan_fochantu01", - tip = string.format("%s",specialConfig[72].Value), + tip = string.format("%s", specialConfig[72].Value) }, [3] = { - id = "妖灵宝镜", --妖灵 + id = "妖灵宝镜", --妖灵 bg = "x_xianyuan_yaolingtu01", - tip = string.format("%s",specialConfig[73].Value), + tip = string.format("%s", specialConfig[73].Value) }, [4] = { - id = "道玄宝镜", --道玄 + id = "道玄宝镜", --道玄 bg = "x_xianyuan_daoxuantu01", - tip = string.format("%s",specialConfig[74].Value), - }, -} + tip = string.format("%s", specialConfig[74].Value) + } +} local curType = 0 local dataList = {} local list = {} local colorText = { - sprite = { [0] = "s_slbz_1anniuhuise",[1] = "s_slbz_1anniuongse",[2] = "s_slbz_1anniuhuangse"}, - color = { [0] = "3B3B3B",[1] = "855139",[2] = "8B670C"}, - text = { [0] = Language[10339],[1] = Language[10334],[2] = Language[10336] } + sprite = {[0] = "s_slbz_1anniuhuise", [1] = "s_slbz_1anniuongse", [2] = "s_slbz_1anniuhuangse"}, + color = {[0] = "3B3B3B", [1] = "855139", [2] = "8B670C"}, + text = {[0] = Language[10339], [1] = Language[10334], [2] = Language[10336]} } local difficult = { - text = {[1]=Language[10351],[2]=Language[10352],[3]=Language[10353],[4]=Language[12250],[5]=Language[10354], - [6]=Language[12148],[7]=Language[12251],[8]=Language[12252],[9]=Language[12253],[10]=Language[12253]}, - sprite = {[1]="x_xb_tiao_05",[2]="x_xb_tiao_05",[3]="x_xb_tiao_04",[4]="x_xb_tiao_04",[5]="x_xb_tiao_03", - [6]="x_xb_tiao_03",[7]="x_xb_tiao_02",[8]="x_xb_tiao_02",[9]="x_xb_tiao_01",[10]="x_xb_tiao_01"}, + text = { + [1] = Language[10351], + [2] = Language[10352], + [3] = Language[10353], + [4] = Language[12250], + [5] = Language[10354], + [6] = Language[12148], + [7] = Language[12251], + [8] = Language[12252], + [9] = Language[12253], + [10] = Language[12253] + }, + sprite = { + [1] = "x_xb_tiao_05", + [2] = "x_xb_tiao_05", + [3] = "x_xb_tiao_04", + [4] = "x_xb_tiao_04", + [5] = "x_xb_tiao_03", + [6] = "x_xb_tiao_03", + [7] = "x_xb_tiao_02", + [8] = "x_xb_tiao_02", + [9] = "x_xb_tiao_01", + [10] = "x_xb_tiao_01" + } } --初始化组件(用于子类重写) function this:InitComponent() this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform) - this.remainTimesTip = Util.GetGameObject(self.gameObject,"Panel/tip/remainTimesTip"): GetComponent("Text") - this.vipTips = Util.GetGameObject(self.gameObject,"Panel/tip/vipTips") : GetComponent("Text") - this.btnBack = Util.GetGameObject(self.gameObject,"Panel/BackBtn") + this.remainTimesTip = Util.GetGameObject(self.gameObject, "Panel/tip/remainTimesTip"):GetComponent("Text") + this.vipTips = Util.GetGameObject(self.gameObject, "Panel/tip/vipTips"):GetComponent("Text") + this.btnBack = Util.GetGameObject(self.gameObject, "Panel/BackBtn") - this.levelPre = Util.GetGameObject(self.gameObject,"Panel/Pre") + this.levelPre = Util.GetGameObject(self.gameObject, "Panel/Pre") --local v21 = Util.GetGameObject(self.gameObject, "Panel/Scroll"):GetComponent("RectTransform").rect - this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.gameObject, "Panel/Scroll").transform, - this.levelPre,nil,Vector2.New(919.6,1241.2), 1, 1, Vector2.New(0,117.7)) + this.ScrollView = + SubUIManager.Open( + SubUIConfig.ScrollCycleView, + Util.GetGameObject(self.gameObject, "Panel/Scroll").transform, + this.levelPre, + nil, + Vector2.New(919.6, 1241.2), + 1, + 1, + Vector2.New(0, 117.7) + ) this.ScrollView.moveTween.MomentumAmount = 1 this.ScrollView.moveTween.Strength = 1 - this.prefab = Util.GetGameObject(self.gameObject,"ItemView") + this.prefab = Util.GetGameObject(self.gameObject, "ItemView") end --绑定事件(用于子类重写) function this:BindEvent() - Util.AddClick(this.btnBack, function() - UIManager.OpenPanel(UIName.XuanYuanMirrorPanel) - this:OnClose() - end) + Util.AddClick( + this.btnBack, + function() + UIManager.OpenPanel(UIName.XuanYuanMirrorPanel) + this:OnClose() + end + ) end --添加事件监听(用于子类重写) @@ -80,35 +116,36 @@ this.RefreshPanel = function() local data = XuanYuanMirrorManager.GetMirroData(curType) if data.passId == 0 or XuanYuanMirrorManager.GetMirrorState(curType) ~= 1 then if data.passId == 0 then - PopupTipPanel.ShowTip(mirrors[curType].id.."已重置!") + PopupTipPanel.ShowTip(mirrors[curType].id .. "已重置!") elseif XuanYuanMirrorManager.GetMirrorState(curType) ~= 1 then - PopupTipPanel.ShowTip(mirrors[curType].id.."已关闭!") + PopupTipPanel.ShowTip(mirrors[curType].id .. "已关闭!") end this:OnClose() UIManager.OpenPanel(UIName.XuanYuanMirrorPanel) end end -function this:OnOpen(_type,_data) - this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Main }) +function this:OnOpen(_type) + this.UpView:OnOpen({showType = UpViewOpenType.ShowRight, panelType = PanelType.Main}) curType = _type XuanYuanMirrorManager.curType = curType - dataList = _data - LogGreen("dataList:"..#dataList) end function this:SwitchView() - local curObj = Util.GetGameObject(self.gameObject,"title") + local curObj = Util.GetGameObject(self.gameObject, "title") curObj:GetComponent("Image").sprite = Util.LoadSprite(mirrors[curType].bg) - Util.GetGameObject(curObj,"Text"):GetComponent("Text").text = mirrors[curType].tip - - this.ScrollView:SetData(dataList, function (index, go) - this:SetLevelData(go, dataList[index]) - table.insert(list,go) - end) + Util.GetGameObject(curObj, "Text"):GetComponent("Text").text = mirrors[curType].tip + + this.ScrollView:SetData( + dataList, + function(index, go) + this:SetLevelData(go, dataList[index]) + table.insert(list, go) + end + ) end -function this:NewItemView(config,gameObject,...) +function this:NewItemView(config, gameObject, ...) local view = reimport(config.script) if gameObject then this:playUIAnimsOnStart(gameObject) @@ -138,7 +175,7 @@ end function this:playUIAnimsOnStart(gameObject) local anims = gameObject:GetComponentsInChildren(typeof(PlayFlyAnim)) if anims.Length > 0 then - for i=0, anims.Length-1 do + for i = 0, anims.Length - 1 do local anim = anims[i] if anim.isPlayOnOpen then anim:PlayAnim(false) @@ -148,97 +185,145 @@ function this:playUIAnimsOnStart(gameObject) end function this:SetLevelData(go, data) - local btnFight = Util.GetGameObject(go,"btnFight") + local btnFight = Util.GetGameObject(go, "btnFight") btnFight:GetComponent("Image").sprite = Util.LoadSprite(colorText.sprite[data.state]) - local text = Util.GetGameObject(btnFight,"Text"):GetComponent("Text") - text.text =string.format("%s",colorText.color[data.state],colorText.text[data.state]) - local tip = Util.GetGameObject(go,"Tip"):GetComponent("Text") + Util.GetGameObject(btnFight, "Text"):GetComponent("Text").text = string.format("%s", colorText.color[data.state], colorText.text[data.state]) + local costIcon = Util.GetGameObject(btnFight, "Icon"):GetComponent("Image") + costIcon.gameObject:SetActive(false) + local costNumText = Util.GetGameObject(btnFight, "IconNum"):GetComponent("Text") + costNumText.gameObject:SetActive(false) + + local tip = Util.GetGameObject(go, "Tip"):GetComponent("Text") tip.gameObject:SetActive(true) - if data.state == 1 then - tip.text=data.condition - elseif data.state == 0 then + + if data.state == 0 then tip.gameObject:SetActive(false) else - tip.text=Language[10337] - end - Util.AddOnceClick(btnFight,function() if data.state == 1 then - this:OnClose() - LogGreen("curType"..curType) - UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.XUANYUAN_MIRROR,curType,data) - elseif data.state == 0 then + tip.text = data.condition + else + tip.text = Language[10337] + end + if XuanYuanMirrorManager.freeTime < 1 then + costNumText.gameObject:SetActive(true) + costIcon.gameObject:SetActive(true) + costNumText.text = costNum + end + end + + Util.AddOnceClick(btnFight,function() + if data.state == 0 then PopupTipPanel.ShowTip(Language[12255]) - elseif data.state == 2 then - XuanYuanMirrorManager.ExecuteFightBattle(data.id,2,function() - this:RefreshTimes() - end) + else + --检测剩余次数 + if XuanYuanMirrorManager.buyTime <= 0 and XuanYuanMirrorManager.freeTime <= 0 then + PopupTipPanel.ShowTip(Language[10342]) + return + end + local itemId = storeData.Cost[1][1] --消耗道具 + if BagManager.GetItemCountById(itemId) < costNum and XuanYuanMirrorManager.freeTime <= 0 then + PopupTipPanel.ShowTip(string.format(Language[10343], itemConfig[itemId].Name)) + return + end + if XuanYuanMirrorManager.freeTime <= 0 then + ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,storeData.Id,1,function() + PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.buyTimeId, 1) + end) + end + if data.state == 2 then + XuanYuanMirrorManager.ExecuteFightBattle(data.id,2,function() + PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.freeTimeId, 1) + this:OnShow() + end) + elseif data.state == 1 then + LogGreen("curType" .. curType) + UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.XUANYUAN_MIRROR, curType, data) + end end end) - local rewardGrid = Util.GetGameObject(go,"Reward") + local rewardGrid = Util.GetGameObject(go, "Reward") local rewards = {} - for i = 1,rewardGrid.transform.childCount do + for i = 1, rewardGrid.transform.childCount do rewardGrid.transform:GetChild(i - 1).gameObject:SetActive(false) - table.insert(rewards,rewardGrid.transform:GetChild(i - 1)) + table.insert(rewards, rewardGrid.transform:GetChild(i - 1)) end - for n,m in ipairs(data.rewardList) do + for n, m in ipairs(data.rewardList) do if m then --设置概率掉落奖励 if m.israte == 0 then + --设置扫荡掉落奖励 if not rewards[n] then rewards[n] = newObjToParent(this.prefab, rewardGrid) end rewards[n].gameObject:SetActive(true) - local o = this:NewItemView(SubUIConfig.ItemView,rewards[n]) - o:OnOpen(false, {m.id, m.num},0.78, false) - local image = Util.GetGameObject(rewards[n].gameObject,"PreciousShow") + local o = this:NewItemView(SubUIConfig.ItemView, rewards[n]) + o:OnOpen(false, {m.id, m.num}, 0.78, false) + local image = Util.GetGameObject(rewards[n].gameObject, "PreciousShow") image.gameObject:SetActive(true) - Util.GetGameObject(image,"Text").gameObject:SetActive(false) + Util.GetGameObject(image, "Text").gameObject:SetActive(false) image:GetComponent("Image").sprite = Util.LoadSprite("x_xianyuan_gailvjiaobiao") - --设置扫荡掉落奖励 - elseif data.state == 2 and m.israte == 1 then + elseif data.state == 2 and m.israte == 1 then + --设置未开启和挑战掉落奖励 if not rewards[n] then rewards[n] = newObjToParent(this.prefab, rewardGrid) end rewards[n].gameObject:SetActive(true) - local o = this:NewItemView(SubUIConfig.ItemView,rewards[n]) - o:OnOpen(false, {m.id, m.num},0.78, false) - local image = Util.GetGameObject(rewards[n].gameObject,"PreciousShow") + local o = this:NewItemView(SubUIConfig.ItemView, rewards[n]) + o:OnOpen(false, {m.id, m.num}, 0.78, false) + local image = Util.GetGameObject(rewards[n].gameObject, "PreciousShow") image.gameObject:SetActive(false) - --设置未开启和挑战掉落奖励 elseif (data.state == 1 or data.state == 0) and m.israte == 2 then if not rewards[n] then rewards[n] = newObjToParent(this.prefab, rewardGrid) end rewards[n].gameObject:SetActive(true) - local o = this:NewItemView(SubUIConfig.ItemView,rewards[n]) - o:OnOpen(false, {m.id, m.num},0.78, false) - local image = Util.GetGameObject(rewards[n].gameObject,"PreciousShow") + local o = this:NewItemView(SubUIConfig.ItemView, rewards[n]) + o:OnOpen(false, {m.id, m.num}, 0.78, false) + local image = Util.GetGameObject(rewards[n].gameObject, "PreciousShow") image.gameObject:SetActive(true) - Util.GetGameObject(image,"Text").gameObject:SetActive(false) - image:GetComponent("Image").sprite = Util.LoadSprite("x_xianyuan_shoucijiaobiao") + Util.GetGameObject(image, "Text").gameObject:SetActive(false) + image:GetComponent("Image").sprite = Util.LoadSprite("x_xianyuan_shoucijiaobiao") end end end - Util.GetGameObject(go,"Bg/BgQuality/title"):GetComponent("Text").text = mirrors[data.type].id - Util.GetGameObject(go,"Bg/BgQuality/difficult"):GetComponent("Text").text = difficult.text[data.difficulity] - Util.GetGameObject(go,"Bg/BgQuality"):GetComponent("Image").sprite =Util.LoadSprite(difficult.sprite[data.difficulity]) - Util.GetGameObject(go,"Bg/BgQuality/Text"):GetComponent("Text").text = data.power + Util.GetGameObject(go, "Bg/BgQuality/title"):GetComponent("Text").text = mirrors[data.type].id + Util.GetGameObject(go, "Bg/BgQuality/difficult"):GetComponent("Text").text = difficult.text[data.difficulity] + Util.GetGameObject(go, "Bg/BgQuality"):GetComponent("Image").sprite = + Util.LoadSprite(difficult.sprite[data.difficulity]) + Util.GetGameObject(go, "Bg/BgQuality/Text"):GetComponent("Text").text = data.power end --界面打开时调用(用于子类重写) -function this:OnShow(...) - this:SwitchView() - this:RefreshTimes() +function this:OnShow(...) + dataList = XuanYuanMirrorManager.GetMirrorLevelData(curType) + this:RefreshTimes() + local buyTimeId = XuanYuanMirrorManager.buyTimeId + storeData = ConfigManager.GetConfigDataByDoubleKey(ConfigName.StoreConfig, "StoreId", 7, "Limit", buyTimeId) + --商店表数据 + local buyTimes = (PrivilegeManager.GetPrivilegeUsedTimes(buyTimeId) + 1) > PrivilegeManager.GetPrivilegeNumber(buyTimeId) + and PrivilegeManager.GetPrivilegeNumber(buyTimeId) or (PrivilegeManager.GetPrivilegeUsedTimes(buyTimeId) + 1) + costNum = storeData.Cost[2][buyTimes] + this:SwitchView() end --界面打开时调用(用于子类重写) function this:RefreshTimes() --- this.remainTimesTip.text = XuanYuanMirrorManager.GetTimeTip() - -- this.vipTips.text = Language[12257] + this.remainTimesTip.text = XuanYuanMirrorManager.GetTimeTip() + if XuanYuanMirrorManager.GetBuyTimesTip() then + this.vipTips.gameObject:SetActive(false) + else + this.vipTips.gameObject:SetActive(true) + this.vipTips.text = Language[12257] + Util.AddOnceClick( + Util.GetGameObject(this.vipTips.gameObject, "GameObject"), + function() + UIManager.OpenPanel(UIName.MainRechargePanel, 3) + end + ) + end end function this:OnSortingOrderChange() - end --界面关闭时调用(用于子类重写) @@ -252,4 +337,4 @@ function this:OnDestroy() this.ScrollView = nil end -return XuanYuanMirrorPanelList \ No newline at end of file +return XuanYuanMirrorPanelList diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/XuanYuanMirrorFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/XuanYuanMirrorFormation.lua index ac0ad344a1..c82c96da04 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/XuanYuanMirrorFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/XuanYuanMirrorFormation.lua @@ -11,7 +11,6 @@ function this.Init(root, ...) if temp[1] and temp[1] ~= 0 then curType = temp[1] end - LogBlue("curType"..curType) if temp[2] then data = temp[2] end @@ -68,7 +67,6 @@ function this.RefreshFormation(curFormation) end end end - LogBlue("index"..index) if index >= tonumber(data.teamRules[1][2]) then this.root.tip:GetComponent("Text").text = string.format("%s", data.condition) else @@ -82,7 +80,8 @@ end --- 关闭界面事件 function this.OnCloseBtnClick() - this.root:ClosePanel() + this.root.gameObject:SetActive(false) + UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,XuanYuanMirrorManager.curType) end return this