mirror of
https://github.com/4sval/FModel.git
synced 2026-06-21 07:20:05 -05:00
added pakChunkEarly-WindowsClient.pak support + copy image
This commit is contained in:
parent
24be46e3cc
commit
0cb78ee0f2
|
|
@ -69,7 +69,7 @@ namespace FModel.Creator
|
|||
/// 1. order doesn't matter
|
||||
/// 2. the importance here is to get the description before gameplay tags
|
||||
/// </summary>
|
||||
public BaseIcon(IUExport export, string exportType, string assetName) : this()
|
||||
public BaseIcon(IUExport export, string exportType, ref string assetName) : this()
|
||||
{
|
||||
// rarity
|
||||
if (export.GetExport<ObjectProperty>("Series") is ObjectProperty series)
|
||||
|
|
@ -81,7 +81,7 @@ namespace FModel.Creator
|
|||
|
||||
// image
|
||||
if (Properties.Settings.Default.UseItemShopIcon &&
|
||||
DisplayAssetImage.GetDisplayAssetImage(this, export.GetExport<SoftObjectProperty>("DisplayAssetPath"), assetName))
|
||||
DisplayAssetImage.GetDisplayAssetImage(this, export.GetExport<SoftObjectProperty>("DisplayAssetPath"), ref assetName))
|
||||
{ } // ^^^^ will return false if image not found, if so, we try to get the normal icon
|
||||
else if (export.GetExport<ObjectProperty>("HeroDefinition", "WeaponDefinition") is ObjectProperty itemDef)
|
||||
LargeSmallImage.GetPreviewImage(this, itemDef, assetName);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace FModel.Creator
|
|||
case "FortWeaponMeleeDualWieldItemDefinition":
|
||||
case "FortDailyRewardScheduleTokenDefinition":
|
||||
{
|
||||
BaseIcon icon = new BaseIcon(export, exportType, assetName);
|
||||
BaseIcon icon = new BaseIcon(export, exportType, ref assetName);
|
||||
int height = icon.Size + icon.AdditionalSize;
|
||||
using (var ret = new SKBitmap(icon.Size, height, SKColorType.Rgba8888, SKAlphaType.Opaque))
|
||||
using (var c = new SKCanvas(ret))
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace FModel.Creator.Icons
|
|||
{
|
||||
static class DisplayAssetImage
|
||||
{
|
||||
public static bool GetDisplayAssetImage(BaseIcon icon, SoftObjectProperty o, string assetName)
|
||||
public static bool GetDisplayAssetImage(BaseIcon icon, SoftObjectProperty o, ref string assetName)
|
||||
{
|
||||
string imageType = "DetailsImage";
|
||||
switch ("DA_Featured_" + assetName)
|
||||
|
|
@ -44,6 +44,7 @@ namespace FModel.Creator.Icons
|
|||
if (!resourceObject.Value.Resource.OuterIndex.Resource.ObjectName.String.Contains("/Game/Athena/Prototype/Textures/"))
|
||||
{
|
||||
icon.IconImage = Utils.GetObjectTexture(resourceObject);
|
||||
assetName = "DA_Featured_" + assetName;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,12 +122,13 @@
|
|||
<PackageReference Include="AvalonEdit" Version="6.0.1" />
|
||||
<PackageReference Include="CSCore" Version="1.2.1.2" />
|
||||
<PackageReference Include="DiscordRichPresence" Version="1.0.150" />
|
||||
<PackageReference Include="DotNetZip" Version="1.13.7" />
|
||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="3.8.1" />
|
||||
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.1.11" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="NVorbis" Version="0.10.1" />
|
||||
<PackageReference Include="Ookii.Dialogs.Wpf" Version="1.1.0" />
|
||||
<PackageReference Include="SkiaSharp" Version="1.68.2.1" />
|
||||
<PackageReference Include="SkiaSharp" Version="1.68.3" />
|
||||
<PackageReference Include="ToastNotifications" Version="2.5.1" />
|
||||
<PackageReference Include="ToastNotifications.Messages" Version="2.5.1" />
|
||||
<PackageReference Include="WriteableBitmapEx" Version="1.6.5" />
|
||||
|
|
|
|||
|
|
@ -37,9 +37,6 @@ namespace FModel.Grabber.Paks
|
|||
{
|
||||
foreach (string pak in Directory.GetFiles(Properties.Settings.Default.PakPath, "*.pak"))
|
||||
{
|
||||
if (pak.Contains("pakChunkEarly-WindowsClient.pak"))
|
||||
continue;
|
||||
|
||||
if (!Utils.Paks.IsFileReadLocked(new FileInfo(pak)))
|
||||
{
|
||||
PakFileReader pakFile = new PakFileReader(pak);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@
|
|||
</MenuItem>
|
||||
<MenuItem x:Name="FModel_MI_Directory_Save" Header="{x:Static properties:Resources.SaveDirectory}" Click="FModel_MI_Directory_Save_Click">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="Resources/content-save.png"/>
|
||||
<Image Source="Resources/sign-direction-plus.png"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
|
|
@ -247,6 +247,11 @@
|
|||
<Image Source="Resources/open-in-new.png"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static properties:Resources.CopyImage}" Click="FModel_MI_Assets_CopyImage_Click">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="Resources/content-copy.png"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static properties:Resources.SaveImage}" Click="FModel_MI_Assets_SaveImage_Click">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="Resources/image-move.png"/>
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ namespace FModel
|
|||
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);
|
||||
private void FModel_MI_Assets_CopyImage_Click(object sender, RoutedEventArgs e) => ImageBoxVm.imageBoxViewModel.Copy();
|
||||
private void FModel_MI_Assets_SaveImage_Click(object sender, RoutedEventArgs e) => ImageBoxVm.imageBoxViewModel.Save(false);
|
||||
private void FModel_MI_Assets_OpenOutputFolder_Click(object sender, RoutedEventArgs e) => Process.Start(new ProcessStartInfo { FileName = Properties.Settings.Default.OutputPath, UseShellExecute = true });
|
||||
private void FModel_MI_Assets_ImageMerger_Click(object sender, RoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Ionic.Zlib;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace PakReader.Parsers.Objects
|
||||
|
|
@ -133,8 +134,6 @@ namespace PakReader.Parsers.Objects
|
|||
|
||||
public ArraySegment<byte> GetData(Stream stream, byte[] key)
|
||||
{
|
||||
if (CompressionMethodIndex != 0)
|
||||
throw new NotImplementedException("Decompression not yet implemented");
|
||||
lock (stream)
|
||||
{
|
||||
stream.Position = Offset + StructSize;
|
||||
|
|
@ -142,13 +141,21 @@ namespace PakReader.Parsers.Objects
|
|||
{
|
||||
var data = new byte[(Size & 15) == 0 ? Size : ((Size / 16) + 1) * 16];
|
||||
stream.Read(data);
|
||||
return new ArraySegment<byte>(AESDecryptor.DecryptAES(data, key), 0, (int)UncompressedSize);
|
||||
|
||||
if (CompressionMethodIndex == 1)
|
||||
return new ArraySegment<byte>(AESDecryptor.DecryptAES(ZlibStream.UncompressBuffer(data), key), 0, (int)UncompressedSize);
|
||||
else
|
||||
return new ArraySegment<byte>(AESDecryptor.DecryptAES(data, key), 0, (int)UncompressedSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
var data = new byte[UncompressedSize];
|
||||
stream.Read(data);
|
||||
return new ArraySegment<byte>(data);
|
||||
|
||||
if (CompressionMethodIndex == 1)
|
||||
return new ArraySegment<byte>(ZlibStream.UncompressBuffer(data));
|
||||
else
|
||||
return new ArraySegment<byte>(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
18
FModel/Properties/Resources.Designer.cs
generated
18
FModel/Properties/Resources.Designer.cs
generated
|
|
@ -576,6 +576,15 @@ namespace FModel.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une chaîne localisée semblable à Copy Image.
|
||||
/// </summary>
|
||||
public static string CopyImage {
|
||||
get {
|
||||
return ResourceManager.GetString("CopyImage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une chaîne localisée semblable à Copied!.
|
||||
/// </summary>
|
||||
|
|
@ -1774,6 +1783,15 @@ namespace FModel.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une chaîne localisée semblable à There is currently no image to copy.
|
||||
/// </summary>
|
||||
public static string NoImageToCopy {
|
||||
get {
|
||||
return ResourceManager.GetString("NoImageToCopy", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une chaîne localisée semblable à There is currently no image to save.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -853,4 +853,7 @@ C'est maintenant le logiciel gratuit le plus utilisé pour leak sur Fortnite.</v
|
|||
<data name="SaveDirectory" xml:space="preserve">
|
||||
<value>Sauvegarder le Répertoire</value>
|
||||
</data>
|
||||
<data name="CopyImage" xml:space="preserve">
|
||||
<value>Copier l'Image</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
@ -1088,4 +1088,10 @@ It's now the most used free software to leak on Fortnite.</value>
|
|||
<data name="SaveDirectory" xml:space="preserve">
|
||||
<value>Save Directory</value>
|
||||
</data>
|
||||
<data name="CopyImage" xml:space="preserve">
|
||||
<value>Copy Image</value>
|
||||
</data>
|
||||
<data name="NoImageToCopy" xml:space="preserve">
|
||||
<value>There is currently no image to copy</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
@ -58,10 +58,10 @@ namespace FModel.Utils
|
|||
foreach (var namespac in new LocResReader(asset).Entries)
|
||||
{
|
||||
if (!_fortniteLocalizationDict.ContainsKey(namespac.Key))
|
||||
_fortniteLocalizationDict.Add(namespac.Key, new Dictionary<string, string>());
|
||||
_fortniteLocalizationDict[namespac.Key] = new Dictionary<string, string>();
|
||||
|
||||
foreach (var key in namespac.Value)
|
||||
_fortniteLocalizationDict[namespac.Key].Add(key.Key, key.Value);
|
||||
_fortniteLocalizationDict[namespac.Key][key.Key] = key.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,18 @@ namespace FModel.ViewModels.ImageBox
|
|||
}
|
||||
}
|
||||
|
||||
public static void Copy(this ImageBoxViewModel vm)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(delegate
|
||||
{
|
||||
if (vm.Image != null)
|
||||
{
|
||||
Clipboard.SetImage(vm.Image);
|
||||
}
|
||||
else Globals.gNotifier.ShowCustomMessage(Properties.Resources.Error, Properties.Resources.NoImageToCopy);
|
||||
});
|
||||
}
|
||||
|
||||
public static void Save(this ImageBoxViewModel vm, bool autoSave)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(delegate
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user