Skip to content

Commit

Permalink
[v2.5.1] Removed goofy TerminalFormatter compatibility, also recompil…
Browse files Browse the repository at this point in the history
…ed 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!
  • Loading branch information
pacoito123 committed Jan 10, 2025
1 parent 2a1dcb0 commit fa8a4bd
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HarmonyLib;
/* using HarmonyLib;
using StoreRotationConfig.Api;
using System.Collections.Generic;
using System.Reflection.Emit;
Expand Down Expand Up @@ -73,4 +73,4 @@ private static IEnumerable<CodeInstruction> GetNodeTextTranspiler(IEnumerable<Co
.InstructionEnumeration();
}
}
}
} */
8 changes: 4 additions & 4 deletions StoreRotationConfig/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public class Config : SyncedConfig2<Config>
/// </summary>
public ConfigEntry<int> LINES_TO_SCROLL { get; private set; }

/// <summary>
/* /// <summary>
/// Enable compatibility with 'TerminalFormatter'.
/// </summary>
public ConfigEntry<bool> TERMINAL_FORMATTER_COMPAT { get; private set; }
public ConfigEntry<bool> TERMINAL_FORMATTER_COMPAT { get; private set; } */

/* /// <summary>
/// Whether config has been successfully synced with the host or not; reset upon returning to main menu.
Expand Down Expand Up @@ -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<int>(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.
Expand Down
8 changes: 4 additions & 4 deletions StoreRotationConfig/Patches/SyncShipUnlockablesPatches.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using GameNetcodeStuff;
using HarmonyLib;
using StoreRotationConfig.Compatibility;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
Expand Down Expand Up @@ -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<UnlockableSuit>().Select(suit => ___unlockablesList.unlockables[suit.suitID]).Do(item =>
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -163,7 +163,7 @@ private static void MenuManagerStartPre()
TerminalFormatterCompatibility.Patched = true;
Plugin.StaticLogger?.LogInfo($"'TerminalFormatter' patched!");
}
} */
}
}
}
4 changes: 2 additions & 2 deletions StoreRotationConfig/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ namespace StoreRotationConfig
/// </summary>
[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; }

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions StoreRotationConfig/StoreRotationConfig.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>StoreRotationConfig</AssemblyName>
<Description>Configure the number of items in each store rotation, show them all, remove purchases, sort them, and/or enable sales for them.</Description>
<Version>2.5.0</Version>
<Version>2.5.1</Version>
</PropertyGroup>

<!-- Project properties. -->
Expand Down Expand Up @@ -52,9 +52,9 @@
<HintPath>managed\Unity.Netcode.Runtime.dll</HintPath>
</Reference>
<!-- Compatibility with other mods. -->
<Reference Include="TerminalFormatter">
<!-- <Reference Include="TerminalFormatter">
<HintPath>managed\TerminalFormatter.dll</HintPath>
</Reference>
</Reference> -->
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit fa8a4bd

Please sign in to comment.