diff --git a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua index 27a4c7cd29..1e6f577e23 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua @@ -293,7 +293,7 @@ local jumpDic = { UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.Gold }) end, [JumpType.ElementDrawCard] = function(data)--元素招募 - UIManager.OpenPanel(UIName.ElementDrawCardPanel) + UIManager.OpenPanel(UIName.ElementDrawCardPanel,(data and data[1] or 0)) end, [JumpType.Pray] = function(data)--云梦 if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.Pray) then diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua index e132064ad6..8af3478942 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua @@ -261,7 +261,6 @@ function RewardItemSingleShowPopup:OnOpen(...) isNoShowSureBtn = data[4] and data[4] or false end function RewardItemSingleShowPopup:OnShow() - LogGreen("1111111111111111111111111111") this.itemName.text = GetStringByEquipQua(itemConfigData.Quantity, GetLanguageStrById(itemConfigData.Name)) --判断自选宝箱界面是否开启 local isBoxOpen = UIManager.IsOpen(314) diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua index 18976a4595..53699bc53e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua @@ -11,6 +11,7 @@ local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local itemId=20 --元素神符 --初始化组件(用于子类重写) function ElementDrawCardPanel:InitComponent() + this.getCardPanelList = {} this.spLoader = SpriteLoader.New() orginLayer = 0 this.btnBack=Util.GetGameObject(self.gameObject, "enterCardPanel/btnBack") @@ -36,6 +37,10 @@ function ElementDrawCardPanel:InitComponent() this.getCardPanel2=Util.GetGameObject(self.transform, "getCardPanel2") this.getCardPanel3=Util.GetGameObject(self.transform, "getCardPanel3") this.getCardPanel4=Util.GetGameObject(self.transform, "getCardPanel4") + table.insert(this.getCardPanelList,this.getCardPanel1) + table.insert(this.getCardPanelList,this.getCardPanel2) + table.insert(this.getCardPanelList,this.getCardPanel3) + table.insert(this.getCardPanelList,this.getCardPanel4) -- this.getCardPanel5=Util.GetGameObject(self.transform, "getCardPanel5") this.getCardPanelBtnBack1=Util.GetGameObject(self.transform, "getCardPanel1/btnBack") this.getCardPanelBtnBack2=Util.GetGameObject(self.transform, "getCardPanel2/btnBack") @@ -141,52 +146,16 @@ function ElementDrawCardPanel:BindEvent() -- end) Util.AddClick(this.itemBtn1, function () - this.getCardPanel1:SetActive(true) - this.getCardPanel2:SetActive(false) - this.getCardPanel3:SetActive(false) - this.getCardPanel4:SetActive(false) - -- this.getCardPanel5:SetActive(false) - this.getCardPanel1:GetComponent("PlayFlyAnim"):PlayAnim(true) - this.effect:SetActive(true) - -- 音效 - SoundManager.PlaySound(SoundConfig.Sound_syz) - SoundManager.PlayMusic(SoundConfig.Sound_syz_loop) + this:BtnAction(1,this.getCardPanel1) end) Util.AddClick(this.itemBtn2, function () - this.getCardPanel1:SetActive(false) - this.getCardPanel2:SetActive(true) - this.getCardPanel3:SetActive(false) - this.getCardPanel4:SetActive(false) - -- this.getCardPanel5:SetActive(false) - this.getCardPanel2:GetComponent("PlayFlyAnim"):PlayAnim(true) - this.effect:SetActive(true) - -- 音效 - SoundManager.PlaySound(SoundConfig.Sound_syz) - SoundManager.PlayMusic(SoundConfig.Sound_syz_loop) + this:BtnAction(2,this.getCardPanel2) end) Util.AddClick(this.itemBtn3, function () - this.getCardPanel1:SetActive(false) - this.getCardPanel2:SetActive(false) - this.getCardPanel3:SetActive(true) - this.getCardPanel4:SetActive(false) - -- this.getCardPanel5:SetActive(false) - this.getCardPanel3:GetComponent("PlayFlyAnim"):PlayAnim(true) - this.effect:SetActive(true) - -- 音效 - SoundManager.PlaySound(SoundConfig.Sound_syz) - SoundManager.PlayMusic(SoundConfig.Sound_syz_loop) + this:BtnAction(3,this.getCardPanel3) end) Util.AddClick(this.itemBtn4, function () - this.getCardPanel1:SetActive(false) - this.getCardPanel2:SetActive(false) - this.getCardPanel3:SetActive(false) - this.getCardPanel4:SetActive(true) - -- this.getCardPanel5:SetActive(false) - this.getCardPanel4:GetComponent("PlayFlyAnim"):PlayAnim(true) - this.effect:SetActive(true) - -- 音效 - -- SoundManager.PlaySound(SoundConfig.Sound_syz) - SoundManager.PlayMusic(SoundConfig.Sound_syz_loop) + this:BtnAction(4,this.getCardPanel4) end) -- Util.AddClick(this.itemBtn5, function () -- this.getCardPanel1:SetActive(false) @@ -236,6 +205,22 @@ function ElementDrawCardPanel:BindEvent() UIManager.OpenPanel(UIName.CompoundHeroPanel,2) end) end + +function ElementDrawCardPanel:BtnAction(index) + this.getCardPanel1:SetActive(index == 1) + this.getCardPanel2:SetActive(index == 2) + this.getCardPanel3:SetActive(index == 3) + this.getCardPanel4:SetActive(index == 4) + if index == 0 then + return + end + -- this.getCardPanel5:SetActive(false) + this.getCardPanelList[index]:GetComponent("PlayFlyAnim"):PlayAnim(true) + this.effect:SetActive(true) + -- 音效 + SoundManager.PlaySound(SoundConfig.Sound_syz) + SoundManager.PlayMusic(SoundConfig.Sound_syz_loop) +end --添加事件监听(用于子类重写) function ElementDrawCardPanel:AddListener() Game.GlobalEvent:AddEvent(GameEvent.SecretBox.OnOpenOneReward, this.OpenOneRewardPanel) @@ -265,6 +250,8 @@ function ElementDrawCardPanel:OnOpen(...) local parent = Util.GetGameObject(self.transform, "getCardPanel"..i.."/content1/Image/Image (1)/Image (1)") SetTextVerTial(Util.GetGameObject(parent, "Text"),Vector3.New(134.88,-5.9,0),"MiddleLeft") end + local args = {...} + this.index = args[1] or 0 end --界面打开或者重新打开后,界面刷新时调用(用于子类重写) @@ -277,6 +264,8 @@ function ElementDrawCardPanel:OnShow() Util.GetGameObject(this.getCardPanel2, "content2/btn1/Text"):GetComponent("Text").fontSize = GetCurLanguage() ~= 2 and 38 or 30 Util.GetGameObject(this.getCardPanel3, "content2/btn1/Text"):GetComponent("Text").fontSize = GetCurLanguage() ~= 2 and 38 or 30 Util.GetGameObject(this.getCardPanel4, "content2/btn1/Text"):GetComponent("Text").fontSize = GetCurLanguage() ~= 2 and 38 or 30 + + this:BtnAction(this.index) end diff --git a/Assets/ManagedResources/~Lua/View/JumpViewNew.lua b/Assets/ManagedResources/~Lua/View/JumpViewNew.lua index cf3927b859..eaaf4a61c9 100644 --- a/Assets/ManagedResources/~Lua/View/JumpViewNew.lua +++ b/Assets/ManagedResources/~Lua/View/JumpViewNew.lua @@ -65,7 +65,7 @@ function JumpViewNew:OnOpen(jumpId,heroConfig,parent) self.costIconPos.gameObject:SetActive(false) self.desc.text = "设为心愿神将会有更高概率" elseif self.jumpSData.Type == JumpType.ElementDrawCard then - self.info.text = GetLanguageStrById(self.jumpSData.Title).."·"..HeroElementDef[heroConfig.PropertyName] + self.info.text = GetLanguageStrById(self.jumpSData.Title) self.costIconPos.gameObject:SetActive(false) self.desc.text = "抽取时额外赠送元神玉" elseif self.jumpSData.Type == JumpType.ZhuTiHuoDong then