Skip to content

Commit

Permalink
Bump version, add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Falki-git committed Oct 26, 2023
1 parent 03af4cb commit af18906
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin_template/swinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"name": "Skip Splash Screen",
"description": "Skips the splash screen and health warning. To be used only for developing mods (faster iteration).",
"source": "https://github.com/Falki-git/SkipSplashScreen",
"version": "1.1.1",
"version": "1.1.2",
"version_check": "https://raw.githubusercontent.com/Falki-git/SkipSplashScreen/master/plugin_template/swinfo.json",
"ksp2_version": {
"min": "0.1.3",
"min": "0.1.5",
"max": "*"
},
"dependencies": [
{
"id": "com.github.x606.spacewarp",
"version": {
"min": "1.4.0",
"min": "1.5.2",
"max": "*"
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/SkipSplashScreen/SkipSplashScreenPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using KSP.Game;
using SpaceWarp;
using SpaceWarp.API.Mods;
using BepInEx.Logging;

namespace SkipSplashScreen;

Expand All @@ -17,6 +18,8 @@ public class SkipSplashScreenPlugin : BaseSpaceWarpPlugin
[PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;
[PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;

private static ManualLogSource _logger = BepInEx.Logging.Logger.CreateLogSource("SkipSplashScreen");

public void Start()
{
Harmony.CreateAndPatchAll(typeof(SkipSplashScreenPlugin));
Expand All @@ -30,14 +33,18 @@ public void Update()
return;

if (gameState == GameState.MainMenu)
{
_logger.LogDebug($"disappears into oblivion...");
Destroy(this);
}
}

[HarmonyPatch(typeof(SequentialFlow), "AddAction"), HarmonyPrefix]
private static bool SequentialFlow_AddAction(FlowAction action)
{
if (action.Name == "Creating Splash Screens Prefab")
{
_logger.LogDebug($"'Creating Splash Screens Prefab' action found. Skipping!");
GameManager.Instance.HasPhotosensitivityWarningBeenShown = true;
return false;
}
Expand Down

0 comments on commit af18906

Please sign in to comment.