Merge branch 'develop' into feature/gfx-action
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
using BrewMonster.Managers;
|
||||
using BrewMonster.Network;
|
||||
using BrewMonster.Scripts;
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using CSNetwork;
|
||||
using CSNetwork.GPDataType;
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using BrewMonster.UI;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using static BrewMonster.Scripts.EC_Inventory;
|
||||
|
||||
namespace BrewMonster
|
||||
{
|
||||
/// <summary>
|
||||
/// Host player warehouse / trash box (C++ CECHostPlayer::OnMsgHstTrashBoxOperation, GetTrashBox*).
|
||||
/// </summary>
|
||||
public partial class CECHostPlayer
|
||||
{
|
||||
private readonly EC_Inventory m_pTrashBoxPack = new EC_Inventory();
|
||||
private readonly EC_Inventory m_pTrashBoxPack2 = new EC_Inventory();
|
||||
private readonly EC_Inventory m_pTrashBoxPack3 = new EC_Inventory();
|
||||
|
||||
private bool m_bTrashPsw;
|
||||
private bool m_bFirstTBOpen = true;
|
||||
private int m_iTrashBoxMoneyCnt;
|
||||
|
||||
public bool TrashBoxHasPsw() => m_bTrashPsw;
|
||||
public int GetTrashBoxMoneyCnt() => m_iTrashBoxMoneyCnt;
|
||||
public EC_Inventory GetTrashBox() => m_pTrashBoxPack;
|
||||
public EC_Inventory GetTrashBox2() => m_pTrashBoxPack2;
|
||||
public EC_Inventory GetTrashBox3() => m_pTrashBoxPack3;
|
||||
|
||||
void InitTrashBoxPacks()
|
||||
{
|
||||
if (m_pTrashBoxPack.GetSize() == 0)
|
||||
m_pTrashBoxPack.Init(InventoryConst.IVTRSIZE_TRASHBOX);
|
||||
if (m_pTrashBoxPack2.GetSize() == 0)
|
||||
m_pTrashBoxPack2.Init(0);
|
||||
if (m_pTrashBoxPack3.GetSize() == 0)
|
||||
m_pTrashBoxPack3.Init(0);
|
||||
}
|
||||
|
||||
public void OnMsgHstTrashBoxOperation(ECMSG Msg)
|
||||
{
|
||||
var data = Msg.dwParam1 as byte[];
|
||||
if (data == null || data.Length == 0)
|
||||
return;
|
||||
|
||||
int cmd = Convert.ToInt32(Msg.dwParam2);
|
||||
switch (cmd)
|
||||
{
|
||||
case CommandID.TRASHBOX_OPEN:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_trashbox_open>(data);
|
||||
if (pCmd.is_accountbox != 0)
|
||||
break; // PW_TODO: account box UI
|
||||
|
||||
m_bUsingTrashBox = true;
|
||||
InitTrashBoxPacks();
|
||||
|
||||
if (m_bFirstTBOpen)
|
||||
{
|
||||
m_bFirstTBOpen = false;
|
||||
UnityGameSession.c2s_CmdGetTrashBoxData(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_pTrashBoxPack.GetSize() < pCmd.slot_size)
|
||||
m_pTrashBoxPack.Resize(pCmd.slot_size);
|
||||
if (m_pTrashBoxPack2.GetSize() < pCmd.slot_size2)
|
||||
m_pTrashBoxPack2.Resize(pCmd.slot_size2);
|
||||
if (m_pTrashBoxPack3.GetSize() < pCmd.slot_size3)
|
||||
m_pTrashBoxPack3.Resize(pCmd.slot_size3);
|
||||
PopupStorageDialog();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CommandID.TRASHBOX_CLOSE:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_trashbox_close>(data);
|
||||
if (pCmd.is_accountbox != 0)
|
||||
break;
|
||||
m_bUsingTrashBox = false;
|
||||
PopupStorageDialog(true);
|
||||
break;
|
||||
}
|
||||
case CommandID.TRASHBOX_WEALTH:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_trashbox_wealth>(data);
|
||||
if (pCmd.is_accountbox == 0)
|
||||
m_iTrashBoxMoneyCnt = (int)pCmd.money;
|
||||
EC_StorageUI.RefreshMoneyStatic();
|
||||
break;
|
||||
}
|
||||
case CommandID.EXG_TRASH_MONEY:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_exg_trash_money>(data);
|
||||
if (pCmd.is_accountbox == 0)
|
||||
{
|
||||
AddMoneyAmount(pCmd.inv_delta);
|
||||
m_iTrashBoxMoneyCnt += pCmd.tra_delta;
|
||||
}
|
||||
EC_StorageUI.RefreshMoneyStatic();
|
||||
var invUi = UnityEngine.Object.FindFirstObjectByType<EC_InventoryUI>();
|
||||
invUi?.RefreshAll();
|
||||
break;
|
||||
}
|
||||
case CommandID.EXG_TRASHBOX_ITEM:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_exg_trashbox_item>(data);
|
||||
var pTrash = GetPack(pCmd.where);
|
||||
pTrash?.ExchangeItem(pCmd.idx1, pCmd.idx2);
|
||||
EC_StorageUI.RefreshAllStatic();
|
||||
break;
|
||||
}
|
||||
case CommandID.MOVE_TRASHBOX_ITEM:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_move_trashbox_item>(data);
|
||||
var pTrash = GetPack(pCmd.where);
|
||||
pTrash?.MoveItem(pCmd.src, pCmd.dest, (int)pCmd.amount);
|
||||
EC_StorageUI.RefreshAllStatic();
|
||||
break;
|
||||
}
|
||||
case CommandID.EXG_TRASHBOX_IVTR:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_exg_trashbox_ivtr>(data);
|
||||
var pTrash = GetPack(pCmd.where);
|
||||
if (pTrash == null || m_pPack == null)
|
||||
break;
|
||||
var pItem1 = m_pPack.GetItem(pCmd.idx_inv, true);
|
||||
var pItem2 = pTrash.GetItem(pCmd.idx_tra, true);
|
||||
m_pPack.SetItem(pCmd.idx_inv, pItem2);
|
||||
pTrash.SetItem(pCmd.idx_tra, pItem1);
|
||||
RefreshStorageAndInventoryUi();
|
||||
break;
|
||||
}
|
||||
case CommandID.IVTR_ITEM_TO_TRASH:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_ivty_item_to_trash>(data);
|
||||
var pTrash = GetPack(pCmd.where);
|
||||
if (pTrash == null || m_pPack == null)
|
||||
break;
|
||||
var pItem1 = m_pPack.GetItem(pCmd.src);
|
||||
var pItem2 = pTrash.GetItem(pCmd.dest);
|
||||
if (pItem1 == null)
|
||||
break;
|
||||
if (pItem2 != null)
|
||||
{
|
||||
pItem2.AddAmount((int)pCmd.amount);
|
||||
}
|
||||
else
|
||||
{
|
||||
pItem2 = EC_IvtrItem.CreateItem(pItem1.m_tid, pItem1.m_expire_date, (int)pCmd.amount);
|
||||
pTrash.SetItem(pCmd.dest, pItem2);
|
||||
}
|
||||
m_pPack.RemoveItem(pCmd.src, (int)pCmd.amount);
|
||||
RefreshStorageAndInventoryUi();
|
||||
break;
|
||||
}
|
||||
case CommandID.TRASH_ITEM_TO_IVTR:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_trash_item_to_ivtr>(data);
|
||||
var pTrash = GetPack(pCmd.where);
|
||||
if (pTrash == null || m_pPack == null)
|
||||
break;
|
||||
var pItem1 = pTrash.GetItem(pCmd.src);
|
||||
var pItem2 = m_pPack.GetItem(pCmd.dest);
|
||||
if (pItem1 == null)
|
||||
break;
|
||||
if (pItem2 != null)
|
||||
pItem2.AddAmount((int)pCmd.amount);
|
||||
else
|
||||
{
|
||||
pItem2 = EC_IvtrItem.CreateItem(pItem1.m_tid, pItem1.m_expire_date, (int)pCmd.amount);
|
||||
m_pPack.SetItem(pCmd.dest, pItem2);
|
||||
}
|
||||
pTrash.RemoveItem(pCmd.src, (int)pCmd.amount);
|
||||
RefreshStorageAndInventoryUi();
|
||||
break;
|
||||
}
|
||||
case CommandID.TRASHBOX_PWD_CHANGED:
|
||||
case CommandID.TRASHBOX_PWD_STATE:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_trashbox_pwd_state>(data);
|
||||
m_bTrashPsw = pCmd.has_passwd > 0;
|
||||
break;
|
||||
}
|
||||
case CommandID.TRASHBOX_SIZE:
|
||||
{
|
||||
var pCmd = GPDataTypeHelper.FromBytes<cmd_trashbox_size>(data);
|
||||
int msg = (int)FixedMsg.FIXMSG_TRASHBOX_EXPAND;
|
||||
int iSize = pCmd.iNewSize;
|
||||
if (pCmd.where == Inventory_type.IVTRTYPE_TRASHBOX2)
|
||||
msg = (int)FixedMsg.FIXMSG_TRASHBOX2_EXPAND;
|
||||
else if (pCmd.where == Inventory_type.IVTRTYPE_TRASHBOX3)
|
||||
{
|
||||
msg = (int)FixedMsg.FIXMSG_TRASHBOX3_EXPAND;
|
||||
m_pTrashBoxPack3?.Resize(pCmd.iNewSize);
|
||||
}
|
||||
else if (pCmd.where == Inventory_type.IVTRTYPE_TRASHBOX)
|
||||
m_pTrashBoxPack?.Resize(pCmd.iNewSize);
|
||||
EC_Game.GetGameRun()?.AddFixedMessage(msg, iSize);
|
||||
EC_StorageUI.RefreshAllStatic();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void RefreshStorageAndInventoryUi()
|
||||
{
|
||||
EC_StorageUI.RefreshAllStatic();
|
||||
UnityEngine.Object.FindFirstObjectByType<EC_InventoryUI>()?.RefreshAll();
|
||||
}
|
||||
|
||||
/// <summary>C++ CECGameUIMan::PopupStorageDialog — show warehouse + inventory.</summary>
|
||||
public static void PopupStorageDialog(bool close = false)
|
||||
{
|
||||
if (close)
|
||||
{
|
||||
var host = EC_Game.GetGameRun()?.GetHostPlayer();
|
||||
bool wasUsingTrash = host != null && host.IsUsingTrashBox();
|
||||
if (host != null)
|
||||
host.m_bUsingTrashBox = false;
|
||||
|
||||
EC_StorageUI.ClearSelectionStatic();
|
||||
var invUi = UnityEngine.Object.FindFirstObjectByType<EC_InventoryUI>(FindObjectsInactive.Include);
|
||||
invUi?.DismissItemDetail();
|
||||
|
||||
CECUIManager.Instance?.HideStorageDialogPair();
|
||||
|
||||
if (wasUsingTrash)
|
||||
UnityGameSession.c2s_CmdCancelAction();
|
||||
EC_Game.GetGameRun()?.GetUIManager()?.GetInGameUIMan()?.EndNPCService();
|
||||
return;
|
||||
}
|
||||
|
||||
CECUIManager.Instance?.ShowStorageDialogPair();
|
||||
var storageDlg = EC_Game.GetGameRun()?.GetUIManager()?.GetInGameUIMan()?.GetDialog("EC_StorageUI") as EC_StorageUI;
|
||||
storageDlg?.RefreshAll();
|
||||
|
||||
var invDlg = UnityEngine.Object.FindFirstObjectByType<EC_InventoryUI>(FindObjectsInactive.Include);
|
||||
invDlg?.RefreshAll();
|
||||
}
|
||||
|
||||
/// <summary>Transfer between main pack and trash box (C++ CDlgStorage::OnItemDragDrop).</summary>
|
||||
public bool TransferPackAndTrash(byte trashWhere, int trashSlot, int invSlot, int amount = -1)
|
||||
{
|
||||
if (trashWhere != InventoryConst.IVTRTYPE_TRASHBOX)
|
||||
return false;
|
||||
|
||||
var trash = GetPack(trashWhere);
|
||||
var pack = m_pPack;
|
||||
if (trash == null || pack == null)
|
||||
return false;
|
||||
if (trashSlot < 0 || invSlot < 0)
|
||||
return false;
|
||||
|
||||
var srcInv = pack.GetItem(invSlot);
|
||||
var dstTrash = trash.GetItem(trashSlot);
|
||||
if (srcInv != null && dstTrash == null)
|
||||
{
|
||||
UnityGameSession.c2s_CmdExgTrashBoxIvtrItem(trashWhere, (byte)trashSlot, (byte)invSlot);
|
||||
return true;
|
||||
}
|
||||
|
||||
var srcTrash = trash.GetItem(trashSlot);
|
||||
var dstInv = pack.GetItem(invSlot);
|
||||
if (srcTrash != null && dstInv == null)
|
||||
{
|
||||
UnityGameSession.c2s_CmdExgTrashBoxIvtrItem(trashWhere, (byte)trashSlot, (byte)invSlot);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (srcInv != null && dstTrash != null &&
|
||||
srcInv.m_tid == dstTrash.m_tid && srcInv.GetPileLimitInstance() > 1)
|
||||
{
|
||||
int moveAmt = amount > 0 ? amount : Math.Min(srcInv.m_iCount,
|
||||
dstTrash.GetPileLimitInstance() - dstTrash.m_iCount);
|
||||
if (moveAmt > 0)
|
||||
{
|
||||
UnityGameSession.c2s_CmdMoveIvtrToTrashBox(trashWhere, (byte)invSlot, (byte)trashSlot, (uint)moveAmt);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (srcTrash != null && dstInv != null &&
|
||||
srcTrash.m_tid == dstInv.m_tid && srcTrash.GetPileLimitInstance() > 1)
|
||||
{
|
||||
int moveAmt = amount > 0 ? amount : Math.Min(srcTrash.m_iCount,
|
||||
dstInv.GetPileLimitInstance() - dstInv.m_iCount);
|
||||
if (moveAmt > 0)
|
||||
{
|
||||
UnityGameSession.c2s_CmdMoveTrashBoxToIvtr(trashWhere, (byte)trashSlot, (byte)invSlot, (uint)moveAmt);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (srcInv != null || srcTrash != null)
|
||||
{
|
||||
UnityGameSession.c2s_CmdExgTrashBoxIvtrItem(trashWhere, (byte)trashSlot, (byte)invSlot);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TransferWithinTrash(byte where, int slotA, int slotB)
|
||||
{
|
||||
var trash = GetPack(where);
|
||||
if (trash == null || slotA < 0 || slotB < 0 || slotA == slotB)
|
||||
return false;
|
||||
var a = trash.GetItem(slotA);
|
||||
var b = trash.GetItem(slotB);
|
||||
if (a != null && b != null && a.m_tid == b.m_tid && a.GetPileLimitInstance() > 1)
|
||||
{
|
||||
int moveAmt = Math.Min(a.m_iCount, b.GetPileLimitInstance() - b.m_iCount);
|
||||
if (moveAmt > 0)
|
||||
{
|
||||
UnityGameSession.c2s_CmdMoveTrashBoxItem(where, (byte)slotA, (byte)slotB, (uint)moveAmt);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
UnityGameSession.c2s_CmdExgTrashBoxItem(where, (byte)slotA, (byte)slotB);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f43b17fb174c9ce4bbcdf1eb7637aa91
|
||||
@@ -139,7 +139,13 @@ namespace BrewMonster
|
||||
// }
|
||||
// }
|
||||
|
||||
if (m_bUsingTrashBox || DoingSessionPose())
|
||||
if (m_bUsingTrashBox)
|
||||
{
|
||||
CECHostPlayer.PopupStorageDialog(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (DoingSessionPose())
|
||||
{
|
||||
UnityGameSession.c2s_CmdCancelAction();
|
||||
return;
|
||||
|
||||
@@ -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.
|
||||
@@ -511,6 +518,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;
|
||||
@@ -3088,7 +3098,7 @@ namespace BrewMonster
|
||||
}
|
||||
|
||||
// Is host player open trash box ?
|
||||
bool IsUsingTrashBox()
|
||||
public bool IsUsingTrashBox()
|
||||
{
|
||||
return m_bUsingTrashBox;
|
||||
}
|
||||
@@ -3652,7 +3662,7 @@ namespace BrewMonster
|
||||
|
||||
m_PetOptCnt.IncCounter(iRealTime);
|
||||
// Bind command cool counter
|
||||
if (m_BindCmdCoolCnt.IncCounter(iRealTime))
|
||||
if (m_BindCmdCoolCnt.IncCounter(iRealTime))
|
||||
m_BindCmdCoolCnt.Reset(true);
|
||||
|
||||
/*
|
||||
|
||||
@@ -38,6 +38,8 @@ public class CECUIManager : MonoSingleton<CECUIManager>
|
||||
[SerializeField] private DialogScriptTableObject dialogResouce;
|
||||
[SerializeField] private Canvas canvasDlg;
|
||||
|
||||
public Transform DialogCanvasTransform => canvasDlg != null ? canvasDlg.transform : null;
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("Chat TMP: EmotionLibrarySpriteMap (SO). CECGameUIMan is not a MonoBehaviour — assign here on CECUIManager.")]
|
||||
private EmotionLibrarySpriteMap _emotionLibrarySpriteMap;
|
||||
@@ -248,6 +250,34 @@ public class CECUIManager : MonoSingleton<CECUIManager>
|
||||
return Push(componentName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show a modal on top without hiding stack dialogs (e.g. DlgQuantity over storage + inventory).
|
||||
/// </summary>
|
||||
public AUIDialog ShowDialogOverlay(string componentName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(componentName) || canvasDlg == null)
|
||||
return null;
|
||||
|
||||
var dlg = GetInGameUIMan()?.GetDialog(componentName);
|
||||
if (dlg == null)
|
||||
return null;
|
||||
|
||||
dlg.Show(true);
|
||||
dlg.transform.SetAsLastSibling();
|
||||
EC_UIUtility.BringPanelToFront(dlg.gameObject);
|
||||
return dlg;
|
||||
}
|
||||
|
||||
public void HideDialogOverlay(string componentName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(componentName))
|
||||
return;
|
||||
|
||||
var dlg = GetInGameUIMan()?.GetDialog(componentName);
|
||||
if (dlg != null)
|
||||
dlg.Show(false);
|
||||
}
|
||||
|
||||
public void HideCurrentUIInStack()
|
||||
{
|
||||
Pop();
|
||||
@@ -280,6 +310,57 @@ public class CECUIManager : MonoSingleton<CECUIManager>
|
||||
return dlg;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show warehouse + inventory together without hiding the first dialog (C++ PopupStorageDialog).
|
||||
/// </summary>
|
||||
public void ShowStorageDialogPair()
|
||||
{
|
||||
if (canvasDlg == null)
|
||||
return;
|
||||
|
||||
var gui = GetInGameUIMan();
|
||||
if (gui == null)
|
||||
return;
|
||||
|
||||
var storageDlg = gui.GetDialog("EC_StorageUI");
|
||||
var invDlg = gui.GetDialog("Win_Inventory");
|
||||
if (storageDlg == null || invDlg == null)
|
||||
return;
|
||||
_uiStack.Remove("Win_Inventory");
|
||||
_uiStack.Remove("EC_StorageUI");
|
||||
|
||||
invDlg.Show(true);
|
||||
storageDlg.Show(true);
|
||||
|
||||
_uiStack.Insert(0, "Win_Inventory");
|
||||
_uiStack.Insert(0, "EC_StorageUI");
|
||||
|
||||
// Inventory below, storage on top (detail panel uses EC_UIUtility overlay sort).
|
||||
invDlg.transform.SetAsLastSibling();
|
||||
storageDlg.transform.SetAsLastSibling();
|
||||
}
|
||||
|
||||
/// <summary>Hide warehouse pair and restore previous stack top if any.</summary>
|
||||
public void HideStorageDialogPair()
|
||||
{
|
||||
_uiStack.Remove("EC_StorageUI");
|
||||
_uiStack.Remove("Win_Inventory");
|
||||
|
||||
var gui = GetInGameUIMan();
|
||||
gui?.GetDialog("Win_Inventory")?.Show(false);
|
||||
gui?.GetDialog("EC_StorageUI")?.Show(false);
|
||||
|
||||
if (_uiStack.Count > 0)
|
||||
{
|
||||
var newTop = gui?.GetDialog(_uiStack[0]);
|
||||
if (newTop != null)
|
||||
{
|
||||
newTop.Show(true);
|
||||
newTop.transform.SetAsLastSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pop the top dialog off the stack: hide it and bring the new top (if any) to front. Returns true if something was popped.
|
||||
/// </summary>
|
||||
@@ -795,7 +876,7 @@ public class CECUIManager : MonoSingleton<CECUIManager>
|
||||
}
|
||||
public void GetIconStateMgr()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Shows the player options menu for the given character. Requires a prefab with id "DlgPlayerOptions" in DialogScriptTableObject.</summary>
|
||||
|
||||
Reference in New Issue
Block a user