RynthSuite as of 2026-09-27 (internal 1816d05): AutoVendor (UtilityBelt port), missile/magic facing and arc line of sight, nav waypoint skipping, rebuff batch and item-enchant fixes, crafting fallback, Loot Editor AutoVendor folder and command-line open, release 2026.9.27.2
This commit is contained in:
parent
a19ee1904e
commit
d55ffda4ed
33 changed files with 4364 additions and 207 deletions
|
|
@ -15,6 +15,9 @@ namespace RynthCore.LootEditor;
|
|||
public class MainViewModel : INotifyPropertyChanged
|
||||
{
|
||||
private const string DefaultFolder = @"C:\Games\RynthSuite\RynthAi\LootProfiles";
|
||||
// RynthAi's AutoVendor reads <Vendor Name>.utl / default.utl from here (and from
|
||||
// AutoVendor folders per server and per character, which IsAutoVendorPath also covers).
|
||||
private const string AutoVendorFolder = @"C:\Games\RynthSuite\RynthAi\AutoVendor";
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
private void Set<T>(ref T field, T value, [CallerMemberName] string? name = null)
|
||||
|
|
@ -172,6 +175,42 @@ public class MainViewModel : INotifyPropertyChanged
|
|||
{
|
||||
string baseName = string.IsNullOrEmpty(_filePath) ? "untitled.utl" : Path.GetFileName(_filePath);
|
||||
WindowTitle = $"RynthCore Loot Editor — {baseName}{(_dirty ? "*" : "")}";
|
||||
|
||||
// The folder switch follows the open file, so Save As lands next to it.
|
||||
if (!string.IsNullOrEmpty(_filePath))
|
||||
UseAutoVendorFolder = IsAutoVendorPath(_filePath);
|
||||
Notify(nameof(IsAutoVendorProfile));
|
||||
}
|
||||
|
||||
// ── Profile folder (Loot / AutoVendor) ───────────────────────────────────
|
||||
|
||||
private bool _useAutoVendorFolder;
|
||||
/// <summary>Open / Save start in the AutoVendor folder instead of LootProfiles.</summary>
|
||||
public bool UseAutoVendorFolder
|
||||
{
|
||||
get => _useAutoVendorFolder;
|
||||
set
|
||||
{
|
||||
Set(ref _useAutoVendorFolder, value);
|
||||
Notify(nameof(UseLootFolder));
|
||||
Notify(nameof(ProfileFolderHint));
|
||||
Notify(nameof(IsAutoVendorProfile));
|
||||
}
|
||||
}
|
||||
public bool UseLootFolder => !_useAutoVendorFolder;
|
||||
public string ProfileFolderHint => $"Open and Save start in {(_useAutoVendorFolder ? AutoVendorFolder : DefaultFolder)}";
|
||||
|
||||
/// <summary>An AutoVendor profile is open (or, for an unsaved one, the AutoVendor folder is picked).</summary>
|
||||
public bool IsAutoVendorProfile =>
|
||||
string.IsNullOrEmpty(_filePath) ? _useAutoVendorFolder : IsAutoVendorPath(_filePath);
|
||||
|
||||
private static bool IsAutoVendorPath(string path)
|
||||
{
|
||||
string? dir = Path.GetDirectoryName(Path.GetFullPath(path));
|
||||
for (; !string.IsNullOrEmpty(dir); dir = Path.GetDirectoryName(dir))
|
||||
if (string.Equals(Path.GetFileName(dir), "AutoVendor", StringComparison.OrdinalIgnoreCase))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// ── Picker option lists ──────────────────────────────────────────────────
|
||||
|
|
@ -207,6 +246,7 @@ public class MainViewModel : INotifyPropertyChanged
|
|||
public RelayCommand RuleMoveUp { get; }
|
||||
public RelayCommand RuleMoveDown { get; }
|
||||
public RelayCommand SetActionFilter { get; }
|
||||
public RelayCommand SetProfileFolder { get; }
|
||||
public RelayCommand CondAdd { get; }
|
||||
public RelayCommand CondDelete { get; }
|
||||
public RelayCommand CondMoveUp { get; }
|
||||
|
|
@ -239,6 +279,8 @@ public class MainViewModel : INotifyPropertyChanged
|
|||
_ => null,
|
||||
};
|
||||
});
|
||||
SetProfileFolder = new RelayCommand(arg =>
|
||||
UseAutoVendorFolder = string.Equals(arg as string, "AutoVendor", StringComparison.OrdinalIgnoreCase));
|
||||
CondAdd = new RelayCommand(_ => DoCondAdd());
|
||||
CondDelete = new RelayCommand(_ => DoCondDelete(), _ => _selectedCondition != null);
|
||||
CondMoveUp = new RelayCommand(_ => DoCondMove(-1), _ => CanMoveCond(-1));
|
||||
|
|
@ -273,6 +315,40 @@ public class MainViewModel : INotifyPropertyChanged
|
|||
LoadProfile(new VTankLootProfile());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the profile named on the command line (RynthAi's dashboard Edit button passes
|
||||
/// the loot profile in use, or the open vendor's AutoVendor profile). A path that doesn't
|
||||
/// exist yet starts an empty profile that saves there - how a vendor gets its first one.
|
||||
/// </summary>
|
||||
public void OpenFromCommandLine(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
path = Path.GetFullPath(path);
|
||||
if (File.Exists(path))
|
||||
{
|
||||
VTankLootProfile loaded = path.EndsWith(".json", StringComparison.OrdinalIgnoreCase)
|
||||
? ConvertFromJson(path)
|
||||
: VTankLootParser.Load(path);
|
||||
_filePath = path;
|
||||
SearchText = "";
|
||||
LoadProfile(loaded);
|
||||
Status($"Opened {Path.GetFileName(path)} ({loaded.Rules.Count} rules)");
|
||||
}
|
||||
else
|
||||
{
|
||||
_filePath = path;
|
||||
SearchText = "";
|
||||
LoadProfile(new VTankLootProfile());
|
||||
Status($"New profile - Save writes {path}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Status($"Could not open {path}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DoOpenAsync()
|
||||
{
|
||||
if (!ConfirmDiscard()) return;
|
||||
|
|
@ -685,8 +761,13 @@ public class MainViewModel : INotifyPropertyChanged
|
|||
|
||||
private async Task<IStorageFolder?> GetFolderAsync()
|
||||
{
|
||||
if (Directory.Exists(DefaultFolder))
|
||||
return await _window.StorageProvider.TryGetFolderFromPathAsync(DefaultFolder);
|
||||
string folder = _useAutoVendorFolder ? AutoVendorFolder : DefaultFolder;
|
||||
if (_useAutoVendorFolder && !Directory.Exists(folder))
|
||||
{
|
||||
try { Directory.CreateDirectory(folder); } catch { }
|
||||
}
|
||||
if (Directory.Exists(folder))
|
||||
return await _window.StorageProvider.TryGetFolderFromPathAsync(folder);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue