diff --git a/.timetracker b/.timetracker index dc91c0e..13eddb6 100644 --- a/.timetracker +++ b/.timetracker @@ -1,5 +1,5 @@ { - "total": 73071, + "total": 75390, "sessions": [ { "begin": "2026-03-11T23:50:47+01:00", @@ -70,6 +70,11 @@ "begin": "2026-03-15T21:00:39+01:00", "end": "2026-03-15T23:04:35+01:00", "duration": 7435 + }, + { + "begin": "2026-03-28T03:48:55+01:00", + "end": "2026-03-28T04:27:34+01:00", + "duration": 2319 } ] } \ No newline at end of file diff --git a/ChestPreview/ChestPreview/Configs/Config.cs b/ChestPreview/ChestPreview/Configs/Config.cs index b927491..1edde81 100644 --- a/ChestPreview/ChestPreview/Configs/Config.cs +++ b/ChestPreview/ChestPreview/Configs/Config.cs @@ -6,6 +6,8 @@ public sealed class Config public bool HoldKey { get; set; } = true; + public bool BillboardIgnoreFront { get; set; } = false; + public int BillboardColumnsPerBlock { get; set; } = 4; public int ColumnsUnderCursor { get; set; } = 10; diff --git a/ChestPreview/ChestPreview/Rendering/WorldBillboardPresenter.cs b/ChestPreview/ChestPreview/Rendering/WorldBillboardPresenter.cs index 4764f5d..ed7c600 100644 --- a/ChestPreview/ChestPreview/Rendering/WorldBillboardPresenter.cs +++ b/ChestPreview/ChestPreview/Rendering/WorldBillboardPresenter.cs @@ -11,12 +11,13 @@ using Vintagestory.GameContent; namespace ChestPreview.Rendering; -internal class WorldBillboardPresenter(ICoreClientAPI api) +internal class WorldBillboardPresenter(ICoreClientAPI api, Config config) { private const int multiblock_scan_radius = 2; private static readonly float front_face_offset = 0.05f; private readonly ICoreClientAPI api = api; + private readonly Config config = config; private readonly List frameBillboards = []; public IReadOnlyList FrameBillboards => frameBillboards; @@ -162,7 +163,7 @@ internal class WorldBillboardPresenter(ICoreClientAPI api) right = new Vec3f(1f, 0f, 0f); up = new Vec3f(0f, 1f, 0f); - if (TryGetMeshAngle(blockEntity, out float meshAngleRadians)) + if (!config.BillboardIgnoreFront && TryGetMeshAngle(blockEntity, out float meshAngleRadians)) { // MeshAngle is around Y axis in radians. forward = new Vec3f(MathF.Sin(meshAngleRadians), 0f, MathF.Cos(meshAngleRadians)); @@ -171,7 +172,7 @@ internal class WorldBillboardPresenter(ICoreClientAPI api) return true; } - if (TryGetBlockSideFacing(block, out forward)) + if (!config.BillboardIgnoreFront && TryGetBlockSideFacing(block, out forward)) { BuildBasisFromForward(forward, out right, out up); return true; diff --git a/ChestPreview/ChestPreview/Rendering/WorldBillboardRenderer.cs b/ChestPreview/ChestPreview/Rendering/WorldBillboardRenderer.cs index 420c28b..2d1b3ec 100644 --- a/ChestPreview/ChestPreview/Rendering/WorldBillboardRenderer.cs +++ b/ChestPreview/ChestPreview/Rendering/WorldBillboardRenderer.cs @@ -19,7 +19,7 @@ internal class WorldBillboardRenderer(ICoreClientAPI api, Config config, CardRen private readonly List frameTargets = []; private readonly CardRenderer cardRenderer = cardRenderer; private readonly PreviewTargetProvider targetProvider = new(api, config); - private readonly WorldBillboardPresenter worldBillboardPresenter = new(api); + private readonly WorldBillboardPresenter worldBillboardPresenter = new(api, config); private readonly MeshRef quadMeshRef = api.Render.UploadMesh( QuadMeshUtil.GetCustomQuadModelData( 1f, diff --git a/ChestPreview/ChestPreview/assets/chestpreview/config/configlib-patches.json b/ChestPreview/ChestPreview/assets/chestpreview/config/configlib-patches.json index dbc6deb..765be73 100644 --- a/ChestPreview/ChestPreview/assets/chestpreview/config/configlib-patches.json +++ b/ChestPreview/ChestPreview/assets/chestpreview/config/configlib-patches.json @@ -27,6 +27,13 @@ "default": true, "clientSide": true }, + { + "code": "BillboardIgnoreFront", + "comment": "config-desc-BillboardIgnoreFront", + "type": "boolean", + "default": false, + "clientSide": true + }, { "code": "BillboardColumnsPerBlock", "comment": "config-desc-BillboardColumnsPerBlock", diff --git a/ChestPreview/ChestPreview/assets/chestpreview/lang/en.json b/ChestPreview/ChestPreview/assets/chestpreview/lang/en.json index 5cfc5ba..10bf30a 100644 --- a/ChestPreview/ChestPreview/assets/chestpreview/lang/en.json +++ b/ChestPreview/ChestPreview/assets/chestpreview/lang/en.json @@ -3,6 +3,7 @@ "hotkey-preview-containers-nearby": "Preview containers nearby", "config-desc-Mode": "Preview mode. Valid values: None, UnderCursor, OnHoveredContainer, OnNearbyContainers.", "config-desc-HoldKey": "Previews only show while the \"Preview containers\" key is held.", + "config-desc-BillboardIgnoreFront": "With this set to false, in-world previews show on the front side of containers. By setting this to true, the previews show on the side determined to be most visible.", "config-desc-BillboardColumnsPerBlock": "Columns per block width used for world billboards. For containers 2 blocks wide it's doubled.", "config-desc-ColumnsUnderCursor": "Columns in the UnderCursor mode.", "config-desc-PreviewNearbyRadius": "Radius for \"Preview containers nearby\".", diff --git a/ChestPreview/ChestPreview/modinfo.json b/ChestPreview/ChestPreview/modinfo.json index 27f60fe..85c230f 100644 --- a/ChestPreview/ChestPreview/modinfo.json +++ b/ChestPreview/ChestPreview/modinfo.json @@ -7,7 +7,7 @@ "OrekiWoof" ], "description": "see containers' contents without having to open them", - "version": "1.1.0", + "version": "1.2.0-dev.0", "dependencies": { "game": "1.21.0" },