add chat world

This commit is contained in:
CuongNV
2026-04-06 15:23:59 +07:00
parent 22ad4ebaca
commit 2f083c870d
6 changed files with 291 additions and 6 deletions
+22 -2
View File
@@ -3,9 +3,12 @@ using UnityEngine;
using TMPro;
using CSNetwork.GPDataType;
using System.Collections.Generic;
using BrewMonster;
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.UI;
using CSNetwork;
using PerfectWorld.Scripts.Managers;
namespace BrewMonster.Scripts.ChatUI
{
@@ -233,6 +236,11 @@ namespace BrewMonster.Scripts.ChatUI
ChatChannel resolvedChannel = ParseAndSendMessage(strText, nPack, nSlot);
if (resolvedChannel == ChatChannel.GP_CHAT_FARCRY && strText.StartsWith("!@"))
m_dwTickFarCry = now;
if (resolvedChannel == ChatChannel.GP_CHAT_SUPERFARCRY && strText.StartsWith("!#"))
m_dwTickFarCry2 = now;
SaveHistory(resolvedChannel, strText, nPack, nSlot, now);
ClearTextInInputField();
@@ -601,7 +609,19 @@ namespace BrewMonster.Scripts.ChatUI
inputField.ActivateInputField();
}
private int GetPlayerItemCount(int id) => 0;
private int GetPlayerLevel() => 10;
/// <summary>
/// C++: GetHostPlayer()->GetPack()->GetItemTotalNum(id) — đếm túi chính.
/// </summary>
private int GetPlayerItemCount(int templateId)
{
var host = EC_Game.GetGameRun()?.GetHostPlayer();
EC_Inventory pack = host?.GetPack();
return pack?.GetItemTotalNum(templateId) ?? 0;
}
private int GetPlayerLevel()
{
return EC_Game.GetGameRun()?.GetHostPlayer()?.GetBasicProps().iLevel ?? 0;
}
}
}