Skip to content

Commit

Permalink
bug修复
Browse files Browse the repository at this point in the history
  • Loading branch information
MakesYT committed Oct 2, 2023
1 parent 85de1bd commit d76698c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Core/SDKs/HotKey/HotKeyModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public bool IsSelectWin
/// <summary>
/// 选中的按键
/// </summary>
public EKey? SelectKey
public EKey SelectKey
{
get;
set;
Expand Down
2 changes: 1 addition & 1 deletion Core/SDKs/Tools/DelayAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Core.SDKs.Tools;

public class DelayAction
{
private readonly string _lock1 = "0";
private readonly object _lock1 = new();
private Timer? _timerDbc;

/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions uToolkitopia/Converter/HotKeysToHotKeyShow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public object Convert(object? value, Type targetType, object parameter, CultureI
return false;
});
var type = 0000;
if (hotKeyModel == null)
{
return type;
}

if (hotKeyModel.IsSelectAlt)
{
type += 10;
Expand Down
5 changes: 5 additions & 0 deletions uToolkitopia/Converter/HotKeysToKeyName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public object Convert(object? value, Type targetType, object parameter, CultureI
return false;
});
if (hotKeyModel == null)
{
return string.Empty;
}

return hotKeyModel.SelectKey.ToString();
}

Expand Down
4 changes: 2 additions & 2 deletions uToolkitopia/Services/ToastService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public void showMessageBox(string Title, string Content, Action? yesAction, Acti
{
case MessageBoxResult.Primary:
{
yesAction.Invoke();
yesAction?.Invoke();
break;
}
case MessageBoxResult.None:
{
noAction.Invoke();
noAction?.Invoke();
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion uToolkitopia/View/HotKeyEditorWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
return;
}

_hotKeyModel.SelectKey = selectedKey;
_hotKeyModel.SelectKey = selectedKey.Value;
ConfigManger.Save();
setSuccess = ((MainWindow)ServiceManager.Services.GetService(typeof(MainWindow))).HotKeySet(_hotKeyModel);
if (!setSuccess)
Expand Down

0 comments on commit d76698c

Please sign in to comment.