From b808bda60c99aa4bcc591af71d48375442564709 Mon Sep 17 00:00:00 2001 From: NguyenVanDat Date: Mon, 2 Feb 2026 15:22:15 +0700 Subject: [PATCH 1/2] fix embed stone --- .../PerfectWorld/Prefab/UI/MessageBox.prefab | 14 ++++----- .../UI/DialogScriptTableObject.asset | 2 ++ .../Scripts/UI/Dialogs/DlgInstall.cs | 31 +++++++------------ .../PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs | 5 --- Assets/Prefabs/UI/DlgInstall.prefab | 2 +- 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/Assets/PerfectWorld/Prefab/UI/MessageBox.prefab b/Assets/PerfectWorld/Prefab/UI/MessageBox.prefab index c68a796b79..3d3caedc34 100644 --- a/Assets/PerfectWorld/Prefab/UI/MessageBox.prefab +++ b/Assets/PerfectWorld/Prefab/UI/MessageBox.prefab @@ -425,10 +425,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 8578995796031649400} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 3} - m_SizeDelta: {x: 200, y: 50} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &655909173274991632 CanvasRenderer: @@ -487,10 +487,10 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 + m_fontSize: 44.75 m_fontSizeBase: 36 m_fontWeight: 400 - m_enableAutoSizing: 0 + m_enableAutoSizing: 1 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 @@ -570,7 +570,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 30.6318} - m_SizeDelta: {x: 434.6896, y: 248.9211} + m_SizeDelta: {x: 1067.9689, y: 248.9211} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2243330050876855902 CanvasRenderer: diff --git a/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset b/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset index 3a56aa4ebf..393710000b 100644 --- a/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset +++ b/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset @@ -39,3 +39,5 @@ MonoBehaviour: prefab: {fileID: 6310702841431484757, guid: 6620f766cee7c8f4cb00dd457ac77675, type: 3} - id: Win_ArrangeTeam prefab: {fileID: 2452003196178065293, guid: 5a3e828efd5c542469d1f17565205ded, type: 3} + - id: DlgMessageBox + prefab: {fileID: 5492547392745930423, guid: 54cccb2c6a758a24183474cd385ccb2c, type: 3} diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs index b42dd8c65f..363c0dce18 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs @@ -56,6 +56,7 @@ namespace BrewMonster //todo need to set from other class // SetName("Win_Enchase"); m_BtnMerge.onClick.AddListener(OnClickedMerge); + m_BtnCancel.onClick.AddListener(OnClickedCancel); m_install_price = -1; } @@ -63,11 +64,7 @@ namespace BrewMonster { base.OnDisable(); m_BtnMerge.onClick.RemoveListener(OnClickedMerge); - } - - public void OpenInstall(uint npcId) - { - + m_BtnCancel.onClick.RemoveListener(OnClickedCancel); } public void CloseInstall() @@ -227,8 +224,6 @@ namespace BrewMonster SetInventorySlotGray(btn, true); detailedItem.Freeze(true); - - Debug.Log($"[Install] Equipment: {detailedItem.m_tid} from slot {slotIndex}"); } private void OnDropMaterial(PointerEventData eventData) @@ -297,8 +292,6 @@ namespace BrewMonster // a_sprintf(szText, _AL("%d"), nAmount); // m_pTxtGold->SetText(szText); // } - - Debug.Log($"[Install] Material: {detailedItem.m_tid} from slot {slotIndex}"); } private void SetInventorySlotGray(Button btn, bool gray) @@ -348,8 +341,6 @@ namespace BrewMonster m_FirstInvSlot = -1; m_TxtFirstName.text = "___"; ClearSlotIcon(m_SlotFirstParent); - - Debug.Log("[Install] Equipment slot cleared"); } private void ClearMaterialSlot() @@ -358,8 +349,6 @@ namespace BrewMonster m_SecondInvSlot = -1; m_TxtSecondName.text = "___"; ClearSlotIcon(m_SlotSecondlParent); - - Debug.Log("[Install] Material slot cleared"); } private void ClearSlotIcon(Transform slot) @@ -385,7 +374,7 @@ namespace BrewMonster if( nMoney > pHost.GetMoneyAmount() ) { message = GetGameUIMan().GetStringFromTable(226); - Debug.LogError(message); + CECUIManager.Instance.ShowMessageBox("", message); // GetGameUIMan()->MessageBox("", GetGameUIMan().GetStringFromTable(226), MB_OK, // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox->SetLife(3); @@ -396,7 +385,7 @@ namespace BrewMonster if( !pIvtrA.IsEquipment() ) { message = GetGameUIMan().GetStringFromTable(223); - Debug.LogError(message); + CECUIManager.Instance.ShowMessageBox("", message); // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(223), MB_OK, // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox.SetLife(3); @@ -410,7 +399,7 @@ namespace BrewMonster if( pEquipA.GetEmptyHoleNum() <= 0 ) { message = GetGameUIMan().GetStringFromTable(224); - Debug.LogError(message); + CECUIManager.Instance.ShowMessageBox("", message); // GetGameUIMan().MessageBox("", GetGameUIMan()->GetStringFromTable(224), MB_OK, // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox.SetLife(3); @@ -421,7 +410,7 @@ namespace BrewMonster if(pIvtrB == null || !pIvtrB.IsEmbeddable() ) { message = GetGameUIMan().GetStringFromTable(225); - Debug.LogError(message); + CECUIManager.Instance.ShowMessageBox("", message); // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(225), MB_OK, // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox.SetLife(3); @@ -449,7 +438,7 @@ namespace BrewMonster if( nStoneLevel > nEquipLevel ) { message = GetGameUIMan().GetStringFromTable(300); - Debug.LogError(message); + CECUIManager.Instance.ShowMessageBox("", message); // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(300), MB_OK, // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox.SetLife(3); @@ -464,7 +453,7 @@ namespace BrewMonster pHost.GetPack(InventoryConst.IVTRTYPE_PACK).UnfreezeAllItems(); message = GetGameUIMan().GetStringFromTable(228); - Debug.LogError(message); + CECUIManager.Instance.ShowMessageBox("", message); // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(228), // MB_OK, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox.SetLife(3); @@ -484,5 +473,9 @@ namespace BrewMonster // MB_OKCANCEL, A3DCOLORRGBA(255, 255, 255, 160)); // } } + private void OnClickedCancel() + { + Show(false); + } } } \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs index a546e83502..79d9d1914e 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs @@ -3422,11 +3422,6 @@ namespace BrewMonster.UI } } } - - if(dlgInstall != null) - { - dlgInstall.OpenInstall(npcID); - } } //pShow1 = m_pAUIManager.GetDialog("Win_Enchase"); //pShow2 = m_pAUIManager.GetDialog("Win_Inventory"); diff --git a/Assets/Prefabs/UI/DlgInstall.prefab b/Assets/Prefabs/UI/DlgInstall.prefab index bed021b314..a8f3fce4f0 100644 --- a/Assets/Prefabs/UI/DlgInstall.prefab +++ b/Assets/Prefabs/UI/DlgInstall.prefab @@ -1660,7 +1660,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 10000000000000 + m_text: 0 m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2} m_sharedMaterial: {fileID: 9092487103257209053, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2} From fef0ef492188caaff77d557570d0588f0ce67561 Mon Sep 17 00:00:00 2001 From: NguyenVanDat Date: Mon, 2 Feb 2026 15:31:03 +0700 Subject: [PATCH 2/2] update logic show Install Dialogue --- .../Scripts/UI/Dialogs/DlgInstall.cs | 2 +- .../PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs | 19 +++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs index 363c0dce18..f45efd4a3e 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs @@ -375,7 +375,7 @@ namespace BrewMonster { message = GetGameUIMan().GetStringFromTable(226); CECUIManager.Instance.ShowMessageBox("", message); - // GetGameUIMan()->MessageBox("", GetGameUIMan().GetStringFromTable(226), MB_OK, + // GetGameUIMan().GetDialog("") // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox->SetLife(3); return; diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs index 79d9d1914e..ab8369e45a 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs @@ -3406,22 +3406,9 @@ namespace BrewMonster.UI if (pCurNPCEssence.HasValue) { uint npcID = pCurNPCEssence.Value.id; - DlgInstall dlgInstall = FindFirstObjectByType(); - if (dlgInstall == null) - { - CECGameUIMan gameUIMan = GetGameUIMan(); - DialogScriptTableObject dialogResource = gameUIMan.GetDialogResource(); - Canvas canvas = gameUIMan.GetCanvas(); - - if(dialogResource != null && canvas != null) - { - GameObject ob = dialogResource.GetPrefabDialog("Win_Enchase"); - if (ob != null) - { - dlgInstall = GameObject.Instantiate(ob, canvas.transform).GetComponent(); - } - } - } + + var dlgInstall =GetGameUIMan().GetDialog("Win_Enchase"); + dlgInstall.Show(true); } //pShow1 = m_pAUIManager.GetDialog("Win_Enchase"); //pShow2 = m_pAUIManager.GetDialog("Win_Inventory");