Compare commits

...

8 Commits

Author SHA1 Message Date
ivan tkachenko 7adac63345 Add tcli 2026-04-10 21:40:39 +03:00
ivan tkachenko 763c45e0be Bump version, prepare release 2026-04-10 21:37:37 +03:00
ivan tkachenko 52a69155bb Rebuild assets and add new editor script 2026-04-10 21:33:02 +03:00
ivan tkachenko b6f0901063 Add Terminal patch to make Hookah unlockable always available in shop 2026-04-10 21:33:02 +03:00
ivan tkachenko be62175767 Use DawnLib.SourceGen for Dawn namespaced keys 2026-04-10 21:33:02 +03:00
ivan tkachenko a3dc292614 Add DawnLib.SourceGen for keys generation 2026-04-10 21:33:02 +03:00
ivan tkachenko c758e60f73 Bump DawnLib version 2026-04-10 21:33:02 +03:00
ivan tkachenko 55233c73f8 Promo: Add announcement materials 2026-04-10 20:29:11 +03:00
23 changed files with 287 additions and 22 deletions

View File

@ -1,10 +1,8 @@
using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
using System.Windows;
public class HookahAssetBuilder public class HookahAssetBuilder
{ {
@ -15,28 +13,53 @@ public class HookahAssetBuilder
static readonly string ModPackProfilePath = $@"{ModManagerProfilesPath}/{ModPackProfileName}"; static readonly string ModPackProfilePath = $@"{ModManagerProfilesPath}/{ModPackProfileName}";
static readonly string ModPackHookahPlacePath = @$"{ModPackProfilePath}/BepInEx/plugins/{ModPackModName}"; static readonly string ModPackHookahPlacePath = @$"{ModPackProfilePath}/BepInEx/plugins/{ModPackModName}";
static readonly string ModProjectPath = @"D:\Code\LC-Decompiled\Mods\HookahPlace"; static readonly string ModProjectPath = @"D:\Code\LethalCompany\Mods\HookahPlace";
static readonly string DllName = "Ratijas.HookahPlace.dll"; static readonly string DllName = "Ratijas.HookahPlace.dll";
static readonly string DllSourcePath = $@"{ModProjectPath}/HookahPlace/bin/Debug/netstandard2.1/{DllName}"; static readonly string DllSourcePath = $@"{ModProjectPath}/HookahPlace/bin/Debug/netstandard2.1/{DllName}";
static readonly string[] DllDestinationPaths = new string[] static readonly string[] DllDestinationPaths = new string[]
{ {
// relative to Unity project // relative to Unity project
$@"Assets/LethalCompany/Mods/plugins/HookahPlace/Dependencies/{ModPackModName}", $@"Assets/LethalCompany/Mods/plugins/Dependencies/{ModPackModName}",
ModPackHookahPlacePath, ModPackHookahPlacePath,
}; };
static readonly string AssetBundlesPath = "Assets/LethalCompany/Mods/plugins/HookahPlace/AssetBundles"; static readonly string AssetBundlesPath = "Assets/LethalCompany/Mods/plugins/HookahPlace/AssetBundles";
static readonly string[] AssetBundlesNames = new string[]
{
"hookahplaceasset",
"hookahunlockableassets",
};
static readonly string[] AssetBundlesDestinationPaths = new string[] static readonly string[] AssetBundlesDestinationPaths = new string[]
{ {
@$"{ModPackHookahPlacePath}/Assets", @$"{ModPackHookahPlacePath}/Assets",
@$"{ModProjectPath}/HookahPlace/res", @$"{ModProjectPath}/HookahPlace/res",
}; };
public static BuildAssetBundlesParameters GetBuildAssetBundlesParameters()
{
var assetBundleDefinitions = new AssetBundleBuild[]
{
new AssetBundleBuild()
{
assetBundleName = "hookahplaceasset",
assetNames = new string[]
{
"Assets/LethalCompany/Mods/plugins/HookahPlace/HookahContentContainer.asset",
}
},
new AssetBundleBuild()
{
assetBundleName = "hookahunlockableassets",
assetNames = new string[]
{
"Assets/LethalCompany/Mods/plugins/HookahPlace/Content/Unlockables",
}
},
};
var buildParameters = new BuildAssetBundlesParameters()
{
outputPath = AssetBundlesPath,
options = BuildAssetBundleOptions.ChunkBasedCompression,
bundleDefinitions = assetBundleDefinitions
};
return buildParameters;
}
[MenuItem("HookahPlace/All")] [MenuItem("HookahPlace/All")]
public static void DoAll() public static void DoAll()
{ {
@ -82,9 +105,22 @@ public class HookahAssetBuilder
{ {
UnityEngine.Debug.Log("Building asset bundles for HookahPlace..."); UnityEngine.Debug.Log("Building asset bundles for HookahPlace...");
Directory.CreateDirectory(AssetBundlesPath); var buildParameters = GetBuildAssetBundlesParameters();
Directory.CreateDirectory(buildParameters.outputPath);
AssetBundleManifest manifest = BuildPipeline.BuildAssetBundles(buildParameters);
BuildPipeline.BuildAssetBundles(AssetBundlesPath, BuildAssetBundleOptions.ChunkBasedCompression, BuildTarget.StandaloneWindows); if (manifest != null)
{
foreach(var bundleName in manifest.GetAllAssetBundles())
{
string projectRelativePath = buildParameters.outputPath + "/" + bundleName;
UnityEngine.Debug.Log($"Size of AssetBundle {projectRelativePath} is {new FileInfo(projectRelativePath).Length}");
}
}
else
{
UnityEngine.Debug.Log("Build failed, see Console and Editor log for details");
}
if (Application.isBatchMode) if (Application.isBatchMode)
{ {
@ -97,13 +133,16 @@ public class HookahAssetBuilder
{ {
UnityEngine.Debug.Log("Installing asset bundles for HookahPlace..."); UnityEngine.Debug.Log("Installing asset bundles for HookahPlace...");
var buildParameters = GetBuildAssetBundlesParameters();
foreach (var destinationPath in AssetBundlesDestinationPaths) foreach (var destinationPath in AssetBundlesDestinationPaths)
{ {
Directory.CreateDirectory(destinationPath); Directory.CreateDirectory(destinationPath);
foreach (var name in AssetBundlesNames) foreach (var bundle in buildParameters.bundleDefinitions)
{ {
var sourceFileName = $"{AssetBundlesPath}/{name}"; var name = bundle.assetBundleName;
var sourceFileName = $"{buildParameters.outputPath}/{name}";
var destFileName = $"{destinationPath}/{name}"; var destFileName = $"{destinationPath}/{name}";
FileCopy(sourceFileName, destFileName); FileCopy(sourceFileName, destFileName);
} }

View File

@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<AssemblyName>Ratijas.HookahPlace</AssemblyName> <AssemblyName>Ratijas.HookahPlace</AssemblyName>
<Product>HookahPlace</Product> <Product>HookahPlace</Product>
<Version>4.2.0</Version> <Version>4.20.0</Version>
</PropertyGroup> </PropertyGroup>
<!-- Project Properties --> <!-- Project Properties -->
<PropertyGroup> <PropertyGroup>
@ -44,7 +44,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<DawnLibVersion>0.7.11</DawnLibVersion> <DawnLibVersion>0.9.3</DawnLibVersion>
</PropertyGroup> </PropertyGroup>
<!-- Primary Package References - BepInEx --> <!-- Primary Package References - BepInEx -->
@ -61,12 +61,18 @@
<PackageReference Include="UnityEngine.Modules" Version="2022.3.62" PrivateAssets="all"/> <PackageReference Include="UnityEngine.Modules" Version="2022.3.62" PrivateAssets="all"/>
<PackageReference Include="TeamXiaolan.DawnLib" Version="$(DawnLibVersion)" PrivateAssets="all"/> <PackageReference Include="TeamXiaolan.DawnLib" Version="$(DawnLibVersion)" PrivateAssets="all"/>
<PackageReference Include="TeamXiaolan.DawnLib.DuskMod" Version="$(DawnLibVersion)" /> <PackageReference Include="TeamXiaolan.DawnLib.DuskMod" Version="$(DawnLibVersion)" />
<PackageReference Include="TeamXiaolan.DawnLib.SourceGen" Version="$(DawnLibVersion)" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'"> <ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all"/> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all"/>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Remove="data\**\*.json" />
<AdditionalFiles Include="data\**\*.json" />
</ItemGroup>
<!-- Package References - Game Assembly HookGen --> <!-- Package References - Game Assembly HookGen -->
<ItemGroup> <ItemGroup>
<Reference Include="MMHOOK_Assembly-CSharp"> <Reference Include="MMHOOK_Assembly-CSharp">
@ -86,6 +92,6 @@
</PropertyGroup> </PropertyGroup>
<Target Name="PackThunderstore" DependsOnTargets="NetcodePatch" AfterTargets="PostBuildEvent" Condition="$(Configuration) == 'Release'"> <Target Name="PackThunderstore" DependsOnTargets="NetcodePatch" AfterTargets="PostBuildEvent" Condition="$(Configuration) == 'Release'">
<Exec Command="tcli build --config-path &quot;$(ProjectDir)Thunderstore/thunderstore.toml&quot; --package-version $(Version) --package-name $(Product)" /> <Exec Command="dotnet tcli build --config-path &quot;$(ProjectDir)Thunderstore/thunderstore.toml&quot; --package-version $(Version) --package-name $(Product)" />
</Target> </Target>
</Project> </Project>

View File

@ -10,9 +10,7 @@ Become a ship-mom (or a ship-dad) and smoke shisha while guiding your crew over
## Store ## Store
The mod adds a ship decor/furniture to the store called "Hookah". The mod adds a ship decor/furniture to the store called "Hookah". It is _always available_ in the store.
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 ## Made by Ratijas

View File

@ -1,3 +1,8 @@
# 4.20.0
- Update dependencies, and rebuild for v81 (also known as "v80").
- Hookah is always in shop now.
# 4.2.0 # 4.2.0
Fixed Hookah unlockable item disappearing after reloading a save file. Fixed Hookah unlockable item disappearing after reloading a save file.

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View File

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

View File

@ -0,0 +1,6 @@
{
"HookahPlaceKeys": {
"__type": "DawnUnlockableItemInfo",
"Hookah": "hookah_place:hookah"
}
}

Binary file not shown.

View File

@ -0,0 +1,22 @@
using HarmonyLib;
using System.Linq;
using Dawn;
namespace HookahPlace;
[HarmonyPatch(typeof(Terminal))]
internal static class TerminalPatch
{
[HarmonyPrefix]
[HarmonyPatch("Update")]
private static void UpdatePatch(Terminal __instance)
{
var hookahNode = LethalContent.Unlockables[HookahPlaceKeys.Hookah].UnlockableItem.shopSelectionNode;
if (!__instance.ShipDecorSelection.Any(node => node.shipUnlockableID == hookahNode.shipUnlockableID))
{
HookahPlace.Logger.LogInfo($"Patching terminal selection list {hookahNode.shipUnlockableID}");
__instance.ShipDecorSelection = [.. __instance.ShipDecorSelection, hookahNode];
}
}
}

View File

@ -0,0 +1 @@
Content for initial release announcements for various discord communities.

View File

@ -0,0 +1,23 @@
---
Announcement for community discord
https://discord.com/channels/1169792572382773318/1465128348434038980
---
# Hookah Place
_Relaxing hookah as a ship upgrade_
:link: https://thunderstore.io/c/lethal-company/p/Ratijas/HookahPlace/
Welcome to your very own Lethal Hookah Place!
Become a ship-mom (or a ship-dad) and smoke shisha while guiding your crew over a walkie-talkie. Let 'em know you're having a good time! :speaking_head::100::thought_balloon:
## Store
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 or add "Hookah" (with capital 'H', without quotes) to the `itemWhitelist`.
---
insert picture
HookahPlace/Thunderstore/HookahPlace-demo-1.jpg

View File

@ -0,0 +1,23 @@
---
Announcement for modding discord
https://discord.com/channels/1168655651455639582/1465126696117076242
---
# Hookah Place
_Relaxing hookah as a ship upgrade_
:Thunderstore: https://thunderstore.io/c/lethal-company/p/Ratijas/HookahPlace/
Welcome to your very own Lethal Hookah Place!
Become a ship-mom (or a ship-dad) and smoke shisha while guiding your crew over a walkie-talkie. Let 'em know you're having a good time! :speaking_head::100::thought_balloon:
## Store
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 or add "Hookah" (with capital 'H', without quotes) to the `itemWhitelist`.
---
insert picture
HookahPlace/Thunderstore/HookahPlace-demo-1.jpg

14
Promo/Announcement/ru.md Normal file
View File

@ -0,0 +1,14 @@
---
Announcement for russian discord
https://discord.com/channels/762286753989132299/1410237812829065268/1465132804395241618
---
Давно мечтали сходить в кальянку, но всё время не позволяло? Новый мод **HookahPlace by Ratijas** позволит отовариться прямо на рабочем месте! :speaking_head::100::thought_balloon:
Множество вкусов на выбор, дымные занавесы и бульканье в радиоэфир — всё включено в скромную цену 130 шекелей¹.
¹ Предметы декора обновляются по 4-6 позиций каждую квоту. Чтобы гарантировать наличие, используйте сторонние моды, например StoreRotationConfig by pacoito с опцией stockAll, либо добавить строчку "Hookah" (с большой буквы, без кавычек) в `itemWhitelist`.
---
insert picture
HookahPlace/Thunderstore/HookahPlace-demo-1.jpg

4
Promo/Reference/EN.md Normal file
View File

@ -0,0 +1,4 @@
Also check out my other mod, 💭 [Hookah Place](https://thunderstore.io/c/lethal-company/p/Ratijas/HookahPlace/) ship decor/furniture! (thread: https://discord.com/channels/1169792572382773318/1465128348434038980)
---
Note: the link refers to the [Unofficial Lethal Company Community Discord](https://discord.gg/lethal-company)

View File

@ -0,0 +1 @@
Reference to this mod which can be appended to README of other mods.

77
Promo/SHOWCASE.md Normal file
View File

@ -0,0 +1,77 @@
---
link for modding discord
---
# Hookah Place
_Relaxing hookah as a ship upgrade_
Welcome to your very own Lethal Hookah Place!
Become a ship-mom (or a ship-dad) and smoke shisha while guiding your crew over a walkie-talkie. Let 'em know you're having a good time! :speaking_head::100::thought_balloon:
## Store
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` with the `stockAll` option toggled ON.
:speech_balloon: Thread: https://discord.com/channels/1168655651455639582/1465126696117076242
:Thunderstore: Thunderstore: https://thunderstore.io/c/lethal-company/p/Ratijas/HookahPlace/
---
insert picture
HookahPlace/Thunderstore/HookahPlace-demo-1.jpg
---
link for community discord
---
# Hookah Place
_Relaxing hookah as a ship upgrade_
Welcome to your very own Lethal Hookah Place!
Become a ship-mom (or a ship-dad) and smoke shisha while guiding your crew over a walkie-talkie. Let 'em know you're having a good time! :speaking_head::100::thought_balloon:
## Store
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` with the `stockAll` option toggled ON.
:speech_balloon: Thread: https://discord.com/channels/1169792572382773318/1465128348434038980
:link: Thunderstore: https://thunderstore.io/c/lethal-company/p/Ratijas/HookahPlace/
---
insert picture
HookahPlace/Thunderstore/HookahPlace-demo-1.jpg
---
post for #looking-for-crew-modded to dodge auto-moderation
---
# Hookah Place
_Relaxing hookah as a ship upgrade_
Welcome to your very own Lethal Hookah Place!
Become a ship-mom (or a ship-dad) and smoke shisha while guiding your crew over a walkie-talkie. Let 'em know you're having a good time! :speaking_head::100::thought_balloon:
The mod adds a ship decor/furniture called "Hookah". To make it always available, use another mod like `StoreRotationConfig` by `pacoito` with the `stockAll` option toggled ON.
:speech_balloon: Thread: https://discord.com/channels/1169792572382773318/1465128348434038980
:link: Thunderstore: https://thunderstore.io/c/lethal-company/p/Ratijas/HookahPlace/
---
update 4.2.0
---
# Hookah Place 4.2.0
Fixed Hookah unlockable item disappearing after reloading a save file.

View File

@ -0,0 +1,12 @@
---
Announcement for community discord
https://discord.com/channels/1169792572382773318/1465128348434038980
---
# Hookah Place 4.2.0
Fixed Hookah unlockable item disappearing after reloading a save file.
---
insert picture
HookahPlace/Thunderstore/HookahPlace-demo-2.jpg

View File

@ -0,0 +1,12 @@
---
Announcement for modding discord
https://discord.com/channels/1168655651455639582/1465126696117076242
---
# Hookah Place 4.2.0
Fixed Hookah unlockable item disappearing after reloading a save file.
---
insert picture
HookahPlace/Thunderstore/HookahPlace-demo-2.jpg

View File

@ -0,0 +1,8 @@
---
Announcement for russian discord
https://discord.com/channels/762286753989132299/1410237812829065268/1469357224139686039
---
Выпустил обновление HookahPlace 4.2.0, через пару часов будет доступно в мод менеджерах.
Исправлено исчезновение кальяна после перезапуска игры, теперь он корректно сохраняется в сейв-файл.

1
Promo/Updates/README.md Normal file
View File

@ -0,0 +1 @@
Content for update announcements for various discord communities.

13
dotnet-tools.json Normal file
View File

@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"tcli": {
"version": "0.2.4",
"commands": [
"tcli"
],
"rollForward": false
}
}
}