Skip to content

Commit

Permalink
integrating code from other projects
Browse files Browse the repository at this point in the history
  • Loading branch information
thojmr committed Jan 24, 2021
1 parent 277e2d9 commit b2e0fa9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
17 changes: 10 additions & 7 deletions KK_VREnhancement/KK_VREnhancement.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
<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>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBE}</ProjectGuid>
<OutputType>library</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>KK_VREnhancement</RootNamespace>
<AssemblyName>KK_VREnhancement</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<AssemblyName>KK_VREnhancement</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
Expand All @@ -18,20 +19,22 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\BepInEx\plugins</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<OutputPath>..\bin\KK_VREnhancement\BepInEx\plugins</OutputPath>
<DefineConstants>DEBUG;TRACE;KK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>embedded</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\BepInEx\plugins</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<OutputPath>..\bin\KK_VREnhancement\BepInEx\plugins</OutputPath>
<DefineConstants>TRACE;KK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion KK_VREnhancement/VRControllerCollider.Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ internal static void StopHelperCoroutine(VRPlugin pluginInstance)
//Got tired of searching for the correct hooks, just check for new dynamic bones on a loop. Genious!
internal static IEnumerator LoopEveryXSeconds()
{
while(coroutineActive) {
while(coroutineActive)
{
VRControllerCollider.SetVRControllerColliderToDynamicBones();

// VRPlugin.Logger.Log(LogLevel.Info, $"Camera distance {distance}");
Expand Down
14 changes: 9 additions & 5 deletions KK_VREnhancement/VREnhancementPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal void Start()
"Will move the VR camera view in front of the heroine as they move around during TalkScene/HScene. This mimics the default KK behavior. \n\nWhen disabled, you stay put as the heroine moves around.");
MoveWithTalkScene.SettingChanged += MoveWithTalkScene_SettingsChanged;

EnableControllerColliders = Config.Bind<bool>("", "Enable VR controller colliders", true,
EnableControllerColliders = Config.Bind<bool>("", "Enable VR controller collision (boop!)", true,
"Allows collision of VR controllers with all dynamic bones.\n\nBoop!");
EnableControllerColliders.SettingChanged += EnableControllerColliders_SettingsChanged;

Expand All @@ -42,7 +42,7 @@ internal void Start()
bool vrFlag = Environment.CommandLine.Contains("--novr");
VREnabled = !noVrFlag && (vrFlag || SteamVRDetector.IsRunning);

if (debugLog) VRPlugin.Logger.Log(LogLevel.Info, $" VREnabled {VREnabled}");
if (VRPlugin.debugLog) VRPlugin.Logger.LogInfo($" VREnabled {VREnabled}");

//IF not VR dont bother with VR hooks
if (!VREnabled) return;
Expand All @@ -58,17 +58,21 @@ internal void Start()

internal void MoveWithTalkScene_SettingsChanged(object sender, System.EventArgs e)
{
if (!MoveWithTalkScene.Value) {
if (!MoveWithTalkScene.Value)
{
VRCameraController.ClearLastPosition();
}
}

internal void EnableControllerColliders_SettingsChanged(object sender, System.EventArgs e)
{
if (!EnableControllerColliders.Value) {
if (!EnableControllerColliders.Value)
{
//Just stop the dynamic bone search loop
VRControllerColliderHelper.StopHelperCoroutine(this);
} else {
}
else
{
if (!VREnabled) return;
VRControllerColliderHelper.TriggerHelperCoroutine(this);
}
Expand Down
File renamed without changes.
8 changes: 5 additions & 3 deletions release.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
::Zips the dll into the correct directory structure for release
::Make sure to increment the version

::CLear last release
rd /s /q "./release"
set kk_version=0.1
set kk_name=KK_VREnhancement

"%ProgramFiles%\7-Zip\7z.exe" a -tzip "./release/KK_VREnhancement v0.1.zip" "./bin/BepinEx" -mx0
IF EXIST "./bin/%kk_name%/BepinEx/plugins/%kk_name%.dll" "%ProgramFiles%\7-Zip\7z.exe" a -tzip "%HOMEPATH%/downloads/%kk_name% v%kk_version%.zip" "./bin/%kk_name%/BepinEx" -mx0

start %HOMEPATH%/downloads

0 comments on commit b2e0fa9

Please sign in to comment.