Skip to content

Commit

Permalink
FModel 3.1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Oct 10, 2020
1 parent b6a628f commit f4e8e34
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 76 deletions.
3 changes: 2 additions & 1 deletion FModel/Creator/Bases/BasePlaylist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public BasePlaylist(IUExport export)
if (export.GetExport<TextProperty>("UIDescription", "Description") is { } description)
Description = Text.GetTextPropertyBase(description);

Width = Height = 512;
Width = 1024;
Height = 512;

if (export.GetExport<NameProperty>("PlaylistName") is { } playlistName && !playlistName.Value.IsNone)
{
Expand Down
4 changes: 2 additions & 2 deletions FModel/Creator/Creator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static bool TryDrawIcon(string assetPath, FName[] exportTypes, IUExport[]
Rarity.DrawRarity(c, icon);
}

LargeSmallImage.DrawPreviewImage(c, icon);
LargeSmallImage.DrawNotStretchedPreviewImage(c, icon);

if ((EIconDesign)Properties.Settings.Default.AssetsIconDesign != EIconDesign.NoBackground)
{
Expand All @@ -164,7 +164,7 @@ public static bool TryDrawIcon(string assetPath, FName[] exportTypes, IUExport[]
}
}

Watermark.DrawWatermark(c); // watermark should only be applied on icons with width = 512
// Watermark.DrawWatermark(c); // boi why would you watermark something you don't own ¯\_(ツ)_/¯
ImageBoxVm.imageBoxViewModel.Set(ret, assetName);
}
return true;
Expand Down
8 changes: 8 additions & 0 deletions FModel/Creator/Icons/LargeSmallImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,13 @@ private static bool GetPreviewImage(BaseIcon icon, UObject obj, bool hightRes)
public static void DrawPreviewImage(SKCanvas c, IBase icon) =>
c.DrawBitmap(icon.IconImage ?? icon.FallbackImage, new SKRect(icon.Margin, icon.Margin, icon.Width - icon.Margin, icon.Height - icon.Margin),
new SKPaint { FilterQuality = SKFilterQuality.High, IsAntialias = true });

public static void DrawNotStretchedPreviewImage(SKCanvas c, IBase icon)
{
SKBitmap i = icon.IconImage ?? icon.FallbackImage;
int x = i.Width < icon.Width ? ((icon.Width / 2) - (i.Width / 2)) : icon.Margin;
c.DrawBitmap(i, new SKRect(x, icon.Margin, (x + i.Width) - (icon.Margin * 2), i.Height - icon.Margin),
new SKPaint { FilterQuality = SKFilterQuality.High, IsAntialias = true });
}
}
}
136 changes: 66 additions & 70 deletions FModel/Creator/Texts/Text.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,96 +157,92 @@ public static void DrawDisplayName(SKCanvas c, IBase icon)
{
_NAME_TEXT_SIZE = 45;
string text = icon.DisplayName;
if (!string.IsNullOrEmpty(text))
SKTextAlign side = SKTextAlign.Center;
int x = icon.Width / 2;
int y = _STARTER_TEXT_POSITION + _NAME_TEXT_SIZE;
switch ((EIconDesign)Properties.Settings.Default.AssetsIconDesign)
{
SKTextAlign side = SKTextAlign.Center;
int x = icon.Width / 2;
int y = _STARTER_TEXT_POSITION + _NAME_TEXT_SIZE;
switch ((EIconDesign)Properties.Settings.Default.AssetsIconDesign)
{
case EIconDesign.Mini:
{
_NAME_TEXT_SIZE = 47;
text = text.ToUpperInvariant();
break;
}
case EIconDesign.Flat:
{
_NAME_TEXT_SIZE = 47;
side = SKTextAlign.Right;
x = icon.Width - icon.Margin * 2;
break;
}
}
case EIconDesign.Mini:
{
_NAME_TEXT_SIZE = 47;
text = text.ToUpperInvariant();
break;
}
case EIconDesign.Flat:
{
_NAME_TEXT_SIZE = 47;
side = SKTextAlign.Right;
x = icon.Width - icon.Margin * 2;
break;
}
}

SKPaint namePaint = new SKPaint
{
IsAntialias = true,
FilterQuality = SKFilterQuality.High,
Typeface = TypeFaces.DisplayNameTypeface,
TextSize = _NAME_TEXT_SIZE,
Color = SKColors.White,
TextAlign = side
};
SKPaint namePaint = new SKPaint
{
IsAntialias = true,
FilterQuality = SKFilterQuality.High,
Typeface = TypeFaces.DisplayNameTypeface,
TextSize = _NAME_TEXT_SIZE,
Color = SKColors.White,
TextAlign = side
};

if ((ELanguage)Properties.Settings.Default.AssetsLanguage == ELanguage.Arabic)
if ((ELanguage)Properties.Settings.Default.AssetsLanguage == ELanguage.Arabic)
{
SKShaper shaper = new SKShaper(namePaint.Typeface);
float shapedTextWidth;

while (true)
{
SKShaper shaper = new SKShaper(namePaint.Typeface);
float shapedTextWidth;
SKShaper.Result shapedText = shaper.Shape(text, namePaint);
shapedTextWidth = shapedText.Points[^1].X + namePaint.TextSize / 2f;

while (true)
if (shapedTextWidth > icon.Width - icon.Margin * 2)
{
SKShaper.Result shapedText = shaper.Shape(text, namePaint);
shapedTextWidth = shapedText.Points[^1].X + namePaint.TextSize / 2f;

if (shapedTextWidth > icon.Width - icon.Margin * 2)
{
namePaint.TextSize = _NAME_TEXT_SIZE -= 1;
}
else
{
break;
}
namePaint.TextSize = _NAME_TEXT_SIZE -= 1;
}

c.DrawShapedText(shaper, text, (icon.Width - shapedTextWidth) / 2f, y, namePaint);
}
else
{
// resize if too long
while (namePaint.MeasureText(text) > icon.Width - icon.Margin * 2)
else
{
namePaint.TextSize = _NAME_TEXT_SIZE -= 1;
break;
}
}

c.DrawText(text, x, y, namePaint);
c.DrawShapedText(shaper, text, side == SKTextAlign.Right ? (x - shapedTextWidth) : ((icon.Width - shapedTextWidth) / 2f), y, namePaint);
}
else
{
// resize if too long
while (namePaint.MeasureText(text) > icon.Width - icon.Margin * 2)
{
namePaint.TextSize = _NAME_TEXT_SIZE -= 1;
}

c.DrawText(text, x, y, namePaint);
}
}

public static void DrawDescription(SKCanvas c, IBase icon)
{
if (!string.IsNullOrEmpty(icon.Description)) return;

int maxLine = 4;
_BOTTOM_TEXT_SIZE = 15;
string text = icon.Description;
ETextSide side = ETextSide.Center;
if (text != null)
switch ((EIconDesign)Properties.Settings.Default.AssetsIconDesign)
{
switch ((EIconDesign)Properties.Settings.Default.AssetsIconDesign)
{
case EIconDesign.Mini:
{
maxLine = 5;
_BOTTOM_TEXT_SIZE = icon.Margin;
text = text.ToUpper();
break;
}
case EIconDesign.Flat:
{
side = ETextSide.Right;
break;
}
}
case EIconDesign.Mini:
{
maxLine = 5;
_BOTTOM_TEXT_SIZE = icon.Margin;
text = text.ToUpper();
break;
}
case EIconDesign.Flat:
{
side = ETextSide.Right;
break;
}
}

SKPaint descriptionPaint = new SKPaint
Expand All @@ -257,7 +253,7 @@ public static void DrawDescription(SKCanvas c, IBase icon)
TextSize = 13,
Color = SKColors.White,
};

// wrap if too long
Helper.DrawCenteredMultilineText(c, text, maxLine, icon, side,
new SKRect(icon.Margin, _STARTER_TEXT_POSITION + _NAME_TEXT_SIZE, icon.Width - icon.Margin, icon.Height - _BOTTOM_TEXT_SIZE),
Expand Down
4 changes: 2 additions & 2 deletions FModel/FModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<StartupObject>FModel.App</StartupObject>
<Authors>Asval</Authors>
<Company></Company>
<AssemblyVersion>3.1.1.2</AssemblyVersion>
<FileVersion>3.1.1.2</FileVersion>
<AssemblyVersion>3.1.1.3</AssemblyVersion>
<FileVersion>3.1.1.3</FileVersion>
<PackageIcon>FModel.ico</PackageIcon>
<PackageIconUrl />
<PackageProjectUrl>https://github.com/iAmAsval/FModel</PackageProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion FModel/Grabber/Paks/PaksGrabber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace FModel.Grabber.Paks
{
static class PaksGrabber
{
private static readonly Regex _pakFileRegex = new Regex(@"^FortniteGame/Content/Paks/.+\.pak$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
private static readonly Regex _pakFileRegex = new Regex(@"^FortniteGame/Content/Paks/pakchunk(?:0|10.*|\w+)-WindowsClient\.pak$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

public static async Task PopulateMenu()
{
Expand Down
9 changes: 9 additions & 0 deletions FModel/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions FModel/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -821,4 +821,10 @@ Jetzt ist es die am häufigsten genutzte freie Software um mit Fortnite zu leake
<data name="SkipThisVersion" xml:space="preserve">
<value>Diese Version überspringen</value>
</data>
<data name="DrawStats" xml:space="preserve">
<value>Zeige Statistiken</value>
</data>
<data name="Fat" xml:space="preserve">
<value>Fett</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FModel/Properties/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1031,4 +1031,10 @@ Ahora es el software gratuito más utilizado para filtrar en Fortnite.</value>
<data name="WithPosition" xml:space="preserve">
<value>Posición / Valor</value>
</data>
<data name="Fat" xml:space="preserve">
<value>Gordo</value>
</data>
<data name="DrawStats" xml:space="preserve">
<value>Mostrar estadísticas</value>
</data>
</root>
3 changes: 3 additions & 0 deletions FModel/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -831,4 +831,7 @@ C'est maintenant le logiciel gratuit le plus utilisé pour leak sur Fortnite.</v
<data name="DrawStats" xml:space="preserve">
<value>Afficher les statistiques</value>
</data>
<data name="Fat" xml:space="preserve">
<value>Gros</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FModel/Properties/Resources.it-IT.resx
Original file line number Diff line number Diff line change
Expand Up @@ -787,4 +787,10 @@ Col tempo sono state aggiunte nuove funzioni e molti altri utenti hanno comincia
<data name="MaybeLater" xml:space="preserve">
<value>Magari più avanti</value>
</data>
<data name="DrawStats" xml:space="preserve">
<value>Mostra statistiche</value>
</data>
<data name="Fat" xml:space="preserve">
<value>Grosso</value>
</data>
</root>
3 changes: 3 additions & 0 deletions FModel/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1085,4 +1085,7 @@ It's now the most used free software to leak on Fortnite.</value>
<data name="DrawStats" xml:space="preserve">
<value>Show statistics</value>
</data>
<data name="Fat" xml:space="preserve">
<value>Fat</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FModel/Properties/Resources.ru-RU.resx
Original file line number Diff line number Diff line change
Expand Up @@ -780,4 +780,10 @@
<data name="SkipThisVersion" xml:space="preserve">
<value>Пропустить эту версию</value>
</data>
<data name="DrawStats" xml:space="preserve">
<value>Посмотреть Статистику</value>
</data>
<data name="Fat" xml:space="preserve">
<value>Жирный</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FModel/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -790,4 +790,10 @@
<data name="SkipThisVersion" xml:space="preserve">
<value>跳过此版本</value>
</data>
<data name="DrawStats" xml:space="preserve">
<value>显示统计数据</value>
</data>
<data name="Fat" xml:space="preserve">
<value>厚</value>
</data>
</root>

0 comments on commit f4e8e34

Please sign in to comment.