Files
JJBB/Assets/Project/Script/GUI/Community/CommunityBlogCommentItem.cs
2024-08-23 15:49:34 +08:00

78 lines
2.2 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using Games.Item;
using GCGame.Table;
using Games.ChatHistory;
using GCGame;
using Games.GlobeDefine;
using System.Collections.Generic;
public class CommunityBlogCommentItem : UIItemBase
{
public ChatContex _MsgInfo;
public GameObject _BtnDel;
#region comment
private BlogComment _BlogComment;
private CommunityBlogInfo _BlogInfo;
private CommunityBlogItem _BlogItem;
public override void Show(Hashtable hash)
{
base.Show(hash);
var blogComment = (BlogComment)hash["InitObj"];
_BlogInfo = (CommunityBlogInfo)hash["BlogInfo"];
_BlogItem = (CommunityBlogItem)hash["BlogItem"];
_BlogComment = blogComment;
bool isShowDelete = false;
var guid = GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid;
if (_BlogComment.Roleguid == guid || _BlogInfo.RoleGuid == guid) /*(hash.Contains("ShowDelete"))*/
{
isShowDelete = true;
}
string commentRoleLink = StrDictionary.GetClientDictionaryString("#{39003}", blogComment.Rolename, blogComment.Roleguid);
string showLinkStr = commentRoleLink;
if (!string.IsNullOrEmpty(blogComment.Desname))
{
string retRoleLink = StrDictionary.GetClientDictionaryString("#{39003}", blogComment.Desname, blogComment.Desguid);
showLinkStr += StrDictionary.GetClientDictionaryString("#{39006}", retRoleLink);
}
showLinkStr += ":" + blogComment.Comment;
_MsgInfo.ShowLinkStr(showLinkStr);
if (!isShowDelete)
{
if (_BlogComment.Roleguid == GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid)
{
_BtnDel.SetActive(true);
}
else
{
_BtnDel.SetActive(false);
}
}
else
{
_BtnDel.SetActive(true);
}
}
public void OnBtnDel()
{
MessageBoxLogic.OpenOKCancelBox(39024, -1, OnDeleteOk);
}
private void OnDeleteOk()
{
Community.Instance.ReqDeleteComment(_BlogItem, _BlogComment.Index);
}
#endregion
}