Skip to content

Commit 4a7ffc4

Browse files
committed
General Updates
1 parent 14ba091 commit 4a7ffc4

20 files changed

+174
-79
lines changed

Source/vj0.Shared/Framework/Base/BaseProfile.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.ComponentModel;
33
using System.ComponentModel.DataAnnotations;
44
using System.Text.Json.Serialization;
5+
using System.Text.RegularExpressions;
56
using CommunityToolkit.Mvvm.ComponentModel;
67
using CUE4Parse.UE4.Assets.Exports.Texture;
78
using CUE4Parse.UE4.Versions;
@@ -80,7 +81,10 @@ protected virtual void NameChanged() { }
8081
public bool IsAutoDetected => AutoDetectedGameId != EDetectedGameId.None;
8182

8283
[JsonIgnore]
83-
public bool IsArchivedGame => AutoDetectedGameId == EDetectedGameId.None && ArchiveDirectory.Contains("Fortnite");
84+
public bool IsArchivedGame =>
85+
!IsAutoDetected
86+
&& ArchiveDirectory.Contains("Fortnite")
87+
&& Regex.IsMatch(Name, @"^\d+\.\d+(\.\d+)?$");
8488

8589
[JsonIgnore]
8690
public bool IsNameEmpty => string.IsNullOrEmpty(Name);

Source/vj0/Application/AppInstance.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
<SolidColorBrush x:Key="SubPanelBackgroundBrush" Color="#1f1f1f"/>
168168
<SolidColorBrush x:Key="SubPanelBorderBrush" Color="#1f2023"/>
169169

170-
<SolidColorBrush x:Key="GuideBackgroundBrush" Color="#0a0a0a"/>
170+
<SolidColorBrush x:Key="GuideBackgroundBrush" Color="Transparent"/>
171171

172172
<SolidColorBrush x:Key="ButtonBackgroundDisabled" Color="#08FFFFFF"/>
173173
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="#0AFFFFFF"/>

Source/vj0/Globals.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ public static class Globals
1111
{
1212
/* Format: 0.0.0 */
1313
public const string VERSION = "dev";
14-
public const string COMMIT = "";
14+
public const string COMMIT = "bd1ed7f";
1515
public static bool IS_COMMIT_AVAILABLE => !COMMIT.IsNullOrEmpty();
1616
public static bool IS_COMMIT_UNAVAILABLE => !IS_COMMIT_AVAILABLE;
1717

1818
/* future. 🤫 */
1919
public const bool IsReadyToExplore = true;
20+
public const bool IsReadyToMeshExport = false;
2021

2122
/* Application Metadata */
2223
public const string CODENAME = "vj0";
@@ -29,9 +30,9 @@ public static class Globals
2930
public const string GITHUB_REPO_NAME = APP_NAME;
3031
private const string AUTHOR_AND_GITHUB = $"{AUTHOR_NAME}/{GITHUB_REPO_NAME}";
3132

32-
public const string GITHUB_LINK = $"https://github.com/{AUTHOR_AND_GITHUB}";
3333
public const string GITHUB_API_LINK = $"https://api.github.com/repos/{AUTHOR_AND_GITHUB}";
34-
public const string GITHUB_RELEASES_LINK = $"{GITHUB_LINK}/releases";
34+
35+
public const string GITHUB_LINK = $"https://github.com/{AUTHOR_AND_GITHUB}";
3536
public const string GITHUB_COMMIT_LINK = $"{GITHUB_LINK}/commit";
3637

3738
/* Discord */
@@ -52,7 +53,7 @@ public static class Globals
5253
public static readonly DirectoryInfo MappingsFolder = new(Path.Combine(RuntimeFolder.ToString(), "Mappings"));
5354
public static readonly DirectoryInfo LogsFolder = new(Path.Combine(RuntimeFolder.ToString(), "Logs"));
5455

55-
/* Other Statics */
56+
/* Other Constants */
5657
public static readonly FGuid ZERO_GUID = new();
5758
public const string EMPTY_CHAR = "0x0000000000000000000000000000000000000000000000000000000000000000";
5859

Source/vj0/Models/Profiles/Profile.cs

Lines changed: 80 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ private async Task LoadAssetRegistries(CancellationToken cancellationToken = def
362362
/* File IO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
363363
public async Task Save()
364364
{
365+
if (Globals.HideAllProfileCardInformation)
366+
{
367+
return;
368+
}
369+
365370
Directory.CreateDirectory(Globals.ProfilesFolder.ToString());
366371

367372
if (IsAutoDetected)
@@ -568,20 +573,9 @@ public async Task TryAutoFetchAesKeysUndetected()
568573

569574
/* Only for Fortnite */
570575
if (!ArchiveDirectory.Contains("Fortnite")) return;
571-
572-
var normalized = Name;
573-
if (Name.Count(c => c == '.') == 2)
574-
{
575-
var parts = Name.Split('.');
576-
if (parts.Length == 3)
577-
{
578-
normalized = parts[0] + "." + parts[1] + parts[2];
579-
}
580-
}
581576

582-
if (!double.TryParse(normalized, NumberStyles.Float, CultureInfo.InvariantCulture, out var value))
577+
if (!TryParseProfileName(Name, out var value))
583578
{
584-
Log.Information($"Could not parse Profile Name {Name}");
585579
return;
586580
}
587581

@@ -613,6 +607,80 @@ public async Task TryAutoFetchAesKeysUndetected()
613607
DisposeProvider(false);
614608
}
615609

610+
public bool TryParseProfileName(string name, out double value)
611+
{
612+
var normalized = name;
613+
614+
if (name.Count(c => c == '.') == 2)
615+
{
616+
var parts = name.Split('.');
617+
if (parts.Length == 3)
618+
{
619+
normalized = parts[0] + "." + parts[1] + parts[2];
620+
}
621+
}
622+
623+
if (!double.TryParse(normalized, NumberStyles.Float, CultureInfo.InvariantCulture, out value))
624+
{
625+
Log.Information($"Could not parse Profile Name {name}");
626+
return false;
627+
}
628+
629+
return true;
630+
}
631+
632+
public EGame PredictBaseUEVersion(string name)
633+
{
634+
if (!TryParseProfileName(name, out var version))
635+
{
636+
return EGame.GAME_UE5_7;
637+
}
638+
639+
var major = Math.Floor(version);
640+
641+
switch (major)
642+
{
643+
case < 1.10:
644+
{
645+
return EGame.GAME_UE4_16;
646+
}
647+
case < 2.5:
648+
{
649+
return EGame.GAME_UE4_19;
650+
}
651+
case < 7.0:
652+
{
653+
return EGame.GAME_UE4_21;
654+
}
655+
case < 8.1:
656+
{
657+
return EGame.GAME_UE4_22;
658+
}
659+
case < 13.0:
660+
{
661+
return EGame.GAME_UE4_23;
662+
}
663+
}
664+
665+
const double minVersion = 1.0;
666+
const double maxVersion = 36.30;
667+
var t = Math.Clamp((version - minVersion) / (maxVersion - minVersion), 0.0, 1.0);
668+
669+
var baseGames = Enum.GetValues(typeof(EGame))
670+
.Cast<EGame>()
671+
.Where(g => ((uint)g & 0xFFFF) == 0)
672+
.Select(g => (uint)g)
673+
.OrderBy(v => v)
674+
.ToArray();
675+
676+
var startGame = baseGames.First();
677+
var endGame = baseGames.Last();
678+
var lerped = startGame + (endGame - startGame) * t;
679+
var snapped = baseGames.OrderBy(v => Math.Abs(v - lerped)).First();
680+
681+
return (EGame)snapped;
682+
}
683+
616684
public async Task FetchEncryptionKeysAsync(string url = null!, bool isUnknown = false)
617685
{
618686
var aes = await RestAPI.Central.GetAesAsync(url, useBaseUrl: false);

Source/vj0/Services/SettingsService.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Serilog;
66
using vj0.Framework;
77
using vj0.ViewModels.Settings;
8-
using vj0.ViewModels.Settings.View;
98

109
namespace vj0.Services;
1110

@@ -19,9 +18,6 @@ public partial class SettingsService : ObservableObject, IService
1918

2019
[ObservableProperty] private DebugSettingsViewModel _debug = new();
2120

22-
/* Tab Specific */
23-
[ObservableProperty] private ExplorerViewSettingsViewModel _explorerView = new();
24-
2521
private static readonly DirectoryInfo DirectoryPath = new(Path.Combine(
2622
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
2723
Globals.CODENAME));
@@ -30,7 +26,7 @@ public partial class SettingsService : ObservableObject, IService
3026
private static readonly FileInfo FilePath = new(Path.Combine(
3127
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
3228
Globals.CODENAME,
33-
"Settings_Debug.json"));
29+
"Settings.Debug.json"));
3430
#else
3531
private static readonly FileInfo FilePath = new(Path.Combine(
3632
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),

Source/vj0/ViewModels/Profiles/ProfileSelectionViewModel.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,36 @@ private ProfileCard CreateCard(Profile profile)
209209

210210
if (Globals.HideAllProfileCardInformation)
211211
{
212+
var funnyNames = new[]
213+
{
214+
"Turbo Bread",
215+
"Moist Duck",
216+
"Sock Blast",
217+
"Pogo Ants",
218+
"Lawn Rage",
219+
"Toast Jam",
220+
"Glue Hero",
221+
"Beef Quest",
222+
"Chonk Run",
223+
"Crab Life",
224+
"Fork Jam",
225+
"Dust Wars",
226+
"Biscuit X",
227+
"Rat Punch",
228+
"Bean Raid",
229+
"Puff Tank",
230+
"Mug Rush",
231+
"Worm Golf",
232+
"Kelp Gun",
233+
"Yarn Pit"
234+
};
235+
212236
var newProfile = profile.LazyClone();
237+
var random = new Random();
238+
239+
newProfile.Name = funnyNames[random.Next(funnyNames.Length)];
213240
newProfile.Display.SetRandomGradient();
214241
newProfile.ArchiveDirectory = @"D:\Builds\Tropical\Game\Content\Paks";
215-
newProfile.Name = "Game";
216242

217243
vm = GetOrCreateProfileViewModel(newProfile);
218244
}

Source/vj0/ViewModels/Settings/View/ExplorerViewSettingsViewModel.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

Source/vj0/Views/HomeView.axaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@
7474
MinWidth="400">
7575

7676
<TextBlock x:Name="RotatingTaglineText"
77-
FontFamily="Consolas"
7877
Foreground="{DynamicResource AnimatingTextBrush}"
79-
FontWeight="Medium"
80-
LetterSpacing="-0.4"
8178
FontSize="25"
8279
HorizontalAlignment="Center"
8380

@@ -110,7 +107,7 @@
110107
OffsetX="0" OffsetY="0" Opacity="0.3"/>
111108
</Viewbox.Effect>
112109
</Viewbox>
113-
<TextBlock Foreground="White" FontWeight="Bold" FontSize="19">Donate</TextBlock>
110+
<TextBlock Foreground="White" FontWeight="DemiBold" FontSize="19">Donate</TextBlock>
114111
</StackPanel>
115112
</Button>
116113

Source/vj0/Views/Onboarding/OnboardingPreferencesView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
Adjust Your Preferences
2525
</TextBlock>
2626

27-
<views:SettingsView Width="950" Height="400" IsOnboarding="True"/>
27+
<views:SettingsView Width="1000" Height="400" IsOnboarding="True"/>
2828

2929
<Button Classes="BlueShine"
3030
x:Name="ContinueButton"

Source/vj0/Views/Onboarding/OnboardingTermsView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Key Terms
2727
</TextBlock>
2828

29-
<controls:NavigationView Width="950" Height="280" x:Name="NavigationView" Classes="NoBackground" Background="Transparent" PaneDisplayMode="Left" OpenPaneLength="350" IsPaneToggleButtonVisible="False">
29+
<controls:NavigationView Width="1000" Height="280" x:Name="NavigationView" Classes="NoBackground" Background="Transparent" PaneDisplayMode="Left" OpenPaneLength="350" IsPaneToggleButtonVisible="False">
3030
<controls:NavigationView.MenuItems>
3131
<controls:NavigationViewItem Content="Profiles?" Tag="{x:Type OnboardingGuide:OnboardingTermsProfilesView}" IsSelected="True">
3232
<controls:NavigationViewItem.IconSource>

0 commit comments

Comments
 (0)