|
|
- CSGWarBaseView = CSGWarBaseView or BaseClass(BaseView)
- local CSGWarBaseView = CSGWarBaseView
-
- function CSGWarBaseView:__init()
- self.base_file = "CSGWar"
- self.layout_file = "CSGWarBaseView"
- self.layer_name = "UI"
- self.destroy_imm = true
- self.use_background = true --全屏界面默认使用这个参数
- self.blur_activity_bg = true
- self.close_fog = true
- self.hide_maincancas = true --全屏界面需要放开隐藏主UI
- self.change_scene_close = true
- self.append_to_ctl_queue = false --是否要添加进界面堆栈
- self.need_show_money = false --是否要显示顶部的金钱栏
- self.model = CSGWarModel:getInstance()
-
- self.load_callback = function ()
- self:LoadSuccess()
- self:AddEvent()
- end
- self.open_callback = function ( )
- self:OpenSuccess()
- end
- self.switch_callback = function(index)
- self:SwitchTab(index)
- end
- self.destroy_callback = function ( )
- self:DestroySuccess()
- end
- end
-
- function CSGWarBaseView:Open( )
- --self.data = data
- BaseView.Open(self)
- end
-
- function CSGWarBaseView:LoadSuccess()
- local nodes = {
- "container","close_btn:obj"
- }
- self:GetChildren(nodes)
- local function bg_back_func( ... )
- if self.background_wnd and self.background_wnd:GetComponent("RawImageExtend") then
- self:MoveUIToBack(self.background_wnd:GetComponent("RawImageExtend"))
- end
- end
- if self.background_wnd then
- bg_back_func()
- else
- self.bg_back_func = bg_back_func
- end
- end
-
- function CSGWarBaseView:AddEvent()
- local function on_close( )
- self:Close()
- end
- AddClickEvent(self.close_btn_obj, on_close)
- end
-
- function CSGWarBaseView:OpenSuccess()
- self:UpdateView()
- end
-
- function CSGWarBaseView:UpdateView()
- if not self.cswar_view then
- self.cswar_view = CSGWarSubView.New(self.container)
- end
- self.cswar_view:SetData()
- self.cswar_view:AppendToBackContainer(self)
- end
-
- function CSGWarBaseView:SwitchTab( index )
-
- end
-
- function CSGWarBaseView:DestroySuccess( )
- if self.cswar_view then
- self.cswar_view:DeleteMe()
- self.cswar_view = nil
- end
- end
|