59 lines
1.4 KiB
C#
59 lines
1.4 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Games.ChatHistory;
|
|
using GCGame.Table;
|
|
using Games.GlobeDefine;
|
|
using GCGame;
|
|
using Module.Log;
|
|
using Games.Item;
|
|
|
|
public class ChatInfoLogItemInBubble : ChatInfoLogItem
|
|
{
|
|
|
|
public override float GetItemHeight()
|
|
{
|
|
return _ChatInfo.preferredHeight + 5;
|
|
}
|
|
|
|
protected override bool SetDetailLog()
|
|
{
|
|
if (_ChatHistory.ChatInfo.StartsWith(ChatVoiceInputLogic._VoiceChatStart))
|
|
{
|
|
_ChatInfo.text = "";
|
|
return false;
|
|
}
|
|
ClearChat();
|
|
_ModifiedStr = _ChatHistory.ChatInfo;
|
|
GetAllChatLinks(_ChatHistory);
|
|
_ModifiedStr = GetLinkedStr(_ChatHistory);
|
|
|
|
_ChatInfo.text = _ModifiedStr;
|
|
_ChatInfo.CalculateLayoutInputHorizontal();
|
|
_ChatInfo.CalculateLayoutInputVertical();
|
|
|
|
SetBGWidth();
|
|
|
|
StartCoroutine(WaitLayout());
|
|
return true;
|
|
|
|
//return base.SetDetailLog();
|
|
}
|
|
|
|
protected override void SetBGWidth()
|
|
{
|
|
if (_LayoutElement == null)
|
|
return;
|
|
|
|
float bgWidth = _ChatInfoBGMinSize.x;
|
|
if (_ChatInfo.preferredWidth + 40 < bgWidth)
|
|
{
|
|
bgWidth = _ChatInfo.preferredWidth + 20;
|
|
}
|
|
|
|
//_LayoutElement.minHeight = _ChatInfo.preferredHeight;
|
|
_LayoutElement.minWidth = bgWidth;
|
|
}
|
|
} |