Beispiel #1
0
    public void Refresh_List(CHeroSelectChatView.Tab type)
    {
        if (type == CHeroSelectChatView.Tab.Template)
        {
            this._refresh_list(this.show_listScript, Singleton <CChatController> .instance.model.GetCurGroupTemplateInfo());
        }
        else if (type == CHeroSelectChatView.Tab.All)
        {
            CChatChannel channel = Singleton <CChatController> .instance.model.channelMgr.GetChannel(EChatChannel.Select_Hero);

            this._refresh_list(this.show_listScript, channel.list);
        }
    }
Beispiel #2
0
    private string _get_current_info(CHeroSelectChatView.Tab type, int index)
    {
        string result = string.Empty;

        if (type == CHeroSelectChatView.Tab.Template)
        {
            result = Singleton <CChatController> .instance.model.Get_HeroSelect_ChatTemplate(index).GetTemplateString();
        }
        else if (type == CHeroSelectChatView.Tab.All)
        {
            ListView <CChatEntity> list = Singleton <CChatController> .GetInstance().model.channelMgr.GetChannel(EChatChannel.Select_Hero).list;

            if (index >= 0 && index < list.Count)
            {
                result = string.Format("{0}:{1}", list[index].name, list[index].text);
            }
        }
        return(result);
    }
Beispiel #3
0
 public void On_Tab_Change(int index)
 {
     this.CurTab = (CHeroSelectChatView.Tab)index;
 }
Beispiel #4
0
    public void OpenForm()
    {
        this.chat_cd_timer = Singleton <CTimerManager> .instance.AddTimer(3000, -1, new CTimer.OnTimeUpHandler(this.On_Input_Timer_End));

        Singleton <CTimerManager> .instance.PauseTimer(this.chat_cd_timer);

        string formPath = string.Empty;

        if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enNormal)
        {
            formPath = CChatController.ChatSelectHeroPath_Normal;
        }
        else
        {
            if (Singleton <CHeroSelectBaseSystem> .instance.uiType != enUIType.enBanPick)
            {
                return;
            }
            formPath = CChatController.ChatSelectHeroPath_BanPick;
        }
        this.formScript = Singleton <CUIManager> .GetInstance().OpenForm(formPath, false, true);

        this.backgroundObject = this.formScript.transform.Find("Background").gameObject;
        this.show_listScript  = this.formScript.transform.Find("chatTools/node/ListView/chatList").gameObject.GetComponent <CUIListScript>();
        GameObject gameObject = this.formScript.transform.Find("chatTools/node/Tab/List").gameObject;

        this.tablistScript = gameObject.GetComponent <CUIListScript>();
        this.tablistScript.SetElementAmount(2);
        CUIListElementScript elemenet = this.tablistScript.GetElemenet(0);

        this.ShowTemplate(elemenet, true);
        elemenet = this.tablistScript.GetElemenet(1);
        this.ShowTemplate(elemenet, false);
        this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true;
        this.tablistScript.SelectElement(0, true);
        this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false;
        this.formScript.transform.Find("bubble_node").gameObject.CustomSetActive(true);
        this.bubbleObj0  = this.formScript.transform.Find("bubble_node/bubble0").gameObject;
        this.bubbleText0 = this.bubbleObj0.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj1  = this.formScript.transform.Find("bubble_node/bubble1").gameObject;
        this.bubbleText1 = this.bubbleObj1.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj2  = this.formScript.transform.Find("bubble_node/bubble2").gameObject;
        this.bubbleText2 = this.bubbleObj2.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj3  = this.formScript.transform.Find("bubble_node/bubble3").gameObject;
        this.bubbleText3 = this.bubbleObj3.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj4  = this.formScript.transform.Find("bubble_node/bubble4").gameObject;
        this.bubbleText4 = this.bubbleObj4.transform.Find("text_bubble0").GetComponent <Text>();
        this.bubbleObj0.CustomSetActive(false);
        this.bubbleObj1.CustomSetActive(false);
        this.bubbleObj2.CustomSetActive(false);
        this.bubbleObj3.CustomSetActive(false);
        this.bubbleObj4.CustomSetActive(false);
        this.bottomVoiceBtn      = this.formScript.transform.Find("chatTools/ChatVoiceBtn").gameObject;
        this.inputField          = this.formScript.transform.Find("chatTools/InputField").GetComponent <InputField>();
        this.bottomSendVoiceBtn  = this.formScript.transform.Find("chatTools/voice_Btn").gameObject;
        this.textSendBtn         = this.formScript.transform.Find("chatTools/TextSendBtn").gameObject;
        this.voiceBtnNode        = this.formScript.transform.Find("VoiceBtn").gameObject;
        this.chatEntryNode       = this.formScript.transform.Find("entry_node").gameObject;
        this.chatDetailNode      = this.formScript.transform.Find("chatTools").gameObject;
        this.m_OpenSpeakeObj     = this.formScript.transform.Find("VoiceBtn/Voice_OpenSpeaker");
        this.m_OpenMicObj        = this.formScript.transform.Find("VoiceBtn/Voice_OpenMic");
        this.m_OpenSpeakerTipObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenSpeaker/info");
        if (this.m_OpenSpeakerTipObj && this.m_OpenSpeakerTipObj.transform.Find("Text"))
        {
            this.m_OpenSpeakerTipText = this.m_OpenSpeakerTipObj.transform.Find("Text").GetComponent <Text>();
        }
        this.m_OpenMicTipObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenMic/info");
        if (this.m_OpenMicTipObj && this.m_OpenMicTipObj.transform.Find("Text"))
        {
            this.m_OpenMicTipText = this.m_OpenMicTipObj.transform.Find("Text").GetComponent <Text>();
        }
        this.m_Vocetimer = Singleton <CTimerManager> .instance.AddTimer(2000, -1, new CTimer.OnTimeUpHandler(this.OnVoiceTimeEnd));

        Singleton <CTimerManager> .instance.PauseTimer(this.m_Vocetimer);

        Singleton <CTimerManager> .instance.ResetTimer(this.m_Vocetimer);

        this.m_VoiceMictime = Singleton <CTimerManager> .instance.AddTimer(2000, -1, new CTimer.OnTimeUpHandler(this.OnVoiceMicTimeEnd));

        Singleton <CTimerManager> .instance.PauseTimer(this.m_VoiceMictime);

        Singleton <CTimerManager> .instance.ResetTimer(this.m_VoiceMictime);

        MonoSingleton <VoiceSys> .GetInstance().UseMicOnUser = false;

        if (MonoSingleton <VoiceSys> .GetInstance().IsUseVoiceSysSetting)
        {
            this.OnChatHeroSelectOpenSpeaker(true);
        }
        this.Show_SelectChat_MidNode(false);
        this._tab        = CHeroSelectChatView.Tab.None;
        this.CurTab      = CHeroSelectChatView.Tab.Template;
        this.curChatType = CHeroSelectChatView.enChatType.Text;
        this.OnUpdateBottomButtons();
        this.Refresh_BottomChat();
        MonoSingleton <VoiceSys> .GetInstance().ShowVoiceBtn_HeroSelect(this.formScript);
    }