Skip to content

Commit

Permalink
less spam, more useful messages
Browse files Browse the repository at this point in the history
  • Loading branch information
radistmorse committed Jan 1, 2018
1 parent a9cce74 commit 3e74cae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 7 additions & 4 deletions AdjustableModPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ private void OnGUIApplicationLauncherUnreadifying (GameScenes scene) {
}

public void AppButtonDisable () {
CloseMainWindow ();
appButton?.SetFalse ();
}

public void AppButtonEnable () {
Expand Down Expand Up @@ -518,16 +518,19 @@ internal bool ForceUpdate {

internal void RecordMod (string descriptor, ApplicationLauncher.AppScenes visibleInScenes, ApplicationLauncher.AppScenes alwaysOn,Texture2D texture) {
if (!modList.ContainsKey (descriptor)) {
Debug.Log ("[Adjustable Mod Panel] Recorded a new mod: " + descriptor);
Debug.Log ("[Adjustable Mod Panel] Recorded a new mod: " + descriptor.Split ('+')[0]);
modList[descriptor] = new KeyValuePair<ApplicationLauncher.AppScenes, Texture2D> (visibleInScenes, texture);
} else {
// update the value in case the visibility was expanded by the mod
modList[descriptor] = new KeyValuePair<ApplicationLauncher.AppScenes, Texture2D> ((visibleInScenes | modList[descriptor].Key), texture);
}
if (!modMatrix.ContainsKey (descriptor))
modMatrix[descriptor] = visibleInScenes;

modMatrixAlwaysOn[descriptor] = alwaysOn;
if (!modMatrixAlwaysOn.ContainsKey (descriptor)) {
if (alwaysOn != ApplicationLauncher.AppScenes.NEVER)
Debug.Log ("[Adjustable Mod Panel] Mod " + descriptor.Split('+')[0] + " requests to be unswitchable in scenes: " + alwaysOn);
modMatrixAlwaysOn[descriptor] = alwaysOn;
}
}

#region Config
Expand Down
3 changes: 1 addition & 2 deletions ModPanelComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void Awake () {

if (modlist == null) {
// no modlist, nothing to do
Debug.Log ("[Adjustable Mod Panel] No mod panel found, exiting now.");
Debug.Log ("[Adjustable Mod Panel] ERROR: No mod panel found, exiting now.");
Destroy (this);
}
}
Expand Down Expand Up @@ -69,7 +69,6 @@ public void Update () {
KSP.UI.Screens.ApplicationLauncher.AppScenes alwaysOn = KSP.UI.Screens.ApplicationLauncher.AppScenes.NEVER;

if (button.container.Data is KSP.UI.Screens.ApplicationLauncher.AppScenes) {
Debug.Log ("[Adjustable Mod Panel] Mod " + module + " requests to be unswitchable in scenes: " + button.container.Data);
alwaysOn = (KSP.UI.Screens.ApplicationLauncher.AppScenes)button.container.Data;
}

Expand Down

0 comments on commit 3e74cae

Please sign in to comment.