Skip to content

Commit 18c61cb

Browse files
authored
Added Files
1 parent 9713b17 commit 18c61cb

8 files changed

Lines changed: 931 additions & 0 deletions

File tree

ButtJiggle/BoneMorph_Patch.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using HarmonyLib;
2+
using UnityEngine;
3+
4+
namespace COM3D2.ButtJiggle
5+
{
6+
[HarmonyPatch(typeof(BoneMorph_))]
7+
internal static class BoneMorph_Patch
8+
{
9+
[HarmonyPrefix, HarmonyPatch(nameof(BoneMorph_.Blend))]
10+
static void Blend_Prefix(BoneMorph_ __instance)
11+
{
12+
if (!__instance.m_tbSkin.body.TryGetHipHelpers(out var jbhHipL, out var jbhHipR)) return;
13+
14+
// Copy helper's transform so we can see if it get's changed
15+
jbhHipL.CopyLocalTransformToBone();
16+
jbhHipR.CopyLocalTransformToBone();
17+
18+
jbhHipL.IsChangeCheck = true;
19+
jbhHipR.IsChangeCheck = true;
20+
}
21+
22+
[HarmonyPostfix, HarmonyPatch(nameof(BoneMorph_.Blend))]
23+
static void Blend_Postfix(BoneMorph_ __instance)
24+
{
25+
if (!__instance.m_tbSkin.body.TryGetHipHelpers(out var jbhHipL, out var jbhHipR)) return;
26+
27+
// Copy the bones's transform and any changes back to the helper
28+
jbhHipL.CopyLocalTransformFromBone();
29+
jbhHipR.CopyLocalTransformFromBone();
30+
}
31+
}
32+
}

ButtJiggle/ButtJiggle.cs

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
using BepInEx;
2+
using BepInEx.Configuration;
3+
using BepInEx.Logging;
4+
using HarmonyLib;
5+
using MaidStatus;
6+
using PrivateMaidMode;
7+
using RootMotion;
8+
using System;
9+
using System.Collections;
10+
using System.Collections.Generic;
11+
using System.Linq;
12+
using System.Reflection;
13+
using System.Security;
14+
using System.Security.Permissions;
15+
using System.Text;
16+
using UnityEngine;
17+
using UnityEngine.SceneManagement;
18+
using UnityEngine.UI;
19+
using UniverseLib;
20+
using UniverseLib.Input;
21+
using UniverseLib.UI;
22+
23+
24+
// If there are errors in the above using statements, restore the NuGet packages:
25+
// 1. Left-click on the ButtJiggle Project in the Solution Explorer (not ButtJiggle.cs)
26+
// 2. In the pop-up context menu, click on "Manage NuGet Packages..."
27+
// 3. In the top-right corner of the NuGet Package Manager, click "restore"
28+
29+
30+
// You can add references to another BepInEx plugin:
31+
// 1. Left-click on the ButtJiggle Project's references in the Solution Explorer
32+
// 2. Select the "Add Reference..." context menu option.
33+
// 3. Expand the "Assemblies" tab group, and select the "Extensions" tab
34+
// 4. Choose your assemblies then select "Ok"
35+
// 5. Be sure to select each of the added references in the solution explorer,
36+
// then in the properties window, set "Copy Local" to false.
37+
38+
39+
40+
// This is the major & minor version with an asterisk (*) appended to auto increment numbers.
41+
[assembly: AssemblyVersion(COM3D2.ButtJiggle.PluginInfo.PLUGIN_VERSION + ".*")]
42+
43+
// These two lines tell your plugin to not give a flying fuck about accessing private variables/classes whatever.
44+
// It requires a publicized stubb of the library with those private objects though.
45+
[module: UnverifiableCode]
46+
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
47+
48+
49+
namespace COM3D2.ButtJiggle
50+
{
51+
public static class PluginInfo
52+
{
53+
// The name of this assembly.
54+
public const string PLUGIN_GUID = "COM3D2.ButtJiggle";
55+
// The name of this plugin.
56+
public const string PLUGIN_NAME = "Butt Jiggle";
57+
// The version of this plugin.
58+
public const string PLUGIN_VERSION = "0.5";
59+
}
60+
}
61+
62+
63+
64+
namespace COM3D2.ButtJiggle
65+
{
66+
// This is the metadata set for your plugin.
67+
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
68+
public sealed partial class ButtJiggle : BaseUnityPlugin
69+
{
70+
// Static saving of the main instance. (Singleton design pattern)
71+
// This makes it easier to run stuff like coroutines from static methods or accessing non-static vars.
72+
public static ButtJiggle Instance { get; private set; }
73+
74+
// Static property for the logger so you can log from other classes.
75+
internal static new ManualLogSource Logger => Instance?._Logger;
76+
private ManualLogSource _Logger => base.Logger;
77+
78+
internal static ConfigEntry<KeyboardShortcut> UIHotkey;
79+
internal static ConfigEntry<bool> ButtJiggle_Enabled;
80+
internal static ConfigEntry<float> ButtJiggle_DefaultSoftness;
81+
82+
void Awake()
83+
{
84+
// Useful for engaging coroutines or accessing non-static variables. Completely optional though.
85+
Instance = this;
86+
87+
// Binds the configuration. In other words it sets your ConfigEntry var to your config setup.
88+
ButtJiggle_Enabled = Config.Bind("Butt Jiggle", "Enabled" , true, "Description");
89+
ButtJiggle_DefaultSoftness = Config.Bind("Butt Jiggle", "DefaultSoftness", 0.5f, "Description");
90+
91+
// Add the keybind
92+
KeyboardShortcut hotkey = new KeyboardShortcut(KeyCode.A, KeyCode.LeftControl);
93+
UIHotkey = Config.Bind("UI", "Toggle", hotkey, "Recomend using Ctrl A for 'Ass'");
94+
95+
Harmony.CreateAndPatchAll(typeof(ButtJiggle));
96+
Harmony.CreateAndPatchAll(typeof(TBodyPatch));
97+
Harmony.CreateAndPatchAll(typeof(BoneMorph_Patch));
98+
99+
Logger.LogInfo("Finished patching");
100+
}
101+
102+
void Start()
103+
{
104+
Universe_Init();
105+
}
106+
107+
private bool m_IsHotkeyHandled = false;
108+
void Update()
109+
{
110+
if (UIHotkey.Value.IsDown() && !m_IsHotkeyHandled)
111+
{
112+
ToggleUI();
113+
m_IsHotkeyHandled = true;
114+
}
115+
else if (UIHotkey.Value.IsUp())
116+
{
117+
m_IsHotkeyHandled = false;
118+
}
119+
}
120+
}
121+
}

ButtJiggle/ButtJiggle.csproj

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<StartAction>Program</StartAction>
9+
<ProjectGuid>{21D55085-3997-4A44-B09B-2B1735CA6D2A}</ProjectGuid>
10+
<OutputType>Library</OutputType>
11+
<PlatformTarget>x64</PlatformTarget>
12+
<AppDesignerFolder>Properties</AppDesignerFolder>
13+
<RootNamespace>COM3D2.ButtJiggle</RootNamespace>
14+
<AssemblyName>COM3D2.ButtJiggle.Plugin</AssemblyName>
15+
<LangVersion>latest</LangVersion>
16+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
17+
<FileAlignment>512</FileAlignment>
18+
<COM3D2InstallPath>C:\DJN\KISS\COM3D2</COM3D2InstallPath>
19+
<OutputPath>bin\$(Configuration)\$(Platform)</OutputPath>
20+
<StartProgram>$(COM3D2InstallPath)\COM3D2x64.exe</StartProgram>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
23+
<DebugSymbols>true</DebugSymbols>
24+
<DebugType>full</DebugType>
25+
<Optimize>false</Optimize>
26+
<DefineConstants>DEBUG;TRACE</DefineConstants>
27+
<ErrorReport>prompt</ErrorReport>
28+
<WarningLevel>4</WarningLevel>
29+
</PropertyGroup>
30+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
31+
<DebugType>pdbonly</DebugType>
32+
<Optimize>true</Optimize>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<PropertyGroup>
38+
<RestoreSources>$(RestoreSources);https://nuget.bepinex.dev/v3/index.json</RestoreSources>
39+
</PropertyGroup>
40+
<ItemGroup>
41+
<PackageReference Include="COM3D2.GameLibs" Version="2.13.0-r.0" targetFramework="net35" />
42+
<PackageReference Include="UnityEngine" Version="5.6.1" targetFramework="net35" />
43+
<PackageReference Include="BepInEx.Analyzers" Version="1.0.8" targetFramework="net35" developmentDependency="true">
44+
<PrivateAssets>all</PrivateAssets>
45+
</PackageReference>
46+
<PackageReference Include="BepInEx.BaseLib" Version="5.4.19" targetFramework="net35" />
47+
<PackageReference Include="BepInEx.Core" Version="5.4.19" targetFramework="net35" />
48+
<PackageReference Include="HarmonyX" Version="2.7.0" targetFramework="net35" />
49+
<PackageReference Include="Mono.Cecil" Version="0.10.4" targetFramework="net35" />
50+
<PackageReference Include="MonoMod.RuntimeDetour" Version="21.12.13.1" targetFramework="net35" />
51+
<PackageReference Include="MonoMod.Utils" Version="21.12.13.1" targetFramework="net35" />
52+
<PackageReference Include="UniverseLib.Analyzers" Version="1.0.3" targetFramework="net35" developmentDependency="true">
53+
<PrivateAssets>all</PrivateAssets>
54+
</PackageReference>
55+
<PackageReference Include="UniverseLib.Mono" Version="1.3.3" targetFramework="net35" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<Reference Include="System">
59+
<Private>False</Private>
60+
</Reference>
61+
<Reference Include="System.Core">
62+
<Private>False</Private>
63+
</Reference>
64+
<Reference Include="System.Xml.Linq">
65+
<Private>False</Private>
66+
</Reference>
67+
<Reference Include="System.Data.DataSetExtensions">
68+
<Private>False</Private>
69+
</Reference>
70+
<Reference Include="System.Data">
71+
<Private>False</Private>
72+
</Reference>
73+
<Reference Include="System.Xml">
74+
<Private>False</Private>
75+
</Reference>
76+
</ItemGroup>
77+
<PropertyGroup>
78+
<ReferencePath>$(ReferencePath);$(COM3D2InstallPath)\BepinEx\plugins</ReferencePath>
79+
<ReferencePath>$(ReferencePath);$(COM3D2InstallPath)\Sybaris</ReferencePath>
80+
<ReferencePath>$(ReferencePath);$(COM3D2InstallPath)\Sybaris\UnityInjector</ReferencePath>
81+
</PropertyGroup>
82+
<ItemGroup>
83+
<Compile Include="ButtJiggleUI.cs" />
84+
<Compile Include="JiggleBoneHelper.cs" />
85+
<Compile Include="BoneMorph_Patch.cs" />
86+
<Compile Include="JiggleBoneOverride.cs" />
87+
<Compile Include="Properties\AssemblyInfo.cs" />
88+
<Compile Include="ButtJiggle.cs" />
89+
<Compile Include="TBodyPatch.cs" />
90+
</ItemGroup>
91+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
92+
<PropertyGroup>
93+
<PostBuildEvent>
94+
rd "$(COM3D2InstallPath)\BepinEx\plugins\vsout_$(ProjectName)"
95+
mklink /J "$(COM3D2InstallPath)\BepinEx\plugins\vsout_$(ProjectName)" .
96+
</PostBuildEvent>
97+
</PropertyGroup>
98+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
99+
Other similar extension points exist, see Microsoft.Common.targets.
100+
<Target Name="BeforeBuild">
101+
</Target>
102+
<Target Name="AfterBuild">
103+
</Target>
104+
-->
105+
</Project>

0 commit comments

Comments
 (0)