update UI DlgUninstall.prefab

This commit is contained in:
VuNgocHaiC7
2026-02-03 17:38:50 +07:00
parent 4d216f3d9f
commit bcb2f61348
6 changed files with 15877 additions and 8 deletions
@@ -33,6 +33,8 @@ MonoBehaviour:
prefab: {fileID: 5910006447059157136, guid: 22d3972b131ebdb4288f9cbdf996d691, type: 3}
- id: Win_Enchase
prefab: {fileID: 5636724581774400035, guid: de6ac6f2630425044a55299c703670f1, type: 3}
- id: Win_Disenchase
prefab: {fileID: 8616615506244952208, guid: 0a7317ed1e4ea3c478057319c0b8fee2, type: 3}
- id: Win_QuestMinion
prefab: {fileID: 2135374639804663431, guid: 474bf9c22c7c445aeb9bfb8b1b77ab55, type: 3}
- id: Win_Character
@@ -2185,6 +2185,18 @@ namespace PerfectWorld.Scripts.Managers
// This would normally query the equipment addon data
return false;
}
public int GetHoleNum()
{
return Holes != null ? Holes.Count : 0;
}
public int GetHoleItem(int index)
{
if(Holes == null || index < 0 || index >= Holes.Count)
return 0;
return Holes[index];
}
#endregion
@@ -19,6 +19,15 @@ namespace BrewMonster
{
public class DlgInstall : AUIDialog
{
public enum InstallMode
{
Enchase,
Disenchase
}
[Header("Mode")]
[SerializeField] private InstallMode m_Mode = InstallMode.Enchase;
[Header("Slot First")]
[SerializeField] private Transform m_SlotFirstParent;
[SerializeField] private TextMeshProUGUI m_TxtFirstName;
@@ -46,9 +55,13 @@ namespace BrewMonster
{
base.Awake();
RegisterDrop(m_SlotFirstParent, OnDropEquip);
RegisterDrop(m_SlotSecondlParent, OnDropMaterial);
RegisterClick(m_SlotFirstParent, OnClickEquipSlot);
RegisterClick(m_SlotSecondlParent, OnClickMaterialSlot);
if (m_Mode == InstallMode.Enchase && m_SlotSecondlParent != null)
{
RegisterDrop(m_SlotSecondlParent, OnDropMaterial);
RegisterClick(m_SlotSecondlParent, OnClickMaterialSlot);
}
}
public override void Update()
@@ -74,6 +87,8 @@ namespace BrewMonster
m_BtnMerge.onClick.AddListener(OnClickedMerge);
m_BtnCancel.onClick.AddListener(OnClickedCancel);
m_install_price = -1;
if(m_SlotSecondlParent != null)
m_SlotSecondlParent.gameObject.SetActive(m_Mode == InstallMode.Enchase);
}
public override void OnDisable()
@@ -322,6 +337,32 @@ namespace BrewMonster
// }
}
private void CalculateUninstallPrice(EC_IvtrItem equipment)
{
if (equipment == null || !equipment.IsEquipment())
return;
EC_IvtrEquip pEquip = (EC_IvtrEquip)equipment;
int nAmount = 0;
for (int i = 0; i < pEquip.GetHoleNum(); i++)
{
int idIten = pEquip.GetHoleItem(i);
if (idIten <= 0)
continue;
EC_IvtrStone pStone = EC_IvtrItem.CreateItem(idIten, 0, 1) as EC_IvtrStone;
if (pStone != null)
{
STONE_ESSENCE pEssence = pStone.GetDBEssence();
nAmount += pEssence.uninstall_price;
}
}
m_install_price = nAmount;
m_TxtMoney.text = nAmount.ToString();
}
private void SetInventorySlotGray(Button btn, bool gray)
{
if (btn == null)
@@ -368,6 +409,11 @@ namespace BrewMonster
m_FirstInvSlot = -1;
m_TxtFirstName.text = "___";
ClearSlotIcon(m_SlotFirstParent);
if(m_Mode == InstallMode.Disenchase)
{
m_install_price = -1;
m_TxtMoney.text = "0";
}
}
private void ClearMaterialSlot()
@@ -377,6 +423,8 @@ namespace BrewMonster
m_SecondInvSlot = -1;
m_TxtSecondName.text = "___";
ClearSlotIcon(m_SlotSecondlParent);
m_TxtMoney.text = "0";
m_install_price = -1;
}
private void ClearSlotIcon(Transform slot)
@@ -511,18 +559,21 @@ namespace BrewMonster
RestoreInventoryColors();
m_SelectedEquip = null;
m_SelectedMaterial = null;
if (m_Mode == InstallMode.Enchase)
{
m_SelectedMaterial = null;
m_SecondInvSlot = -1;
m_TxtSecondName.text = "___";
ClearSlotIcon(m_SlotSecondlParent);
}
m_FirstInvSlot = -1;
m_SecondInvSlot = -1;
m_TxtFirstName.text = "___";
m_TxtSecondName.text = "___";
m_TxtMoney.text = "0";
m_install_price = -1;
ClearSlotIcon(m_SlotFirstParent);
ClearSlotIcon(m_SlotSecondlParent);
gameObject.SetActive(false);
}
@@ -3415,8 +3415,14 @@ namespace BrewMonster.UI
}
else if (idFunction == (int)SERVICE_TYPE.NPC_UNINSTALL)
{
pShow1 = m_pAUIManager.GetDialog("Win_Disenchase");
pShow2 = m_pAUIManager.GetDialog("Win_Inventory");
if (pCurNPCEssence.HasValue)
{
uint npcID = pCurNPCEssence.Value.id;
var dlgInstall = GetGameUIMan().GetDialog("Win_Disenchase");
dlgInstall.Show(true);
}
//pShow1 = m_pAUIManager.GetDialog("Win_Disenchase");
//pShow2 = m_pAUIManager.GetDialog("Win_Inventory");
}
else if (idFunction == (int)SERVICE_TYPE.NPC_HEAL)
{
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0a7317ed1e4ea3c478057319c0b8fee2
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: