Skip to content

Commit

Permalink
version 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
radistmorse committed May 9, 2018
1 parent 359433a commit d4737ca
Show file tree
Hide file tree
Showing 6 changed files with 356 additions and 90 deletions.
187 changes: 103 additions & 84 deletions AdjustableModPanel.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion AdjustableModPanel.version
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"VERSION": {
"MAJOR": 1,
"MINOR": 4,
"MINOR": 5,
"PATCH": 0,
"BUILD": 0
},
Expand Down
1 change: 1 addition & 0 deletions AfjustableModPanel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ModPanelIcons.cs" />
<Compile Include="ModPanelComponent.cs" />
<Compile Include="AdjustableModPanel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
10 changes: 8 additions & 2 deletions ModPanelComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,16 @@ public void Update () {
button.VisibleInScenes = AdjustableModPanel.Instance.GetModScenes (module, method, button.VisibleInScenes, cashes[button]);
// normally, this should be enough. But for some reason some mode buttons remain active,
//even when they should not. So we change the button state explicitly.
button.gameObject.SetActive (KSP.UI.Screens.ApplicationLauncher.Instance.ShouldBeVisible (button));
bool visible = KSP.UI.Screens.ApplicationLauncher.Instance.ShouldBeVisible (button);
button.gameObject.SetActive (visible);

if (visible && AdjustableModPanel.Instance.GetModPinned (module, method, button.VisibleInScenes, cashes[button])) {
// move to the top of the mod panel
mod.listItem.transform.SetAsFirstSibling ();
}
}

// place on top
// our own button should always be the first
myButton?.listItem.transform.SetAsFirstSibling ();
}
}
Expand Down
Loading

0 comments on commit d4737ca

Please sign in to comment.