mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 21:33:28 +08:00
HideTips v1.0.2
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using BepInEx;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace HideTips;
|
||||
|
||||
@@ -15,6 +16,7 @@ public class HideTips : BaseUnityPlugin
|
||||
private static bool _noAchievementCardPopups = false;
|
||||
private static bool _noMilestoneCardPopups = true;
|
||||
private static bool _skipPrologue = true;
|
||||
private static bool _hideMenuDemo = false;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -24,8 +26,13 @@ public class HideTips : BaseUnityPlugin
|
||||
_noAchievementCardPopups = Config.Bind("General", "NoAchievementCardPopups", _noAchievementCardPopups, "Disable Achievement 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;
|
||||
_hideMenuDemo = Config.Bind("General", "HideMenuDemo", _hideMenuDemo, "Disable title screen demo scene loading").Value;
|
||||
if (!_cfgEnabled) return;
|
||||
Harmony.CreateAndPatchAll(typeof(HideTips));
|
||||
if (_hideMenuDemo)
|
||||
{
|
||||
Harmony.CreateAndPatchAll(typeof(HideMenuDemo));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
@@ -75,10 +82,80 @@ public class HideTips : BaseUnityPlugin
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(DSPGame), "StartGame", typeof(GameDesc))]
|
||||
private static bool OnStartGame(GameDesc _gameDesc)
|
||||
private static bool DSPGame_OnStartGame_Prefix(GameDesc _gameDesc)
|
||||
{
|
||||
if (!_skipPrologue) return true;
|
||||
DSPGame.StartGameSkipPrologue(_gameDesc);
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<AssemblyName>HideTips</AssemblyName>
|
||||
<BepInExPluginGuid>org.soardev.hidetips</BepInExPluginGuid>
|
||||
<Description>DSP MOD - HideTips</Description>
|
||||
<Version>1.0.1</Version>
|
||||
<Version>1.0.2</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -5,17 +5,22 @@
|
||||
|
||||
## Updates
|
||||
|
||||
* 1.0.2
|
||||
* Add option to disable title screen demo scene loading
|
||||
|
||||
* 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
|
||||
|
||||
## Usage
|
||||
|
||||
* Tips/messages that can be hidden: random-reminder, tutorial, achievement/milestone card.
|
||||
* Skip prologue for new game.
|
||||
* Disable title screen demo scene loading.
|
||||
* Each type of tips/messages is configurable individually.
|
||||
|
||||
## 使用说明
|
||||
|
||||
* 可以屏蔽的消息:随机提醒,教程,成就/里程碑卡片。
|
||||
* 跳过新游戏引导动画。
|
||||
* 关闭标题画面的演示场景加载。
|
||||
* 各种屏蔽功能都可以在配置文件里开关。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "HideTips",
|
||||
"version_number": "1.0.1",
|
||||
"version_number": "1.0.2",
|
||||
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/HideTips",
|
||||
"description": "Hide/Disable various tutorial tips/messages / 隐藏/屏蔽各种引导提示/消息",
|
||||
"dependencies": [
|
||||
|
||||
Reference in New Issue
Block a user