Compare commits

..

12 Commits

Author SHA1 Message Date
ivan tkachenko 69231bc92a Release v4.2.0 2026-02-06 17:32:29 +02:00
ivan tkachenko ed4766e772 Bump DawnLib version 2026-02-06 17:17:36 +02:00
ivan tkachenko 292afff6ce Add Unity specific code analyzers
Reduces amount of false positive warnings.
2026-02-02 17:22:11 +02:00
ivan tkachenko 5609e0c21c README: Add alternative config recommendation 2026-02-02 17:21:00 +02:00
ivan tkachenko 6575b2685f Turn off Generate Cost Config for Hookah unlockable
It is a new option in DawnLib/Dusk 0.7.8, and it allows to skip binding
cost to a config option which is turn means more artistic control and
less cache invalidation issues.
2026-02-02 16:41:14 +02:00
ivan tkachenko 74f7436ab3 Fix Editor script's menu to Compile Scripts 2026-02-02 16:41:10 +02:00
ivan tkachenko 1d6ae6066d Bump DawnLib version 2026-02-02 15:57:53 +02:00
ivan tkachenko 7ea470758e Set namespace keys in assetbundle
In Unity decompiled project the NamespacedKey properties of the base
class DuskContentDefinition were missing. The fix was to turn off
'Validate References' for all DawnLib (the dependency) DLLs.
Do NOT turn it off for Editor DLL though.
2026-02-02 15:13:58 +02:00
ivan tkachenko 8c59d63fa8 Remove unused PersistentDataContainer
It only stores mod's current version which is not particularly exciting.
It has nothing to do with persisting furniture in a save file.
2026-02-02 15:04:35 +02:00
ivan tkachenko 3bdef5bc72 Instantiate our ContentHandler directly 2026-02-02 15:04:35 +02:00
ivan tkachenko 62a11f76d2 Add editorconfig
Source files being under src/ directory will never match the namespaces.
2026-02-02 15:04:35 +02:00
ivan tkachenko d3720d879b Add link to Discord forum thread 2026-01-26 01:35:07 +02:00
10 changed files with 24 additions and 42 deletions

4
.editorconfig Normal file
View File

@ -0,0 +1,4 @@
[*.cs]
# IDE0130: Namespace does not match folder structure
dotnet_style_namespace_match_folder = false

View File

@ -54,6 +54,7 @@ public class HookahAssetBuilder
FileName = "dotnet",
Arguments = "build",
UseShellExecute = false,
WorkingDirectory = ModProjectPath,
};
var proc = Process.Start(psi);

View File

@ -4,7 +4,7 @@
<PropertyGroup>
<AssemblyName>Ratijas.HookahPlace</AssemblyName>
<Product>HookahPlace</Product>
<Version>4.1.9</Version>
<Version>4.2.0</Version>
</PropertyGroup>
<!-- Project Properties -->
<PropertyGroup>
@ -44,7 +44,7 @@
</PropertyGroup>
<PropertyGroup>
<DawnLibVersion>0.7.3</DawnLibVersion>
<DawnLibVersion>0.7.11</DawnLibVersion>
</PropertyGroup>
<!-- Primary Package References - BepInEx -->
@ -54,6 +54,10 @@
<PackageReference Include="BepInEx.Core" Version="5.*" PrivateAssets="all"/>
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" PrivateAssets="all"/>
<PackageReference Include="LethalCompany.GameLibs.Steam" Version="*-*" PrivateAssets="all"/>
<PackageReference Include="Microsoft.Unity.Analyzers" Version="1.25.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="UnityEngine.Modules" Version="2022.3.62" PrivateAssets="all"/>
<PackageReference Include="TeamXiaolan.DawnLib" Version="$(DawnLibVersion)" PrivateAssets="all"/>
<PackageReference Include="TeamXiaolan.DawnLib.DuskMod" Version="$(DawnLibVersion)" />

View File

@ -12,10 +12,12 @@ Become a ship-mom (or a ship-dad) and smoke shisha while guiding your crew over
The mod adds a ship decor/furniture to the store called "Hookah".
The store rotates between random 4-6 entries every quota. To make the hookah always available in the store, use another mod like [`StoreRotationConfig` by `pacoito`](https://thunderstore.io/c/lethal-company/p/pacoito/StoreRotationConfig/) with the `stockAll` option toggled ON.
The store rotates between random 4-6 entries every quota. To make the hookah always available in the store, use another mod like [`StoreRotationConfig` by `pacoito`](https://thunderstore.io/c/lethal-company/p/pacoito/StoreRotationConfig/) with the `stockAll` option toggled ON or add "Hookah" (with capital 'H', without quotes) to the `itemWhitelist`.
## Made by Ratijas
See also [mod's release thread](https://discord.com/channels/1168655651455639582/1465126696117076242) at [Lethal Company Modding](https://discord.gg/XeyYqRdRGC) Discord server (in case the invite link expires, there should be a fresh one at [lethal.wiki](https://lethal.wiki/)).
Also check out my other mod, 🎵 [Muzika Gromche — The ultimate Jester party music mod](https://thunderstore.io/c/lethal-company/p/Ratijas/MuzikaGromche/)!
Hookah model made in Blender: [HookahPlace.blend](https://ratijas.me/share/public/LC/HookahPlace/HookahPlace.blend)

View File

@ -1,3 +1,7 @@
# 4.2.0
Fixed Hookah unlockable item disappearing after reloading a save file.
# 4.1.9
Inital release

View File

@ -4,14 +4,14 @@ schemaVersion = "0.0.1"
[package]
namespace = "Ratijas"
name = "HookahPlace"
versionNumber = "4.1.9"
versionNumber = "4.2.0"
description = "Relaxing hookah as a ship upgrade"
websiteUrl = "https://git.vilunov.me/ratijas/HookahPlace"
containsNsfwContent = false
[package.dependencies]
BepInEx-BepInExPack = "5.4.2304"
TeamXiaolan-DawnLib = "0.7.3"
TeamXiaolan-DawnLib = "0.7.11"
[build]
icon = "./icon.png"

View File

@ -1,22 +0,0 @@
using BepInEx.Configuration;
using Dusk;
namespace HookahPlace.Content;
internal static class NukeDawnLibConfig
{
static internal void NukeUnlockable(ConfigFile config, string heading, string name, int cost)
{
heading = $"{heading} Options";
var costName = $"{name} | Cost";
var disclaimer = "Sorry, this is not configurable. This is a dirty hack to suppress DawnLib/DuskMod from allowing any configurability here.";
var ctx = new ConfigContext(config, heading);
var enabledEntry = ctx.Bind("Enabled", disclaimer, true);
enabledEntry.Value = true;
var costEntry = ctx.Bind(costName, disclaimer, cost);
costEntry.Value = cost;
}
}

View File

@ -4,12 +4,8 @@ namespace HookahPlace.Content;
public class HookahContentHandler : ContentHandler<HookahContentHandler>
{
const int HOOKAH_PRICE = 130;
public HookahContentHandler(DuskMod mod) : base(mod)
{
NukeDawnLibConfig.NukeUnlockable(HookahPlace.Config, "HookahUnlockable", "Hookah", HOOKAH_PRICE);
if (!RegisterContent("hookahunlockableassets", out DefaultBundle? bundle, forceEnabled: true) || bundle == null)
{
HookahPlace.Logger.LogError($"Failed to register content");

View File

@ -7,6 +7,7 @@ using Dawn.Utils;
using HarmonyLib;
using Dusk;
using BepInEx.Configuration;
using HookahPlace.Content;
namespace HookahPlace;
@ -17,8 +18,6 @@ public class HookahPlace : BaseUnityPlugin
internal new static ManualLogSource Logger { get; private set; } = null!;
internal new static ConfigFile Config { get; private set; } = null!;
internal static PersistentDataContainer PersistentData { get; private set; } = null!;
internal static DuskMod Mod { get; private set; } = null!;
private void Awake()
@ -28,17 +27,11 @@ public class HookahPlace : BaseUnityPlugin
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), MyPluginInfo.PLUGIN_GUID);
// Example Persistent Data Container Usage
// You can do anything you want with this DataContainer, there are a few additonal ones under the DawnLib class that pertain to actual save files
PersistentData = this.GetPersistentDataContainer();
// e.g. track the last version the player played with, could be useful if you want do to stuff like setting migration.
// if you want to do config migration you should use DawnLib.GetCurrentInstallSave instead.
PersistentData.Set(HookahPlaceKeys.LastVersion, MyPluginInfo.PLUGIN_VERSION);
AssetBundle mainBundle = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "hookahplaceasset");
Mod = DuskMod.RegisterMod(this, mainBundle);
Mod.RegisterContentHandlers();
// Effectively the same as `Mod.RegisterContentHandlers();` but simpler and faster
_ = new HookahContentHandler(Mod);
Logger.LogInfo($"{MyPluginInfo.PLUGIN_GUID} v{MyPluginInfo.PLUGIN_VERSION} has loaded!");
}