Skip to content

Commit a606eb0

Browse files
author
DiabloMFHelper
committed
fix:删除掉落记录
1 parent 69d26e3 commit a606eb0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

UI/Timer/LootRecordsControl.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ public Task<bool> DeleteSelectedLootAsync()
148148
return Task.FromResult(false);
149149
if (_currentProfile == null || gridLoot.SelectedRows.Count == 0)
150150
return Task.FromResult(false);
151-
152151
try
153152
{
154153
// 【新增】设置标志位
@@ -205,4 +204,6 @@ public void ClearSelection()
205204
}
206205

207206
public bool HasFocus => gridLoot.ContainsFocus;
207+
208+
public bool HasSelectedRecords => gridLoot.SelectedRows.Count > 0;
208209
}

UI/Timer/TimerControl.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,8 @@ public void HandleLootAdded()
334334
// 路由删除逻辑
335335
public async Task<bool> DeleteSelectedRecordAsync()
336336
{
337-
// 逻辑:如果 Loot 控件拥有焦点,则删除 Loot;否则默认删除 History
338-
339-
if (lootRecordsControl != null && lootRecordsControl.HasFocus)
337+
// 逻辑:如果 Loot 控件有选中记录,则删除 Loot;否则默认删除 History
338+
if (lootRecordsControl != null && (lootRecordsControl.HasFocus || lootRecordsControl.HasSelectedRecords))
340339
{
341340
return await lootRecordsControl.DeleteSelectedLootAsync();
342341
}

0 commit comments

Comments
 (0)