fix combo skill

This commit is contained in:
CuongNV
2026-04-20 19:33:37 +07:00
parent 8f921fda4f
commit 81fa75ca95
3 changed files with 44 additions and 9 deletions
@@ -25,7 +25,6 @@ namespace BrewMonster
private void AddShortCutSkill()
{
OnClickedSkill?.Invoke(this);
Debug.LogError("clicked");
}
private void OpenSetShortCutSkillUI()
{
@@ -24,13 +24,6 @@ namespace BrewMonster
{
base.Awake();
SetUp();
foreach (var skill in ptSkillSlotList)
{
if (skill is LearnedSkillUI skillUI)
{
skillUI.OnClickedSkill += OnClickedSkill;
}
}
}
public override void OnEnable()
@@ -40,6 +33,14 @@ namespace BrewMonster
_skillSetUpComboWidget.OnClickedSkillSlot += OnClickedSkillSlot;
_skillSetUpComboWidget.OnClickedAssignSkill += OnClickedAssignSkill;
_skillSetUpComboWidget.OnClickedConfirmCombo += OnClickedConfirmCombo;
_skillSetUpComboWidget.OnClickedSpecialAction += OnClickedSpecialAction;
foreach (var skill in ptSkillSlotList)
{
if (skill is LearnedSkillUI skillUI)
{
skillUI.OnClickedSkill += OnClickedSkill;
}
}
}
public override void OnDisable()
@@ -48,6 +49,19 @@ namespace BrewMonster
_skillSetUpComboWidget.OnClickedSkillSlot -= OnClickedSkillSlot;
_skillSetUpComboWidget.OnClickedAssignSkill -= OnClickedAssignSkill;
_skillSetUpComboWidget.OnClickedConfirmCombo -= OnClickedConfirmCombo;
_skillSetUpComboWidget.OnClickedSpecialAction -= OnClickedSpecialAction;
foreach (var skill in ptSkillSlotList)
{
if (skill is LearnedSkillUI skillUI)
{
skillUI.OnClickedSkill -= OnClickedSkill;
}
}
}
private void OnClickedSpecialAction()
{
_currentSelectSkill = null;
}
private void OnDestroy()
@@ -81,6 +95,10 @@ namespace BrewMonster
private void OnClickedSkill(AUIImagePicture imagePicture)
{
_currentSelectSkill = imagePicture;
if (_skillSetUpComboWidget.CurrentSkillToAssign != null)
{
_skillSetUpComboWidget.CurrentSkillToAssign.SetFocusFrame(false);
}
}
private void UpdateView()
@@ -161,6 +179,7 @@ namespace BrewMonster
{
if(_currentSelectSkill != null && _currentSelectSkill is LearnedSkillUI skillUI)
{
// _skillSetUpComboWidget.CurrentSkillToAssign = null;
_skillSetUpComboWidget.SetSkillToCurrentCombo(slotWidget.GetSlotIndex, (short)skillUI.SkillId);
}
}
@@ -30,6 +30,7 @@ namespace BrewMonster
private SkillSlotWidget _currentComboSlotWidget;
private SkillSlotWidget _currentSkillToAssign;
private EC_VIDEO_SETTING _currentComboSetting;
private bool _isSelectFromListSkill;
private EC_VIDEO_SETTING Setting => EC_Game.GetConfigs().GetVideoSettings();
public EC_VIDEO_SETTING CurrentComboSetting => _currentComboSetting;
@@ -38,6 +39,13 @@ namespace BrewMonster
public event Action OnClickedEditCombo;
public event Action<SkillSlotWidget> OnClickedAssignSkill; // click to asign skill to combo
public event Action OnClickedConfirmCombo;
public event Action OnClickedSpecialAction;
public SkillSlotWidget CurrentSkillToAssign
{
get => _currentSkillToAssign;
set => _currentSkillToAssign = value;
}
public CECGameUIMan GetGameUIMan()
{
@@ -150,7 +158,7 @@ namespace BrewMonster
slot = GetGameUIMan().SetCover(_detailCombosList[i] ,nameskill, EC_GAMEUI_ICONS.ICONS_SKILL);
}
if (slot is AUIImagePicture picture)
if (slot is SkillSlotWidget picture)
{
picture.SetSkillId(idSkills[i]);
}
@@ -246,6 +254,12 @@ namespace BrewMonster
private void OnClickedAssignSkillBtn(SkillSlotWidget slotWidget)
{
OnClickedAssignSkill?.Invoke(slotWidget);
if (_isSelectFromListSkill)
{
_isSelectFromListSkill = false;
return;
}
//if
if(_currentSkillToAssign!=null)
{
SetSkillToCurrentCombo(slotWidget.GetSlotIndex, (short)_currentSkillToAssign.SkillId);
@@ -264,6 +278,7 @@ namespace BrewMonster
setting.comboSkill[_currentComboSlotWidget.GetSlotIndex].idSkill[slotIndex] = skillId;
ShowComboInDetail(setting.comboSkill[_currentComboSlotWidget.GetSlotIndex].idSkill);
_currentComboSetting = setting;
_isSelectFromListSkill = true;
return true;
}
private void OnSelectedSkillToAsign(SkillSlotWidget skillSlotWidget)
@@ -272,8 +287,10 @@ namespace BrewMonster
{
_currentSkillToAssign.SetFocusFrame(false);
}
OnClickedSpecialAction?.Invoke();
_currentSkillToAssign = skillSlotWidget;
_currentSkillToAssign.SetFocusFrame(true);
_isSelectFromListSkill = false;
}
}
}