Skip to content

Commit

Permalink
Merge branch 'master' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTwentyThree committed Jul 3, 2023
2 parents 28eba84 + 64432d4 commit 9f6d141
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Nautilus/Documentation/tutorials/csproj-tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example:
> [!NOTE]
> For the sake of consistency, we recommend you use reverse-DNS naming for your GUIDs, i.e. "com.authorname.modname`.
## Automatic project building
## Automatic DLL copying

It is possible to use post-build scripts that automatically place your mod's DLL into the BepInEx plugins folder right after you hit Build.

Expand Down Expand Up @@ -118,4 +118,4 @@ Finally, once again in the csproj outside of any PropertyGroups, add the followi

Make sure a folder exists in the BepInEx/plugins folder with the same name as your mod DLL.

If everything went correctly, upon building your project the DLL should be automatically placed in the correct location, meaning you do not have to manually move the DLL anymore!
If everything went correctly, upon building your project the DLL should be automatically placed in the correct location, meaning you do not have to manually move the DLL anymore!
8 changes: 7 additions & 1 deletion Nautilus/Utility/PrefabUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ public static void AddBasicComponents(GameObject prefab, string classId, TechTyp
/// <param name="prefab">The prefab to operate on.</param>
/// <param name="techType">The tech type associated with the specified prefab.</param>
/// <param name="constructableFlags">A bitmask comprised of one or more <see cref="ConstructableFlags"/> that specify how the prefab should be treated during placement.</param>
/// <param name="model"><para>The child GameObject that holds all the renderers that are used for the ghost model.
/// If assigned, this parameter will control the <see cref="Constructable.model"/> field. This field MUST BE ASSIGNED A VALUE to avoid errors when building!</para>
/// <para>This should be a child of <paramref name="prefab"/>, and NOT the root. If it is the same value as <paramref name="prefab"/>, you have done something wrong!</para></param>
/// <returns>The added constructable component.</returns>
public static Constructable AddConstructable(GameObject prefab, TechType techType, ConstructableFlags constructableFlags)
public static Constructable AddConstructable(GameObject prefab, TechType techType, ConstructableFlags constructableFlags, GameObject model = null)
{
if (techType is TechType.None)
{
Expand All @@ -123,6 +126,9 @@ public static Constructable AddConstructable(GameObject prefab, TechType techTyp
constructable.allowedOnConstructables = constructableFlags.HasFlag(ConstructableFlags.AllowedOnConstructable);
constructable.allowedOnWall = constructableFlags.HasFlag(ConstructableFlags.Wall);

if (model != null)
constructable.model = model;

return constructable;
}

Expand Down

0 comments on commit 9f6d141

Please sign in to comment.