-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
添加 DisableBackgroud(关闭背景) SkipFade(跳过过场动画) 功能
- Loading branch information
1 parent
dcd2c4c
commit 057798b
Showing
8 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace SinmaiAssist { | ||
public static partial class BuildInfo { | ||
public const string CommitHash = "6fba1e6"; | ||
public const string BuildDate = "2024-10-04T12:49:39.1283596+08:00"; | ||
public const string CommitHash = "dcd2c4c"; | ||
public const string BuildDate = "2024-10-07T03:09:30.3189038+08:00"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using HarmonyLib; | ||
using Monitor; | ||
using UnityEngine; | ||
|
||
namespace SinmaiAssist.Common; | ||
|
||
public class DisableBackground | ||
{ | ||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(MonitorBackgroundTownController), "SetMainDisp")] | ||
public static bool SetMainDisp(MonitorBackgroundTownController __instance, ref bool dispflag) | ||
{ | ||
dispflag = false; | ||
DisableSubBackground(); | ||
return true; | ||
} | ||
|
||
private static void DisableSubBackground() | ||
{ | ||
try | ||
{ | ||
if (SinmaiAssist.config.Common.SinglePlayer.HideSubMonitor) return; | ||
GameObject leftSubMonitor = GameObject.Find("LeftMonitor") | ||
.transform.Find("CommonProcess(Clone)") | ||
.transform.Find("RearCanvas") | ||
.transform.Find("Sub") | ||
.Find("UI_SubBackground").gameObject; | ||
leftSubMonitor.SetActive(false); | ||
GameObject rightSubMonitor = GameObject.Find("RightMonitor") | ||
.transform.Find("CommonProcess(Clone)") | ||
.transform.Find("RearCanvas") | ||
.transform.Find("Sub") | ||
.Find("UI_SubBackground").gameObject; | ||
rightSubMonitor.SetActive(false); | ||
} | ||
catch (Exception e) | ||
{ | ||
// ignored | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using HarmonyLib; | ||
|
||
namespace SinmaiAssist.Common; | ||
|
||
public class SkipFade | ||
{ | ||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(FadeProcess), "OnStart")] | ||
public static bool OnStart(FadeProcess __instance) | ||
{ | ||
__instance.ProcessingProcess(); | ||
return false; | ||
} | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(FadeProcess), "StartFadeIn")] | ||
public static bool StartFadeIn(FadeProcess __instance) | ||
{ | ||
__instance.ProcessingProcess(); | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters