mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-31 10:29:52 +08:00
53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using BetterGenshinImpact.Core.Config;
|
|
using BetterGenshinImpact.GameTask;
|
|
using BetterGenshinImpact.Model;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using System.ComponentModel;
|
|
|
|
namespace BetterGenshinImpact.ViewModel.Pages.View;
|
|
|
|
public partial class PathingConfigViewModel : ObservableObject, IViewModel
|
|
{
|
|
public AllConfig Config { get; } = TaskContext.Instance().Config;
|
|
|
|
[RelayCommand]
|
|
public void OnAddPartyConditionConfig()
|
|
{
|
|
Config.PathingConditionConfig.PartyConditions.Add(new Condition());
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void OnRemovePartyConditionConfig(object? item)
|
|
{
|
|
if (item is Condition condition)
|
|
{
|
|
Config.PathingConditionConfig.PartyConditions.Remove(condition);
|
|
}
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void OnAddAvatarConditionConfig()
|
|
{
|
|
Config.PathingConditionConfig.AvatarConditions.Add(new Condition
|
|
{
|
|
Subject = "队伍中角色"
|
|
});
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void OnRemoveAvatarConditionConfig(object? item)
|
|
{
|
|
if (item is Condition condition)
|
|
{
|
|
Config.PathingConditionConfig.AvatarConditions.Remove(condition);
|
|
}
|
|
}
|
|
|
|
[RelayCommand]
|
|
private void OnClosing(CancelEventArgs e)
|
|
{
|
|
TaskContext.Instance().Config.OnAnyChangedAction?.Invoke();
|
|
}
|
|
}
|