mirror of
https://github.com/k1tbyte/Wand-Enhancer.git
synced 2026-08-29 01:08:51 +00:00
fixed source stack panel, added autoscroll to the log when adding an entry
This commit is contained in:
@@ -17,6 +17,7 @@ namespace WeModPatcher.View.MainWindow
|
||||
|
||||
public class MainWindowVm : ObservableObject
|
||||
{
|
||||
private readonly MainWindow _view;
|
||||
public ObservableCollection<LogEntry> LogList { get; } = new ObservableCollection<LogEntry>();
|
||||
|
||||
private string _weModPath;
|
||||
@@ -153,6 +154,7 @@ namespace WeModPatcher.View.MainWindow
|
||||
}
|
||||
|
||||
File.Copy(backupPath, Path.Combine(WeModPath, "resources", "app.asar"), true);
|
||||
File.Delete(backupPath);
|
||||
Log("Backup restored successfully.", ELogType.Success);
|
||||
AlreadyPatched = false;
|
||||
IsPatchEnabled = true;
|
||||
@@ -181,16 +183,19 @@ namespace WeModPatcher.View.MainWindow
|
||||
{
|
||||
message = $"[{logType.ToString().ToUpper()}] {message}";
|
||||
|
||||
LogList.Add(new LogEntry
|
||||
var entry = new LogEntry
|
||||
{
|
||||
LogType = logType,
|
||||
Message = message
|
||||
});
|
||||
};
|
||||
LogList.Add(entry);
|
||||
_view.LogList.ScrollIntoView(entry);
|
||||
});
|
||||
}
|
||||
|
||||
public MainWindowVm()
|
||||
public MainWindowVm(MainWindow view)
|
||||
{
|
||||
_view = view;
|
||||
SetFolderPathCommand = new RelayCommand(OnFolderPathSelection);
|
||||
ApplyPatchCommand = new RelayCommand(OnPatching);
|
||||
RestoreBackupCommand = new RelayCommand(OnBackupRestoring);
|
||||
|
||||
Reference in New Issue
Block a user