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

95 lines
3.8 KiB
Lua

require("Base/BasePanel")
FindTreasureVipPopup = Inherit(BasePanel)
local MazeTreasureSetting = ConfigManager.GetConfig(ConfigName.MazeTreasureSetting)
local orginLayer = 0
--初始化组件(用于子类重写)
function FindTreasureVipPopup:InitComponent()
self.spLoader = SpriteLoader.New()
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")
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")
self.effect1 = Util.GetGameObject(self.jumpBtn1, "UI_Effect_MianBan_GuaJi_Ani")
self.effect2 = Util.GetGameObject(self.jumpBtn2, "UI_Effect_MianBan_GuaJi_Ani")
end
--绑定事件(用于子类重写)
function FindTreasureVipPopup:BindEvent()
Util.AddClick(self.btnBack, function()
self:ClosePanel()
end)
Util.AddClick(self.jumpBtn1, function()
DynamicActivityManager.SetSelectIndex(DataType.Shop,{20091,20092})
JumpManager.GoJump(MazeTreasureSetting[1].Jump)
end)
Util.AddClick(self.jumpBtn2, function()
DynamicActivityManager.SetSelectIndex(DataType.Shop,{20091,20092})
JumpManager.GoJump(MazeTreasureSetting[1].Jump)
end)
end
--添加事件监听(用于子类重写)
function FindTreasureVipPopup:AddListener()
end
--移除事件监听(用于子类重写)
function FindTreasureVipPopup:RemoveListener()
end
function FindTreasureVipPopup:OnSortingOrderChange()
Util.AddParticleSortLayer(self.effect1, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(self.effect2, self.sortingOrder - orginLayer)
orginLayer = self.sortingOrder
end
--界面打开时调用(用于子类重写)
function FindTreasureVipPopup:OnOpen(...)
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function FindTreasureVipPopup:OnShow()
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
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
end
--界面关闭时调用(用于子类重写)
function FindTreasureVipPopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function FindTreasureVipPopup:OnDestroy()
self.spLoader:Destroy()
orginLayer = 0
end
return FindTreasureVipPopup