44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using Games.Item;
|
|
using GCGame;
|
|
using GCGame.Table;
|
|
using Games.ChatHistory;
|
|
|
|
public class ChatLinkTeamJoin : ChatLinkItem
|
|
{
|
|
private static string _InputTeamStr = StrDictionary.GetClientDictionaryString("#{5138}");
|
|
|
|
private int _TeamID;
|
|
|
|
public void SetLinkTeamJoin(int teamID)
|
|
{
|
|
_TeamID = teamID;
|
|
|
|
StrInput = _InputTeamStr;
|
|
StrSend = StrSendStart + ((int)ChatLinkType.SelfPos).ToString() + StrSplit + _TeamID + StrSendEnd;
|
|
}
|
|
|
|
public override void SetLinkBySendStr(Text text, ChatHistoryItem chatHistory, string linkStr, string[] linkParams)
|
|
{
|
|
StrSend = linkStr;
|
|
StrInput = linkStr;
|
|
|
|
if (linkParams.Length != 2)
|
|
return;
|
|
|
|
_TeamID = int.Parse(linkParams[1]);
|
|
|
|
StrShow = _InputTeamStr;
|
|
}
|
|
|
|
protected override void LinkClick(int linkindex)
|
|
{
|
|
if (Singleton<ObjManager>.GetInstance().MainPlayer != null)
|
|
{
|
|
Singleton<ObjManager>.GetInstance().MainPlayer.ReqJoinTeam(_TeamID);
|
|
}
|
|
}
|
|
}
|