Changes to Module, Core, and throughout to support module filtering by game mode. Also tweaks to CareerStatus.formatDelta.
[VOID.git] / VOIDCore_Generic.cs
blob:a/VOIDCore_Generic.cs -> blob:b/VOIDCore_Generic.cs
--- a/VOIDCore_Generic.cs
+++ b/VOIDCore_Generic.cs
@@ -324,6 +324,12 @@
 				return HighLogic.LoadedScene.ToAppScenes();
 			}
 		}
+
+		/*
+		 * Events
+		 * */
+		public override event VOIDEventHandler onApplicationQuit;
+		public override event VOIDEventHandler onSkinChanged;
 
 		/*
 		 * Methods
@@ -573,6 +579,16 @@
 			this.Dispose();
 		}
 
+		public virtual void OnApplicationQuit()
+		{
+			if (this.onApplicationQuit != null)
+			{
+				this.onApplicationQuit(this);
+			}
+
+			this.OnDestroy();
+		}
+
 		public void ResetGUI()
 		{
 			this.StopGUI();
@@ -941,6 +957,11 @@
 		protected void LoadGUIStyles()
 		{
 			VOID_Styles.OnSkinChanged();
+
+			if (this.onSkinChanged != null)
+			{
+				this.onSkinChanged(this);
+			}
 
 			this.GUIStylesLoaded = true;
 		}