mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-15 07:43:20 +08:00
update pating ui
This commit is contained in:
@@ -43,4 +43,10 @@ public partial class FileTreeNode<T> : ObservableObject
|
||||
// 子节点列表
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<FileTreeNode<T>> _children = [];
|
||||
|
||||
public T BuildValue()
|
||||
{
|
||||
Value = default!;
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
Margin="0,0,0,8"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
TextWrapping="Wrap">
|
||||
可以实现自动采集、自动挖矿(开发中)、自动锄地(开发中)等功能。建议在调度器中使用!<Hyperlink Command="{Binding GoToPathingUrlCommand}" Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}">
|
||||
可以实现自动采集、自动挖矿(开发中)、自动锄地(开发中)等功能。请调度器中使用!<Hyperlink Command="{Binding GoToPathingUrlCommand}" Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}">
|
||||
点击查看地图追踪与录制使用教程
|
||||
</Hyperlink>
|
||||
</ui:TextBlock>
|
||||
@@ -81,7 +81,7 @@
|
||||
BorderThickness="1"
|
||||
CornerRadius="{DynamicResource ControlCornerRadius}">
|
||||
<Grid Margin="4">
|
||||
<ui:Grid ColumnDefinitions="*,130" Visibility="Hidden">
|
||||
<ui:Grid ColumnDefinitions="*,10" Visibility="Hidden">
|
||||
<Grid x:Name="TreeColumnStar" Grid.Column="0" />
|
||||
</ui:Grid>
|
||||
<ui:TreeListView BorderThickness="0" ItemsSource="{Binding TreeList}">
|
||||
@@ -94,20 +94,24 @@
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
<ui:GridViewColumn Width="120"
|
||||
<!--<ui:GridViewColumn Width="120"
|
||||
DisplayMemberBinding="{Binding Author}"
|
||||
Header="作者" />
|
||||
Header="作者" />-->
|
||||
</GridViewColumnCollection>
|
||||
</ui:TreeListView.Columns>
|
||||
<ui:TreeListView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children}" />
|
||||
</ui:TreeListView.ItemTemplate>
|
||||
<ui:TreeListView.ContextMenu>
|
||||
<!--<ui:TreeListView.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Command="{Binding EditCommand}" Header="编辑" />
|
||||
<MenuItem Command="{Binding DeleteCommand}" Header="删除" />
|
||||
<MenuItem Command="{Binding StartCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}"
|
||||
Header="执行任务" />
|
||||
<MenuItem Command="{Binding RefreshCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}"
|
||||
Header="刷新" />
|
||||
</ContextMenu>
|
||||
</ui:TreeListView.ContextMenu>
|
||||
</ui:TreeListView.ContextMenu>-->
|
||||
</ui:TreeListView>
|
||||
</Grid>
|
||||
</ui:Border>
|
||||
|
||||
@@ -15,6 +15,7 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using BetterGenshinImpact.Core.Script;
|
||||
using Wpf.Ui.Controls;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages;
|
||||
|
||||
@@ -73,21 +74,24 @@ public partial class MapPathingViewModel(IScriptService scriptService, IConfigSe
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async void OnStart(PathingTask? item)
|
||||
public async void OnStart(FileTreeNode<PathingTask>? item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (item.IsDirectory)
|
||||
{
|
||||
Toast.Warning("执行多个地图追踪任务的时候,请使用调度器功能");
|
||||
return;
|
||||
}
|
||||
|
||||
// new TaskRunner(DispatcherTimerOperationEnum.UseCacheImageWithTriggerEmpty)
|
||||
// .FireAndForget(async () =>
|
||||
// {
|
||||
// TaskTriggerDispatcher.Instance().AddTrigger("AutoPick", null);
|
||||
// await new PathExecutor(CancellationContext.Instance.Cts).Pathing(item);
|
||||
// });
|
||||
if (string.IsNullOrEmpty(item.FilePath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var fileInfo = new FileInfo(item.FullPath);
|
||||
var fileInfo = new FileInfo(item.FilePath);
|
||||
var project = ScriptGroupProject.BuildPathingProject(fileInfo.Name, fileInfo.DirectoryName!);
|
||||
await scriptService.RunMulti([project]);
|
||||
}
|
||||
@@ -120,7 +124,7 @@ public partial class MapPathingViewModel(IScriptService scriptService, IConfigSe
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void OnRefresh(PathingTask? item)
|
||||
public void OnRefresh(object? item)
|
||||
{
|
||||
InitScriptListViewData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user