From 8139df082207554181de3f7b231bf04e99d95c75 Mon Sep 17 00:00:00 2001 From: GabiZar Date: Sun, 19 Oct 2025 19:32:44 +0200 Subject: [PATCH] Initial commit: add source files and project --- README.md | 47 ++++++++++++++ ToggleHUD.sln | 25 ++++++++ ToggleHUD/Properties/AssemblyInfo.cs | 33 ++++++++++ ToggleHUD/ToggleHUD.csproj | 93 ++++++++++++++++++++++++++++ ToggleHUD/main.cs | 29 +++++++++ 5 files changed, 227 insertions(+) create mode 100644 README.md create mode 100644 ToggleHUD.sln create mode 100644 ToggleHUD/Properties/AssemblyInfo.cs create mode 100644 ToggleHUD/ToggleHUD.csproj create mode 100644 ToggleHUD/main.cs diff --git a/README.md b/README.md new file mode 100644 index 0000000..6517948 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +

Toggle HUD — Silksong Mod

+ +

+ Version + Stars + Forks + License +
+ +

+ +--- + +This repository contains a **BepInEx 5 mod for Silksong** that allows you to toggle the HUD visibility using **F11**. + +## 🌟 Features + +- Toggle the in-game HUD visibility by pressing **F11**. + +## 🔗 Requirements + +- [BepInEx 5](https://www.nexusmods.com/hollowknightsilksong/mods/26) + +## 🚀 Installation & Usage + +1. Download the mod `.dll` from the [GitHub Releases](https://github.com/Gabi-Zar/Toggle-HUD-Silksong-mod/releases) page or from [Nexus Mods](https://www.nexusmods.com/hollowknightsilksong/mods/673). + +2. Place the `.dll` file in the following folder: + ``` + Hollow Knight Silksong\BepInEx\plugins + ``` + +3. Launch the game and press **F11** to toggle the HUD on or off. + +## 🧩 Compatibility + +- Compatible with **BepInEx 5**. +- Tested with the latest Silksong build (20283943). + +## 📜 License + +This project is licensed under the [MIT License](LICENSE). + +--- + +

If you like this mod, consider giving it a ⭐ on GitHub!

+ diff --git a/ToggleHUD.sln b/ToggleHUD.sln new file mode 100644 index 0000000..9cc2226 --- /dev/null +++ b/ToggleHUD.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36518.9 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToggleHUD", "ToggleHUD\ToggleHUD.csproj", "{D6079317-45E4-4A0D-AEDD-49E1F5E11962}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D6079317-45E4-4A0D-AEDD-49E1F5E11962}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6079317-45E4-4A0D-AEDD-49E1F5E11962}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6079317-45E4-4A0D-AEDD-49E1F5E11962}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6079317-45E4-4A0D-AEDD-49E1F5E11962}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A4C8B74D-5107-4856-B596-DB0DE5794428} + EndGlobalSection +EndGlobal diff --git a/ToggleHUD/Properties/AssemblyInfo.cs b/ToggleHUD/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d84b6c3 --- /dev/null +++ b/ToggleHUD/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("ToggleHUD")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ToggleHUD")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("d6079317-45e4-4a0d-aedd-49e1f5e11962")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ToggleHUD/ToggleHUD.csproj b/ToggleHUD/ToggleHUD.csproj new file mode 100644 index 0000000..21f086d --- /dev/null +++ b/ToggleHUD/ToggleHUD.csproj @@ -0,0 +1,93 @@ + + + + + Debug + AnyCPU + {D6079317-45E4-4A0D-AEDD-49E1F5E11962} + Library + Properties + ToggleHUD + ToggleHUD + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\BepInEx\core\0Harmony.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\Assembly-CSharp.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\Assembly-CSharp-firstpass.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\BepInEx\core\BepInEx.dll + + + + + + + + + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.BuildBot.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.Cinematics.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.Localization.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.NestedFadeGroup.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.SharedUtils.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.Splines.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.TK2D.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.CoreModule.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.InputLegacyModule.dll + + + F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.UI.dll + + + + + + + + \ No newline at end of file diff --git a/ToggleHUD/main.cs b/ToggleHUD/main.cs new file mode 100644 index 0000000..539b7c7 --- /dev/null +++ b/ToggleHUD/main.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using BepInEx; +using BepInEx.Logging; +using HarmonyLib; +using UnityEngine; +using UnityEngine.UI; + + +[BepInPlugin("com.gabizar.togglehud", "Toggle HUD Mod", "0.1.0 ")] +public class ToggleHUD: BaseUnityPlugin +{ + + private void Awake() + { + Logger.LogInfo("Toggle HUD mod loaded and initialized."); + + Harmony.CreateAndPatchAll(typeof(ToggleHUD), null); + } + + private void Update() + { + if (Input.GetKeyDown(KeyCode.F11)) + { + HudGlobalHide.IsHidden = !HudGlobalHide.IsHidden; + Logger.LogInfo($"HUD hidden = {HudGlobalHide.IsHidden}"); + + } + } +} \ No newline at end of file