Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red highlight for dependencies on missing DLC #3698

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 2 additions & 14 deletions Core/Types/CkanModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -607,21 +607,9 @@ public bool DoesProvide(string identifier)
return this.identifier == identifier || provides.Contains(identifier);
}

public bool IsMetapackage
{
get
{
return this.kind == "metapackage";
}
}
public bool IsMetapackage => kind == "metapackage";

public bool IsDLC
{
get
{
return this.kind == "dlc";
}
}
public bool IsDLC => kind == "dlc";

protected bool Equals(CkanModule other)
{
Expand Down
5 changes: 4 additions & 1 deletion GUI/Controls/ModInfoTabs/Relationships.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ private TreeNode providesNode(string identifier, RelationshipType relationship,
private TreeNode indexedNode(IRegistryQuerier registry, CkanModule module, RelationshipType relationship, RelationshipDescriptor relDescr, GameVersionCriteria crit)
{
int icon = (int)relationship + 1;
bool missingDLC = module.IsDLC && !registry.InstalledDlc.ContainsKey(module.identifier);
bool compatible = crit == null ? false
: registry.IdentifierCompatible(module.identifier, crit);
string suffix = compatible ? ""
Expand All @@ -335,7 +336,9 @@ private TreeNode indexedNode(IRegistryQuerier registry, CkanModule module, Relat
Name = module.identifier,
ToolTipText = $"{relationship.Localize()} {relDescr}",
Tag = module,
ForeColor = compatible ? SystemColors.WindowText : Color.Red,
ForeColor = (compatible && !missingDLC)
? SystemColors.WindowText
: Color.Red,
};
}

Expand Down