Skip to content

Commit

Permalink
修复 保存情景后无法即使显示
Browse files Browse the repository at this point in the history
修复 无法正常显示重复设置的按键
  • Loading branch information
MakesYT committed Nov 10, 2023
1 parent 953a6d5 commit 30dabe4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Core/SDKs/CustomScenario/CustomScenarioManger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ public static void Init()

public static void Save(SDKs.CustomScenario.CustomScenario scenario)
{
if (scenario.UUID is null)
if (!CustomScenarios.Contains(scenario))
{
var s = Guid.NewGuid().ToString();
scenario.UUID = s;
CustomScenarios.Add(scenario);
}

Expand Down
9 changes: 8 additions & 1 deletion uToolkitopia/Controls/HotKeyShow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ public enum KeyTypeE
typeof(HotKeyModel), typeof(HotKeyShow),
new PropertyMetadata(null, (o, args) =>
{
HotKeyModelChanged((HotKeyModel)args.NewValue, (HotKeyShow)o);
var argsNewValue = (HotKeyModel)args.NewValue;
if (argsNewValue is null)
{
return;
}
((HotKeyShow)o).HotKeyName = argsNewValue.SignName;
HotKeyModelChanged(argsNewValue, (HotKeyShow)o);
}));

public static readonly DependencyProperty KeyTypeProperty = DependencyProperty.Register(nameof(KeyType),
Expand Down

0 comments on commit 30dabe4

Please sign in to comment.