Files
test/Assets/Scripts/CECHostPlayer_Inventory.cs
T
2025-11-05 16:08:51 +07:00

53 lines
1.8 KiB
C#

using BrewMonster;
using BrewMonster.Scripts;
using BrewMonster.Scripts.Managers;
using ModelRenderer.Scripts.GameData;
public partial class CECHostPlayer
{
public int[] m_aEquips = new int[InventoryConst.IVTRSIZE_EQUIPPACK];
public bool UpdateEquipSkins()
{
var equipPack = EC_Inventory.GetPack(EC_Inventory.IVTRTYPE_EQUIPPACK);
int[] aNewEquips = new int[InventoryConst.IVTRSIZE_EQUIPPACK];
EC_IvtrItem pItem = null;
for (int i = 0; i < InventoryConst.IVTRSIZE_EQUIPPACK; i++)
{
if (equipPack.TryGetValue(i, out pItem))
{
aNewEquips[i] = pItem.m_tid;
}
}
ShowEquipments(aNewEquips, true, true);
return true;
}
public void ShowEquipments(int[] pEquipmentID, bool bLoadAtOnce, bool bForceLoad)
{
var elemendataman = BrewMonster.ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = default;
for (int i = 0; i < InventoryConst.IVTRSIZE_EQUIPPACK; i++)
{
if (pEquipmentID[i] != m_aEquips[i])
{
// new equipment. Need to load and equip to host player
var equipData = elemendataman.get_data_ptr((uint)pEquipmentID[i], ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
switch (DataType)
{
case DATA_TYPE.DT_WEAPON_ESSENCE:
var equip = (WEAPON_ESSENCE)equipData;
BMLogger.Log($"ShowEquipments():: Weapon Essence: {equip.FileModelRight} -- {equip.FileModelLeft}");
break;
default:
break;
}
}
}
}
}