From 8edb8f173c60af6ae1c4c9671d87574b2940173c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Tombor?= <28480228+Smart123s@users.noreply.github.com> Date: Sat, 3 Jun 2023 04:53:38 +0200 Subject: [PATCH] Don't show prompt after the segment has ended (#152) If the user has `HidePromptAdjustment` set to a value larger then the intro length, the prompt would be visible after the intro has ended. Additionally, setting this value to a ridiculously high number allows user to make the prompt visible until the end of the segment. --- .../Controllers/SkipIntroController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs index b98fc3e..a595c2f 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs @@ -91,6 +91,12 @@ public class SkipIntroController : ControllerBase segment.HideSkipPromptAt = segment.IntroStart + config.HidePromptAdjustment; segment.IntroEnd -= config.SecondsOfIntroToPlay; + // Don't show prompt after the segment has ended + if (segment.HideSkipPromptAt > segment.IntroEnd) + { + segment.HideSkipPromptAt = segment.IntroEnd; + } + return segment; } catch (KeyNotFoundException)