Skip to content

Commit

Permalink
Revert back to old naming
Browse files Browse the repository at this point in the history
Renaming causes too many issues and corrupts the global config so that
the delta V and vessel info windows disappears in the VAB.

Unfortunately, corrupted windows will need to be manually fixed by
editing mechjeb_settings_global.cfg and setting showInEditor to
'True' for the 'Vessel Info' and 'Stage Stats' windows.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Nov 2, 2023
1 parent e58d5d2 commit dc4525e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions MechJeb2/DisplayModule.cs
Expand Up @@ -56,33 +56,35 @@ protected set

[UsedImplicitly]
[Persistent(pass = (int)Pass.GLOBAL)]
public bool ShowInFlightConfig = true;
// ReSharper disable once InconsistentNaming
public bool showInFlight = true;

public bool ShowInFlight
{
get => ShowInFlightConfig;
get => showInFlight;
set
{
if (ShowInFlightConfig != value)
if (showInFlight != value)
{
ShowInFlightConfig = value;
Dirty = true;
showInFlight = value;
Dirty = true;
}
}
}

[UsedImplicitly]
[Persistent(pass = (int)Pass.GLOBAL)]
public bool ShowInEditorConfig;
// ReSharper disable once InconsistentNaming
public bool showInEditor;

public bool ShowInEditor
{
get => ShowInEditorConfig;
get => showInEditor;
set
{
if (ShowInEditorConfig == value) return;
ShowInEditorConfig = value;
Dirty = true;
if (showInEditor == value) return;
showInEditor = value;
Dirty = true;
}
}

Expand Down Expand Up @@ -121,7 +123,7 @@ public bool Locked

private GUILayoutOption[] _windowOptions;

public bool ShowInCurrentScene => HighLogic.LoadedSceneIsEditor ? ShowInEditorConfig : ShowInFlightConfig;
public bool ShowInCurrentScene => HighLogic.LoadedSceneIsEditor ? showInEditor : showInFlight;

private readonly int _id;
private static int _nextID = 72190852;
Expand Down

0 comments on commit dc4525e

Please sign in to comment.