diff --git a/GUI/Controls/ModInfo.cs b/GUI/Controls/ModInfo.cs index 6f849d3d9c..11484c6bec 100644 --- a/GUI/Controls/ModInfo.cs +++ b/GUI/Controls/ModInfo.cs @@ -54,7 +54,7 @@ public GUIMod SelectedModule { ReverseRelationshipsCheckbox.CheckState = CheckState.Unchecked; } - UpdateHeaderInfo(module); + UpdateHeaderInfo(value, manager.CurrentInstance.VersionCriteria()); LoadTab(ModInfoTabControl.SelectedTab.Name, value); } selectedModule = value; @@ -168,8 +168,9 @@ private void LinkLabel_KeyDown(object sender, KeyEventArgs e) } } - private void UpdateHeaderInfo(CkanModule module) + private void UpdateHeaderInfo(GUIMod gmod, GameVersionCriteria crit) { + var module = gmod.ToModule(); Util.Invoke(this, () => { MetadataModuleNameTextBox.Text = module.name; @@ -181,6 +182,16 @@ private void UpdateHeaderInfo(CkanModule module) string.IsNullOrWhiteSpace(module.description) ? ScrollBars.None : ScrollBars.Vertical; + // Mono doesn't draw TabPage.ImageIndex, so fake it + const string fakeStopSign = " "; + ComponentResourceManager resources = new SingleAssemblyComponentResourceManager(typeof(ModInfo)); + resources.ApplyResources(RelationshipTabPage, "RelationshipTabPage"); + resources.ApplyResources(AllModVersionsTabPage, "AllModVersionsTabPage"); + if (gmod.IsIncompatible) + { + var pageToAlert = module.IsCompatibleKSP(crit) ? RelationshipTabPage : AllModVersionsTabPage; + pageToAlert.Text = fakeStopSign + pageToAlert.Text; + } }); } @@ -211,25 +222,6 @@ private void UpdateModInfo(GUIMod gui_module) }); Util.Invoke(MetadataModuleGameCompatibilityTextBox, () => MetadataModuleGameCompatibilityTextBox.Text = gui_module.GameCompatibilityLong); - Util.Invoke(ModInfoTabControl, () => - { - // Mono doesn't draw TabPage.ImageIndex, so fake it - const string fakeStopSign = " "; - ComponentResourceManager resources = new SingleAssemblyComponentResourceManager(typeof(ModInfo)); - resources.ApplyResources(RelationshipTabPage, "RelationshipTabPage"); - resources.ApplyResources(AllModVersionsTabPage, "AllModVersionsTabPage"); - if (gui_module.IsIncompatible) - { - if (!module.IsCompatibleKSP(manager.CurrentInstance.VersionCriteria())) - { - AllModVersionsTabPage.Text = fakeStopSign + AllModVersionsTabPage.Text; - } - else - { - RelationshipTabPage.Text = fakeStopSign + RelationshipTabPage.Text; - } - } - }); Util.Invoke(ReplacementTextBox, () => { if (module.replaced_by == null)