Skip to content

Commit

Permalink
allow disabling of chest
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Sep 11, 2024
1 parent 5ca759a commit 1758fd6
Show file tree
Hide file tree
Showing 3 changed files with 7 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 to enable the chest mesh
/// </summary>
public bool hasChest = true;

/// <summary>
/// Whether to enable the boxes next to the chest
/// </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,
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
1 change: 1 addition & 0 deletions Winch/Util/DockUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ internal static (StorageDestination, OverflowStorageDestination, GameObject) Cre
var box = StorageBox.Instantiate(storageObject.transform, false);
box.transform.localPosition = Vector3.zero;
box.transform.localEulerAngles = new Vector3(0, 360, 0);
box.transform.Find("StorageBox/StorageChest").gameObject.SetActive(prebuilt.hasChest);
box.transform.Find("StorageBox/StorageBoxes").gameObject.SetActive(prebuilt.hasBoxes);
return (storageDestination, overflowStorageDestination, storageObject);
}
Expand Down

0 comments on commit 1758fd6

Please sign in to comment.