diff --git a/Graveyard Keeper/BeamMeUpGerry/BeamMeUpGerry.csproj b/Graveyard Keeper/BeamMeUpGerry/BeamMeUpGerry.csproj index 0ab3dc0..d0385b7 100644 --- a/Graveyard Keeper/BeamMeUpGerry/BeamMeUpGerry.csproj +++ b/Graveyard Keeper/BeamMeUpGerry/BeamMeUpGerry.csproj @@ -1,6 +1,6 @@ - 3.0.6 + 3.0.7 $(Version) $(Version) diff --git a/Graveyard Keeper/BeamMeUpGerry/Helpers.cs b/Graveyard Keeper/BeamMeUpGerry/Helpers.cs index 30070e0..181b9b4 100644 --- a/Graveyard Keeper/BeamMeUpGerry/Helpers.cs +++ b/Graveyard Keeper/BeamMeUpGerry/Helpers.cs @@ -11,7 +11,7 @@ public static class Helpers private static bool RemovedQuarryBlockage() { - return MainGame.me.save.completed_one_time_crafts.Any(craft => craft.StartsWithByLanguage("steep_yellow_blockage")); + return MainGame.me.save.completed_one_time_crafts.Any(craft => craft.StartsWith("steep_yellow_blockage")); } diff --git a/Graveyard Keeper/BeamMeUpGerry/Patches.cs b/Graveyard Keeper/BeamMeUpGerry/Patches.cs index 79703ea..7c161b5 100644 --- a/Graveyard Keeper/BeamMeUpGerry/Patches.cs +++ b/Graveyard Keeper/BeamMeUpGerry/Patches.cs @@ -4,6 +4,41 @@ [SuppressMessage("ReSharper", "InconsistentNaming")] public static class Patches { + private static int OneTimeCraftCount; + private static int KnownZoneCount; + private static int KnownNpcCount; + + [HarmonyPrefix] + [HarmonyPatch(typeof(GameSave), nameof(GameSave.OnEnteredWorldZone))] + [HarmonyPatch(typeof(BuildModeLogics), nameof(BuildModeLogics.DoPlace))] + [HarmonyPatch(typeof(GameSave), nameof(GameSave.OnMetNPC))] + public static void BuildModeLogics_DoPlace_Prefix() + { + OneTimeCraftCount = MainGame.me.save.completed_one_time_crafts.Count; + KnownZoneCount = MainGame.me.save.known_world_zones.Count; + KnownNpcCount = MainGame.me.save.known_npcs.npcs.Count; + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(GameSave), nameof(GameSave.OnEnteredWorldZone))] + [HarmonyPatch(typeof(BuildModeLogics), nameof(BuildModeLogics.DoPlace))] + [HarmonyPatch(typeof(GameSave), nameof(GameSave.OnMetNPC))] + public static void BuildModeLogics_DoPlace_Postfix() + { + var newCraftCount = MainGame.me.save.completed_one_time_crafts.Count; + var newZoneCount = MainGame.me.save.known_world_zones.Count; + var newNpcCount = MainGame.me.save.known_npcs.npcs.Count; + + if (newCraftCount > OneTimeCraftCount || newZoneCount > KnownZoneCount || newNpcCount > KnownNpcCount) + { + PlatformSpecific.SaveGame(MainGame.me.save_slot, MainGame.me.save, OnComplete); + + void OnComplete(SaveSlotData __slot) + { + Plugin.InitConfiguration(); + } + } + } [HarmonyPostfix] [HarmonyWrapSafe] diff --git a/Graveyard Keeper/BeamMeUpGerry/Plugin.cs b/Graveyard Keeper/BeamMeUpGerry/Plugin.cs index 0d9d657..eb0e5b6 100644 --- a/Graveyard Keeper/BeamMeUpGerry/Plugin.cs +++ b/Graveyard Keeper/BeamMeUpGerry/Plugin.cs @@ -2,13 +2,13 @@ [Harmony] [BepInPlugin(PluginGuid, PluginName, PluginVer)] -[BepInDependency("p1xel8ted.gyk.gykhelper", "3.0.7")] +[BepInDependency("p1xel8ted.gyk.gykhelper", "3.0.9")] [SuppressMessage("ReSharper", "InconsistentNaming")] public class Plugin : BaseUnityPlugin { private const string PluginGuid = "p1xel8ted.gyk.beammeupgerryrewrite"; private const string PluginName = "Beam Me Up Gerry!"; - private const string PluginVer = "3.0.6"; + private const string PluginVer = "3.0.7"; internal static ConfigEntry DebugEnabled { get; private set; } internal static ConfigEntry IncreaseMenuAnimationSpeed { get; private set; } @@ -110,10 +110,30 @@ private void Update() } } - private void InitInternalConfiguration() { CustomLocationMessage = Config.Bind("Internal (Dont Touch)", "Custom Location Shown", false, new ConfigDescription("Internal use. Used for tracking if the custom location alert has been shown.", null, new ConfigurationManagerAttributes {Browsable = false, HideDefaultButton = true, IsAdvanced = true, ReadOnly = true, Order = 6})); + Config.Bind("Print Known", "Print Known", false, new ConfigDescription("Click to output known zones to log.", null, new ConfigurationManagerAttributes {CustomDrawer = PrintKnown, HideDefaultButton = true, Order = 5})); + } + private static void PrintKnown(ConfigEntryBase __obj) + { + var button = GUILayout.Button("Print Known Zones & One-Time Crafts", GUILayout.ExpandWidth(true)); + if (button) + { + Log.LogInfo("\n"); + Log.LogInfo("Known Zones:"); + foreach (var zone in MainGame.me.save.known_world_zones) + { + Log.LogInfo(zone); + } + Log.LogInfo("\n"); + Log.LogInfo("One-Time Crafts:"); + foreach (var craft in MainGame.me.save.completed_one_time_crafts) + { + Log.LogInfo(craft); + } + Log.LogInfo("\n"); + } } internal static void InitConfiguration() diff --git a/TavernKeeper/.gitignore b/TavernKeeper/.gitignore new file mode 100644 index 0000000..9ae365e --- /dev/null +++ b/TavernKeeper/.gitignore @@ -0,0 +1,625 @@ +# Created by https://www.toptal.com/developers/gitignore/api/git,macos,linux,windows,dotnetcore,visualstudio,visualstudiocode,jetbrains+all +# Edit at https://www.toptal.com/developers/gitignore?templates=git,macos,linux,windows,dotnetcore,visualstudio,visualstudiocode,jetbrains+all + +### DotnetCore ### +# .NET Core build folders +bin/ +obj/ + +# Common node modules locations +/node_modules +/wwwroot/node_modules +AAA_Releases/ +*/AAA_Releases/ + +lib +libs +libs/ +libs/* +*/libs +*/lib +lib/* + +### Git ### +# Created by git for backups. To disable backups in Git: +# $ git config --global mergetool.keepBackup false +*.orig + +# Created by git when using merge tools for conflicts +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt + +### JetBrains+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + + +# Libs +libs/ +libs +lib +lib/ +download +download/ + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +.vscode/*.code-snippets + +# Ignore code-workspaces +*.code-workspace + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools + +# Local History for Visual Studio Code + +# Windows Installer files from build outputs + +# JetBrains Rider +*.sln.iml + +### VisualStudio Patch ### +# Additional files built by Visual Studio + +# End of https://www.toptal.com/developers/gitignore/api/git,macos,linux,windows,dotnetcore,visualstudio,visualstudiocode,jetbrains+all + +!COTL_API/Debug/ +build/ \ No newline at end of file diff --git a/TavernKeeper/DemoUnlocker/DemoUnlocker.csproj b/TavernKeeper/DemoUnlocker/DemoUnlocker.csproj new file mode 100644 index 0000000..eb257cc --- /dev/null +++ b/TavernKeeper/DemoUnlocker/DemoUnlocker.csproj @@ -0,0 +1,94 @@ + + + + net6.0 + TavernKeeperDemoUnlocker + Tavern Keeper Demo Unlocker + 0.1.0 + true + latest + + https://api.nuget.org/v3/index.json; + https://nuget.bepinex.dev/v3/index.json; + https://nuget.samboy.dev/v3/index.json + + + + + + + TRACE;BepInEx_IL2CPP + + + + TRACE;BepInEx_IL2CPP + + + + + + + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\Assembly-CSharp.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\Assembly-CSharp-firstpass.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\Gh.Common.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\Gh.LitJson.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\Il2Cppmscorlib.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\Unity.InputSystem.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.AIModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.AnimationModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.AudioModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.ClothModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.CoreModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.IMGUIModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.InputLegacyModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.ParticleSystemModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.PhysicsModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.SharedInternalsModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.UI.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.UIModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.VideoModule.dll + + + ..\..\..\..\..\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\interop\UnityEngine.WindModule.dll + + + + \ No newline at end of file diff --git a/TavernKeeper/DemoUnlocker/GlobalUsings.cs b/TavernKeeper/DemoUnlocker/GlobalUsings.cs new file mode 100644 index 0000000..bb0e1e8 --- /dev/null +++ b/TavernKeeper/DemoUnlocker/GlobalUsings.cs @@ -0,0 +1,11 @@ + +global using System.Reflection; +global using BepInEx; +global using BepInEx.Logging; +global using BepInEx.Unity.IL2CPP; +global using Gh; +global using Gh.Tk; +global using HarmonyLib; +global using UnityEngine; +global using UnityEngine.SceneManagement; +global using Input = UnityEngine.Input; \ No newline at end of file diff --git a/TavernKeeper/DemoUnlocker/Plugin.cs b/TavernKeeper/DemoUnlocker/Plugin.cs new file mode 100644 index 0000000..7f1b9d0 --- /dev/null +++ b/TavernKeeper/DemoUnlocker/Plugin.cs @@ -0,0 +1,60 @@ +namespace DemoUnlocker; + +[Harmony] +[BepInPlugin(PluginGuid, PluginName, PluginVersion)] +public class Plugin : BasePlugin +{ + private const string PluginGuid = "p1xel8ted.tavernkeeperdemo.unlocker"; + private const string PluginName = "Tavern Keeper Demo Unlocker"; + private const string PluginVersion = "0.1.0"; + + public override void Load() + { + Log.LogInfo($"Plugin {PluginName} is loaded!"); + Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), PluginGuid); + UpdateFlags(); + } + + private static void UpdateFlags() + { + GameFlags.ENABLE_DEMO_MAINMENU = false; + GameFlags.ALLOW_ESCAPE_TO_MAINMENU = true; + GameFlags.ALLOW_SAVELOAD = true; + GameFlags.FORCE_SHOW_REGIONS_UNLOCKED_IN_MAIN_MENU = true; + GameFlags.ALL_LEVELS_UNLOCKED = true; + GameFlags.ENABLE_SHARE_CODES = true; + GameFlags.ENABLE_TROPHY_CASE = true; + GameFlags.ALLOW_FIRE_SPARKS = true; + GameFlags.ALLOW_DIRECTORSTOOLBAR = true; + GameFlags.DEBUG_ENABLE_DIRECTORS_TOOLBAR_DEVTOOLS = true; + GameFlags.ALLOW_DEV_CHEATS = true; + GameFlags.SHOW_HIDDEN_ITEMS_IN_MENU = true; + GameFlags.AUTO_SAVE_INTERVAL_IN_MINUTES = 10; + GameFlags.ENABLE_CINEMATIC_REPLAY = true; + GameFlags.ENABLE_CREDITS = true; + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(SaveLoadManager), nameof(SaveLoadManager.LateUpdate))] + public static void SaveLoadManager_LateUpdate(SaveLoadManager __instance) + { + if (Input.GetKeyUp(KeyCode.F5)) + { + __instance.QuickSave(); + } + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(SceneManager), nameof(SceneManager.Internal_SceneLoaded))] + public static void SceneManager_Internal_SceneLoaded(Scene scene) + { + UpdateFlags(); + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(GameFlags), "get_IsDemoOrBeta")] + public static void GameFlags_IsDemoOrBeta(ref bool __result) + { + __result = false; + } +} \ No newline at end of file diff --git a/TavernKeeper/Directory.Build.props b/TavernKeeper/Directory.Build.props new file mode 100644 index 0000000..cd4f0c6 --- /dev/null +++ b/TavernKeeper/Directory.Build.props @@ -0,0 +1,43 @@ + + + + + + net6.0 + latest + true + p1xel8ted + p1xel8ted + false + true + false + Publicizer001,CS1591 + disable + $(MSBuildProjectName) + + + + + + False + + + False + + + False + + + + + portable + + + + G:\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\plugins + + + + G:\SteamLibrary\steamapps\common\Tavern Keeper Demo\BepInEx\plugins + + \ No newline at end of file diff --git a/TavernKeeper/README.md b/TavernKeeper/README.md new file mode 100644 index 0000000..eb8e167 --- /dev/null +++ b/TavernKeeper/README.md @@ -0,0 +1,12 @@ +
+ +![logo3](https://github.com/p1xel8ted/UltrawideFixes/assets/10510767/e76cd453-4544-4961-a1f6-b2622571cc3a) + +## 🚩 Releases Below 🚩 + +https://github.com/p1xel8ted/UltrawideFixes + +Please consider supporting the project! Your support helps keep the fixes coming (and maintained), improving the experience for all. Thank you for supporting the project! + +[![ko-fi](https://github.com/p1xel8ted/UltrawideFixes/assets/10510767/bf2d4fb0-2249-4193-92df-5de01bf40cbf)](https://ko-fi.com/F2F2DI3WA) +
diff --git a/TavernKeeper/TavernKeeper.sln b/TavernKeeper/TavernKeeper.sln new file mode 100644 index 0000000..eae30bf --- /dev/null +++ b/TavernKeeper/TavernKeeper.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoUnlocker", "DemoUnlocker\DemoUnlocker.csproj", "{18705219-BD5A-4DE5-899C-E774B6347F9D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {18705219-BD5A-4DE5-899C-E774B6347F9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18705219-BD5A-4DE5-899C-E774B6347F9D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18705219-BD5A-4DE5-899C-E774B6347F9D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18705219-BD5A-4DE5-899C-E774B6347F9D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/TavernKeeper/global.json b/TavernKeeper/global.json new file mode 100644 index 0000000..b5b37b6 --- /dev/null +++ b/TavernKeeper/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "8.0.0", + "rollForward": "latestMajor", + "allowPrerelease": false + } +} \ No newline at end of file diff --git a/TavernKeeper/zip.target b/TavernKeeper/zip.target new file mode 100644 index 0000000..f6e85a0 --- /dev/null +++ b/TavernKeeper/zip.target @@ -0,0 +1,24 @@ + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + $(MSBuildProjectDirectory)\temp + $(MSBuildProjectDirectory)\temp + + + + + + + + + \ No newline at end of file