1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 16:13:31 +08:00

HideTips v1.0.2

This commit is contained in:
2023-08-16 17:38:51 +08:00
parent 5f5fb49fcb
commit d9ac817a0e
4 changed files with 86 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
using System; using System;
using BepInEx; using BepInEx;
using HarmonyLib; using HarmonyLib;
using UnityEngine;
namespace HideTips; namespace HideTips;
@@ -15,6 +16,7 @@ public class HideTips : BaseUnityPlugin
private static bool _noAchievementCardPopups = false; private static bool _noAchievementCardPopups = false;
private static bool _noMilestoneCardPopups = true; private static bool _noMilestoneCardPopups = true;
private static bool _skipPrologue = true; private static bool _skipPrologue = true;
private static bool _hideMenuDemo = false;
private void Awake() private void Awake()
{ {
@@ -24,8 +26,13 @@ public class HideTips : BaseUnityPlugin
_noAchievementCardPopups = Config.Bind("General", "NoAchievementCardPopups", _noAchievementCardPopups, "Disable Achievement Card Popups").Value; _noAchievementCardPopups = Config.Bind("General", "NoAchievementCardPopups", _noAchievementCardPopups, "Disable Achievement Card Popups").Value;
_noMilestoneCardPopups = Config.Bind("General", "NoMilestoneCardPopups", _noMilestoneCardPopups, "Disable Milestone Card Popups").Value; _noMilestoneCardPopups = Config.Bind("General", "NoMilestoneCardPopups", _noMilestoneCardPopups, "Disable Milestone Card Popups").Value;
_skipPrologue = Config.Bind("General", "SkipPrologue", _skipPrologue, "Skip prologue for new game").Value; _skipPrologue = Config.Bind("General", "SkipPrologue", _skipPrologue, "Skip prologue for new game").Value;
_hideMenuDemo = Config.Bind("General", "HideMenuDemo", _hideMenuDemo, "Disable title screen demo scene loading").Value;
if (!_cfgEnabled) return; if (!_cfgEnabled) return;
Harmony.CreateAndPatchAll(typeof(HideTips)); Harmony.CreateAndPatchAll(typeof(HideTips));
if (_hideMenuDemo)
{
Harmony.CreateAndPatchAll(typeof(HideMenuDemo));
}
} }
[HarmonyPostfix] [HarmonyPostfix]
@@ -75,10 +82,80 @@ public class HideTips : BaseUnityPlugin
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(DSPGame), "StartGame", typeof(GameDesc))] [HarmonyPatch(typeof(DSPGame), "StartGame", typeof(GameDesc))]
private static bool OnStartGame(GameDesc _gameDesc) private static bool DSPGame_OnStartGame_Prefix(GameDesc _gameDesc)
{ {
if (!_skipPrologue) return true; if (!_skipPrologue) return true;
DSPGame.StartGameSkipPrologue(_gameDesc); DSPGame.StartGameSkipPrologue(_gameDesc);
return false; return false;
} }
} }
[HarmonyPatch]
class HideMenuDemo
{
[HarmonyPrefix]
[HarmonyPatch(typeof(DSPGame), "StartDemoGame", typeof(int))]
private static bool DSPGame_OnStartDemoGame_Prefix()
{
if (DSPGame.Game != null)
{
DSPGame.EndGame();
}
DSPGame.IsMenuDemo = true;
DSPGame.CreateGameMainObject();
DSPGame.Game.isMenuDemo = true;
DSPGame.Game.CreateIconSet();
GameMain.data = new GameData();
GameMain.data.mainPlayer = Player.Create(GameMain.data, 1);
GameMain.data.galaxy = new GalaxyData
{
starCount = 0
};
if (GameMain.universeSimulator != null)
{
UnityEngine.Object.Destroy(GameMain.universeSimulator.gameObject);
}
GameMain.universeSimulator = UnityEngine.Object.Instantiate(Configs.builtin.universeSimulatorPrefab);
GameMain.universeSimulator.spaceAudio = new GameObject("Space Audio")
{
transform =
{
parent = GameMain.universeSimulator.transform
}
}.AddComponent<SpaceAudio>();
GameMain.Begin();
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(VFPreload), "IsMenuDemoLoaded")]
private static bool VFPreload_IsMenuDemoLoaded_Prefix(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(DSPGame), "LateUpdate")]
[HarmonyPatch(typeof(GameMain), "LateUpdate")]
[HarmonyPatch(typeof(GameMain), "FixedUpdate")]
[HarmonyPatch(typeof(GameMain), "Update")]
[HarmonyPatch(typeof(GameCamera), "LateUpdate")]
private static bool DSPGame_LateUpdate_Prefix()
{
return !DSPGame.IsMenuDemo;
}
[HarmonyPrefix]
[HarmonyPriority(Priority.Last)]
[HarmonyPatch(typeof(GameMain), "Begin")]
private static bool GameMain_Begin_Prefix()
{
if (!DSPGame.IsMenuDemo) return true;
DSPGame.Game._loading = false;
DSPGame.Game._running = true;
return false;
}
}

View File

@@ -5,7 +5,7 @@
<AssemblyName>HideTips</AssemblyName> <AssemblyName>HideTips</AssemblyName>
<BepInExPluginGuid>org.soardev.hidetips</BepInExPluginGuid> <BepInExPluginGuid>org.soardev.hidetips</BepInExPluginGuid>
<Description>DSP MOD - HideTips</Description> <Description>DSP MOD - HideTips</Description>
<Version>1.0.1</Version> <Version>1.0.2</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
</PropertyGroup> </PropertyGroup>

View File

@@ -5,6 +5,9 @@
## Updates ## Updates
* 1.0.2
* Add option to disable title screen demo scene loading
* 1.0.1 * 1.0.1
* Hide 3 more random tutorial tips popup from bottom-right panel * Hide 3 more random tutorial tips popup from bottom-right panel
@@ -12,10 +15,12 @@
* Tips/messages that can be hidden: random-reminder, tutorial, achievement/milestone card. * Tips/messages that can be hidden: random-reminder, tutorial, achievement/milestone card.
* Skip prologue for new game. * Skip prologue for new game.
* Disable title screen demo scene loading.
* Each type of tips/messages is configurable individually. * Each type of tips/messages is configurable individually.
## 使用说明 ## 使用说明
* 可以屏蔽的消息:随机提醒,教程,成就/里程碑卡片。 * 可以屏蔽的消息:随机提醒,教程,成就/里程碑卡片。
* 跳过新游戏引导动画。 * 跳过新游戏引导动画。
* 关闭标题画面的演示场景加载。
* 各种屏蔽功能都可以在配置文件里开关。 * 各种屏蔽功能都可以在配置文件里开关。

View File

@@ -1,6 +1,6 @@
{ {
"name": "HideTips", "name": "HideTips",
"version_number": "1.0.1", "version_number": "1.0.2",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/HideTips", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/HideTips",
"description": "Hide/Disable various tutorial tips/messages / 隐藏/屏蔽各种引导提示/消息", "description": "Hide/Disable various tutorial tips/messages / 隐藏/屏蔽各种引导提示/消息",
"dependencies": [ "dependencies": [