diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Assets/AddressableAssetsData/AddressableAssetSettings.asset index 2cc4591b5f..47505516a6 100644 --- a/Assets/AddressableAssetsData/AddressableAssetSettings.asset +++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset @@ -15,7 +15,7 @@ MonoBehaviour: m_DefaultGroup: 712e3991f28e549e7a56ee582a977810 m_currentHash: serializedVersion: 2 - Hash: 00000000000000000000000000000000 + Hash: b25883b8e3382431c6dfcc3aaedd1aaf m_OptimizeCatalogSize: 0 m_BuildRemoteCatalog: 0 m_CatalogRequestsTimeout: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset index 5546a72936..477dd63277 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset @@ -15,6 +15,16 @@ MonoBehaviour: m_GroupName: Default Local Group m_GUID: 712e3991f28e549e7a56ee582a977810 m_SerializeEntries: + - m_GUID: 0a2f50f2fe381024996b30c94befd165 + m_Address: "InGame/\u5143\u795E.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 11d9820773784714ba7ed00226308680 + m_Address: "InGame/\u672A\u547D\u4E2D.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 1b653230886be4009808803501ad7d7f m_Address: Assets/PerfectWorld/SO/TaskTemplContainerSO.asset m_ReadOnly: 0 @@ -30,16 +40,96 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 2cea0a36514b40f4cbb2d93eb50fe97b + m_Address: "InGame/\u7ECF\u9A8C.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 66d520355c8214d8ba4d37422bd27571 + m_Address: "InGame/GM\u6807\u5FD7.dds" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 766835429f2a89f408d4786a3aa06363 + m_Address: "InGame/\u514D\u75AB.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 7b66d105afe110341a51b5043be89f45 + m_Address: "InGame/\u590D\u4EC7\u60E9\u6212.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 82bf5409dc0e9f34a9c114853cd8ee8d + m_Address: InGame/mp_warn.tga + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 8743a82a27870e5489e3bfca82cc3f0f + m_Address: "InGame/\u91D1\u94B1.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 88e840e5dac12ed4383d994c7fadfef1 m_Address: "\u7A0B\u5E8F\u8054\u5165/\u51FB\u4E2D/\u62F3\u5957\u51FB\u4E2D" m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 89a51fc0532e7c244bd25d996a480d1e + m_Address: "InGame/\u72B6\u6001\u95EA\u907F.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: a7cdab13e3d9e6a4da14a7bb02481f35 + m_Address: "InGame/PK\u72B6\u6001\u6807\u8BB0.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: a81dab17b00ef4b4494a71ee88b10cc0 m_Address: "\u7A0B\u5E8F\u8054\u5165/\u89D2\u8272\u5347\u7EA7\u4EBA\u7C7B.gfx" m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: b0860cc78fedf454c8ebf35729998d70 + m_Address: "InGame/\u5931\u8D25.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: bd6cbd6a9c2ce8444a50a177bdfe77fd + m_Address: "InGame/\u7206\u51FB.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: c1761dbd7108bf740a9fd5ee90d5e3de + m_Address: "InGame/\u53CD\u9707.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: ed347377914b065488cf5b42d4e8b5ab + m_Address: "InGame/\u5347\u7EA7\u4E86.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: f55f5d3b9021e5d4daced587dbd48d9f + m_Address: "InGame/\u6210\u529F.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: f635ebcab3287284bb9e206ea8e13d51 + m_Address: "InGame/\u590D\u4EC7\u955C\u50CF.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: fa244579aed36fa4187a0667d52ab84b + m_Address: "InGame/\u5438\u8840.tga" + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: fcbc44b68ce86c047bd67ea7a74d40c2 + m_Address: InGame/hp_warn.tga + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 m_ReadOnly: 0 m_Settings: {fileID: 11400000, guid: 070edb522e6e54c14a99055900003890, type: 2} m_SchemaSet: diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_HostInputFilter.cs b/Assets/PerfectWorld/Scripts/Managers/EC_HostInputFilter.cs index edfce9b093..f8b0964885 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_HostInputFilter.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_HostInputFilter.cs @@ -99,6 +99,18 @@ namespace BrewMonster /// Optional target ID to use instead of raycast (for second-click behavior) / 可选的目标ID,用于替代射线检测(用于第二次点击行为) public void OnMsgLBtnClick(int idTargetOverride = 0) { + // Interactive UI (buttons, fields, scrolls) consumes the click. Full-screen raycast panels alone do not. + // When a non-HUD dialog is open, block world interaction entirely (terrain/NPC/matter) until it is closed. + if (idTargetOverride == 0) + { + if (CECUIManager.IsPointerOverInteractiveUI()) + return; + + var uiMan = EC_Game.GetGameRun()?.GetUIManager(); + if (uiMan != null && uiMan.IsWorldInteractionBlockedByUI()) + return; + } + // 停止自动策略 / Stop auto policy // Note: Auto policy check would go here if implemented diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs index 819cc16740..32fe8bfea6 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs @@ -2402,14 +2402,11 @@ namespace BrewMonster.UI } else if (iService == CDLGNPC.CDLGNPC_PETHATCH && (pEssence?.combined_services & 0x200) != 0) { + // Pop NPC from UI stack first (avoids double hide/pop with _maxStack=1), then hatch + inventory like legacy client. //CloseDialogue(); - // TO DO: fix later - //GetGameUIMan().m_pDlgInventory.Show(true); - //GetGameUIMan().m_pDlgPetHatch.Show(true); - //var dlgPetHatch = GetGameUIMan().GetDialog("DlgPetHatch"); - //dlgPetHatch.Show(true); - CECUIManager.Instance.ShowUI("DlgPetHatch"); + //if (CECUIManager.Instance.ShowUI("DlgPetHatch") != null) + // GetGameUIMan().GetDialog("Win_Inventory")?.Show(true); return; } else if (iService == CDLGNPC.CDLGNPC_PETREC && (pEssence?.combined_services & 0x400) != 0) @@ -3213,53 +3210,53 @@ namespace BrewMonster.UI id_dialog = (int)pService.id_dialog; idFunction = (int)SERVICE_TYPE.NPC_BUY; } - else if (DataType == DATA_TYPE.DT_NPC_REPAIR_SERVICE) - { - NPC_REPAIR_SERVICE pService = (NPC_REPAIR_SERVICE)pData; - id_dialog = (int)pService.id_dialog; - idFunction = (int)SERVICE_TYPE.NPC_REPAIR; - } - else if (DataType == DATA_TYPE.DT_NPC_INSTALL_SERVICE) - { - NPC_INSTALL_SERVICE pService = (NPC_INSTALL_SERVICE)pData; - id_dialog = (int)pService.id_dialog; - idFunction = (int)SERVICE_TYPE.NPC_INSTALL; - } - else if (DataType == DATA_TYPE.DT_NPC_UNINSTALL_SERVICE) - { - NPC_UNINSTALL_SERVICE pService = (NPC_UNINSTALL_SERVICE)pData; - id_dialog = (int)pService.id_dialog; - idFunction = (int)SERVICE_TYPE.NPC_UNINSTALL; - } + // else if (DataType == DATA_TYPE.DT_NPC_REPAIR_SERVICE) + // { + // NPC_REPAIR_SERVICE pService = (NPC_REPAIR_SERVICE)pData; + // id_dialog = (int)pService.id_dialog; + // idFunction = (int)SERVICE_TYPE.NPC_REPAIR; + // } + // else if (DataType == DATA_TYPE.DT_NPC_INSTALL_SERVICE) + // { + // NPC_INSTALL_SERVICE pService = (NPC_INSTALL_SERVICE)pData; + // id_dialog = (int)pService.id_dialog; + // idFunction = (int)SERVICE_TYPE.NPC_INSTALL; + // } + // else if (DataType == DATA_TYPE.DT_NPC_UNINSTALL_SERVICE) + // { + // NPC_UNINSTALL_SERVICE pService = (NPC_UNINSTALL_SERVICE)pData; + // id_dialog = (int)pService.id_dialog; + // idFunction = (int)SERVICE_TYPE.NPC_UNINSTALL; + // } else if (DataType == DATA_TYPE.DT_NPC_SKILL_SERVICE) { NPC_SKILL_SERVICE pService = (NPC_SKILL_SERVICE)pData; id_dialog = (int)pService.id_dialog; idFunction = (int)SERVICE_TYPE.NPC_SKILL; } - else if (DataType == DATA_TYPE.DT_NPC_HEAL_SERVICE) - { - NPC_HEAL_SERVICE pService = (NPC_HEAL_SERVICE)pData; - id_dialog = (int)pService.id_dialog; - idFunction = (int)SERVICE_TYPE.NPC_HEAL; - } - else if (DataType == DATA_TYPE.DT_NPC_TRANSMIT_SERVICE) - { - NPC_TRANSMIT_SERVICE pService = (NPC_TRANSMIT_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_TRANSMIT; - } - else if (DataType == DATA_TYPE.DT_NPC_TRANSPORT_SERVICE) - { - NPC_TRANSPORT_SERVICE pService = (NPC_TRANSPORT_SERVICE)pData; - id_dialog = (int)pService.id_dialog; - idFunction = (int)SERVICE_TYPE.NPC_TRANSPORT; - } - else if (DataType == DATA_TYPE.DT_NPC_PROXY_SERVICE) - { - NPC_PROXY_SERVICE pService = (NPC_PROXY_SERVICE)pData; - id_dialog = (int)pService.id_dialog; - idFunction = (int)SERVICE_TYPE.NPC_PROXY; - } + // else if (DataType == DATA_TYPE.DT_NPC_HEAL_SERVICE) + // { + // NPC_HEAL_SERVICE pService = (NPC_HEAL_SERVICE)pData; + // id_dialog = (int)pService.id_dialog; + // idFunction = (int)SERVICE_TYPE.NPC_HEAL; + // } + // else if (DataType == DATA_TYPE.DT_NPC_TRANSMIT_SERVICE) + // { + // NPC_TRANSMIT_SERVICE pService = (NPC_TRANSMIT_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_TRANSMIT; + // } + // else if (DataType == DATA_TYPE.DT_NPC_TRANSPORT_SERVICE) + // { + // NPC_TRANSPORT_SERVICE pService = (NPC_TRANSPORT_SERVICE)pData; + // id_dialog = (int)pService.id_dialog; + // idFunction = (int)SERVICE_TYPE.NPC_TRANSPORT; + // } + // else if (DataType == DATA_TYPE.DT_NPC_PROXY_SERVICE) + // { + // NPC_PROXY_SERVICE pService = (NPC_PROXY_SERVICE)pData; + // id_dialog = (int)pService.id_dialog; + // idFunction = (int)SERVICE_TYPE.NPC_PROXY; + // } /*else if (DataType == DATA_TYPE.DT_NPC_STORAGE_SERVICE) { NPC_STORAGE_SERVICE pService = (NPC_STORAGE_SERVICE)pData; @@ -3295,21 +3292,21 @@ namespace BrewMonster.UI idFunction = (int)SERVICE_TYPE.NPC_DECOMPOSE; } - else if (DataType == DATA_TYPE.DT_NPC_IDENTIFY_SERVICE) - { - NPC_IDENTIFY_SERVICE pService = (NPC_IDENTIFY_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_IDENTIFY; - } - else if (DataType == DATA_TYPE.DT_NPC_WAR_TOWERBUILD_SERVICE) - { - NPC_WAR_TOWERBUILD_SERVICE pService = (NPC_WAR_TOWERBUILD_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_WAR_TOWERBUILD; - } - else if (DataType == DATA_TYPE.DT_NPC_RESETPROP_SERVICE) - { - NPC_RESETPROP_SERVICE pService = (NPC_RESETPROP_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_RESETPROP; - } + // else if (DataType == DATA_TYPE.DT_NPC_IDENTIFY_SERVICE) + // { + // NPC_IDENTIFY_SERVICE pService = (NPC_IDENTIFY_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_IDENTIFY; + // } + // else if (DataType == DATA_TYPE.DT_NPC_WAR_TOWERBUILD_SERVICE) + // { + // NPC_WAR_TOWERBUILD_SERVICE pService = (NPC_WAR_TOWERBUILD_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_WAR_TOWERBUILD; + // } + // else if (DataType == DATA_TYPE.DT_NPC_RESETPROP_SERVICE) + // { + // NPC_RESETPROP_SERVICE pService = (NPC_RESETPROP_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_RESETPROP; + // } else if (DataType == DATA_TYPE.DT_NPC_PETNAME_SERVICE) { NPC_PETNAME_SERVICE pService = (NPC_PETNAME_SERVICE)pData; @@ -3325,26 +3322,26 @@ namespace BrewMonster.UI NPC_PETFORGETSKILL_SERVICE pService = (NPC_PETFORGETSKILL_SERVICE)pData; idFunction = (int)SERVICE_TYPE.NPC_PETFORGETSKILL; } - else if (DataType == DATA_TYPE.DT_NPC_EQUIPBIND_SERVICE) - { - NPC_EQUIPBIND_SERVICE pService = (NPC_EQUIPBIND_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_EQUIPBIND; - } - else if (DataType == DATA_TYPE.DT_NPC_EQUIPDESTROY_SERVICE) - { - NPC_EQUIPDESTROY_SERVICE pService = (NPC_EQUIPDESTROY_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_EQUIPDESTROY; - } - else if (DataType == DATA_TYPE.DT_NPC_EQUIPUNDESTROY_SERVICE) - { - NPC_EQUIPUNDESTROY_SERVICE pService = (NPC_EQUIPUNDESTROY_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_EQUIPUNDESTROY; - } - else if (DataType == DATA_TYPE.DT_NPC_ENGRAVE_SERVICE) - { - NPC_ENGRAVE_SERVICE pService = (NPC_ENGRAVE_SERVICE)pData; - idFunction = (int)SERVICE_TYPE.NPC_ENGRAVE; - } + // else if (DataType == DATA_TYPE.DT_NPC_EQUIPBIND_SERVICE) + // { + // NPC_EQUIPBIND_SERVICE pService = (NPC_EQUIPBIND_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_EQUIPBIND; + // } + // else if (DataType == DATA_TYPE.DT_NPC_EQUIPDESTROY_SERVICE) + // { + // NPC_EQUIPDESTROY_SERVICE pService = (NPC_EQUIPDESTROY_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_EQUIPDESTROY; + // } + // else if (DataType == DATA_TYPE.DT_NPC_EQUIPUNDESTROY_SERVICE) + // { + // NPC_EQUIPUNDESTROY_SERVICE pService = (NPC_EQUIPUNDESTROY_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_EQUIPUNDESTROY; + // } + // else if (DataType == DATA_TYPE.DT_NPC_ENGRAVE_SERVICE) + // { + // NPC_ENGRAVE_SERVICE pService = (NPC_ENGRAVE_SERVICE)pData; + // idFunction = (int)SERVICE_TYPE.NPC_ENGRAVE; + // } else if (DataType == DATA_TYPE.DT_NPC_RANDPROP_SERVICE) { NPC_RANDPROP_SERVICE pService = (NPC_RANDPROP_SERVICE)pData; @@ -3471,27 +3468,27 @@ namespace BrewMonster.UI // pShow1 = m_pAUIManager.GetDialog("Win_WorldMapTravel"); //((CDlgWorldMap*)pShow1).BuildTravelMap(DT_NPC_TRANSMIT_SERVICE, pData); } - else if (idFunction == (int)SERVICE_TYPE.NPC_SKILL) - { - //string strText = m_pLst_Main.GetText(m_pLst_Main.GetCurSel()); - //string strHead = GetStringFromTable(249); - //string strComp = (strHead + GetStringFromTable(7107)); - //if (0 == a_stricmp(strText, strComp)) - //{ - // pShow1 = m_pAUIManager.GetDialog("Win_ELFLearn"); - // ((CDlgELFLearn*)pShow1).SetNPCName(pCurNPCEssence.name); - // pShow2 = m_pAUIManager.GetDialog("Win_Inventory"); - // GetHostPlayer().PrepareNPCService(iService); - // pShow1.SetData(DT_NPC_SKILL_SERVICE); - //} - //else - //{ - // pShow1 = m_pAUIManager.GetDialog("Win_Teach"); - // GetHostPlayer().PrepareNPCService(iService); - // pShow1.SetData(DT_NPC_SKILL_SERVICE); - // GetGameUIMan().UpdateTeach(0); - //} - } + // else if (idFunction == (int)SERVICE_TYPE.NPC_SKILL) + // { + // //string strText = m_pLst_Main.GetText(m_pLst_Main.GetCurSel()); + // //string strHead = GetStringFromTable(249); + // //string strComp = (strHead + GetStringFromTable(7107)); + // //if (0 == a_stricmp(strText, strComp)) + // //{ + // // pShow1 = m_pAUIManager.GetDialog("Win_ELFLearn"); + // // ((CDlgELFLearn*)pShow1).SetNPCName(pCurNPCEssence.name); + // // pShow2 = m_pAUIManager.GetDialog("Win_Inventory"); + // // GetHostPlayer().PrepareNPCService(iService); + // // pShow1.SetData(DT_NPC_SKILL_SERVICE); + // //} + // //else + // //{ + // // pShow1 = m_pAUIManager.GetDialog("Win_Teach"); + // // GetHostPlayer().PrepareNPCService(iService); + // // pShow1.SetData(DT_NPC_SKILL_SERVICE); + // // GetGameUIMan().UpdateTeach(0); + // //} + // } else if (idFunction == (int)SERVICE_TYPE.NPC_MAKE) { NPC_MAKE_SERVICE pMake = (NPC_MAKE_SERVICE)pData; diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetHatch.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetHatch.cs index b78ec02963..da9bad33c4 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetHatch.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetHatch.cs @@ -385,9 +385,9 @@ namespace BrewMonster.UI GetHostPlayer().HatchPet(m_nSlot); SetDataPtr(null, ""); GetGameUIMan().EndNPCService(); - Show(false); GetGameUIMan().GetDialog("Win_Inventory")?.Show(false); GetHostPlayer().GetPack(Inventory_type.IVTRTYPE_PACK).UnfreezeAllItems(); + CloseDialogue(); } } @@ -396,8 +396,9 @@ namespace BrewMonster.UI RestoreInventoryColor(); ClearEgg(); GetGameUIMan().EndNPCService(); - Show(false); + GetGameUIMan().GetDialog("Win_Inventory")?.Show(false); GetHostPlayer().GetPack(Inventory_type.IVTRTYPE_PACK).UnfreezeAllItems(); + CloseDialogue(); } //public void SetEgg(EC_IvtrItem pItem, int nSlot) @@ -458,7 +459,8 @@ namespace BrewMonster.UI } SetEggInternal(selectedEgg, selectedSlot); - m_itemInfo.SetActive(false); + if (m_itemInfo != null) + m_itemInfo.SetActive(false); } diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetRec.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetRec.cs index 0d897bca7b..392e6c4491 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetRec.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgPetRec.cs @@ -209,7 +209,8 @@ namespace BrewMonster.UI ClearPet(); UpdatePetSlotUI(); GetGameUIMan()?.EndNPCService(); - Show(false); + //Show(false); + CloseDialogue(); //GetGameUIMan()->m_pDlgPetList->Show(false); } } @@ -368,7 +369,8 @@ namespace BrewMonster.UI { ClearPet(); GetGameUIMan()?.EndNPCService(); - Show(false); + CloseDialogue(); + //Show(false); } private void OnDestroy() diff --git a/Assets/PerfectWorld/Scripts/UI/pickupItem.cs b/Assets/PerfectWorld/Scripts/UI/pickupItem.cs index abc7386815..ec541a8752 100644 --- a/Assets/PerfectWorld/Scripts/UI/pickupItem.cs +++ b/Assets/PerfectWorld/Scripts/UI/pickupItem.cs @@ -84,6 +84,13 @@ public class pickupItem : MonoBehaviour // Check for mouse clicks on cubes if (Input.GetMouseButtonDown(0)) { + if (CECUIManager.IsPointerOverInteractiveUI()) + return; + + var uiMan = EC_Game.GetGameRun()?.GetUIManager(); + if (uiMan != null && uiMan.IsWorldInteractionBlockedByUI()) + return; + HandleCubeClick(); } } diff --git a/Assets/Scripts/CECUIManager.cs b/Assets/Scripts/CECUIManager.cs index e6bf282408..08ac4c1171 100644 --- a/Assets/Scripts/CECUIManager.cs +++ b/Assets/Scripts/CECUIManager.cs @@ -9,6 +9,8 @@ using BrewMonster.Scripts.Managers; using BrewMonster.Scripts.Task.UI; using BrewMonster.Scripts.UI; using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; using TMPro; public class CECUIManager : MonoSingleton @@ -366,6 +368,74 @@ public class CECUIManager : MonoSingleton return null; } + /// + /// Dialog names on that are normal gameplay HUD and must NOT block world raycasts + /// (the stack always has at least Win_Hpmpxp after ). + /// + private static readonly HashSet HudStackDialogNames = new HashSet(StringComparer.Ordinal) + { + "Win_Hpmpxp", + }; + + /// + /// Returns true when a modal / non-HUD dialog is open and world clicks should be ignored. + /// + public bool IsWorldInteractionBlockedByUI() + { + if (_uiStack == null || _uiStack.Count == 0) + return false; + + foreach (var name in _uiStack) + { + if (string.IsNullOrEmpty(name)) + continue; + if (!HudStackDialogNames.Contains(name)) + return true; + } + + return false; + } + + /// + /// True when the pointer hits UI that should consume the click (buttons, fields, scroll views). + /// Unlike , full-screen Images/Text with raycast + /// but no interactive control do not block — so clicks can reach the world for NPC selection. + /// + public static bool IsPointerOverInteractiveUI() + { + var es = EventSystem.current; + if (es == null) + return false; + + Vector2 pos = Input.mousePosition; + if (Input.touchCount > 0) + pos = Input.GetTouch(0).position; + + var ped = new PointerEventData(es) { position = pos }; + var results = new List(); + es.RaycastAll(ped, results); + if (results.Count == 0) + return false; + + foreach (var r in results) + { + var go = r.gameObject; + if (go == null) + continue; + + if (go.GetComponentInParent() != null) + return true; + if (go.GetComponentInParent() != null) + return true; + if (go.GetComponentInParent() != null) + return true; + if (go.GetComponentInParent() != null) + return true; + } + + return false; + } + // public CDlgMessageBox ShowMessageBox(MessageBoxData messageBoxData) // { // var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;