diff --git a/.timetracker b/.timetracker
index 3b190e8..f66f816 100644
--- a/.timetracker
+++ b/.timetracker
@@ -1,5 +1,5 @@
{
- "total": 51853,
+ "total": 56092,
"sessions": [
{
"begin": "2026-03-11T23:50:47+01:00",
@@ -10,6 +10,16 @@
"begin": "2026-03-12T17:18:14+01:00",
"end": "2026-03-12T22:08:00+01:00",
"duration": 17386
+ },
+ {
+ "begin": "2026-03-14T13:19:51+01:00",
+ "end": "2026-03-14T13:47:21+01:00",
+ "duration": 1650
+ },
+ {
+ "begin": "2026-03-14T16:53:26+01:00",
+ "end": "2026-03-14T17:36:35+01:00",
+ "duration": 2589
}
]
}
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..3596cb1
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,24 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Vintage Story Client",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build mod",
+ "program": "${env:VINTAGE_STORY}/Vintagestory.dll",
+ "args": [
+ "--tracelog",
+ "--dataPath",
+ "${env:VINTAGE_STORY_DATA}",
+ "--addModPath",
+ "${workspaceFolder}/ChestPreview/ChestPreview/bin/Debug/Mods",
+ "--addOrigin",
+ "${workspaceFolder}/ChestPreview/ChestPreview/assets"
+ ],
+ "cwd": "${env:VINTAGE_STORY}",
+ "console": "integratedTerminal",
+ "stopAtEntry": false
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..1dea310
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,32 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "check env",
+ "type": "shell",
+ "command": "[ -n \"$VINTAGE_STORY\" ] || { echo 'ERROR: VINTAGE_STORY is not set'; exit 1; }; [ -n \"$VINTAGE_STORY_DATA\" ] || { echo 'ERROR: VINTAGE_STORY_DATA is not set'; exit 1; }",
+ "problemMatcher": []
+ },
+ {
+ "label": "build mod",
+ "command": "dotnet",
+ "type": "process",
+ "dependsOn": ["check env"],
+ "dependsOrder": "sequence",
+ "options": {
+ "env": {
+ "VINTAGE_STORY": "${env:VINTAGE_STORY}"
+ }
+ },
+ "args": [
+ "build",
+ "${workspaceFolder}/ChestPreview/ChestPreview/ChestPreview.csproj",
+ "-c",
+ "Debug",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary;ForceNoAlign"
+ ],
+ "problemMatcher": "$msCompile"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ChestPreview/ChestPreview/ChestPreview.csproj b/ChestPreview/ChestPreview/ChestPreview.csproj
index 5dca78e..d43b131 100644
--- a/ChestPreview/ChestPreview/ChestPreview.csproj
+++ b/ChestPreview/ChestPreview/ChestPreview.csproj
@@ -7,6 +7,9 @@
enable
Debug;Release;Version22
+ $([System.Environment]::GetEnvironmentVariable('VS_CONFIGLIB'))
+ true
+ $(DefineConstants);CONFIGLIB
@@ -59,12 +62,16 @@
-
- E:\Code\VintageStory\configlib_1.10.14\configlib.dll
+
+ $(VS_CONFIGLIB)
False
+
+
+
+
PreserveNewest
diff --git a/ChestPreview/ChestPreview/Configs/ConfigLibBridge.cs b/ChestPreview/ChestPreview/Configs/ConfigLibBridge.cs
index 8b7dddd..2853959 100644
--- a/ChestPreview/ChestPreview/Configs/ConfigLibBridge.cs
+++ b/ChestPreview/ChestPreview/Configs/ConfigLibBridge.cs
@@ -1,50 +1,64 @@
-using ChestPreview.Core;
-using ConfigLib;
-using System;
-using Vintagestory.API.Client;
-
-namespace ChestPreview.Configs;
-
-internal class ConfigLibBridge(Config config) : IDisposable
-{
- public const string CONFIGLIB_MODID = "configlib";
-
- private readonly Config config = config;
-
- private ConfigLibModSystem? configLibSystem;
-
- public static ConfigLibBridge? TryCreate(ICoreClientAPI api, Config config)
- {
- if (!api.ModLoader.IsModEnabled(CONFIGLIB_MODID))
- return null;
-
- ConfigLibModSystem? configLibSystem = api.ModLoader.GetModSystem();
- if (configLibSystem == null)
- return null;
-
- var bridge = new ConfigLibBridge(config)
- {
- configLibSystem = configLibSystem
- };
-
- configLibSystem.SettingChanged += bridge.OnSettingChanged;
- return bridge;
- }
-
- public void Dispose()
- {
- if (configLibSystem == null)
- return;
-
- configLibSystem.SettingChanged -= OnSettingChanged;
- configLibSystem = null;
- }
-
- private void OnSettingChanged(string domain, IConfig configObject, ISetting settingObject)
- {
- if (domain != ChestPreviewModSystem.CONFIGLIB_DOMAIN || settingObject == null)
- return;
-
- settingObject.AssignSettingValue(config);
- }
-}
\ No newline at end of file
+using System;
+using Vintagestory.API.Client;
+
+#if CONFIGLIB
+using ChestPreview.Core;
+using ConfigLib;
+#endif
+
+namespace ChestPreview.Configs;
+
+#if CONFIGLIB
+internal class ConfigLibBridge(Config config) : IDisposable
+{
+ public const string CONFIGLIB_MODID = "configlib";
+
+ private readonly Config config = config;
+
+ private ConfigLibModSystem? configLibSystem;
+
+ public static ConfigLibBridge? TryCreate(ICoreClientAPI api, Config config)
+ {
+ if (!api.ModLoader.IsModEnabled(CONFIGLIB_MODID))
+ return null;
+
+ ConfigLibModSystem? configLibSystem = api.ModLoader.GetModSystem();
+ if (configLibSystem == null)
+ return null;
+
+ var bridge = new ConfigLibBridge(config)
+ {
+ configLibSystem = configLibSystem
+ };
+
+ configLibSystem.SettingChanged += bridge.OnSettingChanged;
+ return bridge;
+ }
+
+ public void Dispose()
+ {
+ if (configLibSystem == null)
+ return;
+
+ configLibSystem.SettingChanged -= OnSettingChanged;
+ configLibSystem = null;
+ }
+
+ private void OnSettingChanged(string domain, IConfig configObject, ISetting settingObject)
+ {
+ if (domain != ChestPreviewModSystem.CONFIGLIB_DOMAIN || settingObject == null)
+ return;
+
+ settingObject.AssignSettingValue(config);
+ }
+}
+#else
+internal class ConfigLibBridge : IDisposable
+{
+ public const string CONFIGLIB_MODID = "configlib";
+
+ public static ConfigLibBridge? TryCreate(ICoreClientAPI api, Config config) => null;
+
+ public void Dispose() { }
+}
+#endif
\ No newline at end of file