Skip to content

Commit

Permalink
Add LightingTweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DeathWeasel1337 committed Aug 27, 2021
1 parent 84c1ed2 commit 7901efb
Show file tree
Hide file tree
Showing 10 changed files with 375 additions and 8 deletions.
24 changes: 24 additions & 0 deletions KK_Plugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KKS.EyeShaking", "src\EyeSh
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Core.EyeShaking", "src\EyeShaking.Core\Core.EyeShaking.shproj", "{13C0BADF-1D85-4408-A238-8F62D03BD356}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LightingTweaks", "LightingTweaks", "{27D3ED8A-33AA-4306-B363-ACA1F089E908}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KK.LightingTweaks", "src\LightingTweaks.KK\KK.LightingTweaks.csproj", "{A0316A46-4852-4E57-8528-EC935011D8D1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KKS.LightingTweaks", "src\LightingTweaks.KKS\KKS.LightingTweaks.csproj", "{84EE2EB1-1F34-4C6C-AD66-9540328B0AD1}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Core.LightingTweaks", "src\LightingTweaks.Core\Core.LightingTweaks.shproj", "{6AB4C919-0749-438B-95D5-B55D737C3444}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Shared\Shared.projitems*{002aa641-4dc8-4fef-83dd-a7fab3af6daf}*SharedItemsImports = 4
Expand Down Expand Up @@ -602,6 +610,7 @@ Global
src\Shared\Shared.projitems*{6a1b1a7f-29e4-4984-b5c3-5a8bbb09e7b2}*SharedItemsImports = 4
src\AccessoryClothes.Core\AccessoryClothes.Core.projitems*{6aa3ad0c-ac11-4224-81a8-8e1387df336c}*SharedItemsImports = 4
src\Shared\Shared.projitems*{6aa3ad0c-ac11-4224-81a8-8e1387df336c}*SharedItemsImports = 4
src\LightingTweaks.Core\LightingTweaks.Core.projitems*{6ab4c919-0749-438b-95d5-b55d737c3444}*SharedItemsImports = 13
src\FreeHRandom.Core\FreeHRandom.Core.projitems*{6acab92e-c496-4c43-805f-8ec87bbce957}*SharedItemsImports = 4
src\Shared\Shared.projitems*{6acab92e-c496-4c43-805f-8ec87bbce957}*SharedItemsImports = 4
src\UIUtility\UIUtility.projitems*{6acab92e-c496-4c43-805f-8ec87bbce957}*SharedItemsImports = 4
Expand Down Expand Up @@ -652,6 +661,8 @@ Global
src\AccessoryClothes.Core\AccessoryClothes.Core.projitems*{84060175-95bd-4ad7-ba46-508dc8959b32}*SharedItemsImports = 4
src\Shared\Shared.projitems*{84060175-95bd-4ad7-ba46-508dc8959b32}*SharedItemsImports = 4
src\Shared\Shared.projitems*{841ffff7-1940-4b7b-b21f-83e2f16333d4}*SharedItemsImports = 13
src\LightingTweaks.Core\LightingTweaks.Core.projitems*{84ee2eb1-1f34-4c6c-ad66-9540328b0ad1}*SharedItemsImports = 4
src\Shared\Shared.projitems*{84ee2eb1-1f34-4c6c-ad66-9540328b0ad1}*SharedItemsImports = 4
src\Shared\Shared.projitems*{86bdc6af-b123-4116-b0ce-6884360cf070}*SharedItemsImports = 4
src\Subtitles.Core\Core.Subtitles.projitems*{86bdc6af-b123-4116-b0ce-6884360cf070}*SharedItemsImports = 4
src\MakerDefaults.Core.KKEC\Core.MakerDefaults.KKEC.projitems*{878bb100-7d7c-43d2-8e9d-608d93d738e4}*SharedItemsImports = 4
Expand Down Expand Up @@ -682,6 +693,8 @@ Global
src\PoseFolders.Core\Core.PoseFolders.projitems*{9c19b785-e8e3-4ff0-9e3f-8254355b1ce7}*SharedItemsImports = 4
src\Shared\Shared.projitems*{9c19b785-e8e3-4ff0-9e3f-8254355b1ce7}*SharedItemsImports = 4
src\AccessoryClothes.Core\AccessoryClothes.Core.projitems*{9c636011-35a4-4201-8f81-81564f1edafc}*SharedItemsImports = 13
src\LightingTweaks.Core\LightingTweaks.Core.projitems*{a0316a46-4852-4e57-8528-ec935011d8d1}*SharedItemsImports = 4
src\Shared\Shared.projitems*{a0316a46-4852-4e57-8528-ec935011d8d1}*SharedItemsImports = 4
src\Autosave.Core\Autosave.Core.projitems*{a0e2000f-196f-4ead-b571-20a4446b7824}*SharedItemsImports = 4
src\Shared\Shared.projitems*{a0e2000f-196f-4ead-b571-20a4446b7824}*SharedItemsImports = 4
src\StudioImageEmbed.Core\Core.StudioImageEmbed.projitems*{a18c34c6-1220-487a-8448-fc1a8251fc57}*SharedItemsImports = 13
Expand Down Expand Up @@ -1365,6 +1378,14 @@ Global
{4A9583BC-6018-410C-9659-FDE6F93320EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A9583BC-6018-410C-9659-FDE6F93320EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A9583BC-6018-410C-9659-FDE6F93320EC}.Release|Any CPU.Build.0 = Release|Any CPU
{A0316A46-4852-4E57-8528-EC935011D8D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0316A46-4852-4E57-8528-EC935011D8D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0316A46-4852-4E57-8528-EC935011D8D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0316A46-4852-4E57-8528-EC935011D8D1}.Release|Any CPU.Build.0 = Release|Any CPU
{84EE2EB1-1F34-4C6C-AD66-9540328B0AD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84EE2EB1-1F34-4C6C-AD66-9540328B0AD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84EE2EB1-1F34-4C6C-AD66-9540328B0AD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84EE2EB1-1F34-4C6C-AD66-9540328B0AD1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1545,6 +1566,9 @@ Global
{0315A757-D899-459A-86C0-1D1D603068DA} = {6A2D13AE-71DD-4DAB-9A22-66CF8A4F2AB8}
{4A9583BC-6018-410C-9659-FDE6F93320EC} = {5D7E0E8E-6D1E-4142-9234-DE2761E68BB4}
{13C0BADF-1D85-4408-A238-8F62D03BD356} = {5D7E0E8E-6D1E-4142-9234-DE2761E68BB4}
{A0316A46-4852-4E57-8528-EC935011D8D1} = {27D3ED8A-33AA-4306-B363-ACA1F089E908}
{84EE2EB1-1F34-4C6C-AD66-9540328B0AD1} = {27D3ED8A-33AA-4306-B363-ACA1F089E908}
{6AB4C919-0749-438B-95D5-B55D737C3444} = {27D3ED8A-33AA-4306-B363-ACA1F089E908}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D0F79985-4CB7-46CB-BEC2-FF89C476ED20}
Expand Down
9 changes: 9 additions & 0 deletions src/LightingTweaks.Core/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using KK_Plugins;
using System.Reflection;
using static KK_Plugins.LightingTweaks;

[assembly: AssemblyTitle(PluginNameInternal)]
[assembly: AssemblyProduct(PluginNameInternal)]
[assembly: AssemblyDescription(PluginName + " for " + Constants.GameName)]
[assembly: AssemblyVersion(Version)]
[assembly: AssemblyFileVersion(Version)]
13 changes: 13 additions & 0 deletions src/LightingTweaks.Core/Core.LightingTweaks.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>6ab4c919-0749-438b-95d5-b55d737c3444</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="LightingTweaks.Core.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
15 changes: 15 additions & 0 deletions src/LightingTweaks.Core/LightingTweaks.Core.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>6ab4c919-0749-438b-95d5-b55d737c3444</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>LightingTweaks.Core</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)LightingTweaks.cs" />
</ItemGroup>
</Project>
44 changes: 44 additions & 0 deletions src/LightingTweaks.Core/LightingTweaks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using BepInEx;
using BepInEx.Logging;
using KKAPI.Maker;
using KKAPI.Studio;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace KK_Plugins
{
[BepInPlugin(GUID, PluginName, Version)]
public class LightingTweaks : BaseUnityPlugin
{
public const string GUID = "com.deathweasel.bepinex.lightingtweaks";
public const string PluginName = "Lighting Tweaks";
public const string PluginNameInternal = "KK_LightingTweaks";
public const string Version = "1.0";
internal static new ManualLogSource Logger;

internal void Main()
{
Logger = base.Logger;

MakerAPI.MakerFinishedLoading += (s, e) => TweakLighting();
SceneManager.sceneLoaded += SceneManager_sceneLoaded;
}

private void TweakLighting()
{
foreach (var light in FindObjectsOfType<Light>())
{
light.shadowCustomResolution = 10000;
light.shadowBias = 0.0075f;
if (light.name == "Directional Chara") //Studio shadow strength is different from main game for some reason
light.shadowStrength = 1;
}
}

private void SceneManager_sceneLoaded(Scene s, LoadSceneMode lsm)
{
if (StudioAPI.InsideStudio)
TweakLighting();
}
}
}
109 changes: 109 additions & 0 deletions src/LightingTweaks.KK/KK.LightingTweaks.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?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>{A0316A46-4852-4E57-8528-EC935011D8D1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KK_Plugins</RootNamespace>
<AssemblyName>KK_LightingTweaks</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<DefineConstants>TRACE;DEBUG;KKS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<DefineConstants>TRACE;KKS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionLibs.BepInEx.Harmony.2.5.1\lib\net35\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionLibs.Koikatu.Assembly-CSharp.2019.4.27\lib\net35\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionLibs.Koikatu.Assembly-CSharp-firstpass.2019.4.27\lib\net35\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx, Version=5.4.12.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionLibs.BepInEx.5.4.12\lib\net35\BepInEx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.Harmony, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionLibs.BepInEx.Harmony.2.5.1\lib\net35\BepInEx.Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ExtensibleSaveFormat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\ExtensibleSaveFormat.Koikatu.16.4.0\lib\net35\ExtensibleSaveFormat.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="KKAPI, Version=1.23.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionModdingAPI.KKAPI.1.23.0\lib\net35\KKAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionLibs.Koikatu.UnityEngine.5.6.2\lib\net35\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\IllusionLibs.Koikatu.UnityEngine.UI.5.6.2\lib\net35\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\BepInEx.Analyzers.1.0.4\analyzers\dotnet\cs\BepInEx.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\..\packages\BepInEx.Analyzers.1.0.4\analyzers\dotnet\cs\BepInEx.Analyzers.dll" />
<Analyzer Include="..\..\packages\KoikatuCompatibilityAnalyzer.1.0.1\analyzers\dotnet\cs\KoikatuCompatibilityAnalyzer.dll" />
<Analyzer Include="..\..\packages\Microsoft.Unity.Analyzers.1.11.0\analyzers\dotnet\cs\Microsoft.Unity.Analyzers.dll" />
</ItemGroup>
<Import Project="..\Shared\Shared.projitems" Label="Shared" />
<Import Project="..\LightingTweaks.Core\LightingTweaks.Core.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>IF EXIST "$(TargetDir)$(TargetName).pdb" IF EXIST "$(SolutionDir)pdb2mdb.exe" CALL "$(SolutionDir)pdb2mdb.exe" "$(TargetPath)"
IF EXIST "$(SolutionDir)PostBuild.bat" CALL "$(SolutionDir)PostBuild.bat" "$(TargetPath)" KK
</PostBuildEvent>
</PropertyGroup>
<Import Project="..\..\packages\IllusionLibs.BepInEx.Harmony.2.5.1\build\IllusionLibs.BepInEx.Harmony.targets" Condition="Exists('..\..\packages\IllusionLibs.BepInEx.Harmony.2.5.1\build\IllusionLibs.BepInEx.Harmony.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\IllusionLibs.BepInEx.Harmony.2.5.1\build\IllusionLibs.BepInEx.Harmony.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\IllusionLibs.BepInEx.Harmony.2.5.1\build\IllusionLibs.BepInEx.Harmony.targets'))" />
</Target>
</Project>
14 changes: 14 additions & 0 deletions src/LightingTweaks.KK/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BepInEx.Analyzers" version="1.0.4" targetFramework="net35" developmentDependency="true" />
<package id="ExtensibleSaveFormat.Koikatu" version="16.4.0" targetFramework="net35" developmentDependency="true" />
<package id="IllusionLibs.BepInEx" version="5.4.12" targetFramework="net35" />
<package id="IllusionLibs.BepInEx.Harmony" version="2.5.1" targetFramework="net35" />
<package id="IllusionLibs.Koikatu.Assembly-CSharp" version="2019.4.27" targetFramework="net35" developmentDependency="true" />
<package id="IllusionLibs.Koikatu.Assembly-CSharp-firstpass" version="2019.4.27" targetFramework="net35" developmentDependency="true" />
<package id="IllusionLibs.Koikatu.UnityEngine" version="5.6.2" targetFramework="net35" developmentDependency="true" />
<package id="IllusionLibs.Koikatu.UnityEngine.UI" version="5.6.2" targetFramework="net35" developmentDependency="true" />
<package id="IllusionModdingAPI.KKAPI" version="1.23.0" targetFramework="net35" developmentDependency="true" />
<package id="KoikatuCompatibilityAnalyzer" version="1.0.1" targetFramework="net35" developmentDependency="true" />
<package id="Microsoft.Unity.Analyzers" version="1.11.0" targetFramework="net35" developmentDependency="true" />
</packages>
Loading

0 comments on commit 7901efb

Please sign in to comment.