Initial commit: add source files and project

This commit is contained in:
2025-10-19 19:32:44 +02:00
parent 2395b2ca01
commit 8139df0822
5 changed files with 227 additions and 0 deletions

47
README.md Normal file
View File

@@ -0,0 +1,47 @@
<h1 align="center">Toggle HUD — Silksong Mod</h1>
<p align="center">
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue?style=for-the-badge">
<img alt="Stars" src="https://img.shields.io/github/stars/Gabi-Zar/Toggle-HUD-Silksong-mod?style=for-the-badge&color=magenta">
<img alt="Forks" src="https://img.shields.io/github/forks/Gabi-Zar/Toggle-HUD-Silksong-mod?style=for-the-badge&color=purple">
<img alt="License" src="https://img.shields.io/github/license/Gabi-Zar/Toggle-HUD-Silksong-mod?style=for-the-badge&color=blue">
<br>
<a href="https://github.com/Gabi-Zar"><img title="Developer" src="https://img.shields.io/badge/developer-GabiZar-red?style=flat-square"></a>
</p>
---
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).
---
<p align="center">If you like this mod, consider giving it a ⭐ on GitHub!</p>

25
ToggleHUD.sln Normal file
View File

@@ -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

View File

@@ -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")]

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D6079317-45E4-4A0D-AEDD-49E1F5E11962}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ToggleHUD</RootNamespace>
<AssemblyName>ToggleHUD</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\BepInEx\core\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\BepInEx\core\BepInEx.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="TeamCherry.BuildBot">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.BuildBot.dll</HintPath>
</Reference>
<Reference Include="TeamCherry.Cinematics">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.Cinematics.dll</HintPath>
</Reference>
<Reference Include="TeamCherry.Localization">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.Localization.dll</HintPath>
</Reference>
<Reference Include="TeamCherry.NestedFadeGroup">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.NestedFadeGroup.dll</HintPath>
</Reference>
<Reference Include="TeamCherry.SharedUtils">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.SharedUtils.dll</HintPath>
</Reference>
<Reference Include="TeamCherry.Splines">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.Splines.dll</HintPath>
</Reference>
<Reference Include="TeamCherry.TK2D">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\TeamCherry.TK2D.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>F:\SteamLibrary\steamapps\common\Hollow Knight Silksong\Hollow Knight Silksong_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

29
ToggleHUD/main.cs Normal file
View File

@@ -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}");
}
}
}