From aeced01cce6187d36847eaddf2296f42feb08705 Mon Sep 17 00:00:00 2001 From: iAmAsval Date: Sun, 11 Oct 2020 22:46:50 +0200 Subject: [PATCH] just saving before i break my VS --- FModel/Creator/Bases/BaseSeason.cs | 3 +-- FModel/Creator/Creator.cs | 18 +++++++++++++----- FModel/Creator/Texts/Text.cs | 2 +- FModel/PakReader/ReaderExtensions.cs | 15 ++++----------- FModel/Properties/Resources.fr-FR.resx | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/FModel/Creator/Bases/BaseSeason.cs b/FModel/Creator/Bases/BaseSeason.cs index 6e4adac9..5d5bd576 100644 --- a/FModel/Creator/Bases/BaseSeason.cs +++ b/FModel/Creator/Bases/BaseSeason.cs @@ -1,4 +1,4 @@ -using FModel.Creator.Bundles; +using FModel.Creator.Bundles; using FModel.Creator.Texts; using PakReader.Parsers.Class; using PakReader.Parsers.PropertyTagData; @@ -230,7 +230,6 @@ namespace FModel.Creator.Bases paint.TextSize -= 2; } c.DrawText(text, x, 155, paint); - } paint.Color = SKColors.White.WithAlpha(150); diff --git a/FModel/Creator/Creator.cs b/FModel/Creator/Creator.cs index 796b55e6..b25051f9 100644 --- a/FModel/Creator/Creator.cs +++ b/FModel/Creator/Creator.cs @@ -25,13 +25,21 @@ namespace FModel.Creator string assetFolder = d.Parent.Name; if (Text.TypeFaces.NeedReload(false)) Text.TypeFaces = new Typefaces(); // when opening bundle creator settings without loading paks first - int index = Globals.Game.ActualGame == EGame.Valorant || Globals.Game.ActualGame == EGame.Spellbreak ? 1 : 0; - string exportType = exportTypes.Length > index ? exportTypes[index].String : string.Empty; + int index; + { + if (Globals.Game.ActualGame == EGame.Valorant || Globals.Game.ActualGame == EGame.Spellbreak) + index = 1; + else + index = 0; + } + string exportType; + { + if (exportTypes.Length > index && exportTypes[index].String == "BlueprintGeneratedClass") + index++; - if (Globals.Game.ActualGame == EGame.Spellbreak & exportType == "BlueprintGeneratedClass"){ // there should better way to do this - index++; exportType = exportTypes.Length > index ? exportTypes[index].String : string.Empty; - } + } + switch (exportType) { case "AthenaConsumableEmoteItemDefinition": diff --git a/FModel/Creator/Texts/Text.cs b/FModel/Creator/Texts/Text.cs index bb5e8a30..f54f5959 100644 --- a/FModel/Creator/Texts/Text.cs +++ b/FModel/Creator/Texts/Text.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using FModel.Creator.Bases; using PakReader.Pak; using PakReader.Parsers.Class; diff --git a/FModel/PakReader/ReaderExtensions.cs b/FModel/PakReader/ReaderExtensions.cs index 80d27b0d..f8b479c8 100644 --- a/FModel/PakReader/ReaderExtensions.cs +++ b/FModel/PakReader/ReaderExtensions.cs @@ -1,12 +1,13 @@ using System; using System.IO; using System.Runtime.CompilerServices; +using System.Text; namespace PakReader { static class ReaderExtensions { - public static unsafe string ReadFString(this BinaryReader reader) + public static string ReadFString(this BinaryReader reader) { var SaveNum = reader.ReadInt32(); @@ -24,20 +25,12 @@ namespace PakReader SaveNum = -SaveNum; var dataBytes = reader.ReadBytes(SaveNum * sizeof(char)); - - fixed (byte* pData = dataBytes) - { - return new string((char*)pData, 0, SaveNum - 1); // 1 byte is removed because of null terminator (\0) - } + return Encoding.Unicode.GetString(dataBytes, 0, dataBytes.Length - 1); // 1 byte is removed because of null terminator (\0) } else { var dataBytes = reader.ReadBytes(SaveNum); - - fixed (byte* pData = dataBytes) - { - return new string((sbyte*)pData, 0, SaveNum - 1); // 1 byte is removed because of null terminator (\0) - } + return Encoding.UTF8.GetString(dataBytes, 0, dataBytes.Length - 1); // 1 byte is removed because of null terminator (\0) } } diff --git a/FModel/Properties/Resources.fr-FR.resx b/FModel/Properties/Resources.fr-FR.resx index fc3d5956..09341833 100644 --- a/FModel/Properties/Resources.fr-FR.resx +++ b/FModel/Properties/Resources.fr-FR.resx @@ -832,6 +832,6 @@ C'est maintenant le logiciel gratuit le plus utilisé pour leak sur Fortnite.Afficher les statistiques - Gros + Gras \ No newline at end of file