diff --git a/Assets/PerfectWorld/Scripts/UI/GamePlay/LearnedSkillUI.cs b/Assets/PerfectWorld/Scripts/UI/GamePlay/LearnedSkillUI.cs index 96ec8e3f02..84b2468691 100644 --- a/Assets/PerfectWorld/Scripts/UI/GamePlay/LearnedSkillUI.cs +++ b/Assets/PerfectWorld/Scripts/UI/GamePlay/LearnedSkillUI.cs @@ -25,7 +25,6 @@ namespace BrewMonster private void AddShortCutSkill() { OnClickedSkill?.Invoke(this); - Debug.LogError("clicked"); } private void OpenSetShortCutSkillUI() { diff --git a/Assets/PerfectWorld/Scripts/UI/SkillUI/CDlgSkillSubPool.cs b/Assets/PerfectWorld/Scripts/UI/SkillUI/CDlgSkillSubPool.cs index 420c0d55a1..29e8b25610 100644 --- a/Assets/PerfectWorld/Scripts/UI/SkillUI/CDlgSkillSubPool.cs +++ b/Assets/PerfectWorld/Scripts/UI/SkillUI/CDlgSkillSubPool.cs @@ -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); } } diff --git a/Assets/PerfectWorld/Scripts/UI/SkillUI/SkillSetUpComboWidget.cs b/Assets/PerfectWorld/Scripts/UI/SkillUI/SkillSetUpComboWidget.cs index 3bd01534b9..42ab293b41 100644 --- a/Assets/PerfectWorld/Scripts/UI/SkillUI/SkillSetUpComboWidget.cs +++ b/Assets/PerfectWorld/Scripts/UI/SkillUI/SkillSetUpComboWidget.cs @@ -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 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; } } }