Skip to content

Commit c74403d

Browse files
committed
Code fixes
1 parent bcb8006 commit c74403d

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

Source/vj0/Models/Profiles/Display/BaseProfileDisplay.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ protected override void NameChanged()
5353
/* Helper */
5454
public string FindContentFolder()
5555
{
56+
if (ArchiveDirectory is null) return null!;
57+
5658
var index = ArchiveDirectory.IndexOf("Content", StringComparison.OrdinalIgnoreCase);
5759
if (index > 0) return ArchiveDirectory[..(index + "Content".Length)];
5860

Source/vj0/Models/Profiles/Display/ProfileSplash.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public ProfileSplash(BaseProfileDisplay profile)
4848
}
4949

5050
var ContentFolder = Profile.FindContentFolder();
51+
52+
if (ContentFolder is null) return null;
5153

5254
var splashPath = Path.Combine(ContentFolder, "Splash", "Splash.bmp");
5355

Source/vj0/Models/Profiles/Profile.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public async Task Initialize(CancellationToken cancellationToken = default)
111111
{
112112
return;
113113
}
114-
// ? await Provider.MountAsync();
114+
await Provider.MountAsync();
115115

116116
if (cancellationToken.IsCancellationRequested)
117117
{
@@ -275,21 +275,12 @@ private async Task LoadKeys(CancellationToken cancellationToken = default)
275275
}
276276
}
277277
}
278-
279-
if (Provider is null) return;
280-
281-
if (cancellationToken.IsCancellationRequested)
282-
{
283-
return;
284-
}
285-
286-
Provider.PostMount();
287278
}
288279
}
289280

290281
private async void LoadMappings(CancellationToken cancellationToken = default)
291282
{
292-
var mapping = await RestAPI.Central.FetchMappingAsync();
283+
var mapping = await RestAPI.Central.FetchMappingAsync(token: cancellationToken);
293284

294285
if (Provider is null) return;
295286

@@ -419,11 +410,11 @@ public Profile Clone()
419410
Version = Version,
420411
FileName = FileName,
421412
AutoDetectedGameId = AutoDetectedGameId,
422-
PakFileEntries = new List<BasePakFileEntry>(PakFileEntries),
413+
PakFileEntries = [..PakFileEntries],
423414
Display = Display.Clone(),
424415
Status = Status,
425416
IsInitialized = true,
426-
SecondaryAssetTypes = new List<string>(SecondaryAssetTypes),
417+
SecondaryAssetTypes = [..SecondaryAssetTypes],
427418
EnableDisplayLinks = true
428419
};
429420
}

Source/vj0/Views/Profiles/ProfileSelectionView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<DropShadowEffect
4747
Color="#e3e3e3"
4848
BlurRadius="99"
49-
Opacity="0.4"/>
49+
Opacity="0.2"/>
5050
</TextBlock.Effect>
5151

5252
Start creating your profiles!

Source/vj0/Windows/MainWindow.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
</Grid>
123123

124124
<!-- Notifications -->
125-
<ItemsControl Margin="0 10" VerticalAlignment="Bottom" ItemsSource="{Binding Info.Messages}">
125+
<ItemsControl Margin="0 25" VerticalAlignment="Bottom" ItemsSource="{Binding Info.Messages}">
126126
<ItemsControl.ItemTemplate>
127127
<DataTemplate>
128128
<controls:InfoBar

0 commit comments

Comments
 (0)