|
|
- GodActivityEffectView = GodActivityEffectView or BaseClass(BaseView)
- local GodActivityEffectView = GodActivityEffectView
-
- function GodActivityEffectView:__init()
- self.base_file = "godActivity"
- self.layout_file = "GodActivityEffectView"
- self.layer_name = "Top"
- self.destroy_imm = true
- self.change_scene_close = true
- self.append_to_ctl_queue = false --是否要添加进界面堆栈
- self.is_set_zdepth = true
- -- self.blur_activity_bg = true
- self.click_bg_toClose = false
- ------------------------
- -- 一级全屏界面:
- self.hide_maincancas = false --隐藏主界面
- self.use_background = true --不一定显示遮罩
- -- 二级界面:
- -- self.hide_maincancas = false --是否需要隐藏主界面,看策划需求
- -- self.use_background = true --需要遮罩
- ------------------------
-
- self.load_callback = function ()
- self:LoadSuccess()
- end
- self.open_callback = function ( )
- self:OpenSuccess()
- end
- self.close_win_callback = function ( )
- self:Close()
- end
- self.destroy_callback = function ( )
- self:DestroySuccess()
- end
- end
-
- function GodActivityEffectView:Open( data )
- self.data = data
- BaseView.Open(self)
- end
-
- function GodActivityEffectView:LoadSuccess()
- local nodes = {
- "con_effect","skipBtn:obj",
- }
- self:GetChildren(nodes)
- self:AddEvent()
- end
-
- function GodActivityEffectView:AddEvent()
- local on_click = function ( click_obj )
- if self.skipBtn_obj == click_obj then
- self:Close()
- end
- end
- AddClickEvent(self.skipBtn_obj, on_click)
-
- end
-
- function GodActivityEffectView:OpenSuccess()
- self:UpdateView()
- end
-
- function GodActivityEffectView:UpdateView()
- if not self.data then self:Close() end
- local function close_call( )
- self:Close()
- end
- self.time_close_id = self.time_close_id or setTimeout(close_call,self.data.time or 1)
- self:AddUIEffect(self.data.name, self.con_effect, self.layer_name, self.data.pos, self.data.scale, false,
- nil, nil, nil, nil, 5)
- end
-
- function GodActivityEffectView:DestroySuccess( )
- if self.time_close_id then
- GlobalTimerQuest:CancelQuest(self.time_close_id)
- self.time_close_id = nil
- end
- self:ClearUIEffect(self.con_effect.transform)
- if self.data.end_func then
- self.data.end_func()
- end
- end
|