Example #1
0
    void Start()
    {
        ChannelChan.ChannelType type = ((ChannelChan)GameManager.Instance.selectedChannel).type;
        string channel = type == ChannelChan.ChannelType.Amateur ? "Nền đất"
            : type == ChannelChan.ChannelType.Professional ? " Chiếu cói"
            : type == ChannelChan.ChannelType.Experts ? "Phản gỗ"
            : type == ChannelChan.ChannelType.Giants ? "Sập gụ" : "Chiếu vương";

        lbName.text = channel + " " + ((LobbyChan)GameManager.Instance.selectedLobby).gameIndex + " - " + ((LobbyChan)GameManager.Instance.selectedLobby).nameLobby;

        if (GameManager.PlayGoldOrChip == "chip")
        {
            lbBetting.text = Utility.Convert.Chip(((LobbyChan)GameManager.Instance.selectedLobby).betting) + " Chip";
        }
        else if (GameManager.PlayGoldOrChip == "gold")
        {
            lbBetting.text = Utility.Convert.Chip(((LobbyChan)GameManager.Instance.selectedLobby).betting) + " Gold";
        }

        lbGameType.text = ((LobbyChan)GameManager.Instance.selectedLobby).config.RULE_FULL_PLAYING == 1 ? "Ù xuông" :
                          ((LobbyChan)GameManager.Instance.selectedLobby).config.RULE_FULL_PLAYING == 2 ? "Ù không xuông" :
                          ((LobbyChan)GameManager.Instance.selectedLobby).config.RULE_FULL_PLAYING == 3 ? "Ù 4-17 điểm" : "";
        lbGa.text   = ((LobbyChan)GameManager.Instance.selectedLobby).config.strGameRule;
        lbTime.text = ((LobbyChan)GameManager.Instance.selectedLobby).timePlay + "s";
        listMessage.ForEach(str =>
        {
            textInfor.Add(str);
            Utility.AutoScrollChat(textInfor);
        });
    }
    void Start()
    {
        ChannelTLMN.ChannelType type = ((ChannelTLMN)GameManager.Instance.selectedChannel).type;
        string channel = type == ChannelTLMN.ChannelType.Amateur ? "Nghiệp dư"
            : type == ChannelTLMN.ChannelType.Professional ? " Chuyên nghiệp"
            : type == ChannelTLMN.ChannelType.Experts ? "Cao Thủ"
            : type == ChannelTLMN.ChannelType.Giants ? "Đại Gia" : "Giải Đấu";

        lbName.text = channel + " " + ((LobbyTLMN)GameManager.Instance.selectedLobby).gameIndex + " - " + ((LobbyTLMN)GameManager.Instance.selectedLobby).nameLobby;

        if (GameManager.PlayGoldOrChip == "chip")
        {
            lbBetting.text = Utility.Convert.Chip(((LobbyTLMN)GameManager.Instance.selectedLobby).betting) + " Chip";
        }
        else if (GameManager.PlayGoldOrChip == "gold")
        {
            lbBetting.text = Utility.Convert.Chip(((LobbyTLMN)GameManager.Instance.selectedLobby).betting) + " Gold";
        }

        lbName.text       = ((LobbyTLMN)GameManager.Instance.selectedLobby).gameIndex + " - " + ((LobbyTLMN)GameManager.Instance.selectedLobby).nameLobby;
        lbMasterRoom.text = ((LobbyTLMN)GameManager.Instance.selectedLobby).roomMasterUsername;
        lbGameType.text   = ((LobbyTLMN)GameManager.Instance.selectedLobby).config.GAME_TYPE_TLMN == LobbyTLMN.GameConfig.GameTypeLTMN.DEM_LA ? "Đếm lá" : "Xếp hạng";
        lbGameRule.text   = ((LobbyTLMN)GameManager.Instance.selectedLobby).config.CHAT_CHUONG_RULE ? ((LobbyTLMN)GameManager.Instance.selectedLobby).config.strGameRule : "";

        listMessage.ForEach(str =>
        {
            textInfor.Add(str);
            Utility.AutoScrollChat(textInfor);
        });
    }
Example #3
0
    void Start()
    {
        lbMaster.text   = ((LobbyPhom)GameManager.Instance.selectedLobby).roomMasterUsername;
        lbRule.text     = ((LobbyPhom)GameManager.Instance.selectedLobby).config.isAdvanceGame ? "Nâng cao" : "Cơ bản";
        lblSubRule.text = ((LobbyPhom)GameManager.Instance.selectedLobby).config.strGameRule;
        ChannelPhom.ChannelType type = ((ChannelPhom)GameManager.Instance.selectedChannel).type;
        string channel = type == ChannelPhom.ChannelType.Amateur ? "Nghiệp dư"
            : type == ChannelPhom.ChannelType.Professional ? " Chuyên nghiệp"
            : type == ChannelPhom.ChannelType.Experts ? "Phản gỗ"
            : type == ChannelPhom.ChannelType.Giants ? "Sập gụ" : "Chiếu vương";

        lbName.text = channel + " " + ((LobbyPhom)GameManager.Instance.selectedLobby).gameIndex + " - " + ((LobbyPhom)GameManager.Instance.selectedLobby).nameLobby;

        if (GameManager.PlayGoldOrChip == "chip")
        {
            lbBetting.text = Utility.Convert.Chip(((LobbyPhom)GameManager.Instance.selectedLobby).betting) + " Chip";
        }
        else if (GameManager.PlayGoldOrChip == "gold")
        {
            lbBetting.text = Utility.Convert.Chip(((LobbyPhom)GameManager.Instance.selectedLobby).betting) + " Gold";
        }


        listMessage.ForEach(str =>
        {
            textInfor.Add(str);
            Utility.AutoScrollChat(textInfor);
        });
    }
Example #4
0
 void Start()
 {
     listMessage.ForEach(str => {
         listChat.Add(str);
         Utility.AutoScrollChat(listChat);
     });
     FocusTextChat();
 }
Example #5
0
    /// <summary>
    /// Submit notification is sent by UIInput when 'enter' is pressed or iOS/Android keyboard finalizes input.
    /// </summary>
    ///
    void Submit()
    {
        if (textList != null)
        {
            // It's a good idea to strip out all symbols as we don't want user input to alter colors, add new lines, etc
            string text = NGUIText.StripSymbols(mInput.value);

            if (!string.IsNullOrEmpty(text))
            {
                SendChatToServer(text);

                if (GameManager.CurrentScene == ESceneName.GameplayChan)
                {
                    text = string.Format("{0}" + GameManager.Instance.mInfo.username.ToUpper() + ":[-] " + text + "\n", GameModelChan.ListWaitingPlayer.Find(plc => plc.username == GameManager.Instance.mInfo.username) != null ? "[FFCC00]" : "[FF6600]");
                }
                else
                {
                    text = string.Format("[FF6600]" + GameManager.Instance.mInfo.username.ToUpper() + ":[-] " + text + "\n");
                }

                textList.Add(text);
                Utility.AutoScrollChat(textList);

                mInput.value      = "";
                mInput.isSelected = false;
            }
        }
        mIgnoreNextEnter = true;
    }
    /// <summary>
    /// Khi có người chát đến (mình chát gửi đi được viết trong ChatInput
    /// </summary>
    void OnPublicMessage(PublicMessageEvent e)
    {
        if (e.UserName == GameManager.Instance.mInfo.username)
        {
            return;
        }

        textChat.Add("[FF6600]" + e.UserName.ToUpper() + ":[-] " + e.Message + "\n");
        Utility.AutoScrollChat(textChat);
    }