mirror of
https://github.com/4sval/FModel.git
synced 2026-04-16 22:46:09 -05:00
added Valorant 1.04 sound names + Fortnite 1.8 icon support (if working)
This commit is contained in:
parent
7bdabfd04b
commit
8e0d140089
|
|
@ -85,6 +85,8 @@ namespace FModel.Creator.Fortnite
|
|||
{ } // ^^^^ 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);
|
||||
else if (export.GetExport<ObjectProperty>("SmallPreviewImage") is ObjectProperty smallPreviewImage)
|
||||
this.IconImage = Utils.GetObjectTexture(smallPreviewImage);
|
||||
else if (export.GetExport<SoftObjectProperty>("LargePreviewImage", "SmallPreviewImage", "ItemDisplayAsset") is SoftObjectProperty previewImage)
|
||||
LargeSmallImage.GetPreviewImage(this, previewImage);
|
||||
else if (export.GetExport<StructProperty>("IconBrush") is StructProperty iconBrush) // abilities
|
||||
|
|
|
|||
|
|
@ -35,14 +35,19 @@ namespace FModel.Creator.Icons
|
|||
{
|
||||
if (obj != null)
|
||||
{
|
||||
if (hightRes && obj.TryGetValue("LargePreviewImage", out var sLarge) && sLarge is SoftObjectProperty largePreviewImage)
|
||||
if (hightRes && obj.TryGetValue("LargePreviewImage", out var sLarge) && sLarge is SoftObjectProperty largePreviewImage && !string.IsNullOrEmpty(largePreviewImage.Value.AssetPathName.String))
|
||||
{
|
||||
GetPreviewImage(icon, largePreviewImage);
|
||||
return true;
|
||||
}
|
||||
else if (obj.TryGetValue("SmallPreviewImage", out var sSmall) && sSmall is SoftObjectProperty smallPreviewImage)
|
||||
else if (obj.TryGetValue("SmallPreviewImage", out var sSmall1) && sSmall1 is SoftObjectProperty smallPreviewImage1 && !string.IsNullOrEmpty(smallPreviewImage1.Value.AssetPathName.String))
|
||||
{
|
||||
GetPreviewImage(icon, smallPreviewImage);
|
||||
GetPreviewImage(icon, smallPreviewImage1);
|
||||
return true;
|
||||
}
|
||||
else if (obj.TryGetValue("SmallPreviewImage", out var sSmall2) && sSmall2 is ObjectProperty smallPreviewImage2 && !string.IsNullOrEmpty(smallPreviewImage2.Value.Resource.OuterIndex.Resource.ObjectName.String))
|
||||
{
|
||||
icon.IconImage = Utils.GetObjectTexture(smallPreviewImage2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace FModel.Creator
|
|||
public static SKBitmap GetTexture(string s)
|
||||
{
|
||||
// FortniteGame/Content/Catalog/DisplayAssets/DA_BattlePassBundle_2020.uasset
|
||||
if (s.Equals("/Game/UI/Foundation/Textures/BattleRoyale/FeaturedItems/Outfit/T_UI_InspectScreen_annualPass"))
|
||||
if (s != null && s.Equals("/Game/UI/Foundation/Textures/BattleRoyale/FeaturedItems/Outfit/T_UI_InspectScreen_annualPass"))
|
||||
s += "_1024";
|
||||
|
||||
PakPackage p = GetPropertyPakPackage(s);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
<None Remove="Resources\api-off.ico" />
|
||||
<None Remove="Resources\api.ico" />
|
||||
<None Remove="Resources\backup-restore.png" />
|
||||
<None Remove="Resources\Base.xshd" />
|
||||
<None Remove="Resources\battlebreakers.ico" />
|
||||
<None Remove="Resources\borderlands3.ico" />
|
||||
<None Remove="Resources\bug.png" />
|
||||
|
|
@ -49,6 +50,7 @@
|
|||
<None Remove="Resources\ColorPickerTwo.png" />
|
||||
<None Remove="Resources\content-copy.png" />
|
||||
<None Remove="Resources\content-save.png" />
|
||||
<None Remove="Resources\Cpp.xshd" />
|
||||
<None Remove="Resources\delete-forever.png" />
|
||||
<None Remove="Resources\discord.png" />
|
||||
<None Remove="Resources\egl2.ico" />
|
||||
|
|
@ -122,6 +124,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\Base.xshd" />
|
||||
<EmbeddedResource Include="Resources\Cpp.xshd" />
|
||||
<EmbeddedResource Include="Resources\Ini.xshd" />
|
||||
<EmbeddedResource Include="Resources\Json.xshd" />
|
||||
<EmbeddedResource Include="Resources\Xml.xshd" />
|
||||
|
|
@ -138,7 +142,7 @@
|
|||
<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="2.80.0" />
|
||||
<PackageReference Include="SkiaSharp" Version="2.80.1" />
|
||||
<PackageReference Include="ToastNotifications" Version="2.5.1" />
|
||||
<PackageReference Include="ToastNotifications.Messages" Version="2.5.1" />
|
||||
<PackageReference Include="WriteableBitmapEx" Version="1.6.7" />
|
||||
|
|
|
|||
|
|
@ -1025,6 +1025,68 @@ namespace FModel
|
|||
{ 966068874, "Play_Bomb_Foley_Plant_Slam" },
|
||||
{ 998447475, "Play_Bomb_Plant_Intro_01" },
|
||||
{ 1069876360, "Play_Bomb_Drop_Bounce" },
|
||||
{ 467578783, "Play_Wp_Melee_Oni_Equip_1P_Lvl2" },
|
||||
{ 424872654, "Play_Wp_Finisher_Oni" },
|
||||
{ 1013606431, "Play_Wp_Carbine_Oni_Silenced_Fire" },
|
||||
{ 392577348, "Play_Wp_Shotgun_Pump_MagePunk_Fire_Alt_RemoteBlast" },
|
||||
{ 10719599, "Play_Wp_Carbine_Oni_Inspect_Element_C_FP" },
|
||||
{ 95077989, "Play_Wp_Carbine_Oni_Equip_Element_A_FP" },
|
||||
{ 97355598, "Play_Wp_Carbine_Oni_Inspect_Element_B_FP" },
|
||||
{ 150907956, "Play_Wp_Carbine_Oni_Inspect_Mvt_A_FP" },
|
||||
{ 255778446, "Play_Wp_Carbine_Oni_Inspect_Element_A_FP" },
|
||||
{ 268584898, "Play_Wp_Carbine_Oni_Reload_Element_B_FP" },
|
||||
{ 273001458, "Play_Wp_Carbine_Oni_Equip_Element_A_FP" },
|
||||
{ 309087885, "Play_Wp_Carbine_Oni_Mag_Out_FP" },
|
||||
{ 312762255, "Play_Wp_Carbine_Oni_Inspect_Element_B_FP" },
|
||||
{ 329146364, "Play_Wp_Carbine_Oni_Inspect_Element_B_FP" },
|
||||
{ 333887615, "Play_Wp_Carbine_Oni_Inspect_Element_C_FP" },
|
||||
{ 348821097, "Play_Wp_Carbine_Oni_Equip_Mvt_Grab_FP" },
|
||||
{ 365048659, "Play_Wp_Carbine_Oni_Reload_Element_D_FP" },
|
||||
{ 387174817, "Play_Wp_Carbine_Oni_Reload_Element_B_FP" },
|
||||
{ 397383781, "Play_Wp_Carbine_Oni_Reload_Mvt_B_FP" },
|
||||
{ 437043323, "Play_Wp_Carbine_Oni_Equip_Element_A_FP" },
|
||||
{ 460557635, "Play_Wp_Carbine_Oni_Inspect_Element_C_FP" },
|
||||
{ 484183554, "Play_Wp_Carbine_Oni_Reload_Mvt_Grab_FP" },
|
||||
{ 518773888, "Play_Wp_Carbine_Oni_Reload_Chg_Hnd_Back_FP" },
|
||||
{ 523856920, "Play_Wp_Carbine_Oni_Reload_Mvt_A_FP" },
|
||||
{ 528537112, "Play_Wp_Carbine_Oni_Inspect_Mvt_Grab_FP" },
|
||||
{ 575869628, "Play_Wp_Carbine_Oni_Equip_Mvt_A_FP" },
|
||||
{ 643849265, "Play_Wp_Carbine_Oni_Inspect_Element_A_FP" },
|
||||
{ 685675369, "Play_Wp_Carbine_Oni_Reload_Element_C_FP" },
|
||||
{ 812971282, "Play_Wp_Carbine_Oni_Reload_Element_C_FP" },
|
||||
{ 844910882, "Play_Wp_Carbine_Oni_Reload_Chg_Hnd_Fwd_FP" },
|
||||
{ 871137564, "Play_Wp_Carbine_Oni_Reload_Element_C_FP" },
|
||||
{ 895009894, "Play_Wp_Carbine_Oni_Mag_In_FP" },
|
||||
{ 936326076, "Play_Wp_Carbine_Oni_Inspect_Element_A_FP" },
|
||||
{ 979491769, "Play_Wp_Carbine_Oni_Inspect_Mvt_C_FP" },
|
||||
{ 1010089630, "Play_Wp_Carbine_Oni_Reload_Element_B_FP" },
|
||||
{ 1061292768, "Play_Wp_Carbine_Oni_Inspect_Mvt_B_FP" },
|
||||
{ 76653560, "Play_Wp_Oni_DMR_Equip_Mvt_Element_A" },
|
||||
{ 246952494, "Play_Wp_Oni_DMR_Equip_Mvt_Element_B" },
|
||||
{ 328586668, "Play_Wp_Oni_DMR_Reload_Mvt_Element_A" },
|
||||
{ 616322611, "Play_Wp_Oni_DMR_Equip_Mvt_Element_C" },
|
||||
{ 695739042, "Play_Wp_Oni_DMR_Inspect_Mvt_Element_C" },
|
||||
{ 729048643, "Play_Wp_Oni_DMR_Reload_Mvt_Element_B" },
|
||||
{ 787432024, "Play_Wp_Oni_DMR_Reload_Mvt_Element_E" },
|
||||
{ 819357532, "Play_Wp_Oni_DMR_Inspect_Mvt_Element_A" },
|
||||
{ 1066309683, "Play_Wp_Oni_DMR_Inspect_Mvt_Element_B" },
|
||||
{ 80372429, "Play_Wp_Oni_Pump_Reload_Mvt_Element_B" },
|
||||
{ 405274204, "Play_Wp_Oni_Pump_Inspect_Mvt_Element_A" },
|
||||
{ 479658674, "Play_Wp_Oni_Pump_Equip_Mvt_Element_A" },
|
||||
{ 527246789, "Play_Wp_Oni_Pump_Inspect_Mvt_Element_C" },
|
||||
{ 627881474, "Play_Wp_Oni_Pump_Reload_Mvt_Element_C" },
|
||||
{ 895756588, "Play_Wp_Oni_Pump_Equip_Mvt_Element_B" },
|
||||
{ 938809816, "Play_Wp_Oni_Pump_Inspect_Mvt_Element_B" },
|
||||
{ 16907461, "Play_Wp_Oni_SawedOff_Reload_Mvt_Element_C" },
|
||||
{ 361321823, "Play_Wp_Oni_SawedOff_Reload_Mvt_Element_A" },
|
||||
{ 364969835, "Play_Wp_Oni_SawedOff_Equip_Mvt_Element_A" },
|
||||
{ 474046400, "Play_Wp_Oni_SawedOff_Reload_Mvt_Element_B" },
|
||||
{ 576794135, "Play_Wp_Oni_SawedOff_Inspect_Mvt_Element_A" },
|
||||
{ 600379645, "Play_Wp_Oni_SawedOff_Inspect_Mvt_Element_B" },
|
||||
{ 119899004, "Play_UI_KillBanner_Oni_4" },
|
||||
{ 585551763, "Play_UI_KillBanner_Oni_3" },
|
||||
{ 906892702, "Play_UI_KillBanner_Oni_1" },
|
||||
{ 907593259, "Play_UI_KillBanner_Oni_5" },
|
||||
};
|
||||
public static readonly Notifier gNotifier = new Notifier(cfg =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,12 +40,13 @@ namespace FModel.Grabber.Paks
|
|||
// Add Pak Files
|
||||
if (Directory.Exists(Properties.Settings.Default.PakPath))
|
||||
{
|
||||
foreach (string pak in Directory.GetFiles(Properties.Settings.Default.PakPath, "*.pak"))
|
||||
string[] paks = Directory.GetFiles(Properties.Settings.Default.PakPath, "*.pak");
|
||||
for (int i = 0; i < paks.Length; i++)
|
||||
{
|
||||
if (!Utils.Paks.IsFileReadLocked(new FileInfo(pak)))
|
||||
if (!Utils.Paks.IsFileReadLocked(new FileInfo(paks[i])))
|
||||
{
|
||||
PakFileReader pakFile = new PakFileReader(pak);
|
||||
Globals.Game.Version = pakFile.Info.Version;
|
||||
PakFileReader pakFile = new PakFileReader(paks[i]);
|
||||
if (i == 0) Globals.Game.Version = pakFile.Info.Version;
|
||||
DebugHelper.WriteLine("{0} {1} {2} {3}", "[FModel]", "[PAK]", "[Registering]", $"{pakFile.FileName} with GUID {pakFile.Info.EncryptionKeyGuid.Hex}");
|
||||
|
||||
Application.Current.Dispatcher.Invoke(delegate
|
||||
|
|
@ -59,8 +60,8 @@ namespace FModel.Grabber.Paks
|
|||
}
|
||||
else
|
||||
{
|
||||
FConsole.AppendText(string.Format(Properties.Resources.PakFileLocked, Path.GetFileNameWithoutExtension(pak)), FColors.Red, true);
|
||||
DebugHelper.WriteLine("{0} {1} {2} {3}", "[FModel]", "[PAK]", "[Locked]", pak);
|
||||
FConsole.AppendText(string.Format(Properties.Resources.PakFileLocked, Path.GetFileNameWithoutExtension(paks[i])), FColors.Red, true);
|
||||
DebugHelper.WriteLine("{0} {1} {2} {3}", "[FModel]", "[PAK]", "[Locked]", paks[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ namespace PakReader.Parsers.Objects
|
|||
internal FSoftObjectPath(PackageReader reader)
|
||||
{
|
||||
AssetPathName = reader.ReadFName();
|
||||
SubPathString = reader.ReadFString();
|
||||
SubPathString = string.Empty;
|
||||
if (FModel.Globals.Game.Version >= EPakVersion.RELATIVE_CHUNK_OFFSETS)
|
||||
{
|
||||
SubPathString = reader.ReadFString();
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetValue()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace PakReader.Parsers.Objects
|
|||
};
|
||||
|
||||
int NumEntries = reader.ReadInt32();
|
||||
for (int i = 0; i < NumEntries; i++)
|
||||
for (int i = 0; i < NumEntries; ++i)
|
||||
{
|
||||
string key = reader.ReadFString();
|
||||
KeysToMetadata[TableNamespace].Add(key, Localizations.GetLocalization(TableNamespace, key, reader.ReadFString()));
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@ namespace PakReader.Parsers
|
|||
else
|
||||
throw new FileLoadException("Can't get class name"); // Shouldn't reach this unless the laws of math have bent to MagmaReef's will
|
||||
|
||||
if (ExportType.String.Equals("BlueprintGeneratedClass")) continue;
|
||||
|
||||
var pos = Position = Export.SerialOffset - PackageFileSummary.TotalHeaderSize;
|
||||
DataExports[i] = ExportType.String switch
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ namespace PakReader.Parsers.PropertyTagData
|
|||
//"MulticastDelegateProperty" => new MulticastDelegateProperty(reader, tag),
|
||||
//"LazyObjectProperty" => new LazyObjectProperty(reader, tag),
|
||||
"SoftObjectProperty" => new SoftObjectProperty(reader, readType),
|
||||
"AssetObjectProperty" => new SoftObjectProperty(reader, readType),
|
||||
"UInt64Property" => new UInt64Property(reader),
|
||||
"UInt32Property" => new UInt32Property(reader),
|
||||
"UInt16Property" => new UInt16Property(reader),
|
||||
|
|
@ -58,6 +59,7 @@ namespace PakReader.Parsers.PropertyTagData
|
|||
//"MulticastDelegateProperty" => new MulticastDelegateProperty(reader, tag).Value,
|
||||
//"LazyObjectProperty" => new LazyObjectProperty(reader, tag).Value,
|
||||
"SoftObjectProperty" => new SoftObjectProperty(reader, readType).Value,
|
||||
"AssetObjectProperty" => new SoftObjectProperty(reader, readType).Value,
|
||||
"UInt64Property" => new UInt64Property(reader).Value,
|
||||
"UInt32Property" => new UInt32Property(reader).Value,
|
||||
"UInt16Property" => new UInt16Property(reader).Value,
|
||||
|
|
|
|||
645
FModel/Properties/Resources.Designer.cs
generated
645
FModel/Properties/Resources.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -1075,4 +1075,10 @@ It's now the most used free software to leak on Fortnite.</value>
|
|||
<data name="trello1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\trello.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Base" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Base.xshd;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Cpp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Cpp.xshd;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
146
FModel/Resources/Base.xshd
Normal file
146
FModel/Resources/Base.xshd
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<?xml version="1.0"?>
|
||||
<SyntaxDefinition name="PowerShell" extensions=".ps1;.psm1;.psd1" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
|
||||
<Color name="Comment" foreground="Green" exampleText="// comment" />
|
||||
<Color name="String" foreground="Blue" exampleText="string text = "Hello, World!""/>
|
||||
<Color name="Char" foreground="Magenta" exampleText="char linefeed = '\n';"/>
|
||||
<Color name="Punctuation" exampleText="a(b.c);" />
|
||||
<Color name="NumberLiteral" foreground="#F78C6C" exampleText="3.1415f"/>
|
||||
<Color name="Keywords" fontWeight="bold" foreground="Blue" exampleText="if (a)"/>
|
||||
<Color name="Variable" foreground="Maroon" exampleText="$param = 1" />
|
||||
<Color name="ExceptionKeywords" fontWeight="bold" foreground="Teal" />
|
||||
<Color name="GotoKeywords" foreground="Navy" />
|
||||
<Color name="ReferenceTypes" foreground="Red" />
|
||||
<Color name="Command" fontWeight="bold" foreground="MidnightBlue" />
|
||||
<Color name="Operators" foreground="#FF8515EA" exampleText="-eq"/>
|
||||
|
||||
<RuleSet ignoreCase="true">
|
||||
<Span color="Comment">
|
||||
<Begin>\#</Begin>
|
||||
</Span>
|
||||
|
||||
<Span color="Comment" multiline="true">
|
||||
<Begin><\#</Begin>
|
||||
<End>\#></End>
|
||||
</Span>
|
||||
|
||||
<Span color="String">
|
||||
<Begin>"</Begin>
|
||||
<End>"</End>
|
||||
<RuleSet>
|
||||
<!-- span for escape sequences -->
|
||||
<Span begin="\\" end="."/>
|
||||
</RuleSet>
|
||||
</Span>
|
||||
|
||||
<Span color="Char">
|
||||
<Begin>'</Begin>
|
||||
<End>'</End>
|
||||
<RuleSet>
|
||||
<!-- span for escape sequences -->
|
||||
<Span begin="\\" end="."/>
|
||||
</RuleSet>
|
||||
</Span>
|
||||
|
||||
<Span color="String" multiline="true">
|
||||
<Begin color="String">@"</Begin>
|
||||
<End>"@</End>
|
||||
<RuleSet>
|
||||
<!-- span for escape sequences -->
|
||||
<Span begin='""' end=""/>
|
||||
</RuleSet>
|
||||
</Span>
|
||||
|
||||
<Keywords color="Keywords">
|
||||
<Word>while</Word>
|
||||
<Word>param</Word>
|
||||
<Word>end</Word>
|
||||
<Word>define</Word>
|
||||
<Word>else</Word>
|
||||
<Word>from</Word>
|
||||
<Word>foreach</Word>
|
||||
<Word>var</Word>
|
||||
<Word>dynamicparam</Word>
|
||||
<Word>filter</Word>
|
||||
<Word>dp</Word>
|
||||
<Word>until</Word>
|
||||
<Word>for</Word>
|
||||
<Word>exit</Word>
|
||||
<Word>switch</Word>
|
||||
<Word>process</Word>
|
||||
<Word>begin</Word>
|
||||
<Word>elseif</Word>
|
||||
<Word>if</Word>
|
||||
<Word>in</Word>
|
||||
<Word>data</Word>
|
||||
<Word>class</Word>
|
||||
<Word>using</Word>
|
||||
<Word>function</Word>
|
||||
</Keywords>
|
||||
|
||||
<Keywords color="ExceptionKeywords">
|
||||
<Word>catch</Word>
|
||||
<Word>finally</Word>
|
||||
<Word>throw</Word>
|
||||
<Word>trap</Word>
|
||||
<Word>try</Word>
|
||||
</Keywords>
|
||||
|
||||
<Keywords color="GotoKeywords">
|
||||
<Word>break</Word>
|
||||
<Word>continue</Word>
|
||||
<Word>return</Word>
|
||||
</Keywords>
|
||||
|
||||
<Keywords color="ReferenceTypes">
|
||||
<Word>class</Word>
|
||||
</Keywords>
|
||||
|
||||
<Keywords color="Operators">
|
||||
<Word>-not</Word>
|
||||
<Word>-band</Word>
|
||||
<Word>-bor</Word>
|
||||
<Word>-replace</Word>
|
||||
<Word>-ireplace</Word>
|
||||
<Word>-creplace</Word>
|
||||
<Word>-and</Word>
|
||||
<Word>-or</Word>
|
||||
<Word>-is</Word>
|
||||
<Word>-isnot</Word>
|
||||
<Word>-as</Word>
|
||||
<Word>-lt</Word>
|
||||
<Word>-le</Word>
|
||||
<Word>-gt</Word>
|
||||
<Word>-ge</Word>
|
||||
<Word>-eq</Word>
|
||||
<Word>-ne</Word>
|
||||
<Word>-contains</Word>
|
||||
<Word>-notcontains</Word>
|
||||
<Word>-like</Word>
|
||||
<Word>-notlike</Word>
|
||||
<Word>-match</Word>
|
||||
<Word>-notmatch</Word>
|
||||
</Keywords>
|
||||
|
||||
<Rule color="Variable">
|
||||
\$[\d\w_]+
|
||||
</Rule>
|
||||
|
||||
<Rule color="Command">
|
||||
[\w]+-[\w]+
|
||||
</Rule>
|
||||
|
||||
<!-- Digits -->
|
||||
<Rule color="NumberLiteral">
|
||||
\b0[xX][0-9a-fA-F]+ # hex number
|
||||
|
|
||||
( \b\d+(\.[0-9]+)? #number with optional floating point
|
||||
| \.[0-9]+ #or just starting with floating point
|
||||
)
|
||||
([eE][+-]?[0-9]+)? # optional exponent
|
||||
</Rule>
|
||||
|
||||
<Rule color="Punctuation">
|
||||
[?,.;()\[\]{}+\-/%*<>^+~!|&]+
|
||||
</Rule>
|
||||
</RuleSet>
|
||||
</SyntaxDefinition>
|
||||
195
FModel/Resources/Cpp.xshd
Normal file
195
FModel/Resources/Cpp.xshd
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- syntaxdefinition for C/C++ 2001 by Andrea Paatz and Mike Krueger -->
|
||||
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
|
||||
<SyntaxDefinition name="C++" extensions=".c;.h;.cc;.cpp;.hpp" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
|
||||
<Color name="Comment" foreground="Green" />
|
||||
<Color name="Character" foreground="Fuchsia" />
|
||||
<Color name="String" foreground="Fuchsia" />
|
||||
<Color name="Preprocessor" foreground="Green" />
|
||||
<Color name="Punctuation" foreground="DarkGreen" />
|
||||
<Color name="MethodName" foreground="MidnightBlue" fontWeight="bold" />
|
||||
<Color name="Digits" foreground="#F78C6C" />
|
||||
<Color name="CompoundKeywords" foreground="Black" fontWeight="bold" />
|
||||
<Color name="This" foreground="Black" fontWeight="bold" />
|
||||
<Color name="Operators" foreground="#FF008B8B" fontWeight="bold" />
|
||||
<Color name="Namespace" foreground="#FF008000" fontWeight="bold" />
|
||||
<Color name="Friend" foreground="#FFA52A2A" />
|
||||
<Color name="Modifiers" foreground="#FF0000FF" fontWeight="bold" />
|
||||
<Color name="TypeKeywords" foreground="#FFFF0000" />
|
||||
<Color name="BooleanConstants" foreground="#FF000000" fontWeight="bold" />
|
||||
<Color name="Keywords" foreground="#FF0000FF" fontWeight="bold" />
|
||||
<Color name="LoopKeywords" foreground="#FF0000FF" fontWeight="bold" />
|
||||
<Color name="JumpKeywords" foreground="#FF000080" />
|
||||
<Color name="ExceptionHandling" foreground="#FF008080" fontWeight="bold" />
|
||||
<Color name="ControlFlow" foreground="#FF0000FF" fontWeight="bold" />
|
||||
<RuleSet ignoreCase="false">
|
||||
<Rule color="Punctuation">
|
||||
[?,.;()\[\]{}+\-/%*<>^=~!&]+
|
||||
</Rule>
|
||||
<Keywords color="CompoundKeywords">
|
||||
<Word>__abstract</Word>
|
||||
<Word>__box</Word>
|
||||
<Word>__delegate</Word>
|
||||
<Word>__gc</Word>
|
||||
<Word>__identifier</Word>
|
||||
<Word>__nogc</Word>
|
||||
<Word>__pin</Word>
|
||||
<Word>__property</Word>
|
||||
<Word>__sealed</Word>
|
||||
<Word>__try_cast</Word>
|
||||
<Word>__typeof</Word>
|
||||
<Word>__value</Word>
|
||||
<Word>__event</Word>
|
||||
<Word>__hook</Word>
|
||||
<Word>__raise</Word>
|
||||
<Word>__unhook</Word>
|
||||
<Word>__interface</Word>
|
||||
<Word>ref class</Word>
|
||||
<Word>ref struct</Word>
|
||||
<Word>value class</Word>
|
||||
<Word>value struct</Word>
|
||||
<Word>interface class</Word>
|
||||
<Word>interface struct</Word>
|
||||
<Word>enum class</Word>
|
||||
<Word>enum struct</Word>
|
||||
<Word>delegate</Word>
|
||||
<Word>event</Word>
|
||||
<Word>property</Word>
|
||||
<Word>abstract</Word>
|
||||
<Word>override</Word>
|
||||
<Word>sealed</Word>
|
||||
<Word>generic</Word>
|
||||
<Word>where</Word>
|
||||
<Word>finally</Word>
|
||||
<Word>for each</Word>
|
||||
<Word>gcnew</Word>
|
||||
<Word>in</Word>
|
||||
<Word>initonly</Word>
|
||||
<Word>literal</Word>
|
||||
<Word>nullptr</Word>
|
||||
</Keywords>
|
||||
<Keywords color="This">
|
||||
<Word>this</Word>
|
||||
</Keywords>
|
||||
<Keywords color="Operators">
|
||||
<Word>and</Word>
|
||||
<Word>and_eq</Word>
|
||||
<Word>bitand</Word>
|
||||
<Word>bitor</Word>
|
||||
<Word>new</Word>
|
||||
<Word>not</Word>
|
||||
<Word>not_eq</Word>
|
||||
<Word>or</Word>
|
||||
<Word>or_eq</Word>
|
||||
<Word>xor</Word>
|
||||
<Word>xor_eq</Word>
|
||||
</Keywords>
|
||||
<Keywords color="Namespace">
|
||||
<Word>using</Word>
|
||||
<Word>namespace</Word>
|
||||
</Keywords>
|
||||
<Keywords color="Friend">
|
||||
<Word>friend</Word>
|
||||
</Keywords>
|
||||
<Keywords color="Modifiers">
|
||||
<Word>private</Word>
|
||||
<Word>protected</Word>
|
||||
<Word>public</Word>
|
||||
<Word>const</Word>
|
||||
<Word>volatile</Word>
|
||||
<Word>static</Word>
|
||||
</Keywords>
|
||||
<Keywords color="TypeKeywords">
|
||||
<Word>bool</Word>
|
||||
<Word>char</Word>
|
||||
<Word>unsigned</Word>
|
||||
<Word>union</Word>
|
||||
<Word>virtual</Word>
|
||||
<Word>double</Word>
|
||||
<Word>float</Word>
|
||||
<Word>short</Word>
|
||||
<Word>signed</Word>
|
||||
<Word>void</Word>
|
||||
<Word>class</Word>
|
||||
<Word>enum</Word>
|
||||
<Word>struct</Word>
|
||||
</Keywords>
|
||||
<Keywords color="BooleanConstants">
|
||||
<Word>false</Word>
|
||||
<Word>true</Word>
|
||||
</Keywords>
|
||||
<Keywords color="LoopKeywords">
|
||||
<Word>do</Word>
|
||||
<Word>for</Word>
|
||||
<Word>while</Word>
|
||||
</Keywords>
|
||||
<Keywords color="JumpKeywords">
|
||||
<Word>break</Word>
|
||||
<Word>continue</Word>
|
||||
<Word>goto</Word>
|
||||
<Word>return</Word>
|
||||
</Keywords>
|
||||
<Keywords color="ExceptionHandling">
|
||||
<Word>catch</Word>
|
||||
<Word>throw</Word>
|
||||
<Word>try</Word>
|
||||
</Keywords>
|
||||
<Keywords color="ControlFlow">
|
||||
<Word>case</Word>
|
||||
<Word>else</Word>
|
||||
<Word>if</Word>
|
||||
<Word>switch</Word>
|
||||
<Word>default</Word>
|
||||
</Keywords>
|
||||
<Keywords color="Keywords">
|
||||
<Word>asm</Word>
|
||||
<Word>auto</Word>
|
||||
<Word>compl</Word>
|
||||
<Word>mutable</Word>
|
||||
<Word>const_cast</Word>
|
||||
<Word>delete</Word>
|
||||
<Word>dynamic_cast</Word>
|
||||
<Word>explicit</Word>
|
||||
<Word>export</Word>
|
||||
<Word>extern</Word>
|
||||
<Word>inline</Word>
|
||||
<Word>int</Word>
|
||||
<Word>long</Word>
|
||||
<Word>operator</Word>
|
||||
<Word>register</Word>
|
||||
<Word>reinterpret_cast</Word>
|
||||
<Word>sizeof</Word>
|
||||
<Word>static_cast</Word>
|
||||
<Word>template</Word>
|
||||
<Word>typedef</Word>
|
||||
<Word>typeid</Word>
|
||||
<Word>typename</Word>
|
||||
</Keywords>
|
||||
<Span color="Preprocessor">
|
||||
<Begin>\#</Begin>
|
||||
</Span>
|
||||
<Span color="Comment">
|
||||
<Begin>//</Begin>
|
||||
</Span>
|
||||
<Span color="Comment" multiline="true">
|
||||
<Begin>/\*</Begin>
|
||||
<End>\*/</End>
|
||||
</Span>
|
||||
<Span color="String">
|
||||
<Begin>"</Begin>
|
||||
<End>"</End>
|
||||
<RuleSet>
|
||||
<Span begin="\\" end="." />
|
||||
</RuleSet>
|
||||
</Span>
|
||||
<Span color="Character">
|
||||
<Begin>'</Begin>
|
||||
<End>'</End>
|
||||
<RuleSet>
|
||||
<Span begin="\\" end="." />
|
||||
</RuleSet>
|
||||
</Span>
|
||||
<Rule color="MethodName">[\d\w_]+(?=(\s*\())</Rule>
|
||||
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
|
||||
</RuleSet>
|
||||
</SyntaxDefinition>
|
||||
|
|
@ -24,6 +24,7 @@ using SkiaSharp;
|
|||
using System.Text;
|
||||
using FModel.ViewModels.DataGrid;
|
||||
using FModel.PakReader;
|
||||
using ICSharpCode.AvalonEdit.Highlighting;
|
||||
using static FModel.Creator.FortniteCreator;
|
||||
using static FModel.Creator.ValorantCreator;
|
||||
|
||||
|
|
@ -70,33 +71,32 @@ namespace FModel.Utils
|
|||
if (Globals.CachedPakFiles.TryGetValue(selected.PakEntry.PakFileName, out var r))
|
||||
{
|
||||
string mount = r.MountPoint;
|
||||
switch (selected.PakEntry.GetExtension())
|
||||
string ext = selected.PakEntry.GetExtension();
|
||||
switch (ext)
|
||||
{
|
||||
case ".ini":
|
||||
case ".txt":
|
||||
{
|
||||
using var asset = GetMemoryStream(selected.PakEntry.PakFileName, mount + selected.PakEntry.GetPathWithoutExtension());
|
||||
asset.Position = 0;
|
||||
using var reader = new StreamReader(asset);
|
||||
AvalonEditVm.avalonEditViewModel.Set(reader.ReadToEnd(), mount + selected.PakEntry.Name, AvalonEditVm.IniHighlighter);
|
||||
break;
|
||||
}
|
||||
case ".bat":
|
||||
case ".xml":
|
||||
{
|
||||
using var asset = GetMemoryStream(selected.PakEntry.PakFileName, mount + selected.PakEntry.GetPathWithoutExtension());
|
||||
asset.Position = 0;
|
||||
using var reader = new StreamReader(asset);
|
||||
AvalonEditVm.avalonEditViewModel.Set(reader.ReadToEnd(), mount + selected.PakEntry.Name, AvalonEditVm.XmlHighlighter);
|
||||
break;
|
||||
}
|
||||
case ".h":
|
||||
case ".uproject":
|
||||
case ".uplugin":
|
||||
case ".upluginmanifest":
|
||||
case ".json":
|
||||
{
|
||||
IHighlightingDefinition syntax = ext switch
|
||||
{
|
||||
".ini" => AvalonEditVm.IniHighlighter,
|
||||
".txt" => AvalonEditVm.BaseHighlighter,
|
||||
".bat" => AvalonEditVm.BaseHighlighter,
|
||||
".xml" => AvalonEditVm.XmlHighlighter,
|
||||
".h" => AvalonEditVm.CppHighlighter,
|
||||
_ => AvalonEditVm.JsonHighlighter
|
||||
};
|
||||
using var asset = GetMemoryStream(selected.PakEntry.PakFileName, mount + selected.PakEntry.GetPathWithoutExtension());
|
||||
asset.Position = 0;
|
||||
using var reader = new StreamReader(asset);
|
||||
AvalonEditVm.avalonEditViewModel.Set(reader.ReadToEnd(), mount + selected.PakEntry.Name);
|
||||
AvalonEditVm.avalonEditViewModel.Set(reader.ReadToEnd(), mount + selected.PakEntry.Name, syntax);
|
||||
break;
|
||||
}
|
||||
case ".locmeta":
|
||||
|
|
|
|||
|
|
@ -88,6 +88,8 @@ namespace FModel.ViewModels.AvalonEdit
|
|||
public static readonly IHighlightingDefinition JsonHighlighter = LoadHighlighter("Json.xshd");
|
||||
public static readonly IHighlightingDefinition IniHighlighter = LoadHighlighter("Ini.xshd");
|
||||
public static readonly IHighlightingDefinition XmlHighlighter = LoadHighlighter("Xml.xshd");
|
||||
public static readonly IHighlightingDefinition CppHighlighter = LoadHighlighter("Cpp.xshd");
|
||||
public static readonly IHighlightingDefinition BaseHighlighter = LoadHighlighter("Base.xshd");
|
||||
public static IHighlightingDefinition LoadHighlighter(string resourceName)
|
||||
{
|
||||
Assembly executingAssembly = Assembly.GetExecutingAssembly();
|
||||
|
|
|
|||
|
|
@ -261,32 +261,11 @@ namespace FModel.Windows.SoundPlayer
|
|||
{
|
||||
// vgmstream convert on select
|
||||
if (string.IsNullOrEmpty(selectedItem.FullPath) && selectedItem.Data != null)
|
||||
{
|
||||
string file = Properties.Settings.Default.OutputPath + "\\vgmstream\\test.exe";
|
||||
if (File.Exists(file))
|
||||
if (TryVGMStreamConvert(selectedItem, out string wavFile))
|
||||
{
|
||||
string folder = Properties.Settings.Default.OutputPath + "\\Sounds\\" + selectedItem.Folder + "\\";
|
||||
Directory.CreateDirectory(folder);
|
||||
File.WriteAllBytes(folder + selectedItem.Content, selectedItem.Data);
|
||||
string newFile = Path.ChangeExtension(folder + selectedItem.Content, ".wav");
|
||||
var vgmstream = Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = file,
|
||||
Arguments = $"-o \"{newFile}\" \"{folder + selectedItem.Content}\"",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
CreateNoWindow = true
|
||||
});
|
||||
vgmstream.WaitForExit();
|
||||
ListBoxVm.soundFiles.Remove(selectedItem);
|
||||
File.Delete(folder + selectedItem.Content);
|
||||
if (vgmstream.ExitCode == 0 && File.Exists(newFile))
|
||||
{
|
||||
_oldPlayedSound = newFile;
|
||||
LoadFile(newFile);
|
||||
}
|
||||
_oldPlayedSound = wavFile;
|
||||
LoadFile(wavFile);
|
||||
}
|
||||
}
|
||||
else if (!_oldPlayedSound.Equals(selectedItem.FullPath))
|
||||
_oldPlayedSound = selectedItem.FullPath;
|
||||
|
||||
|
|
@ -296,5 +275,35 @@ namespace FModel.Windows.SoundPlayer
|
|||
PlayPauseImg.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/play.png"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// this sucks honestly but i lost hope with all wav conversion types
|
||||
/// </summary>
|
||||
private bool TryVGMStreamConvert(ListBoxViewModel2 selectedItem, out string wavFilePath)
|
||||
{
|
||||
if (File.Exists(Properties.Settings.Default.OutputPath + "\\vgmstream\\test.exe"))
|
||||
{
|
||||
Directory.CreateDirectory(Properties.Settings.Default.OutputPath + "\\Sounds\\" + selectedItem.Folder + "\\");
|
||||
File.WriteAllBytes(Properties.Settings.Default.OutputPath + "\\Sounds\\" + selectedItem.Folder + "\\" + selectedItem.Content, selectedItem.Data);
|
||||
|
||||
wavFilePath = Path.ChangeExtension(Properties.Settings.Default.OutputPath + "\\Sounds\\" + selectedItem.Folder + "\\" + selectedItem.Content, ".wav");
|
||||
var vgmstream = Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = Properties.Settings.Default.OutputPath + "\\vgmstream\\test.exe",
|
||||
Arguments = $"-o \"{wavFilePath}\" \"{Properties.Settings.Default.OutputPath + "\\Sounds\\" + selectedItem.Folder + "\\" + selectedItem.Content}\"",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
CreateNoWindow = true
|
||||
});
|
||||
vgmstream.WaitForExit();
|
||||
|
||||
ListBoxVm.soundFiles.Remove(selectedItem);
|
||||
File.Delete(Properties.Settings.Default.OutputPath + "\\Sounds\\" + selectedItem.Folder + "\\" + selectedItem.Content);
|
||||
|
||||
return vgmstream.ExitCode == 0 && File.Exists(wavFilePath);
|
||||
}
|
||||
wavFilePath = string.Empty;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user