Skip to content

Commit

Permalink
Various Minor Housecleaning Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DelnarErsike committed Feb 26, 2024
1 parent ce0967e commit ff0af68
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 35 deletions.
10 changes: 3 additions & 7 deletions Chummer/Backend/Characters/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7164,13 +7164,9 @@ IReadOnlyList<CustomDataDirectoryInfo> lstProspectiveInfos
// ReSharper disable once MethodHasAsyncOverload
? this.GetNodeXPath(token: token)
: await this.GetNodeXPathAsync(token: token).ConfigureAwait(false);
if (objMetavariantNode != null)
{
Guid.TryParse(objMetavariantNode
.SelectSingleNodeAndCacheExpression("id", token)?.Value,
out _guiMetavariant);
}
else
if (!Guid.TryParse(
objMetavariantNode?.SelectSingleNodeAndCacheExpression("id", token)?.Value,
out _guiMetavariant))
_guiMetavariant = Guid.Empty;
}
// Empty metavariant GUID takes precedence over non-empty metavariant name
Expand Down
2 changes: 1 addition & 1 deletion Chummer/Controls/Shared/ObservableCollectionDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ private static Task<bool> DefaultVisibleAsync(TType x, CancellationToken token =
return token.IsCancellationRequested ? Task.FromCanceled<bool>(token) : Task.FromResult(true);
}

private Task<bool> DefaultVisibleAsync(Predicate<TType> predicate, TType x, CancellationToken token = default)
private static Task<bool> DefaultVisibleAsync(Predicate<TType> predicate, TType x, CancellationToken token = default)
{
return token.IsCancellationRequested
? Task.FromCanceled<bool>(token)
Expand Down
50 changes: 24 additions & 26 deletions Chummer/Forms/Character Forms/CharacterCareer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3472,34 +3472,32 @@ await CharacterObject.ExpenseEntries

if (e.PropertyNames.Contains(nameof(Character.InitiationEnabled)))
{
// Change the status of the Initiation tab being show.
if (CharacterObject.InitiationEnabled)
{
// Change the status of the Initiation tab being show.
if (CharacterObject.InitiationEnabled)
{
await tabCharacterTabs.DoThreadSafeAsync(x =>
{
if (!x.TabPages.Contains(tabInitiation))
x.TabPages.Insert(3, tabInitiation);
}, token).ConfigureAwait(false);
await gpbInitiationType
.DoThreadSafeAsync(x => x.Visible = true, token)
.ConfigureAwait(false);
await gpbInitiationGroup
.DoThreadSafeAsync(x => x.Visible = true, token)
.ConfigureAwait(false);
}
else
await tabCharacterTabs.DoThreadSafeAsync(x =>
{
await tabCharacterTabs
.DoThreadSafeAsync(x => x.TabPages.Remove(tabInitiation), token)
.ConfigureAwait(false);
await gpbInitiationType
.DoThreadSafeAsync(x => x.Visible = false, token)
.ConfigureAwait(false);
await gpbInitiationGroup
.DoThreadSafeAsync(x => x.Visible = false, token)
.ConfigureAwait(false);
}
if (!x.TabPages.Contains(tabInitiation))
x.TabPages.Insert(3, tabInitiation);
}, token).ConfigureAwait(false);
await gpbInitiationType
.DoThreadSafeAsync(x => x.Visible = true, token)
.ConfigureAwait(false);
await gpbInitiationGroup
.DoThreadSafeAsync(x => x.Visible = true, token)
.ConfigureAwait(false);
}
else
{
await tabCharacterTabs
.DoThreadSafeAsync(x => x.TabPages.Remove(tabInitiation), token)
.ConfigureAwait(false);
await gpbInitiationType
.DoThreadSafeAsync(x => x.Visible = false, token)
.ConfigureAwait(false);
await gpbInitiationGroup
.DoThreadSafeAsync(x => x.Visible = false, token)
.ConfigureAwait(false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<cyberware>
<id>7b2accbc-7f6b-4362-ba7f-52a76fccf043</id>
<bonus addifnotfound="True">
<enablecyberzombie amendoperation="addnode">True</enablecyberzombie>
<enablecyberzombie>True</enablecyberzombie>
</bonus>
</cyberware>
</cyberwares>
Expand Down

0 comments on commit ff0af68

Please sign in to comment.