miduo_client/Assets/ManagedResources/~Lua/Modules/FindTreasure/FindTreasureVipPopup.lua

93 lines
3.7 KiB
Lua
Raw Normal View History

2021-04-20 13:58:00 +08:00
require("Base/BasePanel")
2020-05-09 13:31:21 +08:00
FindTreasureVipPopup = Inherit(BasePanel)
local MazeTreasureSetting = ConfigManager.GetConfig(ConfigName.MazeTreasureSetting)
2021-03-30 13:43:46 +08:00
local orginLayer = 0
2020-05-09 13:31:21 +08:00
--初始化组件(用于子类重写)
function FindTreasureVipPopup:InitComponent()
self.btnBack = Util.GetGameObject(self.gameObject, "Button")
self.descText1 = Util.GetGameObject(self.gameObject, "GameObject1/descText"):GetComponent("Text")
self.jumpBtn1 = Util.GetGameObject(self.gameObject, "GameObject1/jumpBtn")
self.finfsh1 = Util.GetGameObject(self.gameObject, "GameObject1/finish")
self.jumpBtn1Text = Util.GetGameObject(self.gameObject, "GameObject1/jumpBtn/Text"):GetComponent("Text")
self.finfsh1Text = Util.GetGameObject(self.gameObject, "GameObject1/finish/Text"):GetComponent("Text")
2020-05-09 13:31:21 +08:00
self.descText2 = Util.GetGameObject(self.gameObject, "GameObject2/descText"):GetComponent("Text")
self.jumpBtn2 = Util.GetGameObject(self.gameObject, "GameObject2/jumpBtn")
self.finfsh2 = Util.GetGameObject(self.gameObject, "GameObject2/finish")
self.jumpBtn2Text = Util.GetGameObject(self.gameObject, "GameObject2/jumpBtn/Text"):GetComponent("Text")
self.finfsh2Text = Util.GetGameObject(self.gameObject, "GameObject2/finish/Text"):GetComponent("Text")
2021-03-30 13:43:46 +08:00
self.effect1 = Util.GetGameObject(self.jumpBtn1, "UI_Effect_MianBan_GuaJi_Ani")
self.effect2 = Util.GetGameObject(self.jumpBtn2, "UI_Effect_MianBan_GuaJi_Ani")
2020-05-09 13:31:21 +08:00
end
--绑定事件(用于子类重写)
function FindTreasureVipPopup:BindEvent()
Util.AddClick(self.btnBack, function()
self:ClosePanel()
end)
Util.AddClick(self.jumpBtn1, function()
2021-03-31 16:09:15 +08:00
DynamicActivityManager.SetSelectIndex(DataType.Shop,{20091,20092})
2020-05-09 13:31:21 +08:00
JumpManager.GoJump(MazeTreasureSetting[1].Jump)
end)
Util.AddClick(self.jumpBtn2, function()
2021-03-31 16:09:15 +08:00
DynamicActivityManager.SetSelectIndex(DataType.Shop,{20091,20092})
2020-05-09 13:31:21 +08:00
JumpManager.GoJump(MazeTreasureSetting[1].Jump)
end)
end
--添加事件监听(用于子类重写)
function FindTreasureVipPopup:AddListener()
end
--移除事件监听(用于子类重写)
function FindTreasureVipPopup:RemoveListener()
end
2021-03-30 13:43:46 +08:00
function FindTreasureVipPopup:OnSortingOrderChange()
Util.AddParticleSortLayer(self.effect1, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(self.effect2, self.sortingOrder - orginLayer)
orginLayer = self.sortingOrder
end
2020-05-09 13:31:21 +08:00
--界面打开时调用(用于子类重写)
function FindTreasureVipPopup:OnOpen(...)
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function FindTreasureVipPopup:OnShow()
2021-01-26 17:08:39 +08:00
local desc = string.split(GetLanguageStrById(MazeTreasureSetting[1].DescDailyPrivilege), "#")
self.descText1.text = string.gsub(desc[1],"|","#")
self.descText2.text = string.gsub(desc[2],"|","#")
self.descText1.fontSize = GetCurLanguage() ~= 2 and 30 or 28
self.descText2.fontSize = GetCurLanguage() ~= 2 and 30 or 25
2021-01-26 17:08:39 +08:00
2020-05-09 13:31:21 +08:00
local gaoState = PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.GoFindTreasure)
local haoState = PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.HaoFindTreasure)
self.jumpBtn1:SetActive(not gaoState)
self.finfsh1:SetActive(gaoState)
self.jumpBtn2:SetActive(not haoState)
self.finfsh2:SetActive(haoState)
self.jumpBtn1Text.fontSize = GetCurLanguage() ~= 2 and 35 or 20
self.jumpBtn2Text.fontSize = GetCurLanguage() ~= 2 and 35 or 20
self.finfsh1Text.fontSize = GetCurLanguage() ~= 2 and 35 or 20
self.finfsh2Text.fontSize = GetCurLanguage() ~= 2 and 35 or 20
2020-05-09 13:31:21 +08:00
end
--界面关闭时调用(用于子类重写)
function FindTreasureVipPopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function FindTreasureVipPopup:OnDestroy()
2021-03-30 13:43:46 +08:00
orginLayer = 0
2020-05-09 13:31:21 +08:00
end
2020-06-23 18:36:24 +08:00
return FindTreasureVipPopup