Skip to content
Merged

3.0 #82

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
aae9613
3.0
obvEve Jan 6, 2026
5ff3de9
Merge branch 'dev' into 3.0
obvEve Jan 6, 2026
22ec81f
Update Attribute to Attributes namespace
obvEve Jan 7, 2026
b544af7
Namespace fix
obvEve Jan 7, 2026
6c765bd
Change DoorPermissionCheck to use bitwise
obvEve Jan 18, 2026
cc80604
SSSS additions (#85)
obvEve Mar 27, 2026
d069214
Fix build (Please Exiled stop changing it)
obvEve Mar 27, 2026
a771508
docs: Change & symbol to and
obvEve Mar 27, 2026
2284ecd
Update csproj to obvEve instead of Misfiy & Bump version to 3.0.0
obvEve Mar 27, 2026
f57caf8
Minor code improvements
obvEve Mar 27, 2026
2afdab8
CustomPlainTextSetting::LastInputText -> Remove validation as basegam…
obvEve Mar 27, 2026
92cd31c
Change version to 3.0.0-beta1
obvEve Mar 30, 2026
83c2c49
Fix? --output on nuget.yml dotnet pack
obvEve Mar 30, 2026
21eacc0
Remove CustomHeader::Gameplay
obvEve Mar 30, 2026
d965696
File-scoped namespaces
obvEve Mar 30, 2026
ff35b6a
CustomSetting:HasValueChanged -> Explicitly default to false
obvEve Mar 30, 2026
1e175cf
Improvements to RoomExtensions (#84)
obvEve Apr 2, 2026
aadb2e4
Prefab Debugging (#88)
obvEve Apr 2, 2026
b0ccc13
fix: nuget push
obvEve Apr 2, 2026
98da508
Bump to V3.0.0-beta2
obvEve Apr 2, 2026
08c3dc6
docs: Remove outdated mention of RoleExtensions and add CallOnLoadAtt…
obvEve Apr 2, 2026
65cc8f2
CustomHeader::Label & ReducedPadding getters
obvEve Apr 2, 2026
2f85f45
fix: CustomPlainTextSetting not implementing HasValueChanged
obvEve Apr 2, 2026
49c79cb
Improve github actions
obvEve Apr 2, 2026
ed82973
fix actions? i added a space by accident
obvEve Apr 2, 2026
9f5a723
Fix redundant step + only upload SecretAPI
obvEve Apr 2, 2026
5376213
Minor code improvements
obvEve Apr 4, 2026
1ca4da3
PlayerRoundIgnore (#89)
obvEve Apr 8, 2026
16dfc1b
3.0-beta3
obvEve Apr 8, 2026
4affa21
Consistency
obvEve Apr 8, 2026
41852c8
Test setting up dotnet
obvEve Apr 8, 2026
a4b20be
List References
obvEve Apr 8, 2026
c03402c
ls steps.refs.outputs.target
obvEve Apr 8, 2026
0aa7286
Remove debug
obvEve Apr 8, 2026
bd683e0
Fix: Workflow
obvEve Apr 9, 2026
e07b8e0
Remove hintpath + use LabApi
obvEve Apr 9, 2026
447ad38
Use .props more
obvEve Apr 9, 2026
fc6477a
Fix stuff (#91)
obvEve Apr 10, 2026
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
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ csharp_style_var_when_type_is_apparent = false:error
csharp_style_var_elsewhere = false:error
csharp_using_directive_placement = inside_namespace:error
csharp_prefer_braces = false
dotnet_code_quality_unused_parameters = non_public:none
dotnet_code_quality_unused_parameters = non_public:none
csharp_style_namespace_declarations = file_scoped:error
4 changes: 2 additions & 2 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

# Features
- CollectionExtensions: Extensions to provide utility for collections like lists and arrays.
- RoleExtensions: Extensions to help with handling role specific tasks. Like getting a role's spawn point.
- RoomExtensions: Extensions to help with room specific tasks, like checking if a room is safe to teleport to.
- HarmonyExtensions: Extensions to provide more utility to Harmony patching, like adding some updated Harmony features which can't be utilised, i.e. patching by category.
- CustomPlayerEffect: Create custom status effects using the base-game system.
- IRegister: Handle auto registering certain plugin features inheriting this interface and then running `IRegister.RegisterAll()` in your plugin's initialise method.
- IRegister: Handle auto registering certain plugin features inheriting this interface and then running `IRegister.RegisterAll(Assembly)` in your plugin's initialise method.
- CallOnLoadAttribute: Allows calling static initialize methods on enable via ``CallOnLoadAttribute.Load(Assembly)``
- CustomSetting: Server Specific Settings without the management hassle, control everything for 1 setting in 1 class, including permissions. A better setting system overall.

# Examples
Expand Down
32 changes: 9 additions & 23 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,22 @@ on:

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest

env:
REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip
REFERENCES_PATH: ${{ github.workspace }}/References
NUGET_PACKAGED_PATH: ${{ github.workspace }}/nupkgs
BUILD_OUTPUT: ${{ github.workspace }}/Output

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Dotnet
uses: actions/setup-dotnet@v4.0.1
- name: Download SCP:SL References
uses: Axwabo/scpsl-references-downloader@v1
id: refs

- name: Download References
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ env.REFERENCES_URL }} -OutFile "${{ github.workspace }}/References.zip"
Expand-Archive -Path "${{ github.workspace }}/References.zip" -DestinationPath ${{ env.REFERENCES_PATH }}

- name: Rename Assembly-CSharp-Publicized to Assembly-CSharp
shell: pwsh
run: Rename-Item -Path "${{ env.REFERENCES_PATH }}\Assembly-CSharp-Publicized.dll" -NewName "Assembly-CSharp.dll"

- name: Build and Pack NuGet
env:
SL_REFERENCES: ${{ env.REFERENCES_PATH }}
run: dotnet pack -c Release --output ${NUGET_PACKAGED_PATH}
- name: Build
run: dotnet build -c Release --output ${{ env.BUILD_OUTPUT }}

- name: Push NuGet package
run: |
$PackageFile = (Get-ChildItem -Path "${NUGET_PACKAGED_PATH}" -Include 'SecretAPI.*.nupkg' -Recurse | Select-Object -First 1).FullName
dotnet nuget push $PackageFile --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
working-directory: ${{ env.BUILD_OUTPUT }}
run: dotnet nuget push SecretAPI.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
27 changes: 7 additions & 20 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,25 @@ on:

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest

env:
REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip
REFERENCES_PATH: ${{ github.workspace }}/References
BUILD_OUTPUT: ${{ github.workspace }}/Output

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Dotnet
uses: actions/setup-dotnet@v4.0.1

- name: Download References
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ env.REFERENCES_URL }} -OutFile "${{ github.workspace }}/References.zip"
Expand-Archive -Path "${{ github.workspace }}/References.zip" -DestinationPath ${{ env.REFERENCES_PATH }}

- name: Rename Assembly-CSharp-Publicized to Assembly-CSharp
shell: pwsh
run: Rename-Item -Path "${{ env.REFERENCES_PATH }}\Assembly-CSharp-Publicized.dll" -NewName "Assembly-CSharp.dll"
- name: Download SCP:SL References
uses: Axwabo/scpsl-references-downloader@v1
id: refs

- name: Build
env:
SL_REFERENCES: ${{ env.REFERENCES_PATH }}
shell: pwsh
run: dotnet build -c Release
run: dotnet build -c Release --output ${{ env.BUILD_OUTPUT }}

- name: Upload
uses: actions/upload-artifact@v4
with:
name: Build Result
path: ${{ github.workspace }}/**/bin/Release/net48/*SecretAPI*.dll
path: ${{ env.BUILD_OUTPUT }}\SecretAPI*.dll
retention-days: 7
25 changes: 25 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<Version>3.0.0-beta3</Version>
</PropertyGroup>

<PropertyGroup Label="Nuget">
<Authors>obvEve</Authors>
<Company>obvEve</Company>

<GenerateDocumentationFile>true</GenerateDocumentationFile>

<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/obvEve/SecretAPI</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>recommended</AnalysisMode>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<CodeAnalysisRuleSet>../stylecop.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
22 changes: 22 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project>
<Import Project="ReferencePath.props.user" Condition="Exists('ReferencePath.props.user')" />
<PropertyGroup>
<ReferencePath Condition="$(ReferencePath) == ''">$(SL_REFERENCES)</ReferencePath>
<AssemblySearchPaths>$(ReferencePath);$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>

<Target Name="NotifyIncompleteSetup" BeforeTargets="PrepareForBuild" Condition="$(ReferencePath) == ''">
<PropertyGroup>
<Props>$(MSBuildThisFileDirectory)ReferencePath.props.user</Props>
<Template><![CDATA[
<Project>
<PropertyGroup>
<ReferencePath></ReferencePath>
</PropertyGroup>
</Project>
]]></Template>
</PropertyGroup>
<WriteLinesToFile File="$(Props)" Lines="$(Template)" Condition="!Exists($(Props))" />
<Error Text="The ReferencePath property is not specified! Make sure to set the property in the ReferencePath.props.user file." />
</Target>
</Project>
62 changes: 29 additions & 33 deletions SecretAPI.Examples/ExampleEntry.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
namespace SecretAPI.Examples
namespace SecretAPI.Examples;

using System;
using LabApi.Loader.Features.Plugins;
using SecretAPI.Examples.Settings;
using SecretAPI.Features.UserSettings;

/// <summary>
/// Defines the entry for the plugin.
/// </summary>
public class ExampleEntry : Plugin
{
using System;
using System.Reflection;
using HarmonyLib;
using LabApi.Loader.Features.Plugins;
using SecretAPI.Examples.Settings;
using SecretAPI.Extensions;
using SecretAPI.Features.UserSettings;

/// <summary>
/// Defines the entry for the plugin.
/// </summary>
public class ExampleEntry : Plugin
{
/// <inheritdoc/>
public override string Name { get; } = "SecretAPI.Examples";
/// <inheritdoc/>
public override string Name { get; } = "SecretAPI.Examples";

/// <inheritdoc/>
public override string Description { get; } = "An example plugin";
/// <inheritdoc/>
public override string Description { get; } = "An example plugin";

/// <inheritdoc/>
public override string Author { get; } = "@misfiy / @obvEvelyn";
/// <inheritdoc/>
public override string Author { get; } = "@misfiy / @obvEvelyn";

/// <inheritdoc/>
public override Version Version { get; } = typeof(SecretApi).Assembly.GetName().Version;
/// <inheritdoc/>
public override Version Version { get; } = typeof(SecretApi).Assembly.GetName().Version;

/// <inheritdoc/>
public override Version RequiredApiVersion { get; } = new(LabApi.Features.LabApiProperties.CompiledVersion);
/// <inheritdoc/>
public override Version RequiredApiVersion { get; } = new(LabApi.Features.LabApiProperties.CompiledVersion);

/// <inheritdoc/>
public override void Enable()
{
CustomSetting.Register(new ExampleKeybindSetting(), new ExampleDropdownSetting());
}
/// <inheritdoc/>
public override void Enable()
{
CustomSetting.Register(new ExampleKeybindSetting(), new ExampleDropdownSetting());
}

/// <inheritdoc/>
public override void Disable()
{
}
/// <inheritdoc/>
public override void Disable()
{
}
}
37 changes: 18 additions & 19 deletions SecretAPI.Examples/Patches/ExamplePatch.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
namespace SecretAPI.Examples.Patches
{
using SecretAPI.Attribute;
namespace SecretAPI.Examples.Patches;

using SecretAPI.Attributes;

/// <summary>
/// An example harmony patch.
/// </summary>
[HarmonyPatchCategory(nameof(ExampleEntry))]
/*[HarmonyPatch]*/
public static class ExamplePatch
/// <summary>
/// An example harmony patch.
/// </summary>
[HarmonyPatchCategory(nameof(ExampleEntry))]
/*[HarmonyPatch]*/
public static class ExamplePatch
{
// gets called before the original method is called
private static bool Prefix()
{
// gets called before the original method is called
private static bool Prefix()
{
// prevent original method from running
return false;
}
// prevent original method from running
return false;
}

// gets called after the original method is called
private static void Postfix()
{
}
// gets called after the original method is called
private static void Postfix()
{
}
}
34 changes: 14 additions & 20 deletions SecretAPI.Examples/SecretAPI.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,31 @@
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.2" PrivateAssets="all" />
<PackageReference Include="Lib.Harmony" Version="2.2.2" />
<!--
<PackageReference Include="Northwood.LabAPI" Version="1.1.4" IncludeAssets="All" PrivateAssets="All" />
-->
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" IncludeAssets="All" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SecretAPI\SecretAPI.csproj" />
<Reference Include="Assembly-CSharp" HintPath="$(SL_REFERENCES)\Assembly-CSharp.dll" Publicize="true" />
<Reference Include="CommandSystem.Core" HintPath="$(SL_REFERENCES)\CommandSystem.Core.dll" />
<Reference Include="NorthwoodLib" HintPath="$(SL_REFERENCES)\NorthwoodLib.dll" />
<Reference Include="Assembly-CSharp-firstpass" HintPath="$(SL_REFERENCES)\Assembly-CSharp-firstpass.dll" />
<Reference Include="Pooling" HintPath="$(SL_REFERENCES)\Pooling.dll" />
<Reference Include="Mirror" HintPath="$(SL_REFERENCES)\Mirror.dll" />
<Reference Include="mscorlib" HintPath="$(SL_REFERENCES)\mscorlib.dll" />
<Reference Include="UnityEngine" HintPath="$(SL_REFERENCES)\UnityEngine.dll" />
<Reference Include="UnityEngine.CoreModule" HintPath="$(SL_REFERENCES)\UnityEngine.CoreModule.dll" />
<Reference Include="UnityEngine.PhysicsModule" HintPath="$(SL_REFERENCES)\UnityEngine.PhysicsModule.dll" />
<Reference Include="Unity.TextMeshPro" HintPath="$(SL_REFERENCES)\Unity.TextMeshPro.dll" />
<Reference Include="Assembly-CSharp" Publicize="true" />
<Reference Include="LabApi" />
<Reference Include="CommandSystem.Core" />
<Reference Include="NorthwoodLib"/>
<Reference Include="Assembly-CSharp-firstpass" />
<Reference Include="Pooling" />
<Reference Include="Mirror" />
<Reference Include="mscorlib"/>
<Reference Include="UnityEngine"/>
<Reference Include="UnityEngine.CoreModule" />
<Reference Include="UnityEngine.PhysicsModule" />
<Reference Include="Unity.TextMeshPro" />
</ItemGroup>

<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>recommended</AnalysisMode>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<CodeAnalysisRuleSet>../stylecop.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
Loading
Loading