fix conflig

This commit is contained in:
VuNgocHaiC7
2026-04-22 16:57:25 +07:00
parent 100f93c2d8
commit 026286ac46
@@ -106,6 +106,7 @@ namespace BrewMonster
int needMoney = CECHostSkillModel.Instance.GetSkillMoney(m_skillID, m_curLevel + 1);
int needSp = CECHostSkillModel.Instance.GetSkillSp(m_skillID, m_curLevel + 1);
string str = GPDataTypeHelper.ReplacePercentD(GetStringFromTable(11326), needMoney, needSp);
// var messagebox = uiManager.ShowMessageBox(new MessageBoxData()
// {
@@ -115,16 +116,38 @@ namespace BrewMonster
// });
var messagebox = uiManager.ShowMessageBoxYes("Game_LearnSkill", str, this,
() => {
UnityGameSession.c2s_SendCmdNPCSevLearnSkill(m_skillID);
int skillID = (int)GetData();
int nCondition = EC_Game.GetGameRun().GetHostPlayer().CheckSkillLearnCondition(skillID, true);
// BMLogger.LogError("HoangDev: CDlgSkillSubListItem OnCommand_Upgrade clicked yes for nCondition " + nCondition);
CECHostPlayer hostPlayer = GetHostPlayer();
if (hostPlayer == null)
return;
if (0 == nCondition)
int skillID = m_skillID;
int recheck = hostPlayer.CheckSkillLearnCondition(skillID, true);
if (recheck != 0)
{
UnityGameSession.c2s_SendCmdNPCSevLearnSkill(skillID);
UpdateUpgradeBtn();
if (!string.IsNullOrEmpty(m_upgradeDisabledReason))
{
uiManager.ShowMessageBoxGeneral("MessageBox", m_upgradeDisabledReason, this);
}
return;
}
int costMoney = CECHostSkillModel.Instance.GetSkillMoney(skillID, m_curLevel + 1);
int costSp = CECHostSkillModel.Instance.GetSkillSp(skillID, m_curLevel + 1);
if(!hostPlayer.TryConsumeSkillLearnCost(costMoney, costSp))
{
UpdateUpgradeBtn();
if(!string.IsNullOrEmpty(m_upgradeDisabledReason))
{
uiManager.ShowMessageBoxGeneral("MessageBox", m_upgradeDisabledReason, this);
}
return;
}
UnityGameSession.c2s_SendCmdNPCSevLearnSkill(skillID);
UpdateUpgradeBtn();
});
messagebox.SetData((uint)m_skillID);
//GetGameUIMan()->MessageBox("Game_LearnSkill", str, //GetGameUIMan()->GetStringFromTable(231),