mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 02:53:29 +08:00
WIP
This commit is contained in:
@@ -20,7 +20,7 @@ public class HideTips : BaseUnityPlugin
|
||||
private static bool _noResearchCompletionPopups = true;
|
||||
private static bool _noResearchCompletionTips;
|
||||
private static bool _skipPrologue = true;
|
||||
// private static bool _hideMenuDemo;
|
||||
// private static bool _hideMenuDemo;
|
||||
|
||||
private static Harmony _patch;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class HideTips : BaseUnityPlugin
|
||||
_noResearchCompletionPopups = Config.Bind("General", "NoResearchCompletionPopups", _noResearchCompletionPopups, "Disable Research Completion Popup Windows").Value;
|
||||
_noResearchCompletionTips = Config.Bind("General", "NoResearchCompletionTips", _noResearchCompletionTips, "Disable Research Completion Tips").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;
|
||||
// _hideMenuDemo = Config.Bind("General", "HideMenuDemo", _hideMenuDemo, "Disable title screen demo scene loading").Value;
|
||||
if (!_cfgEnabled) return;
|
||||
Harmony.CreateAndPatchAll(typeof(HideTips));
|
||||
/*
|
||||
@@ -50,7 +50,7 @@ public class HideTips : BaseUnityPlugin
|
||||
_patch?.UnpatchSelf();
|
||||
_patch = null;
|
||||
}
|
||||
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(VFPreload), nameof(VFPreload.Start))]
|
||||
private static void VFPreload_Start_Prefix(VFPreload __instance)
|
||||
@@ -59,7 +59,7 @@ public class HideTips : BaseUnityPlugin
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UIBuildMenu), "_OnCreate")]
|
||||
[HarmonyPatch(typeof(UIBuildMenu), nameof(UIBuildMenu._OnCreate))]
|
||||
private static void ClearRandReminderTips(UIBuildMenu __instance)
|
||||
{
|
||||
if (!_noRandomReminderTips) return;
|
||||
@@ -70,48 +70,52 @@ public class HideTips : BaseUnityPlugin
|
||||
randTip._Free();
|
||||
}
|
||||
}
|
||||
|
||||
__instance.randRemindTips = Array.Empty<UIRandomTip>();
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UIGameMenu), "_OnCreate")]
|
||||
[HarmonyPatch(typeof(UIGameMenu), nameof(UIGameMenu._OnCreate))]
|
||||
private static void UIGameMenu__OnCreate_Postfix(UIGameMenu __instance)
|
||||
{
|
||||
if (!_noRandomReminderTips) return;
|
||||
__instance.randTipButton0.pop = __instance.randTipButton0.popCount;
|
||||
__instance.randTipButton1.pop = __instance.randTipButton1.popCount;
|
||||
__instance.randTipButton2.pop = __instance.randTipButton2.popCount;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UITutorialTip), "PopupTutorialTip")]
|
||||
private static bool UITutorialTip_PopupTutorialTip_Prefix()
|
||||
[HarmonyPatch(typeof(UITutorialTip), nameof(UITutorialTip.PopupTutorialTip))]
|
||||
private static bool UITutorialTip_PopupTutorialTip_Prefix(int tutorialId)
|
||||
{
|
||||
return !_noTutorialTips;
|
||||
if (!_noTutorialTips) return true;
|
||||
GameMain.history.UnlockTutorial(tutorialId);
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UIVariousPopupGroup), "CreateAchievementPopupCard")]
|
||||
[HarmonyPatch(typeof(UIVariousPopupGroup), nameof(UIVariousPopupGroup.CreateAchievementPopupCard))]
|
||||
private static bool UIVariousPopupGroup_CreateAchievementPopupCard_Prefix()
|
||||
{
|
||||
return !_noAchievementCardPopups;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UIVariousPopupGroup), "CreateMilestonePopupCard")]
|
||||
[HarmonyPatch(typeof(UIVariousPopupGroup), nameof(UIVariousPopupGroup.CreateMilestonePopupCard))]
|
||||
private static bool UIVariousPopupGroup_CreateMilestonePopupCard_Prefix()
|
||||
{
|
||||
return !_noMilestoneCardPopups;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UIResearchResultWindow), "SetTechId")]
|
||||
[HarmonyPatch(typeof(UIResearchResultWindow), nameof(UIResearchResultWindow.SetTechId))]
|
||||
private static bool UIResearchResultWindow_SetTechId_Prefix()
|
||||
{
|
||||
return !_noResearchCompletionPopups;
|
||||
}
|
||||
|
||||
|
||||
[HarmonyTranspiler]
|
||||
[HarmonyPatch(typeof(UIGeneralTips), "OnTechUnlocked")]
|
||||
[HarmonyPatch(typeof(UIGeneralTips), nameof(UIGeneralTips.OnTechUnlocked))]
|
||||
private static IEnumerable<CodeInstruction> UIGeneralTips_OnTechUnlocked_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
|
||||
{
|
||||
var matcher = new CodeMatcher(instructions, generator);
|
||||
@@ -134,7 +138,7 @@ public class HideTips : BaseUnityPlugin
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(DSPGame), "StartGame", typeof(GameDesc))]
|
||||
[HarmonyPatch(typeof(DSPGame), nameof(DSPGame.StartGame), typeof(GameDesc))]
|
||||
private static bool DSPGame_StartGame_Prefix(GameDesc _gameDesc)
|
||||
{
|
||||
if (!_skipPrologue) return true;
|
||||
@@ -174,7 +178,7 @@ class HideMenuDemo
|
||||
GameMain.universeSimulator = UnityEngine.Object.Instantiate(Configs.builtin.universeSimulatorPrefab);
|
||||
GameMain.universeSimulator.spaceAudio = new GameObject("Space Audio")
|
||||
{
|
||||
transform =
|
||||
transform =
|
||||
{
|
||||
parent = GameMain.universeSimulator.transform
|
||||
}
|
||||
@@ -182,7 +186,7 @@ class HideMenuDemo
|
||||
GameMain.Begin();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
[HarmonyPriority(Priority.First), HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(VFPreload), "IsMenuDemoLoaded")]
|
||||
private static bool VFPreload_IsMenuDemoLoaded_Prefix(ref bool __result)
|
||||
@@ -190,7 +194,7 @@ class HideMenuDemo
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
[HarmonyPriority(Priority.First), HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(DSPGame), "LateUpdate")]
|
||||
[HarmonyPatch(typeof(GameMain), "LateUpdate")]
|
||||
@@ -212,4 +216,4 @@ class HideMenuDemo
|
||||
return false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
<AssemblyName>HideTips</AssemblyName>
|
||||
<BepInExPluginGuid>org.soardev.hidetips</BepInExPluginGuid>
|
||||
<Description>DSP MOD - HideTips</Description>
|
||||
<Version>1.0.3</Version>
|
||||
<Version>1.0.4</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RestoreAdditionalProjectSources>https://nuget.bepinex.dev/v3/index.json</RestoreAdditionalProjectSources>
|
||||
@@ -23,7 +23,7 @@
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release'">
|
||||
<Exec Command="del /F /Q package\$(ProjectName)-$(Version).zip
powershell Compress-Archive -Force -DestinationPath 'package/$(ProjectName)-$(Version).zip' -Path '$(TargetPath)', package/icon.png, package/manifest.json, README.md" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#### 隐藏/屏蔽各种引导提示/消息
|
||||
|
||||
## Changelog
|
||||
* 1.0.4
|
||||
+ Remove `Disable title screen demo scene loading`, as it is buggy in recent updates.
|
||||
+ Fix a bug that when tutorials are not added to the guides panel when they are hidden by this MOD.
|
||||
* 1.0.3
|
||||
+ Add config entries to disable research completion tips/popup windows
|
||||
+ Add a note to README for mod compatibility on `Disable title screen demo scene loading`.
|
||||
@@ -17,10 +20,12 @@
|
||||
## Usage
|
||||
* Tips/messages that can be hidden: random-reminder, tutorial, achievement/milestone card, research completion tips/popup windows.
|
||||
* Skip prologue for new game.
|
||||
* Disable title screen demo scene loading. Be note that this may conflict with some mods, disable this if you get any error popup on title screen.
|
||||
* Each type of tips/messages is configurable individually.
|
||||
|
||||
## 更新日志
|
||||
* 1.0.4
|
||||
+ 移除`关闭标题画面的演示场景加载`设置,因为在最近的更新中有较多bug。
|
||||
+ 修复了一个bug,当教程指引被这个MOD隐藏时,它们不会被添加到教程面板。
|
||||
* 1.0.3
|
||||
+ 增加设置项以关闭研究完成的提示/弹窗
|
||||
+ 在README中增加了一个关于`关闭标题画面的演示场景加载`设置的兼容性说明
|
||||
@@ -34,5 +39,4 @@
|
||||
## 使用说明
|
||||
* 可以屏蔽的消息:随机提醒,教程,成就/里程碑卡片,研究完成的提示/弹窗。
|
||||
* 跳过新游戏引导动画。
|
||||
* 关闭标题画面的演示场景加载。注意这可能会和其他mod冲突,如果在标题画面出现错误弹窗请关闭这个设置。
|
||||
* 各种屏蔽功能都可以在配置文件里开关。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "HideTips",
|
||||
"version_number": "1.0.3",
|
||||
"version_number": "1.0.4",
|
||||
"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