Skip to content

Commit

Permalink
Add LongerSigns mod
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTwentyThree committed Jul 5, 2023
1 parent a8e0352 commit 777fe45
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
31 changes: 31 additions & 0 deletions LongerSigns/LongerSigns/LongerSigns.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AssemblyName>LongerSigns</AssemblyName>
<Version>1.0.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>11</LangVersion>
<RootNamespace>LongerSigns</RootNamespace>
<BepInExPluginName>Longer Signs</BepInExPluginName>
<BepInExPluginGuid>com.lee23.longersigns</BepInExPluginGuid>

<RestoreAdditionalProjectSources>
https://api.nuget.org/v3/index.json;
https://nuget.bepinex.dev/v3/index.json;
</RestoreAdditionalProjectSources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.1.0" />
<PackageReference Include="UnityEngine.Modules" Version="2019.4.36" IncludeAssets="compile" />
<PackageReference Include="Subnautica.GameLibs" Version="71288.0.0-r.0" />
<PackageReference Include="PolySharp" Version="1.13.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions LongerSigns/LongerSigns/LongerSigns.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LongerSigns", "LongerSigns.csproj", "{F0CC6A68-5E91-4D90-B4A5-DC15DB9C13E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0CC6A68-5E91-4D90-B4A5-DC15DB9C13E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0CC6A68-5E91-4D90-B4A5-DC15DB9C13E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0CC6A68-5E91-4D90-B4A5-DC15DB9C13E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0CC6A68-5E91-4D90-B4A5-DC15DB9C13E8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B779FA9-01E7-4AD8-93C4-331A68DC9FEF}
EndGlobalSection
EndGlobal
21 changes: 21 additions & 0 deletions LongerSigns/LongerSigns/Patches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using HarmonyLib;
using UnityEngine.UI;

namespace LongerSigns;

public static class Patches
{
[HarmonyPatch(typeof(uGUI_SignInput), nameof(uGUI_SignInput.Awake))]
[HarmonyPostfix]
public static void uGUI_SignInputAwakePostfix(uGUI_SignInput __instance)
{
var inputField = __instance.GetComponentInChildren<uGUI_InputField>();
if (inputField == null)
return;

inputField.characterLimit = int.MaxValue;

// inputField.lineLimit = int.MaxValue;
// inputField.lineType = TMPro.TMP_InputField.LineType.MultiLineNewline;
}
}
23 changes: 23 additions & 0 deletions LongerSigns/LongerSigns/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using System.Reflection;

namespace LongerSigns;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
public new static ManualLogSource Logger { get; private set; }

private static Assembly Assembly { get; } = Assembly.GetExecutingAssembly();

private void Awake()
{
// plugin startup logic
Logger = base.Logger;

// register harmony patches, if there are any
Harmony.CreateAndPatchAll(Assembly, $"{PluginInfo.PLUGIN_GUID}");
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
}
}

0 comments on commit 777fe45

Please sign in to comment.