Add handle storage msg

This commit is contained in:
HungDK
2026-05-21 17:35:15 +07:00
parent c26ab4b1f7
commit f51191f721
8 changed files with 721 additions and 133 deletions
+19 -4
View File
@@ -8,7 +8,7 @@ using CSNetwork.GPDataType;
using CSNetwork.S2CCommand;
using System;
using BrewMonster.UI;
using PerfectWorld.Scripts.Managers;
using BrewMonster.Scripts.Managers;
using UnityEngine;
using static BrewMonster.Scripts.CECHPWork;
using static BrewMonster.Scripts.EC_Inventory;
@@ -88,9 +88,15 @@ namespace BrewMonster
{
UpdateEquipSkins();
}
else if (byPackage == InventoryConst.IVTRTYPE_TRASHBOX && m_bUsingTrashBox)
{
PopupStorageDialog();
}
var ui = GameObject.FindFirstObjectByType<EC_InventoryUI>();
ui?.RefreshAll();
if (byPackage == InventoryConst.IVTRTYPE_TRASHBOX)
EC_StorageUI.RefreshAllStatic();
}
break;
}
@@ -131,6 +137,15 @@ namespace BrewMonster
{
UpdateEquipSkins();
}
else if (byPackage == InventoryConst.IVTRTYPE_TRASHBOX && m_bUsingTrashBox)
{
PopupStorageDialog();
}
var uiDetail = GameObject.FindFirstObjectByType<EC_InventoryUI>();
uiDetail?.RefreshAll();
if (byPackage == InventoryConst.IVTRTYPE_TRASHBOX)
EC_StorageUI.RefreshAllStatic();
}
break;
@@ -1598,9 +1613,9 @@ namespace BrewMonster
case Inventory_type.IVTRTYPE_PACK: pInventory = m_pPack; break;
case Inventory_type.IVTRTYPE_EQUIPPACK: pInventory = m_pEquipPack; break;
case Inventory_type.IVTRTYPE_TASKPACK: pInventory = m_pTaskPack; break;
//case Inventory_type.IVTRTYPE_TRASHBOX: pInventory = m_pTrashBoxPack; break;
//case Inventory_type.IVTRTYPE_TRASHBOX2: pInventory = m_pTrashBoxPack2; break;
//case Inventory_type.IVTRTYPE_TRASHBOX3: pInventory = m_pTrashBoxPack3; break;
case Inventory_type.IVTRTYPE_TRASHBOX: pInventory = m_pTrashBoxPack; break;
case Inventory_type.IVTRTYPE_TRASHBOX2: pInventory = m_pTrashBoxPack2; break;
case Inventory_type.IVTRTYPE_TRASHBOX3: pInventory = m_pTrashBoxPack3; break;
//case Inventory_type.IVTRTYPE_ACCOUNT_BOX: pInventory = m_pAccountBoxPack; break;
//case Inventory_type.IVTRTYPE_GENERALCARD_BOX: pInventory = m_pGeneralCardPack; break;
//case IVTRTYPE_PACK_CLIENT_GENERALCAR.IVTRTYPE_CLIENT_GENERALCARD_PACK: pInventory = m_pClientGenCardPack; break;
+15 -12
View File
@@ -321,6 +321,12 @@ namespace BrewMonster
return m_pEquipPack;
case InventoryConst.IVTRTYPE_TASKPACK:
return m_pTaskPack;
case InventoryConst.IVTRTYPE_TRASHBOX:
return m_pTrashBoxPack;
case InventoryConst.IVTRTYPE_TRASHBOX2:
return m_pTrashBoxPack2;
case InventoryConst.IVTRTYPE_TRASHBOX3:
return m_pTrashBoxPack3;
default:
return null;
}
@@ -329,6 +335,7 @@ namespace BrewMonster
private void Awake()
{
base.Awake();
InitTrashBoxPacks();
m_MoveCtrl = new CECHostMove(this);
// Cache: không bắt buộc, nhưng gọn tay và ít gọi property lặp.
@@ -513,6 +520,9 @@ namespace BrewMonster
case EC_MsgDef.MSG_HST_ITEMOPERATION:
OnMsgHstItemOperation(Msg);
break;
case EC_MsgDef.MSG_HST_TRASHBOXOP:
OnMsgHstTrashBoxOperation(Msg);
break;
case EC_MsgDef.MSG_HST_PICKUPITEM:
OnMsgHstPickupItem(Msg);
break;
@@ -565,7 +575,6 @@ namespace BrewMonster
case EC_MsgDef.MSG_HST_COOLTIMEDATA: OnMsgHstCoolTimeData(Msg); break;
case EC_MsgDef.MSG_HST_PRESSCANCEL: OnMsgHstPressCancel(Msg); break;
case EC_MsgDef.MSG_PM_PLAYERFLY: OnMsgPlayerFly(Msg); break;
case EC_MsgDef.MSG_PM_PLAYERSITDOWN: OnMsgPlayerSitDown(Msg); break;
case EC_MsgDef.MSG_HST_PETOPT: OnMsgHstPetOpt(Msg); break;
case EC_MsgDef.MSG_HST_SETPLAYERLIMIT: OnMsgHstSetPlayerLimit(Msg); break;
case EC_MsgDef.MSG_PM_PLAYERMOUNT: OnMsgPlayerMount(Msg); break;
@@ -1328,7 +1337,6 @@ namespace BrewMonster
m_IncantCnt = new CECCounter();
m_IncantCnt.SetPeriod(1000);
m_IncantCnt.Reset(true);
InitBindCmdCoolCnt();
m_bEnterGame = false;
}
@@ -2386,10 +2394,7 @@ namespace BrewMonster
public bool GetPushDir(ref Vector3 vPushDir, uint dwMask, float deltaTime)
{
vPushDir = Vector3.zero;
if (IsDead())
return false;
if (joystick == null || (joystick.Horizontal == 0 && joystick.Vertical == 0))
if (joystick.Horizontal == 0 && joystick.Vertical == 0)
{
if (isPressMoveUp)
{
@@ -3093,7 +3098,7 @@ namespace BrewMonster
}
// Is host player open trash box ?
bool IsUsingTrashBox()
public bool IsUsingTrashBox()
{
return m_bUsingTrashBox;
}
@@ -3376,8 +3381,7 @@ namespace BrewMonster
if (iPose == (int)RoleExpression.ROLEEXP_SITDOWN)
{
BMLogger.LogError("HoangDev: c2s_CmdSessionEmote: "+iPose);
UnityGameSession.c2s_CmdSessionEmote(iPose);
// UnityGameSession.c2s_CmdSessionEmote(iPose);
}
else if (iPose == (int)RoleExpression.ROLEEXP_KISS)
{
@@ -3658,10 +3662,9 @@ namespace BrewMonster
m_PetOptCnt.IncCounter(iRealTime);
// Bind command cool counter
if (m_BindCmdCoolCnt.IncCounter(iRealTime))
m_BindCmdCoolCnt.Reset(true);
/* if (m_BindCmdCoolCnt.IncCounter(dwDeltaTime))
m_BindCmdCoolCnt.Reset(true);
/*
// Auto fashion time counter
if (m_bAutoFashion && GetBoothState() != 2 && !IsShapeChanged())
{