Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Setup CI for Submerged #162

Closed
wants to merge 14 commits into from
16 changes: 16 additions & 0 deletions .github/build_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"build": {
"path": "BepInEx/plugins"
},
"dependencies": {
"BepInEx": {
"download": "https://builds.bepinex.dev/projects/bepinex_be/688/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.688%2B4901521.zip",
"path": ".",
"unarchive": true
},
"Reactor": {
"download": "https://github.com/NuclearPowered/Reactor/releases/download/2.2.0/Reactor.dll",
"path": "BepInEx/plugins"
}
}
}
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build Debug
run: dotnet build --configuration Debug --no-restore
- name: Build Release
run: dotnet build --configuration Release --no-restore
- name: Upload Debug Artifact
uses: actions/upload-artifact@v2
with:
name: submerged-debug
path: Submerged/bin/Debug/net6.0/Submerged.dll
- name: Upload Release Artifact
uses: actions/upload-artifact@v2
with:
name: submerged-release
path: Submerged/bin/Release/net6.0/Submerged.dll
- name: Setup Draft Release
if: github.ref == 'refs/heads/main'
run: echo "Draft release steps to be implemented"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The table below lists the most recent Submerged release for each Among Us versio

| Among Us Version | Submerged Version | Links |
|:---------------------------------------------------------------------------------------------:|:-----------------:|:-----------------------------------------------------------------------------------:|
| `v2024.3.5` | `v2024.3.24` | [Download](https://github.com/SubmergedAmongUs/Submerged/releases/tag/v2024.3.24/) |
| `v2024.3.5` | `v2024.3.25` | [Download](https://github.com/SubmergedAmongUs/Submerged/releases/tag/v2024.3.25/) |
| `v2023.11.28` | `v2023.11.29` | [Download](https://github.com/SubmergedAmongUs/Submerged/releases/tag/v2023.11.29/) |
| `v2023.10.24` | `v2023.11.2` | [Download](https://github.com/SubmergedAmongUs/Submerged/releases/tag/v2023.11.2/) |
| `v2023.7.12`<br>`v2023.7.11` | `v2023.8.2` | [Download](https://github.com/SubmergedAmongUs/Submerged/releases/tag/v2023.8.2/) |
Expand Down Expand Up @@ -116,7 +116,7 @@ Any and all contributions are welcome, but please keep in mind that Submerged is

Additionally feel free to [open an issue](https://github.com/SubmergedAmongUs/Submerged/issues/new/choose/) if you have a feature request, want to report a bug, or basically anything else.

All pull request contributors are required to sign a [CLA](https://gist.github.com/Alexejhero/fabcc123434c6306bb5c3fde8a6bcd9c) (a bot will comment on opened pull requests with instructions).
All pull request contributors are required to sign a [CLA](https://gist.github.com/Alexejhero/740d681de944b21948edd940a23f3ff1) (a bot will comment on opened pull requests with instructions).

# License

Expand Down
2 changes: 2 additions & 0 deletions Submerged/Floors/Objects/GenericShadowBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public sealed class GenericShadowBehaviour(nint ptr) : MonoBehaviour(ptr)

static GenericShadowBehaviour()
{
// Overrides added earlier have higher priority (smaller index goes first)
ShadowTypeOverrides.Add(obj => obj.gameObject.GetComponentInParent<LongBoiPlayerBody>(true) ? typeof(LongPlayerShadowRenderer) : null);
ShadowTypeOverrides.Add(obj => obj.gameObject.GetComponentInParent<PlayerControl>() ? typeof(PlayerShadowRenderer) : null);
ShadowTypeOverrides.Add(obj => obj.gameObject.GetComponent<DeadBody>() ? typeof(DeadBodyShadowRenderer) : null);
}

Expand Down
2 changes: 1 addition & 1 deletion Submerged/Floors/Objects/LongPlayerShadowRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Submerged.Floors.Objects;

[RegisterInIl2Cpp]
public class LongPlayerShadowRenderer(nint ptr) : RelativeShadowRenderer(ptr)
public class LongPlayerShadowRenderer(nint ptr) : PlayerShadowRenderer(ptr)
{
public LongBoiPlayerBody body;

Expand Down
17 changes: 17 additions & 0 deletions Submerged/Floors/Objects/PlayerShadowRenderer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Reactor.Utilities.Attributes;

namespace Submerged.Floors.Objects;

[RegisterInIl2Cpp]
public class PlayerShadowRenderer(nint ptr) : RelativeShadowRenderer(ptr)
{
public PlayerControl player;

protected override void Start()
{
base.Start();
player = GetComponentInParent<PlayerControl>();
}

public override bool EnableShadow => player.isDummy || (!player.Data.IsDead && !player.Data.Disconnected);
}
4 changes: 3 additions & 1 deletion Submerged/Floors/Objects/RelativeShadowRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class RelativeShadowRenderer(nint ptr) : MonoBehaviour(ptr)

private readonly Dictionary<Sprite, Sprite> _cachedSprites = [];

public virtual bool EnableShadow => true;

protected virtual void Awake()
{
gameObject.layer = 4;
Expand Down Expand Up @@ -48,7 +50,7 @@ protected virtual void LateUpdate()

if (targetRenderer)
{
shadowRenderer.enabled = targetRenderer.enabled && targetRenderer.gameObject.activeInHierarchy;
shadowRenderer.enabled = targetRenderer.enabled && targetRenderer.gameObject.activeInHierarchy && EnableShadow;
shadowRenderer.sprite = GetReplacementSprite(targetRenderer.sprite);
shadowRenderer.SetColorAlpha(targetRenderer.color.a);
shadowRenderer.flipX = targetRenderer.flipX;
Expand Down
3 changes: 1 addition & 2 deletions Submerged/Submerged.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>2024.3.24</Version>
<Version>2024.3.25</Version>
<Authors>Submerged Team</Authors>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/SubmergedAmongUs/Submerged</RepositoryUrl>
Expand All @@ -24,7 +24,6 @@
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1" PrivateAssets="all" />
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0-eap3" Aliases="JetBrains" PrivateAssets="all" />
<PackageReference Include="Resource.Embedder" Version="2.2.1-submerged" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down