|
|
- ChatSettingView = ChatSettingView or BaseClass(BaseView)
-
- ChatSettingView.TabList = {"频道设置","个性设置"}
-
- function ChatSettingView:__init()
- self.base_file = "chat"
- self.layout_file = "ChatSettingView"
- self.destroy_imm = false
- self.use_background = true
- self.layer_name = "UI"
-
- self.panel_list = {}
- self.cur_select_index = 0
-
- self.load_callback = function ()
- self:LoadSuccess()
- self:SetData()
- self:SeletedTabbar(1)
- end
- self.destroy_callback = function ()
-
- end
-
- self:AddPreLoadList("uiComponent",{"TabButton"})
-
- end
-
- function ChatSettingView:__delete()
- self:Clear()
- end
-
- function ChatSettingView:Clear()
- if self.TabWindowComponent then
- self.TabWindowComponent:DeleteMe()
- self.TabWindowComponent = nil
- end
- end
-
- function ChatSettingView:LoadSuccess()
- for i=1,#ChatSettingView.TabList do
- local panel = GameObject("Panel_"..i).transform
- panel.parent = self.transform
- panel.localPosition = Vector3.zero
- panel.localScale = Vector3.one
- table.insert(self.panel_list, panel)
- end
- if self.TabWindowComponent == nil then
- local select_callback = function(index)
- self:SeletedTabbar(index)
- end
- local close_callback = function()
- self:Close()
- end
- self.TabWindowComponent = TabWindowComponent.New(self.transform, "聊天设置", ChatSettingView.TabList, 615, 675, 332, 54, select_callback, close_callback, nil, self.background_wnd)
- end
- end
-
- function ChatSettingView:InitEvent()
-
- end
-
- function ChatSettingView:SetData()
-
- end
-
- function ChatSettingView:SeletedTabbar(index)
- local current_index = self.TabWindowComponent:GetCurrentSelectIndex()
- if current_index == index then return end
-
- if self.TabWindowComponent then
- self.TabWindowComponent:SetTabBarIndex(index)
- self:SwitchBar()
- end
- end
-
- function ChatSettingView:SwitchBar()
- local index = self.TabWindowComponent:GetCurrentSelectIndex()
- if index == 1 then
- if self.ChannelSettingView == nil then
- self.ChannelSettingView = ChannelSettingView.New(self.panel_list[index])
- end
- self:PopUpChild(self.ChannelSettingView)
- elseif index == 2 then
- -- if self.BubbleSettingView == nil then
- -- self.BubbleSettingView = BubbleSettingView.New(self.panel_list[index])
- -- end
- end
- end
-
|