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

Enable nullable (and resolve most nullable warnings) #119

Open
wants to merge 25 commits into
base: experimental
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build

on:
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
push:
branches: [main]
# Trigger the workflow on any pull request
pull_request:
workflow_call:
inputs:
ref:
description: "A tag reference passed from Publish workflow"
default: ${{ github.sha }}
required: false
type: string

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
filter: tree:0

- name: Setup .NET environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.100"

- name: Install Evaisa's netcode-patcher
run: |
dotnet tool install -g Evaisa.NetcodePatcher.Cli
- name: Restore project
run: |
dotnet restore
dotnet tool restore
- name: Build and pack solution
run: |
dotnet pack -c Release
- name: Set MOD_NAME environment variable
run: echo "MOD_NAME=$(cat ./*/dist/name.txt )" >> $GITHUB_ENV

- name: Set MOD_VERSION environment variable
run: echo "MOD_VERSION=$(cat ./*/dist/version.txt )" >> $GITHUB_ENV

- name: Set ZIP_PATH environment variable
run: echo "ZIP_PATH=./${{ env.MOD_NAME }}/dist/curseforge.zip" >> $GITHUB_ENV

- name: Upload CurseForge artifact
uses: actions/upload-artifact@v4
with:
name: curseforge-build
path: ./*/dist/*.zip

- name: Upload Thunderstore artifact
uses: actions/upload-artifact@v4
with:
name: thunderstore-build
path: ./*/dist/*.zip

- name: Upload nupkg artifact
uses: actions/upload-artifact@v4
with:
name: nupkg-build
path: ./*/bin/Release/*.nupkg

- name: Upload Versions artifact
uses: actions/upload-artifact@v4
with:
name: versions
path: ./*/dist/*.txt
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish

on:
release:
types: [prereleased, released]

jobs:
build:
uses: ./.github/workflows/build.yml
with:
ref: ${{ github.event.release.tag_name }}

upload-release-artifacts:
name: Add artifacts to Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Upload artifacts to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB }}
run: gh release upload ${{ github.event.release.tag_name }} thunderstore-build/*/dist/*.zip nupkg-build/*/bin/Release/*.nupkg

release-curseforge:
needs: build
uses: ./.github/workflows/release-curseforge.yml
secrets:
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}
project-id: ${{ secrets.CURSEFORGE_PROJECTID }}

release-thunderstore:
needs: build
uses: ./.github/workflows/release-thunderstore.yml
secrets:
thunderstore-token: ${{ secrets.THUNDERSTORE_API_KEY }}

release-nuget:
needs: build
uses: ./.github/workflows/release-nuget.yml
secrets:
nuget-token: ${{ secrets.NUGET_API_KEY }}
46 changes: 46 additions & 0 deletions .github/workflows/release-curseforge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release on Curseforge

on:
workflow_call:
secrets:
curseforge-token:
required: true
project-id:
required: true

jobs:
curseforge:
name: Upload
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download Curseforge artifact
uses: actions/download-artifact@v4
with:
name: curseforge-build

- name: Download Versions artifact
uses: actions/download-artifact@v4
with:
name: versions

- name: Set MOD_NAME environment variable
run: echo "MOD_NAME=$(cat ./*/dist/name.txt )" >> $GITHUB_ENV

- name: Set MOD_VERSION environment variable
run: echo "MOD_VERSION=$(cat ./*/dist/version.txt )" >> $GITHUB_ENV

- name: Set ZIP_PATH environment variable
run: echo "ZIP_PATH=./${{ env.MOD_NAME }}/dist/curseforge.zip" >> $GITHUB_ENV

- name: "Upload to CurseForge"
uses: itsmeow/curseforge-upload@v3
with:
token: ${{ secrets.curseforge-token }}
project_id: ${{ secrets.project-id }}
game_endpoint: "lethal-company"
game_versions: "0.50.0"
file_path: ${{ env.ZIP_PATH }}
display_name: ${{ env.MOD_NAME }} v${{ env.MOD_VERSION }}
29 changes: 29 additions & 0 deletions .github/workflows/release-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release on Nuget

on:
workflow_call:
secrets:
nuget-token:
required: true

jobs:
nuget:
name: Upload
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download nupkg artifact
uses: actions/download-artifact@v4
with:
name: nupkg-build

- name: Setup .NET environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.100"

- name: Publish to NuGet.org
run: |
dotnet nuget push ./*/bin/Release/*.nupkg --api-key ${{ secrets.nuget-token }} --source https://api.nuget.org/v3/index.json
37 changes: 37 additions & 0 deletions .github/workflows/release-thunderstore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release on Thunderstore

on:
workflow_call:
secrets:
thunderstore-token:
required: true

jobs:
thunderstore:
name: Upload
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download Thunderstore artifact
uses: actions/download-artifact@v4
with:
name: thunderstore-build

- name: Setup .NET environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.100"

- name: Install Evaisa's netcode-patcher
run: |
dotnet tool install -g Evaisa.NetcodePatcher.Cli
- name: Restore dotnet tools
run: |
dotnet tool restore
- name: Publish to Thunderstore
env:
TCLI_AUTH_TOKEN: ${{ secrets.thunderstore-token }}
run: |
dotnet build -target:PublishThunderstore
114 changes: 114 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,120 @@
**Changelog**
--

**<details><summary>Version 1.3.8</summary>**

**<details><summary>Features</summary>**

* Added interior selection history to DayHistory

</details>

</details>

**<details><summary>Version 1.3.7</summary>**

**<details><summary>Fixes</summary>**

* Added additional safety checks to ExtendedFootstepSurface patches

</details>

</details>

**<details><summary>Version 1.3.6</summary>**

**<details><summary>Features</summary>**

* Added content restoration support for basegame water shader

</details>

</details>

**<details><summary>Version 1.3.5</summary>**

**<details><summary>Fixes</summary>**

* Added safety checks to new FootstepSurface Material cache system.
* Added safety checks to new ExtendedLevel override fog size feature.
* Changed ContentRestoring of EnemyType's to use ScriptableObject name rather than enemyName
* Fixed issue where synced audio clip that plays when previewing enemy beastiary file was not playing for custom enemies
* Fixed issue where custom Enemy beastiary files did not have Info as a default keyword

</details>

</details>

**<details><summary>Version 1.3.4</summary>**

**<details><summary>Fixes</summary>**

* Updated .csproj and thunderstore.toml
* Updated outdated README.md

</details>

</details>

**<details><summary>Version 1.3.3</summary>**

**<details><summary>Features</summary>**

* Implemented ExtendedFootstepSurface

</details>

</details>

**<details><summary>Version 1.3.2</summary>**

**<details><summary>Fixes</summary>**

* Updated onApparatusTaken ExtendedEvent

</details>

</details>

**<details><summary>Version 1.3.1</summary>**

**<details><summary>Fixes</summary>**

* Fixed issue regarding deprecated Level list.

</details>

</details>


**<details><summary>Version 1.3.0</summary>**

**<details><summary>Features</summary>**

* Updated mod for Lethal Company version 56
* Added initial ExtendedBuyableVehicle implementation
* Added LevelEvents.onShipLand ExtendedEvent
* Added LevelEvents.onShipLeave ExtendedEvent
* Added ExtendedLevel.OverrideDustStormVolumeSize Value
* Added ExtendedLevel.OverrideFoggyVolumeSize Value
* Added PatchedContent.TryGetExtendedContent() Function.
* Added public references to basegame manager instances to OriginalContent
* Updated ContentTag's for new Version 55/56 content

</details>

**<details><summary>Fixes</summary>**

* Fixed issue with onApparatusTaken event running at unintended moments
* Added safeguard to prevent multiple Lethalbundles with identical names from causing a gamebreaking error
* Moved LethalLib from a Hard Dependency to a Soft Dependency
* Fixed ExtendedItem's not correctly playing the purchased SFX when purchased from Terminal
* Merged various pull requests to improve the workflow and deployment of further LethalLevelLoader development

</details>

</details>

**<details><summary>Version 1.2.2</summary>**

**<details><summary>Fixes</summary>**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace LethalLevelLoader
[CreateAssetMenu(fileName = "ExtendedBuyableVehicle", menuName = "Lethal Level Loader/Extended Content/ExtendedBuyableVehicle", order = 21)]
public class ExtendedBuyableVehicle : ExtendedContent
{
[field: SerializeField] public BuyableVehicle BuyableVehicle { get; set; }
[field: SerializeField] public BuyableVehicle BuyableVehicle { get; set; } = null!;
[field: SerializeField] public string TerminalKeywordName { get; set; } = string.Empty;

public int VehicleID { get; set; }

public TerminalNode VehicleBuyNode { get; set; }
public TerminalNode VehicleBuyConfirmNode { get; set; }
public TerminalNode VehicleInfoNode { get; set; }
public TerminalNode VehicleBuyNode { get; set; } = null!;
public TerminalNode VehicleBuyConfirmNode { get; set; } = null!;
public TerminalNode VehicleInfoNode { get; set; } = null!;

internal static ExtendedBuyableVehicle Create(BuyableVehicle newBuyableVehicle)
{
Expand Down
Loading
Loading