mirror of
https://github.com/4sval/FModel.git
synced 2026-03-25 03:04:53 -05:00
don't you dare tell me you don't know where things go now
This commit is contained in:
parent
d02272b82d
commit
eecf5f16ce
|
|
@ -175,6 +175,9 @@ public partial class MainWindow
|
|||
if (AssetsFolderName.SelectedItem is TreeItem folder)
|
||||
{
|
||||
await _threadWorkerView.Begin(cancellationToken => { _applicationView.CUE4Parse.ExportFolder(cancellationToken, folder); });
|
||||
FLogger.AppendInformation();
|
||||
FLogger.AppendText("Successfully exported ", Constants.WHITE);
|
||||
FLogger.AppendLink(folder.PathAtThisPoint, UserSettings.Default.RawDataDirectory, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,8 @@ public class AudioPlayerViewModel : ViewModel, ISource, IDisposable
|
|||
{
|
||||
Log.Information("{FileName} successfully saved", fileToSave.FileName);
|
||||
FLogger.AppendInformation();
|
||||
FLogger.AppendText($"Successfully saved '{fileToSave.FileName}'", Constants.WHITE, true);
|
||||
FLogger.AppendText("Successfully saved ", Constants.WHITE);
|
||||
FLogger.AppendLink(fileToSave.FileName, path, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ public class BackupManagerViewModel : ViewModel
|
|||
{
|
||||
Log.Information("{FileName} successfully {Type}", fileName, type1);
|
||||
FLogger.AppendInformation();
|
||||
FLogger.AppendText($"Successfully {type1} '{fileName}'", Constants.WHITE, true);
|
||||
FLogger.AppendText($"Successfully {type1} ", Constants.WHITE);
|
||||
FLogger.AppendLink(fileName, fullPath, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -113,4 +114,4 @@ public class BackupManagerViewModel : ViewModel
|
|||
FLogger.AppendText($"Could not {type2} '{fileName}'", Constants.WHITE, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -897,7 +897,8 @@ public class CUE4ParseViewModel : ViewModel
|
|||
{
|
||||
Log.Information("Successfully saved {FilePath}", savedFilePath);
|
||||
FLogger.AppendInformation();
|
||||
FLogger.AppendText($"Successfully saved {label}", Constants.WHITE, true);
|
||||
FLogger.AppendText("Successfully saved ", Constants.WHITE);
|
||||
FLogger.AppendLink(label, savedFilePath, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -912,9 +913,10 @@ public class CUE4ParseViewModel : ViewModel
|
|||
var fileName = fullPath.SubstringAfterLast('/');
|
||||
if (Provider.TrySavePackage(fullPath, out var assets))
|
||||
{
|
||||
string path = UserSettings.Default.RawDataDirectory;
|
||||
Parallel.ForEach(assets, kvp =>
|
||||
{
|
||||
var path = Path.Combine(UserSettings.Default.RawDataDirectory, UserSettings.Default.KeepDirectoryStructure ? kvp.Key : kvp.Key.SubstringAfterLast('/')).Replace('\\', '/');
|
||||
path = Path.Combine(path, UserSettings.Default.KeepDirectoryStructure ? kvp.Key : kvp.Key.SubstringAfterLast('/')).Replace('\\', '/');
|
||||
Directory.CreateDirectory(path.SubstringBeforeLast('/'));
|
||||
File.WriteAllBytes(path, kvp.Value);
|
||||
});
|
||||
|
|
@ -923,9 +925,9 @@ public class CUE4ParseViewModel : ViewModel
|
|||
{
|
||||
Log.Information("{FileName} successfully exported", fileName);
|
||||
FLogger.AppendInformation();
|
||||
FLogger.AppendText($"Successfully exported '{fileName}'", Constants.WHITE, true);
|
||||
FLogger.AppendText("Successfully exported ", Constants.WHITE);
|
||||
FLogger.AppendLink(fileName, path, true);
|
||||
}
|
||||
else ApplicationService.ApplicationView.Status.UpdateStatusLabel($"Raw Data for {fullPath.SubstringAfterLast('/')}");
|
||||
}
|
||||
else if (updateUi)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -379,7 +379,8 @@ public class TabItem : ViewModel
|
|||
{
|
||||
Log.Information("{FileName} successfully saved", fileName);
|
||||
FLogger.AppendInformation();
|
||||
FLogger.AppendText($"Successfully saved '{fileName}'", Constants.WHITE, true);
|
||||
FLogger.AppendText("Successfully saved ", Constants.WHITE);
|
||||
FLogger.AppendLink(fileName, path, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -280,7 +280,8 @@ public partial class ImageMerger
|
|||
{
|
||||
Log.Information("{FileName} successfully saved", fileName);
|
||||
FLogger.AppendInformation();
|
||||
FLogger.AppendText($"Successfully saved '{fileName}'", Constants.WHITE, true);
|
||||
FLogger.AppendText("Successfully saved ", Constants.WHITE);
|
||||
FLogger.AppendLink(fileName, path, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -294,4 +295,4 @@ public partial class ImageMerger
|
|||
{
|
||||
ClipboardExtensions.SetImage(_imageBuffer, FILENAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace FModel.Views.Resources.Controls;
|
||||
|
|
@ -46,6 +48,33 @@ public class FLogger : ITextFormatter
|
|||
});
|
||||
}
|
||||
|
||||
public static void AppendLink(string message, string url, bool newLine = false)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(delegate
|
||||
{
|
||||
var link = new Hyperlink(new Run(newLine ? $"{message}{Environment.NewLine}" : message), Logger.Document.ContentEnd)
|
||||
{
|
||||
NavigateUri = new Uri(url),
|
||||
OverridesDefaultStyle = true,
|
||||
Style = new Style(typeof(Hyperlink)) { Setters =
|
||||
{
|
||||
new Setter(FrameworkContentElement.CursorProperty, Cursors.Hand),
|
||||
new Setter(TextBlock.TextDecorationsProperty, TextDecorations.Underline),
|
||||
new Setter(TextElement.ForegroundProperty, Brushes.Cornsilk)
|
||||
}}
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
link.Click += (sender, _) => Process.Start("explorer.exe", $"/select, \"{((Hyperlink)sender).NavigateUri.AbsoluteUri}\"");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Logger.ScrollToEnd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public string GetText(FlowDocument document)
|
||||
{
|
||||
return new TextRange(document.ContentStart, document.ContentEnd).Text;
|
||||
|
|
@ -168,4 +197,4 @@ public class CustomRichTextBox : RichTextBox
|
|||
UpdateTextFromDocument();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1367,6 +1367,7 @@
|
|||
<Style x:Key="CustomRichTextBox" TargetType="RichTextBox">
|
||||
<Setter Property="Height" Value="175" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="IsDocumentEnabled" Value="True" />
|
||||
<Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer3BackgroundBrush}}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer3BorderBrush}}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user