Added multiple asset support when right clicking + Skip Version button

This commit is contained in:
iAmAsval
2020-09-01 22:29:23 +02:00
parent 546c72d48a
commit b5560d55b9
12 changed files with 91 additions and 44 deletions

View File

@@ -130,7 +130,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.6.0" />
<PackageReference Include="Autoupdater.NET.Official" Version="1.6.2" />
<PackageReference Include="AvalonEdit" Version="6.0.1" />
<PackageReference Include="CSCore" Version="1.2.1.2" />
<PackageReference Include="DiscordRichPresence" Version="1.0.150" />

View File

@@ -179,17 +179,11 @@
<Image Source="Resources/discord.png"/>
</MenuItem.Icon>
</MenuItem>
<Separator/>
<MenuItem x:Name="FModel_MI_Help_About" Header="{x:Static properties:Resources.AboutF}" Click="FModel_MI_Help_About_Click">
<MenuItem.Icon>
<Image Source="Resources/information.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="FModel_MI_Help_Updates" Header="{x:Static properties:Resources.CheckForUpdates}" Click="FModel_MI_Help_Updates_Click">
<MenuItem.Icon>
<Image Source="Resources/refresh.png"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>

View File

@@ -47,7 +47,6 @@ namespace FModel
private async void OnClosing(object sender, CancelEventArgs e)
{
Updater.CheckForUpdate();
Globals.gNotifier.Dispose();
Tasks.TokenSource?.Dispose();
DiscordIntegration.Dispose();
@@ -69,6 +68,7 @@ namespace FModel
FModel_MI_Assets_GoTo.ItemsSource = MenuItems.customGoTos;
FModel_AssetsPathTree.ItemsSource = SortedTreeviewVm.gameFilesPath.ChildrensView;
if (!Properties.Settings.Default.SkipVersion) Updater.CheckForUpdate();
DebugHelper.WriteUserSettings();
Folders.CheckWatermarks();
@@ -180,10 +180,23 @@ namespace FModel
}
else { FWindows.GetOpenedWindow<Window>(Properties.Resources.AudioPlayer).Focus(); }
}
private void FModel_MI_Assets_Export_Click(object sender, RoutedEventArgs e)
private async void FModel_MI_Assets_Export_Click(object sender, RoutedEventArgs e)
{
if (FModel_AssetsList.HasItems && FModel_AssetsList.SelectedIndex >= 0 && FModel_AssetsList.SelectedItem is ListBoxViewModel selectedItem)
Assets.Export(selectedItem.PakEntry, false);
{
bool autoExport = FModel_AssetsList.SelectedItems.Count > 1;
if (!autoExport) Assets.Export(selectedItem.PakEntry, false); // manual export if one
else
{
bool ret = Properties.Settings.Default.AutoExport;
Properties.Settings.Default.AutoExport = autoExport;
await Assets.GetUserSelection(FModel_AssetsList.SelectedItems); // auto export if multiple
Properties.Settings.Default.AutoExport = ret;
Properties.Settings.Default.Save();
}
}
else Globals.gNotifier.ShowCustomMessage(Properties.Resources.Error, Properties.Resources.NoDataToExport);
}
private void FModel_MI_Assets_Save_Click(object sender, RoutedEventArgs e) => AvalonEditVm.avalonEditViewModel.Save(false);
@@ -266,10 +279,6 @@ namespace FModel
}
else { FWindows.GetOpenedWindow<Window>(Properties.Resources.AboutF).Focus(); }
}
private void FModel_MI_Help_Updates_Click(object sender, RoutedEventArgs e)
{
Updater.CheckForUpdate();
}
#endregion
#region TREEVIEW
@@ -414,8 +423,15 @@ namespace FModel
AvalonEditVm.avalonEditViewModel.Save(false);
else // extract (aka display) and save
{
await Assets.GetUserSelection(FModel_AssetsList.SelectedItems);
AvalonEditVm.avalonEditViewModel.Save(false);
bool autoSave = FModel_AssetsList.SelectedItems.Count > 1;
bool ret = Properties.Settings.Default.AutoSave;
Properties.Settings.Default.AutoSave = autoSave;
await Assets.GetUserSelection(FModel_AssetsList.SelectedItems); // auto save if multiple
if (!autoSave) AvalonEditVm.avalonEditViewModel.Save(false); // manual save if one
Properties.Settings.Default.AutoSave = ret;
Properties.Settings.Default.Save();
}
}
else Globals.gNotifier.ShowCustomMessage(Properties.Resources.Error, Properties.Resources.NoDataToSave);

View File

@@ -462,15 +462,6 @@ namespace FModel.Properties {
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Check For Updates.
/// </summary>
public static string CheckForUpdates {
get {
return ResourceManager.GetString("CheckForUpdates", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Chinese (Simplified).
/// </summary>
@@ -1654,6 +1645,15 @@ namespace FModel.Properties {
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Maybe Later.
/// </summary>
public static string MaybeLater {
get {
return ResourceManager.GetString("MaybeLater", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à MB.
/// </summary>
@@ -2352,6 +2352,15 @@ namespace FModel.Properties {
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Skip this Version.
/// </summary>
public static string SkipThisVersion {
get {
return ResourceManager.GetString("SkipThisVersion", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Spanish.
/// </summary>

View File

@@ -822,7 +822,10 @@ C'est maintenant le logiciel gratuit le plus utilisé pour leak sur Fortnite.</v
<data name="NoKeyWarning" xml:space="preserve">
<value>Un fichier .PAK chiffré a été trouvé. Afin de le déchiffrer, veuillez spécifier une clé de chiffrement AES fonctionnelle</value>
</data>
<data name="CheckForUpdates" xml:space="preserve">
<value>Vérifier les Mises à Jour</value>
<data name="MaybeLater" xml:space="preserve">
<value>Peut être plus tard</value>
</data>
<data name="SkipThisVersion" xml:space="preserve">
<value>Ignorer cette version</value>
</data>
</root>

View File

@@ -1075,7 +1075,10 @@ It's now the most used free software to leak on Fortnite.</value>
<data name="NoKeyWarning" xml:space="preserve">
<value>An encrypted .PAK file has been found. In order to decrypt it, please specify a working AES encryption key</value>
</data>
<data name="CheckForUpdates" xml:space="preserve">
<value>Check For Updates</value>
<data name="MaybeLater" xml:space="preserve">
<value>Maybe Later</value>
</data>
<data name="SkipThisVersion" xml:space="preserve">
<value>Skip this Version</value>
</data>
</root>

View File

@@ -12,7 +12,7 @@ namespace FModel.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -502,5 +502,17 @@ namespace FModel.Properties {
this["ChallengeBannerSecondaryColor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool SkipVersion {
get {
return ((bool)(this["SkipVersion"]));
}
set {
this["SkipVersion"] = value;
}
}
}
}

View File

@@ -32,6 +32,7 @@ namespace FModel.Properties
}
}
Default.SkipVersion = false; // just in case
Default.UpdateSettings = false; // just in case
Default.Save();
}

View File

@@ -53,9 +53,9 @@
<Setting Name="AudioPlayerDevice" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="AudioPlayerVolume" Type="System.String" Scope="User">
<Value Profile="(Default)">0.5</Value>
</Setting>
<Setting Name="AudioPlayerVolume" Type="System.String" Scope="User">
<Value Profile="(Default)">0.5</Value>
</Setting>
<Setting Name="AutoExport" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
@@ -68,15 +68,15 @@
<Setting Name="CustomGoTos" Type="System.String" Scope="User">
<Value Profile="(Default)">[{"Header":"Cosmetics","DirectoryPath":"FortniteGame/Content/Athena/Items/Cosmetics/"},{"Header":"Challenges","DirectoryPath":"FortniteGame/Content/Athena/Items/ChallengeBundles/"},{"Header":"Emotes [Audio]","DirectoryPath":"FortniteGame/Content/Athena/Sounds/Emotes/"},{"Header":"Music Packs [Audio]","DirectoryPath":"FortniteGame/Content/Athena/Sounds/MusicPacks/"},{"Header":"Weapons","DirectoryPath":"FortniteGame/Content/Athena/Items/Weapons/"},{"Header":"Strings","DirectoryPath":"FortniteGame/Content/Localization/"}]</Value>
</Setting>
<Setting Name="ProgramLanguage" Type="System.Int64" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="ProgramLanguage" Type="System.Int64" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="AssetsLanguage" Type="System.Int64" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="AssetsJsonType" Type="System.Int64" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="AssetsJsonType" Type="System.Int64" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="AssetsIconDesign" Type="System.Int64" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
@@ -122,5 +122,8 @@
<Setting Name="ChallengeBannerSecondaryColor" Type="System.String" Scope="User">
<Value Profile="(Default)">2848A3</Value>
</Setting>
<Setting Name="SkipVersion" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -41,14 +41,19 @@ namespace FModel.Utils
MessageBoxResult dialogResult = DarkMessageBoxHelper.ShowYesNoCancel(
string.Format(Properties.Resources.UpdateAvailableConfirm, args.CurrentVersion, args.InstalledVersion),
Properties.Resources.UpdateAvailable,
Properties.Resources.YesShowChangelog,
Properties.Resources.Yes,
Properties.Resources.No);
Properties.Resources.YesShowChangelog, // Yes
Properties.Resources.MaybeLater, // No
Properties.Resources.SkipThisVersion); // Cancel
if (dialogResult == MessageBoxResult.Yes)
Process.Start(new ProcessStartInfo { FileName = args.ChangelogURL, UseShellExecute = true });
if (dialogResult == MessageBoxResult.Cancel)
{
Properties.Settings.Default.SkipVersion = true;
Properties.Settings.Default.Save();
}
if (dialogResult == MessageBoxResult.Yes || dialogResult == MessageBoxResult.No || dialogResult == MessageBoxResult.OK)
if (dialogResult == MessageBoxResult.Yes || dialogResult == MessageBoxResult.OK)
{
try
{

View File

@@ -68,7 +68,7 @@
<Image x:Name="Preview_Img" Width="512" Height="512"/>
</Border>
<Slider x:Name="ImTheSlider" Style="{StaticResource Horizontal_Slider}"
Grid.Row="1" Margin="0,3,0,0" TickPlacement="None" Value="7" IsSnapToTickEnabled="True"
Grid.Row="1" Margin="0,3,0,0" TickPlacement="None" IsSnapToTickEnabled="True"
Minimum="2" Maximum="20" TickFrequency="1" Thumb.DragCompleted="DrawPreview"/>
<Button x:Name="OpenImageBtn" Grid.Row="2"
Content="{x:Static properties:Resources.OpenImage}"

View File

@@ -139,6 +139,7 @@ namespace FModel.Windows.ImagesMerger
});
}
ImTheSlider.Value = Math.Min(Images_LstBx.Items.Count, Math.Round(Math.Sqrt(Images_LstBx.Items.Count)));
await DrawPreview().ConfigureAwait(false);
}
}