From 43b0d5870d528f23ecd6aeceb6cfd4325188b46f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 01 七月 2021 15:50:43 +0800 Subject: [PATCH] Revert "1" --- HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs index 739bc8c..7fe638d 100644 --- a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs +++ b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs @@ -14,13 +14,13 @@ #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> - /// 鎺у埗浜嬩欢(涓嶆敮鎸丒nable鍜孌isable,閮藉綊涓篗id) + /// 鐐瑰嚮鍚庤嚜鍔ㄨ繕鍘熺姸鎬佺殑鎺у埗浜嬩欢(鍙湁Mid,left,right,up,down) /// </summary> - public Action<DirectionEnum> ControlEvent = null; + public Action<DirectionEnum> AutoRecoverControlEvent = null; /// <summary> - /// 鏄惁浣跨敤鐐瑰嚮鐗规晥,涓�鏃﹁缃负true,鍒欑偣鍑讳箣鍚�,浼氳嚜鍔ㄨ繕鍘熷洖Enable鐘舵�� + /// 鐐瑰嚮鍚庝笉浼氳繕鍘熺姸鎬佺殑鎺у埗浜嬩欢(鍙湁enable,Mid,left,right,up,down銆� enable:鎵嬫寚鏉惧紑鏂瑰悜閿悗瑙﹀彂) /// </summary> - public bool UseClickStau = false; + public Action<DirectionEnum> NotRecoverControlEvent = null; /// <summary> /// 鑳藉惁鎺у埗鏂瑰悜 /// </summary> @@ -75,7 +75,8 @@ //寮�鍚瓑寰呯嚎绋�(涓嶅厑璁哥媯鐐�) this.StartWaitThread(); - this.ControlEvent?.Invoke(DirectionEnum.Mid); + this.AutoRecoverControlEvent?.Invoke(DirectionEnum.Mid); + this.NotRecoverControlEvent?.Invoke(DirectionEnum.Mid); }; //涓婃寜閽� @@ -161,7 +162,7 @@ //涓嶈兘鎺у埗鏂瑰悜 this.CanDirection = false; } - else if (direction == DirectionEnum.Enable) + else { //鑳藉鎺у埗鏂瑰悜 this.CanDirection = true; @@ -191,19 +192,21 @@ } //濡傛灉浣跨敤鐗规晥鐨勮瘽 - if (this.UseClickStau == true) + if (this.AutoRecoverControlEvent != null) { //鍒囨崲鍥剧墖 this.SetDirectionImage(direction); //寮�鍚瓑寰呯嚎绋�(涓嶅厑璁哥媯鐐�) this.StartWaitThread(); + + this.AutoRecoverControlEvent?.Invoke(direction); } else { //鍒囨崲鍥剧墖 this.SetDirectionImage(DirectionEnum.Enable); + this.NotRecoverControlEvent?.Invoke(DirectionEnum.Enable); } - this.ControlEvent?.Invoke(direction); } /// <summary> @@ -213,12 +216,13 @@ private void DirectionDownClickEvent(DirectionEnum direction) { //濡傛灉涓嶄娇鐢ㄧ壒鏁堢殑璇� - if (this.CanClick == false || this.CanDirection == false || this.UseClickStau == true) + if (this.CanClick == false || this.CanDirection == false || this.NotRecoverControlEvent == null) { return; } //鍒囨崲鍥剧墖 this.SetDirectionImage(direction); + this.NotRecoverControlEvent?.Invoke(direction); } #endregion @@ -237,7 +241,7 @@ this.CanClick = true; //濡傛灉涓嶄娇鐢ㄧ壒鏁堢殑璇� - if (this.UseClickStau == false) + if (this.NotRecoverControlEvent != null) { return; } -- Gitblit v1.8.0