mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 02:13:29 +08:00
Add HideTips
This commit is contained in:
@@ -4,6 +4,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevShortcuts", "DevShortcut
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogisticMiner", "LogisticMiner\LogisticMiner.csproj", "{7149D717-C913-4153-9425-38CB9D087F83}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HideTips", "HideTips\HideTips.csproj", "{4EABD71D-477F-448B-801B-48F8745A3FA7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -18,5 +20,9 @@ Global
|
||||
{7149D717-C913-4153-9425-38CB9D087F83}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -19,7 +19,7 @@ public class DevShortcuts : BaseUnityPlugin
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PlayerController), "Init")]
|
||||
static void PlayerControllerInit(ref PlayerAction[] ___actions, Player ___player)
|
||||
private static void PlayerControllerInit(ref PlayerAction[] ___actions, Player ___player)
|
||||
{
|
||||
var cnt = ___actions.Length;
|
||||
var newActions = new PlayerAction[cnt + 1];
|
||||
@@ -35,7 +35,7 @@ public class DevShortcuts : BaseUnityPlugin
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PlayerAction_Test), "GameTick")]
|
||||
static void PlayerAction_TestGameTick(PlayerAction_Test __instance, long timei)
|
||||
private static void PlayerAction_TestGameTick(PlayerAction_Test __instance, long timei)
|
||||
{
|
||||
__instance.Update();
|
||||
}
|
||||
|
||||
63
HideTips/HideTips.cs
Normal file
63
HideTips/HideTips.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using BepInEx;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace HideTips;
|
||||
|
||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||
public class HideTips : BaseUnityPlugin
|
||||
{
|
||||
private new static readonly BepInEx.Logging.ManualLogSource Logger = BepInEx.Logging.Logger.CreateLogSource(PluginInfo.PLUGIN_NAME);
|
||||
|
||||
private bool _cfgEnabled = true;
|
||||
private static bool _noRandomReminderTips = true;
|
||||
private static bool _noTutorialTips = true;
|
||||
private static bool _noAchievementCardPopups = false;
|
||||
private static bool _noMilestoneCardPopups = true;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_cfgEnabled = Config.Bind("General", "Enabled", _cfgEnabled, "enable/disable this plugin").Value;
|
||||
_noRandomReminderTips = Config.Bind("General", "NoRandomReminderTips", _noRandomReminderTips, "Disable Random Reminder Tips").Value;
|
||||
_noTutorialTips = Config.Bind("General", "NoTutorialTips", _noTutorialTips, "Disable Tutorial Tips").Value;
|
||||
_noAchievementCardPopups = Config.Bind("General", "NoAchievementCardPopups", _noAchievementCardPopups, "Disable Achievement Card Popups").Value;
|
||||
_noMilestoneCardPopups = Config.Bind("General", "NoMilestoneCardPopups", _noMilestoneCardPopups, "Disable Milestone Card Popups").Value;
|
||||
if (!_cfgEnabled) return;
|
||||
Harmony.CreateAndPatchAll(typeof(HideTips));
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UIBuildMenu), "_OnCreate")]
|
||||
private static void ClearRandReminderTips(UIBuildMenu __instance)
|
||||
{
|
||||
if (!_noRandomReminderTips) return;
|
||||
foreach (var randTip in __instance.randRemindTips)
|
||||
{
|
||||
if (randTip != null)
|
||||
{
|
||||
randTip._Free();
|
||||
}
|
||||
}
|
||||
__instance.randRemindTips = Array.Empty<UIRandomTip>();
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UITutorialTip), "PopupTutorialTip")]
|
||||
private static bool SkipTutorialTips()
|
||||
{
|
||||
return !_noTutorialTips;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UIVariousPopupGroup), "CreateAchievementPopupCard")]
|
||||
private static bool SkipAchievementCardPopups()
|
||||
{
|
||||
return !_noAchievementCardPopups;
|
||||
}
|
||||
|
||||
[HarmonyPrefix] [HarmonyPatch(typeof(UIVariousPopupGroup), "CreateMilestonePopupCard")]
|
||||
private static bool SkipMilestoneCardPopups()
|
||||
{
|
||||
return !_noMilestoneCardPopups;
|
||||
}
|
||||
}
|
||||
24
HideTips/HideTips.csproj
Normal file
24
HideTips/HideTips.csproj
Normal file
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<AssemblyName>HideTips</AssemblyName>
|
||||
<BepInExPluginGuid>org.soardev.hidetips</BepInExPluginGuid>
|
||||
<Description>DSP MOD - HideTips</Description>
|
||||
<Version>1.0.0</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
|
||||
<PackageReference Include="BepInEx.Core" Version="5.*" />
|
||||
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
|
||||
<PackageReference Include="DysonSphereProgram.GameLibs" Version="0.9.26.13026-r.0" />
|
||||
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -27,4 +27,9 @@
|
||||
### Logistic Storages can mine all ores/water on current planet
|
||||
* The same speed as normal Mining Machine for normal ores and 100/s for water.
|
||||
* Energy costs: 200kJ for each vein or oil, 50kJ for each water. `Veins Utilization` upgrades does not increase power consumption.
|
||||
* `Veins Utilization` upgrades affects mining speed and ore consume as normal.
|
||||
* `Veins Utilization` upgrades affects mining speed and ore consumption as normal.
|
||||
|
||||
## [HideTips](HideTips)
|
||||
### Hide/Disable various in-game tips
|
||||
* Tips that can be hidden: random-reminder, tutorial, achievement/milestone card
|
||||
* Each type of tips can be configurable individually
|
||||
|
||||
Reference in New Issue
Block a user