From fa8a4bd77be91cccfac94807b116fdc60ba01592 Mon Sep 17 00:00:00 2001 From: pacoito123 Date: Thu, 9 Jan 2025 21:54:36 -0600 Subject: [PATCH] [v2.5.1] Removed goofy TerminalFormatter compatibility, also recompiled for v69. - **NOTE:** TerminalFormatter `v0.2.24` is currently incompatible; rotating item discounts aren't displayed (though they still apply), and any available items above the vanilla cap are not shown (but they can still be purchased). - Make sure to update to a newer version once available! --- CHANGELOG.md | 7 +++++++ README.md | 4 ++-- .../Compatibility/TerminalFormatterCompatibility.cs | 4 ++-- StoreRotationConfig/Config.cs | 8 ++++---- StoreRotationConfig/Patches/SyncShipUnlockablesPatches.cs | 8 ++++---- StoreRotationConfig/Plugin.cs | 4 ++-- StoreRotationConfig/StoreRotationConfig.csproj | 6 +++--- manifest.json | 2 +- 8 files changed, 25 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bd750b..6efa360 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.5.1] + +Removed goofy TerminalFormatter compatibility, also recompiled for v69. + +- **NOTE:** [TerminalFormatter](https://thunderstore.io/c/lethal-company/p/mrov/TerminalFormatter) `v0.2.24` is currently incompatible; rotating item discounts aren't displayed (though they still apply), and any available items above the vanilla cap are not shown (but they can still be purchased). + - Make sure to update to a newer version once available! + ## [2.5.0] Basic API added for managing rotating items, fixed rotating shop desync with 'removePurchased' setting. diff --git a/README.md b/README.md index f2563d7..f395a6f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # StoreRotationConfig [![Thunderstore Downloads](https://img.shields.io/thunderstore/dt/pacoito/StoreRotationConfig?style=for-the-badge&logo=thunderstore&color=mediumseagreen -)](https://thunderstore.io/c/lethal-company/p/pacoito/StoreRotationConfig/) +)](https://thunderstore.io/c/lethal-company/p/pacoito/StoreRotationConfig) [![GitHub Releases](https://img.shields.io/github/v/release/pacoito123/LC_StoreRotationConfig?display_name=tag&style=for-the-badge&logo=github&color=steelblue )](https://github.com/pacoito123/LC_StoreRotationConfig/releases) [![License](https://img.shields.io/github/license/pacoito123/LC_StoreRotationConfig?style=for-the-badge&logo=github&color=teal @@ -15,7 +15,7 @@ Simple mod that adds configurability to the number of items that show up in the Intended for when there's a large number of modded items (suits, furniture, etc.) in the store, and the vanilla store rotation makes it too unlikely to ever see a desired item in stock. -Compatible with `v61`, and `v64`. Should also be compatible with `v45`, `v49`, `v50`, `v56`, `v61`, and `v64`, though the latest releases are untested and downgrading to an older version might be required. +Compatible with `v64`, and `v69`. Should also be compatible with `v45`, `v49`, `v50`, `v56`, and `v61`, though the latest releases of this mod are untested in these older versions, and downgrading to an older release might be required. Uses [CSync (v5.0.1 and above)](https://thunderstore.io/c/lethal-company/p/Sigurd/CSync) by [Lordfirespeed](https://github.com/Lorefirespeed) to sync config settings between host and clients. diff --git a/StoreRotationConfig/Compatibility/TerminalFormatterCompatibility.cs b/StoreRotationConfig/Compatibility/TerminalFormatterCompatibility.cs index 004b0a2..26cc774 100644 --- a/StoreRotationConfig/Compatibility/TerminalFormatterCompatibility.cs +++ b/StoreRotationConfig/Compatibility/TerminalFormatterCompatibility.cs @@ -1,4 +1,4 @@ -using HarmonyLib; +/* using HarmonyLib; using StoreRotationConfig.Api; using System.Collections.Generic; using System.Reflection.Emit; @@ -73,4 +73,4 @@ private static IEnumerable GetNodeTextTranspiler(IEnumerable /// public ConfigEntry LINES_TO_SCROLL { get; private set; } - /// + /* /// /// Enable compatibility with 'TerminalFormatter'. /// - public ConfigEntry TERMINAL_FORMATTER_COMPAT { get; private set; } + public ConfigEntry TERMINAL_FORMATTER_COMPAT { get; private set; } */ /* /// /// Whether config has been successfully synced with the host or not; reset upon returning to main menu. @@ -151,9 +151,9 @@ public Config(ConfigFile cfg) : base(Plugin.GUID) LINES_TO_SCROLL = cfg.Bind("Miscellaneous", "linesToScroll", 20, new ConfigDescription("Number of lines to scroll at a time with " + "'relativeScroll' enabled.", new AcceptableValueRange(1, 28))); - TERMINAL_FORMATTER_COMPAT = cfg.Bind("Compatibility", "terminalFormatterCompat", true, "Enable compatibility between 'TerminalFormatter' " + /* TERMINAL_FORMATTER_COMPAT = cfg.Bind("Compatibility", "terminalFormatterCompat", true, "Enable compatibility between 'TerminalFormatter' " + "and the item sales system. Patches some methods so a restart is probably required.\nNOTE: This setting will be removed once compatibility is handled within 'TerminalFormatter' " - + "itself, since it wouldn't require any complex patching from their end."); + + "itself, since it wouldn't require any complex patching from their end."); */ // ... // Reset cached text if 'linesToScroll' is updated in-game. diff --git a/StoreRotationConfig/Patches/SyncShipUnlockablesPatches.cs b/StoreRotationConfig/Patches/SyncShipUnlockablesPatches.cs index b16f692..5d2f50b 100644 --- a/StoreRotationConfig/Patches/SyncShipUnlockablesPatches.cs +++ b/StoreRotationConfig/Patches/SyncShipUnlockablesPatches.cs @@ -1,6 +1,4 @@ -using GameNetcodeStuff; using HarmonyLib; -using StoreRotationConfig.Compatibility; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; @@ -91,6 +89,8 @@ private static void SyncShipUnlockablesClientRpcPost(StartOfRound __instance, Un // Check if unlockables need to be synced. if (!UnlockablesSynced) { + Plugin.StaticLogger?.LogInfo("Attempting to sync purchased and stored ship unlockables..."); + // Sync purchased suits. Resources.FindObjectsOfTypeAll().Select(suit => ___unlockablesList.unlockables[suit.suitID]).Do(item => { @@ -146,7 +146,7 @@ private static void MenuManagerStartPre() UnlockablesSynced = false; // ... - // Handle 'TerminalFormatter' compatibility here since I can't seem to get it to load before my mod, despite the soft dependency. + /* // Handle 'TerminalFormatter' compatibility here since I can't seem to get it to load before my mod, despite the soft dependency. if (Plugin.Settings != null && Plugin.Settings.TERMINAL_FORMATTER_COMPAT.Value && TerminalFormatterCompatibility.Enabled && !TerminalFormatterCompatibility.Patched) { @@ -163,7 +163,7 @@ private static void MenuManagerStartPre() TerminalFormatterCompatibility.Patched = true; Plugin.StaticLogger?.LogInfo($"'TerminalFormatter' patched!"); - } + } */ } } } \ No newline at end of file diff --git a/StoreRotationConfig/Plugin.cs b/StoreRotationConfig/Plugin.cs index 496faad..ea1b6d8 100644 --- a/StoreRotationConfig/Plugin.cs +++ b/StoreRotationConfig/Plugin.cs @@ -11,10 +11,10 @@ namespace StoreRotationConfig /// [BepInPlugin(GUID, PLUGIN_NAME, VERSION)] [BepInDependency("com.sigurd.csync", "5.0.1")] - [BepInDependency("TerminalFormatter", BepInDependency.DependencyFlags.SoftDependency)] + // [BepInDependency("TerminalFormatter", BepInDependency.DependencyFlags.SoftDependency)] public class Plugin : BaseUnityPlugin { - internal const string GUID = "pacoito.StoreRotationConfig", PLUGIN_NAME = "StoreRotationConfig", VERSION = "2.5.0"; + internal const string GUID = "pacoito.StoreRotationConfig", PLUGIN_NAME = "StoreRotationConfig", VERSION = "2.5.1"; internal static ManualLogSource? StaticLogger { get; private set; } /// diff --git a/StoreRotationConfig/StoreRotationConfig.csproj b/StoreRotationConfig/StoreRotationConfig.csproj index 5f2d3b8..89708d6 100644 --- a/StoreRotationConfig/StoreRotationConfig.csproj +++ b/StoreRotationConfig/StoreRotationConfig.csproj @@ -3,7 +3,7 @@ StoreRotationConfig Configure the number of items in each store rotation, show them all, remove purchases, sort them, and/or enable sales for them. - 2.5.0 + 2.5.1 @@ -52,9 +52,9 @@ managed\Unity.Netcode.Runtime.dll - + diff --git a/manifest.json b/manifest.json index 69800b8..8e0e80e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "StoreRotationConfig", - "version_number": "2.5.0", + "version_number": "2.5.1", "website_url": "https://github.com/pacoito123/LC_StoreRotationConfig", "description": "Configure the number of items in each store rotation, show them all, remove purchases, sort them, and/or enable sales for them. Also includes a fix for the terminal scrolling too far and skipping lines.", "dependencies": [