├── .github ├── FUNDING.yml └── workflows │ └── main.yml ├── libs ├── AtLib.stripped.dll ├── Assembly-CSharp.stripped.dll ├── Il2Cppmscorlib.stripped.dll ├── UnityEngine.UI.stripped.dll ├── UnhollowerBaseLib.stripped.dll ├── UnityEngine.CoreModule.stripped.dll └── Unity.RenderPipelines.Universal.Runtime.stripped.dll ├── release_body.md ├── LICENSE ├── SoulHackers2Fix.sln ├── SoulHackers2Fix.csproj ├── .gitattributes ├── README.md ├── BepInEx.cfg ├── .gitignore └── SoulHackers2Fix.cs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | ko_fi: lyall 3 | -------------------------------------------------------------------------------- /libs/AtLib.stripped.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lyall/SoulHackers2Fix/HEAD/libs/AtLib.stripped.dll -------------------------------------------------------------------------------- /libs/Assembly-CSharp.stripped.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lyall/SoulHackers2Fix/HEAD/libs/Assembly-CSharp.stripped.dll -------------------------------------------------------------------------------- /libs/Il2Cppmscorlib.stripped.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lyall/SoulHackers2Fix/HEAD/libs/Il2Cppmscorlib.stripped.dll -------------------------------------------------------------------------------- /libs/UnityEngine.UI.stripped.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lyall/SoulHackers2Fix/HEAD/libs/UnityEngine.UI.stripped.dll -------------------------------------------------------------------------------- /libs/UnhollowerBaseLib.stripped.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lyall/SoulHackers2Fix/HEAD/libs/UnhollowerBaseLib.stripped.dll -------------------------------------------------------------------------------- /libs/UnityEngine.CoreModule.stripped.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lyall/SoulHackers2Fix/HEAD/libs/UnityEngine.CoreModule.stripped.dll -------------------------------------------------------------------------------- /libs/Unity.RenderPipelines.Universal.Runtime.stripped.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lyall/SoulHackers2Fix/HEAD/libs/Unity.RenderPipelines.Universal.Runtime.stripped.dll -------------------------------------------------------------------------------- /release_body.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | - Extract the contents of the release zip in to the game directory.
(e.g. "**steamapps\common\SOUL HACKERS2**" for Steam). 3 | - Run the game once to generate a config file located at **\BepinEx\config\SoulHackers2Fix.cfg** 4 | - The first launch may take a little while as BepInEx does its magic. 5 | 6 | ## Configuration 7 | - See the generated config file to adjust various aspects of the plugin. 8 | 9 | More up to date [installation instructions are available here](https://github.com/Lyall/SoulHackers2Fix#installation). 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Lyall 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SoulHackers2Fix.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32630.192 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoulHackers2Fix", "SoulHackers2Fix.csproj", "{2797660F-5114-454C-9CEA-16B304A262C5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2797660F-5114-454C-9CEA-16B304A262C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2797660F-5114-454C-9CEA-16B304A262C5}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2797660F-5114-454C-9CEA-16B304A262C5}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2797660F-5114-454C-9CEA-16B304A262C5}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {A947E403-8B35-4AFA-A0D8-D1665DE3F951} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SoulHackers2Fix.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | SoulHackers2Fix 6 | Soul Hackers 2 Fix 7 | 0.0.4 8 | true 9 | latest 10 | 11 | https://api.nuget.org/v3/index.json; 12 | https://nuget.bepinex.dev/v3/index.json 13 | 14 | SH2Fix 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | libs\Assembly-CSharp.stripped.dll 25 | 26 | 27 | libs\AtLib.stripped.dll 28 | 29 | 30 | libs\Il2Cppmscorlib.stripped.dll 31 | 32 | 33 | libs\UnhollowerBaseLib.stripped.dll 34 | 35 | 36 | libs\Unity.RenderPipelines.Universal.Runtime.stripped.dll 37 | 38 | 39 | libs\UnityEngine.CoreModule.stripped.dll 40 | 41 | 42 | libs\UnityEngine.UI.stripped.dll 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Publish Release 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | description: 'Release version number' 8 | required: true 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | permissions: 14 | contents: write 15 | steps: 16 | - uses: actions/checkout@v2 17 | - uses: actions/setup-dotnet@v1 18 | with: 19 | dotnet-version: '6.0.x' 20 | - run: echo "::set-output name=URL::$(curl -vs https://builds.bepinex.dev/projects/bepinex_be 2>&1 | grep -Po '(?<=href=")(\/projects\/bepinex_be\/(.*)\/BepInEx-Unity.IL2CPP-win-x64(.*))(?=")' | head -1)" 21 | id: bepinexurl 22 | - run: wget https://builds.bepinex.dev${{ steps.bepinexurl.outputs.URL}} 23 | - run: mkdir -p ${{ github.event.repository.name }}/BepInEx/plugins 24 | - run: mkdir -p ${{ github.event.repository.name }}/BepInEx/config 25 | - run: dotnet build -c Release -o build 26 | - run: cp build/${{ github.event.repository.name }}.dll ${{ github.event.repository.name }}/BepInEx/plugins/${{ github.event.repository.name }}.dll 27 | - run: unzip BepInEx-Unity* -d ${{ github.event.repository.name }} 28 | - run: cp BepInEx.cfg ${{ github.event.repository.name }}/BepInEx/config/BepInEx.cfg 29 | - run: touch ${{ github.event.repository.name }}/EXTRACT_TO_GAME_DIRECTORY 30 | - run: chmod -R 777 ${{ github.event.repository.name }} 31 | - run: cd ${{ github.event.repository.name }}; zip -r ../${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip ./* 32 | - uses: ncipollo/release-action@v1 33 | with: 34 | artifacts: "${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip" 35 | token: ${{ secrets.GITHUB_TOKEN }} 36 | tag: ${{ github.event.inputs.version }} 37 | name: "${{ github.event.inputs.version }}" 38 | draft: true 39 | generateReleaseNotes: true 40 | bodyFile: "release_body.md" 41 | artifactErrorsFailBuild: true 42 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ⚠️ This repository has been migrated 2 | Active development has moved to [Codeberg](https://codeberg.org/Lyall/SoulHackers2Fix). 3 | This repo is archived and will no longer receive updates. 4 | 5 | # Soul Hackers 2 Fix 6 | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W01UAI9)
7 | [![Github All Releases](https://img.shields.io/github/downloads/Lyall/SoulHackers2Fix/total.svg)](https://github.com/Lyall/SoulHackers2Fix/releases) 8 | 9 | This BepInEx plugin for the game Soul Hackers 2 features: 10 | - Proper ultrawide and non-16:9 aspect ratio support with pillarbox removal. 11 | - Custom resolution support. 12 | - Graphical tweaks to increase fidelity. 13 | - Disable Chromatic Aberration 14 | - Anisotropic Filtering 15 | - LOD Bias 16 | - Render Scale (Resolution Scale) 17 | - Fix for slidey character movement above 60fps. 18 | 19 | ## Installation 20 | - Grab the latest release of SoulHackers2Fix from [here.](https://github.com/Lyall/SoulHackers2Fix/releases) 21 | - Extract the contents of the release zip in to the game directory.
(e.g. "**steamapps\common\SOUL HACKERS2**" for Steam). 22 | - Run the game once to generate a config file located at **\BepInEx\config\SoulHackers2Fix.cfg** 23 | - The first launch may take a little while as BepInEx does its magic. 24 | 25 | ### Linux 26 | - If you are running Linux (for example with the Steam Deck) then the game needs to have it's launch option changed to load BepInEx. 27 | - You can do this by going to the game properties in Steam and finding "LAUNCH OPTIONS". 28 | - Make sure the launch option is set to: ```WINEDLLOVERRIDES="winhttp=n,b" %command%``` 29 | 30 | | ![steam launch options](https://user-images.githubusercontent.com/695941/179568974-6697bfcf-b67d-441c-9707-88cd3c72a104.jpeg) | 31 | |:--:| 32 | | Steam launch options. | 33 | 34 | ## Configuration 35 | - See the generated config file to adjust various aspects of the plugin. 36 | 37 | ## Known Issues 38 | Please report any issues you see. 39 | - Fullscreen exclusive for custom resolutions does not seem to work properly at the moment. 40 | 41 | ## Screenshots 42 | | ![ezgif-5-8c9e6fffc1](https://user-images.githubusercontent.com/695941/187015446-42c19f43-c3e6-48f6-811f-f0fb120deedb.gif) | 43 | |:--:| 44 | | Ultrawide pillarbox removal. | 45 | 46 | ![CA On](https://user-images.githubusercontent.com/695941/187334877-2768b152-7f49-4787-b5a6-f8e4b4befb4a.jpg)| ![CA Off](https://user-images.githubusercontent.com/695941/187334873-36430911-4eae-432b-9aa5-72708a212cb2.jpg) 47 | :-------------------------:|:-------------------------: 48 | Chromatic Aberration On | Chromatic Aberration Off 49 | 50 | ## Credits 51 | - [BepinEx](https://github.com/BepInEx/BepInEx) is licensed under the GNU Lesser General Public License v2.1. 52 | -------------------------------------------------------------------------------- /BepInEx.cfg: -------------------------------------------------------------------------------- 1 | [] 2 | 3 | UnityLogListening = false 4 | 5 | [Caching] 6 | 7 | ## Enable/disable assembly metadata cache 8 | ## Enabling this will speed up discovery of plugins and patchers by caching the metadata of all types BepInEx discovers. 9 | # Setting type: Boolean 10 | # Default value: true 11 | EnableAssemblyCache = true 12 | 13 | [Detours] 14 | 15 | ## The native provider to use for managed detours 16 | # Setting type: DetourProvider 17 | # Default value: Default 18 | # Acceptable values: Default, Dobby, Funchook 19 | DetourProviderType = Default 20 | 21 | [Harmony.Logger] 22 | 23 | ## Specifies which Harmony log channels to listen to. 24 | ## NOTE: IL channel dumps the whole patch methods, use only when needed! 25 | # Setting type: LogChannel 26 | # Default value: Warn, Error 27 | # Acceptable values: None, Info, IL, Warn, Error, Debug, All 28 | # Multiple values can be set at the same time by separating them with , (e.g. Debug, Warning) 29 | LogChannels = Warn, Error 30 | 31 | [IL2CPP] 32 | 33 | ## Whether to run Il2CppInterop automatically to generate Il2Cpp support assemblies when they are outdated. 34 | ## If disabled assemblies in `BepInEx/interop` won't be updated between game or BepInEx updates! 35 | ## 36 | # Setting type: Boolean 37 | # Default value: true 38 | UpdateInteropAssemblies = true 39 | 40 | ## URL to the ZIP of managed Unity base libraries. 41 | ## The base libraries are used by Il2CppInterop to generate interop assemblies. 42 | ## The URL can include {VERSION} template which will be replaced with the game's Unity engine version. 43 | ## 44 | # Setting type: String 45 | # Default value: https://unity.bepinex.dev/libraries/{VERSION}.zip 46 | UnityBaseLibrariesSource = https://unity.bepinex.dev/libraries/{VERSION}.zip 47 | 48 | ## The RegEx string to pass to Il2CppAssemblyUnhollower for renaming obfuscated names. 49 | ## All types and members matching this RegEx will get a name based on their signature, 50 | ## resulting in names that persist after game updates. 51 | ## 52 | # Setting type: String 53 | # Default value: 54 | UnhollowerDeobfuscationRegex = 55 | 56 | ## If enabled, BepInEx will save dummy assemblies generated by an Cpp2IL dumper into BepInEx/dummy. 57 | # Setting type: Boolean 58 | # Default value: false 59 | DumpDummyAssemblies = false 60 | 61 | [Logging] 62 | 63 | ## Enables showing unity log messages in the BepInEx logging system. 64 | # Setting type: Boolean 65 | # Default value: true 66 | UnityLogListening = false 67 | 68 | [Logging.Console] 69 | 70 | ## Enables showing a console for log output. 71 | # Setting type: Boolean 72 | # Default value: true 73 | Enabled = false 74 | 75 | ## If enabled, will prevent closing the console (either by deleting the close button or in other platform-specific way). 76 | # Setting type: Boolean 77 | # Default value: false 78 | PreventClose = false 79 | 80 | ## If true, console is set to the Shift-JIS encoding, otherwise UTF-8 encoding. 81 | # Setting type: Boolean 82 | # Default value: false 83 | ShiftJisEncoding = false 84 | 85 | ## Hints console manager on what handle to assign as StandardOut. Possible values: 86 | ## Auto - lets BepInEx decide how to redirect console output 87 | ## ConsoleOut - prefer redirecting to console output; if possible, closes original standard output 88 | ## StandardOut - prefer redirecting to standard output; if possible, closes console out 89 | ## 90 | # Setting type: ConsoleOutRedirectType 91 | # Default value: Auto 92 | # Acceptable values: Auto, ConsoleOut, StandardOut 93 | StandardOutType = Auto 94 | 95 | ## Which log levels to show in the console output. 96 | # Setting type: LogLevel 97 | # Default value: Fatal, Error, Warning, Message, Info 98 | # Acceptable values: None, Fatal, Error, Warning, Message, Info, Debug, All 99 | # Multiple values can be set at the same time by separating them with , (e.g. Debug, Warning) 100 | LogLevels = Fatal, Error, Warning, Message, Info 101 | 102 | [Logging.Disk] 103 | 104 | ## Appends to the log file instead of overwriting, on game startup. 105 | # Setting type: Boolean 106 | # Default value: false 107 | AppendLog = false 108 | 109 | ## Enables writing log messages to disk. 110 | # Setting type: Boolean 111 | # Default value: true 112 | Enabled = true 113 | 114 | ## Only displays the specified log levels in the disk log output. 115 | # Setting type: LogLevel 116 | # Default value: Fatal, Error, Warning, Message, Info 117 | # Acceptable values: None, Fatal, Error, Warning, Message, Info, Debug, All 118 | # Multiple values can be set at the same time by separating them with , (e.g. Debug, Warning) 119 | LogLevels = Fatal, Error, Warning, Message, Info 120 | 121 | ## If true, instantly writes any received log entries to disk. 122 | ## This incurs a major performance hit if a lot of log messages are being written, however it is really useful for debugging crashes. 123 | ## 124 | # Setting type: Boolean 125 | # Default value: false 126 | InstantFlushing = false 127 | 128 | ## The maximum amount of concurrent log files that will be written to disk. 129 | ## As one log file is used per open game instance, you may find it necessary to increase this limit when debugging multiple instances at the same time. 130 | ## 131 | # Setting type: Int32 132 | # Default value: 5 133 | ConcurrentFileLimit = 5 134 | 135 | ## Include unity log messages in log file output. 136 | # Setting type: Boolean 137 | # Default value: false 138 | WriteUnityLog = false 139 | 140 | [Preloader] 141 | 142 | ## Specifies which MonoMod backend to use for Harmony patches. Auto uses the best available backend. 143 | ## This setting should only be used for development purposes (e.g. debugging in dnSpy). Other code might override this setting. 144 | # Setting type: MonoModBackend 145 | # Default value: auto 146 | # Acceptable values: auto, dynamicmethod, methodbuilder, cecil 147 | HarmonyBackend = auto 148 | 149 | ## If enabled, BepInEx will save patched assemblies into BepInEx/DumpedAssemblies. 150 | ## This can be used by developers to inspect and debug preloader patchers. 151 | # Setting type: Boolean 152 | # Default value: false 153 | DumpAssemblies = false 154 | 155 | ## If enabled, BepInEx will load patched assemblies from BepInEx/DumpedAssemblies instead of memory. 156 | ## This can be used to be able to load patched assemblies into debuggers like dnSpy. 157 | ## If set to true, will override DumpAssemblies. 158 | # Setting type: Boolean 159 | # Default value: false 160 | LoadDumpedAssemblies = false 161 | 162 | ## If enabled, BepInEx will call Debugger.Break() once before loading patched assemblies. 163 | ## This can be used with debuggers like dnSpy to install breakpoints into patched assemblies before they are loaded. 164 | # Setting type: Boolean 165 | # Default value: false 166 | BreakBeforeLoadAssemblies = false 167 | 168 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /SoulHackers2Fix.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepInEx.Configuration; 3 | using BepInEx.Logging; 4 | using BepInEx.Unity.IL2CPP; 5 | using HarmonyLib; 6 | 7 | using UnityEngine; 8 | using UnityEngine.Rendering.Universal; 9 | using UnityEngine.UI; 10 | 11 | using AtLib.AtGraphics.AtImageEffect; 12 | 13 | namespace SH2Fix 14 | { 15 | [BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)] 16 | public class SH2 : BasePlugin 17 | { 18 | internal static new ManualLogSource Log; 19 | 20 | // Features 21 | public static ConfigEntry bUltrawideFixes; 22 | public static ConfigEntry bMovementFix; 23 | public static ConfigEntry fMovementFix; 24 | 25 | // Graphics 26 | public static ConfigEntry bDisableChromaticAberration; 27 | public static ConfigEntry iAnisotropicFiltering; 28 | public static ConfigEntry fLODBias; 29 | public static ConfigEntry fRenderScale; 30 | 31 | // Custom Resolution 32 | public static ConfigEntry bCustomResolution; 33 | public static ConfigEntry fDesiredResolutionX; 34 | public static ConfigEntry fDesiredResolutionY; 35 | public static ConfigEntry iWindowMode; 36 | 37 | // Aspect Ratio 38 | public static float DefaultAspectRatio = (float)16 / 9; 39 | public static float NewAspectRatio = (float)Screen.width / Screen.height; // This is only calculated on startup. Potential issue? 40 | public static float AspectMultiplier = NewAspectRatio / DefaultAspectRatio; 41 | public static float AspectDivider = DefaultAspectRatio / NewAspectRatio; 42 | 43 | public override void Load() 44 | { 45 | // Plugin startup logic 46 | Log = base.Log; 47 | Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!"); 48 | 49 | // Features 50 | bUltrawideFixes = Config.Bind("General", 51 | "UltrawideFixes", 52 | true, 53 | "Set to true to enable ultrawide UI fixes."); 54 | 55 | bMovementFix = Config.Bind("General", 56 | "MovementFix", 57 | true, 58 | "Set to true to fix player movement above 60fps."); 59 | 60 | fMovementFix = Config.Bind("General", 61 | "MovementFix.Value", 62 | (float)0f, // Game Default = 0.1f | Leave on 0 to auto calculate 63 | new ConfigDescription("Set player motion blend time. Lower values reduce the amount of time it takes to come to a stop after moving.\n" + 64 | "You can set this to 0 to have the fix calculate this automatically.\n" + 65 | "Game Default = 0.1", 66 | new AcceptableValueRange(0f, 10f))); 67 | 68 | // Graphics 69 | bDisableChromaticAberration = Config.Bind("Graphical Tweaks", 70 | "DisableChromaticAberration", 71 | false, // Default to false, maybe people like it. 72 | "Set to true to disable chromatic aberration effects."); 73 | 74 | iAnisotropicFiltering = Config.Bind("Graphical Tweaks", 75 | "AnisotropicFiltering.Value", 76 | (int)16, 77 | new ConfigDescription("Set Anisotropic Filtering level. Higher values improve clarity of textures at oblique angles.", 78 | new AcceptableValueRange(1, 16))); 79 | 80 | fLODBias = Config.Bind("Graphical Tweaks", 81 | "LODBias.Value", 82 | (float)1.5f, // Default = 1.5f 83 | new ConfigDescription("Set LOD Bias. Controls distance for level of detail switching.", 84 | new AcceptableValueRange(0.1f, 10f))); 85 | 86 | fRenderScale = Config.Bind("Graphical Tweaks", 87 | "RenderScale.Value", 88 | (float)100f, // Default = 100 89 | new ConfigDescription("Set Render Scale. Setting higher than 100 provides downsampling for much improved anti-aliasing.", 90 | new AcceptableValueRange(10f, 400f))); 91 | 92 | // Custom Resolution 93 | bCustomResolution = Config.Bind("Set Custom Resolution", 94 | "CustomResolution", 95 | true, // Enabled by default to fix the janky startup resolution. 96 | "Set to true to enable the custom resolution below."); 97 | 98 | fDesiredResolutionX = Config.Bind("Set Custom Resolution", 99 | "ResolutionWidth", 100 | (float)Display.main.systemWidth, // Set default to display width so we don't leave an unsupported resolution as default. 101 | "Set desired resolution width."); 102 | 103 | fDesiredResolutionY = Config.Bind("Set Custom Resolution", 104 | "ResolutionHeight", 105 | (float)Display.main.systemHeight, // Set default to display height so we don't leave an unsupported resolution as default. 106 | "Set desired resolution height."); 107 | 108 | iWindowMode = Config.Bind("Set Custom Resolution", 109 | "WindowMode", 110 | (int)1, 111 | new ConfigDescription("Set window mode. 1 = Borderless, 2 = Windowed.\nExclusive Fullscreen is broken at the moment.", 112 | new AcceptableValueRange(1, 2))); 113 | 114 | // Run UltrawidePatches 115 | if (bUltrawideFixes.Value) 116 | { 117 | Harmony.CreateAndPatchAll(typeof(UltrawidePatches)); 118 | } 119 | 120 | // Run CustomResolutionPatches 121 | if (bCustomResolution.Value) 122 | { 123 | Harmony.CreateAndPatchAll(typeof(CustomResolutionPatches)); 124 | } 125 | 126 | Harmony.CreateAndPatchAll(typeof(EffectPatches)); 127 | Harmony.CreateAndPatchAll(typeof(MiscellaneousPatches)); 128 | 129 | } 130 | 131 | [HarmonyPatch] 132 | public class UltrawidePatches 133 | { 134 | public static GameObject LetterboxingUp; 135 | public static GameObject LetterboxingDown; 136 | public static GameObject LetterboxingLeft; 137 | public static GameObject LetterboxingRight; 138 | 139 | public static bool bLetterboxPatchHasRun = false; 140 | 141 | // Set screen match mode when object has canvas scaler enabled 142 | [HarmonyPatch(typeof(CanvasScaler), nameof(CanvasScaler.OnEnable))] 143 | [HarmonyPostfix] 144 | public static void SetScreenMatchMode(CanvasScaler __instance) 145 | { 146 | if (NewAspectRatio > DefaultAspectRatio || NewAspectRatio < DefaultAspectRatio) 147 | { 148 | __instance.m_ScreenMatchMode = CanvasScaler.ScreenMatchMode.Expand; 149 | } 150 | } 151 | 152 | // Letterboxing 153 | [HarmonyPatch(typeof(Game.UI.System.LetterBox), nameof(Game.UI.System.LetterBox.updateBlack))] 154 | [HarmonyPostfix] 155 | public static void DisableLetterboxing(Game.UI.System.LetterBox __instance) 156 | { 157 | if (!bLetterboxPatchHasRun) 158 | { 159 | LetterboxingUp = __instance.Up.gameObject; 160 | LetterboxingDown = __instance.Down.gameObject; 161 | LetterboxingLeft = __instance.Left.gameObject; 162 | LetterboxingRight = __instance.Right.gameObject; 163 | 164 | LetterboxingUp.gameObject.SetActive(false); 165 | LetterboxingDown.gameObject.SetActive(false); 166 | LetterboxingLeft.gameObject.SetActive(false); 167 | LetterboxingRight.SetActive(false); 168 | 169 | bLetterboxPatchHasRun = true; 170 | Log.LogInfo($"Disabled letterboxing."); 171 | } 172 | } 173 | } 174 | 175 | [HarmonyPatch] 176 | public class MiscellaneousPatches 177 | { 178 | public static bool bMovementLogHasRun = false; 179 | 180 | // Adjust graphics settings 181 | [HarmonyPatch(typeof(Game.Common.ConfigCtrl), nameof(Game.Common.ConfigCtrl.ApplyGraphicsSettings))] 182 | [HarmonyPostfix] 183 | public static void PostApplyGraphicsSettings() 184 | { 185 | var configData = Game.Common.ConfigCtrl.s_ConfigSystem2Data; 186 | 187 | // Anisotropic Filtering 188 | if (iAnisotropicFiltering.Value > 0) 189 | { 190 | Log.LogInfo($"Old: Anisotropic filtering = {QualitySettings.anisotropicFiltering}"); 191 | QualitySettings.anisotropicFiltering = AnisotropicFiltering.ForceEnable; 192 | Texture.SetGlobalAnisotropicFilteringLimits(iAnisotropicFiltering.Value, iAnisotropicFiltering.Value); 193 | Log.LogInfo($"New: Anisotropic filtering = {QualitySettings.anisotropicFiltering}. Value = {iAnisotropicFiltering.Value}"); 194 | } 195 | 196 | // Render Scale 197 | if (fRenderScale.Value > 0f) 198 | { 199 | Log.LogInfo($"Old: Game RenderScale = {Game.Common.ConfigCtrl.GetRenderScale()}. URP m_RenderScale = {UniversalRenderPipeline.asset.m_RenderScale}"); 200 | Game.Common.ConfigCtrl.SetRenderScale((int)fRenderScale.Value); 201 | UniversalRenderPipeline.asset.m_RenderScale = fRenderScale.Value / 100; 202 | Log.LogInfo($"New: Game RenderScale = {Game.Common.ConfigCtrl.GetRenderScale()}. URP m_RenderScale = {UniversalRenderPipeline.asset.m_RenderScale}"); 203 | } 204 | 205 | // LOD Bias 206 | if (fLODBias.Value >= 0.1f) 207 | { 208 | Log.LogInfo($"Old: LODBias set to {fLODBias.Value}"); 209 | QualitySettings.lodBias = fLODBias.Value; // Default = 1.5f 210 | Log.LogInfo($"New: LODBias set to {fLODBias.Value}"); 211 | } 212 | Log.LogInfo("Applied custom settings."); 213 | } 214 | 215 | // Fix movement sliding 216 | [HarmonyPatch(typeof(MapNew.MapChara), nameof(MapNew.MapChara.SetActive))] 217 | [HarmonyPostfix] 218 | public static void FixSliding(MapNew.MapChara __instance) 219 | { 220 | if (bMovementFix.Value) 221 | { 222 | var global = MapNew.MapManager.GlobalSettings; 223 | 224 | if (fMovementFix.Value == 0f) 225 | { 226 | // Calculate motion blend time based on FPS cap. 227 | var currFPS = Game.Common.ConfigCtrl.GetFps() switch 228 | { 229 | Game.Common.eGameGraphicsFps.Free => Screen.currentResolution.refreshRate, 230 | Game.Common.eGameGraphicsFps.Fps30 => 30f, 231 | Game.Common.eGameGraphicsFps.Fps60 => 60f, 232 | Game.Common.eGameGraphicsFps.Fps75 => 75f, 233 | Game.Common.eGameGraphicsFps.Fps120 => 120f, 234 | Game.Common.eGameGraphicsFps.Fps144 => 144f, 235 | Game.Common.eGameGraphicsFps.Fps150 => 150f, 236 | Game.Common.eGameGraphicsFps.Max => Screen.currentResolution.refreshRate, 237 | _ => Screen.currentResolution.refreshRate, 238 | }; 239 | 240 | float FPSDivider = (float)currFPS / (float)60; // Assuming default (0.1f) is for 60fps. 241 | global.m_Common.m_PlayerMoveMotionBlendTime = (float)0.1f / FPSDivider; 242 | if (!bMovementLogHasRun) 243 | { 244 | Log.LogInfo($"MovementFix: Automatic: currFPS = {currFPS}, PlayerMoveMotionBlendTime = {global.m_Common.m_PlayerMoveMotionBlendTime}."); 245 | bMovementLogHasRun = true; 246 | } 247 | 248 | } 249 | else if (fMovementFix.Value > 0f) 250 | { 251 | // Set to value defined in config. 252 | global.m_Common.m_PlayerMoveMotionBlendTime = fMovementFix.Value; 253 | if (!bMovementLogHasRun) 254 | { 255 | Log.LogInfo($"MovementFix: Manual: PlayerMoveMotionBlendTime = {global.m_Common.m_PlayerMoveMotionBlendTime}."); 256 | bMovementLogHasRun = true; 257 | } 258 | 259 | } 260 | } 261 | } 262 | } 263 | 264 | [HarmonyPatch] 265 | public class CustomResolutionPatches 266 | { 267 | // Apply Custom Resolution 268 | [HarmonyPatch(typeof(Game.Common.ConfigCtrl), nameof(Game.Common.ConfigCtrl.SetDisplayAndResolutionAll))] 269 | [HarmonyPrefix] 270 | public static bool ForceCustomResolution(ref bool __0, ref bool __1, ref bool __2, ref int __3, ref Game.Common.eGameGraphicsScreenModeSetting __4, ref int __5, ref int __6) 271 | { 272 | var screenMode = iWindowMode.Value switch 273 | { 274 | //1 => Game.Common.eGameGraphicsScreenModeSetting.ExclusiveFullScreen, // Exclusive Full Screen - Broken? 275 | 1 => Game.Common.eGameGraphicsScreenModeSetting.FullScreen, // Borderless 276 | 2 => Game.Common.eGameGraphicsScreenModeSetting.Window, // Windowed 277 | _ => Game.Common.eGameGraphicsScreenModeSetting.FullScreen, // Borderless 278 | }; 279 | 280 | Log.LogInfo($"Custom Resolution: Old: SetDisplayAndResolutionAll: reso = {__0}, screen = {__1}, monitor = {__2}, monNum = {__3}, screenMode = {__4}, w = {__5}, h = {__6}"); 281 | Game.Common.ConfigCtrl.SetResolutionW((int)fDesiredResolutionX.Value); 282 | Game.Common.ConfigCtrl.SetResolutionH((int)fDesiredResolutionY.Value); 283 | Game.Common.ConfigCtrl.SetScreenMode(screenMode); 284 | __5 = (int)fDesiredResolutionX.Value; 285 | __6 = (int)fDesiredResolutionY.Value; 286 | __4 = screenMode; 287 | Log.LogInfo($"Custom Resolution: New: SetDisplayAndResolutionAll: reso = {__0}, screen = {__1}, monitor = {__2}, monNum = {__3}, screenMode = {__4}, w = {__5}, h = {__6}"); 288 | return true; 289 | } 290 | } 291 | 292 | [HarmonyPatch] 293 | public class EffectPatches 294 | { 295 | // Effect Toggles 296 | [HarmonyPatch(typeof(RpGraphics.RpImageEffectData), nameof(RpGraphics.RpImageEffectData.OnEnable))] 297 | [HarmonyPostfix] 298 | public static void EffectToggles() 299 | { 300 | var imageEffectManager = RpGraphics.RpGraphicsManager.GetImageEffectManager(); 301 | 302 | if (bDisableChromaticAberration.Value) 303 | { 304 | AtGlitch.u_colorGap = 0; 305 | Log.LogInfo($"Glitch Effect: Set color gap to {AtGlitch.u_colorGap}"); 306 | Log.LogInfo($"Vignette Effect: Renderer disabled"); 307 | var vignetteRenderer = imageEffectManager.GetRenderer(); 308 | vignetteRenderer.enabled = false; 309 | } 310 | } 311 | } 312 | } 313 | } 314 | 315 | --------------------------------------------------------------------------------