Skip to content

Commit

Permalink
isIndoors
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Sep 13, 2024
1 parent 1e77ada commit 6fd07aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Winch/Data/POI/Dock/Destinations/CustomStorageDestination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public class CustomStorageDestination
/// </summary>
public float overflowHeight = 0.6f;

/// <summary>
/// Whether this storage is inside a building
/// </summary>
public bool isIndoors = false;

/// <summary>
/// Whether to enable the chest mesh
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions Winch/Serialization/DredgeTypeHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ public static CustomStorageDestination ParsePrebuiltStorageDestination(object va
vCam = jsonDict.TryGetValue("vCam", out object vCam) ? ParseVector3(vCam) : new Vector3(4.5f, 3.45f, 6.75f),
hasOverflow = jsonDict.TryGetValue("hasOverflow", out object hasOverflow) ? bool.Parse(hasOverflow.ToString()) : false,
overflowHeight = jsonDict.TryGetValue("overflowHeight", out object overflowHeight) ? float.Parse(overflowHeight.ToString()) : 0.6f,
isIndoors = jsonDict.TryGetValue("isIndoors", out object isIndoors) ? bool.Parse(isIndoors.ToString()) : false,
hasChest = jsonDict.TryGetValue("hasChest", out object hasChest) ? bool.Parse(hasChest.ToString()) : true,
hasBoxes = jsonDict.TryGetValue("hasBoxes", out object hasBoxes) ? bool.Parse(hasBoxes.ToString()) : true,
};
Expand Down
2 changes: 2 additions & 0 deletions Winch/Util/DockUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ internal static (StorageDestination, OverflowStorageDestination, GameObject) Cre
storageDestination.highlightConditions = new List<HighlightCondition>();
storageDestination.speakerRootNodeOverride = string.Empty;
storageDestination.visitSFX = visitSFX;
storageDestination.isIndoors = prebuilt.isIndoors;
var overflowStorageDestinationObject = new GameObject("OverflowStorageDestination");
overflowStorageDestinationObject.transform.SetParent(storageDestinationObject.transform, false);
overflowStorageDestinationObject.transform.localPosition = new Vector3(0, prebuilt.overflowHeight, 0);
Expand All @@ -819,6 +820,7 @@ internal static (StorageDestination, OverflowStorageDestination, GameObject) Cre
overflowStorageDestination.highlightConditions = new List<HighlightCondition> { new UnstructedHighlightCondition { alwaysHighlight = true } };
overflowStorageDestination.speakerRootNodeOverride = string.Empty;
overflowStorageDestination.visitSFX = visitSFX;
overflowStorageDestination.isIndoors = prebuilt.isIndoors;
var box = StorageBox.Instantiate(storageObject.transform, false);
box.transform.localPosition = Vector3.zero;
box.transform.localEulerAngles = new Vector3(0, 360, 0);
Expand Down

0 comments on commit 6fd07aa

Please sign in to comment.