예제 #1
0
        public void Init()
        {
            m_diyChannelItemPrefabRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "UI/Prefabs/Chat/ChatDiyChannelItem");
            if (m_diyChannelItemPrefabRes == null)
            {
                return;
            }


            foreach (var item in m_ChannelNameMap)
            {
                String     channelName = item.Key;
                GameObject ob          = m_diyChannelItemPrefabRes.InstanceMainRes();
                ob.transform.SetParent(m_ChannelGroup.transform);
                ob.name = item.Key;
                ob.transform.FindChild("ChannelName").GetComponent <Text>().text = ChatBoxWndView.getChannelName((EMChatChannelType)item.Value);


                Toggle tg = ob.GetComponent <Toggle>();

                // 初始化复选框状态
                initChannelGroup(channelName, ref tg);

                // 设置复选框状态变化回调
                tg.onValueChanged.AddListener(delegate(bool check)
                {
                    this.onValueChanged(check, ob);
                });
            }
        }
예제 #2
0
 public void SetWndView(ChatBoxWndView wndView)
 {
     m_wndView = wndView;
 }
예제 #3
0
        public void Init(ChatBoxWndView wndView, ChatChannelGroupType nType)
        {
            m_wndView          = wndView;
            m_ChannelGroupType = nType;
            transform.SetParent(wndView.channelMaskButtonFrame, false);
            m_buttonGroupItem = GetComponent <UButtonGroupItem>();
            if (m_buttonGroupItem == null)
            {
                Debug.LogError("ChatBoxWndView::Init::m_buttonGroupItem == null");
                return;
            }

            m_buttonGroupItem.Group = wndView.channelMaskButtonGroup;
            m_buttonGroupItem.onSelectedChanged.AddListener(onSelectedChanged);
            m_buttonGroupItem.onDoubleClick.AddListener(onDoubleClick);
            m_buttonGroupItem.onRightClick.AddListener(onRightClick);
            m_nChannelMask = 0;


            switch (nType)
            {
            case ChatChannelGroupType.ChatChannel_Clan:
                itemText.text   = ULocalizationService.Instance.Get("UIView", "ChatBox", "ClanChannelName");
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_CLAN);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            case ChatChannelGroupType.ChatChannel_Kin:
                itemText.text   = ULocalizationService.Instance.Get("UIView", "ChatBox", "KinChannelName");
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_KIN);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            case ChatChannelGroupType.ChatChannel_Team:
                itemText.text   = ULocalizationService.Instance.Get("UIView", "ChatBox", "TeammateChannelName");
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_TEAMMATE);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            case ChatChannelGroupType.ChatChannel_Zone:
                itemText.text   = ULocalizationService.Instance.Get("UIView", "ChatBox", "WarSceneChannelName");
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_TEAMMATE);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_ZONE);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            case ChatChannelGroupType.ChatChannel_Room:
                itemText.text   = ULocalizationService.Instance.Get("UIView", "ChatBox", "MatchroomChannelName");
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_MATCHROOM);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_CAMP);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            case ChatChannelGroupType.ChatChannel_Personal:
                itemText.text   = "个人";
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_CLAN);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_KIN);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_PRIVATE);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_TEAMMATE);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_CAMP);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            case ChatChannelGroupType.ChatChannel_Public:
                itemText.text   = "公共";
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_WORLD);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_ZONE);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_NEARBY);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            case ChatChannelGroupType.ChatChannel_Diy:
                itemText.text = "自定义";
                break;

            case ChatChannelGroupType.ChatChannel_WarScene:
                itemText.text   = "战场";
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_CAMP);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_WARSCENE);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_NEARBY);
                m_nChannelMask |= (1 << (int)EMChatChannelType.CHAT_CHANNEL_SYSTEM);
                break;

            default:
                itemText.text  = ULocalizationService.Instance.Get("UIView", "ChatBox", "ChatChannelGroupAll");
                m_nChannelMask = ~0;
                break;
            }
        }
예제 #4
0
 public ChatBoxWarScene(ChatBoxWndView view) : base(view)
 {
 }
예제 #5
0
 public ChatBoxStaticScene(ChatBoxWndView view) : base(view)
 {
     m_ActiveSize = View.m_InitSize;
 }
예제 #6
0
 public ChatBoxWarLoading(ChatBoxWndView view) : base(view)
 {
 }
예제 #7
0
 public ChatBoxMatchRoom(ChatBoxWndView view) : base(view)
 {
     m_ActiveSize = View.m_InitSize;
 }
예제 #8
0
 public ChatBoxBase(ChatBoxWndView view)
 {
     View = view;
 }
예제 #9
0
 public ChatBoxStaticScenePopup(ChatBoxWndView view) : base(view)
 {
 }
예제 #10
0
 public ChatBoxStaticSceneFullScreen(ChatBoxWndView view) : base(view)
 {
 }