Skip to content

Commit

Permalink
Merge branch 'apis-rework' into pr/2267
Browse files Browse the repository at this point in the history
  • Loading branch information
louis1706 committed Feb 4, 2024
2 parents f1086d9 + 53a41b3 commit 90281e0
Show file tree
Hide file tree
Showing 568 changed files with 23,189 additions and 7,714 deletions.
21 changes: 1 addition & 20 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,14 @@ csharp_style_var_elsewhere = false:error

# ReSharper properties
resharper_csharp_max_line_length = 400
dotnet_diagnostic.SA1009.severity = none

[*.properties]
ij_properties_align_group_field_declarations = false
ij_properties_keep_blank_lines = false
ij_properties_key_value_delimiter = equals
ij_properties_spaces_around_key_value_delimiter = false

[*.styl]
indent_size = 2
ij_stylus_align_closing_brace_with_properties = false
ij_stylus_blank_lines_around_nested_selector = 1
ij_stylus_blank_lines_between_blocks = 1
ij_stylus_brace_placement = 0
ij_stylus_enforce_quotes_on_format = false
ij_stylus_hex_color_long_format = false
ij_stylus_hex_color_lower_case = false
ij_stylus_hex_color_short_format = false
ij_stylus_hex_color_upper_case = false
ij_stylus_keep_blank_lines_in_code = 2
ij_stylus_keep_indents_on_empty_lines = false
ij_stylus_keep_single_line_blocks = false
ij_stylus_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow
ij_stylus_space_after_colon = true
ij_stylus_space_before_opening_brace = true
ij_stylus_use_double_quotes = true
ij_stylus_value_alignment = 0

[.editorconfig]
ij_editorconfig_align_group_field_declarations = false
ij_editorconfig_space_after_colon = false
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/Resonance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Exiled Resonance CI

on:
push:
branches:
- apis-rework
pull_request:
branches:
- apis-rework
workflow_dispatch:

env:
EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Dev.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/References
EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe

jobs:

build:

runs-on: windows-latest
# Prevent double running for push & pull_request events from the main repo
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'Exiled-Team/Exiled'

steps:

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.7.2

- name: Setup Nuget
uses: iRebbok/setup-nuget@master

- uses: actions/checkout@v2.3.4

- name: Get references
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ env.EXILED_REFERENCES_URL }} -OutFile ${{ github.workspace }}/References.zip
Expand-Archive -Path References.zip -DestinationPath ${{ env.EXILED_REFERENCES_PATH }}
- name: Build
env:
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }}
shell: pwsh
run: |
./build.ps1 -BuildNuGet
$File = (Get-ChildItem -Path . -Include 'EXILED.*.nupkg' -Recurse).Name
Out-File -FilePath ${{ github.env }} -InputObject "PackageFile=$File" -Encoding utf-8 -Append
- name: Upload nuget package
uses: actions/upload-artifact@v2
with:
name: ${{ env.PackageFile }}
path: ${{ env.PackageFile }}

- name: Get references
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ env.EXILED_DLL_ARCHIVER_URL }} -OutFile ${{ github.workspace }}/EXILED-DLL-Archiver.exe
- name: Packaging results as tar.gz
shell: pwsh
run: ./packaging.ps1

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Build Result
path: bin/Release/Exiled.tar.gz
1 change: 1 addition & 0 deletions EXILED.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<HarmonyVersion>2.2.2</HarmonyVersion>
<StyleCopVersion>1.1.118</StyleCopVersion>
<SemanticVersioningVersion>2.0.2</SemanticVersioningVersion>
<YamlDotNetVersion>13.7.1</YamlDotNetVersion>

<Copyright>Copyright © $(Authors) 2020 - $([System.DateTime]::Now.ToString("yyyy"))</Copyright>
<RepositoryType>Git</RepositoryType>
Expand Down
10 changes: 1 addition & 9 deletions EXILED.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.API", "Exiled.API\Ex
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.Example", "Exiled.Example\Exiled.Example.csproj", "{4F183633-0A36-408C-A42E-6FBA48751054}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.CustomItems", "Exiled.CustomItems\Exiled.CustomItems.csproj", "{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.CreditTags", "Exiled.CreditTags\Exiled.CreditTags.csproj", "{9FEBCAEA-EB51-46D0-BC04-F74789A40079}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.CustomRoles", "Exiled.CustomRoles\Exiled.CustomRoles.csproj", "{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.CustomModules", "Exiled.CustomModules\Exiled.CustomModules.csproj", "{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "docs", "docs\docs.csproj", "{33EEFAC8-F5A7-4E51-8FD1-C45D25268B4A}"
ProjectSection(ProjectDependencies) = postProject
Expand All @@ -31,7 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "docs", "docs\docs.csproj",
{4F183633-0A36-408C-A42E-6FBA48751054} = {4F183633-0A36-408C-A42E-6FBA48751054}
{4FFB9CEB-2956-4F62-88B3-6416DB8A8ED7} = {4FFB9CEB-2956-4F62-88B3-6416DB8A8ED7}
{9FEBCAEA-EB51-46D0-BC04-F74789A40079} = {9FEBCAEA-EB51-46D0-BC04-F74789A40079}
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65} = {B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}
EndProjectSection
EndProject
Global
Expand Down Expand Up @@ -72,11 +69,6 @@ Global
{4F183633-0A36-408C-A42E-6FBA48751054}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
{4F183633-0A36-408C-A42E-6FBA48751054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F183633-0A36-408C-A42E-6FBA48751054}.Release|Any CPU.Build.0 = Release|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Release|Any CPU.Build.0 = Release|Any CPU
{9FEBCAEA-EB51-46D0-BC04-F74789A40079}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FEBCAEA-EB51-46D0-BC04-F74789A40079}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FEBCAEA-EB51-46D0-BC04-F74789A40079}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
Expand Down
2 changes: 0 additions & 2 deletions Exiled.API/Enums/DecontaminationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

namespace Exiled.API.Enums
{
using System;

using Features;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
// -----------------------------------------------------------------------
// <copyright file="CheckType.cs" company="Exiled Team">
// <copyright file="TextChannelType.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.CustomRoles.API.Features.Enums
namespace Exiled.API.Enums
{
/// <summary>
/// The possible types of checks to preform on active abilities.
/// All available text channels.
/// </summary>
public enum CheckType
public enum TextChannelType
{
/// <summary>
/// Check if the ability is available to the player. (DOES NOT CHECK COOLDOWNS)
/// Means text won't be displayed.
/// </summary>
Available,
None,

/// <summary>
/// Check if the ability is selected, but not active.
/// Means the text will be displayed through the broadcast system.
/// </summary>
Selected,
Broadcast,

/// <summary>
/// The ability is currently active.
/// Means the text will be displayed through hint display system.
/// </summary>
Active,
Hint,
}
}
}
61 changes: 61 additions & 0 deletions Exiled.API/Enums/UEBranchType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// -----------------------------------------------------------------------
// <copyright file="UEBranchType.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
using Exiled.API.Features.Core.Generic;

/// <summary>
/// All available branch environments.
/// </summary>
public class UEBranchType : UnmanagedEnumClass<sbyte, UEBranchType>
{
/// <summary>
/// The production branch.
/// </summary>
public static readonly UEBranchType Release = new(0);

/// <summary>
/// The debug branch.
/// </summary>
public static readonly UEBranchType Debug = new(1);

/// <summary>
/// The development branch.
/// </summary>
public static readonly UEBranchType Dev = new(2);

/// <summary>
/// The beta branch.
/// </summary>
public static readonly UEBranchType Beta = new(3);

/// <summary>
/// The alpha branch.
/// </summary>
public static readonly UEBranchType Alpha = new(4);

/// <summary>
/// The prealpha branch.
/// </summary>
public static readonly UEBranchType Prealpha = new(5);

/// <summary>
/// The unstable branch.
/// </summary>
public static readonly UEBranchType Unstable = new(6);

/// <summary>
/// Initializes a new instance of the <see cref="UEBranchType"/> class.
/// </summary>
/// <param name="value">The <see cref="sbyte"/> value.</param>
protected UEBranchType(sbyte value)
: base(value)
{
}
}
}
44 changes: 44 additions & 0 deletions Exiled.API/Enums/UUKeypressTriggerType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// -----------------------------------------------------------------------
// <copyright file="UUKeypressTriggerType.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
using Exiled.API.Features.Core.Generic;

#pragma warning disable SA1310 // Field names should not contain underscore

/// <summary>
/// The action type that should be triggered from a keypress trigger.
/// </summary>
public class UUKeypressTriggerType : UniqueUnmanagedEnumClass<uint, UUKeypressTriggerType>
{
/// <summary>
/// No action.
/// </summary>
public static readonly UUKeypressTriggerType None = new();

/// <summary>
/// Declares a keypress trigger input.
/// </summary>
public static readonly UUKeypressTriggerType KT_INPUT_0 = new();

/// <summary>
/// Declares a keypress trigger input.
/// </summary>
public static readonly UUKeypressTriggerType KT_INPUT_1 = new();

/// <summary>
/// Declares a keypress trigger input.
/// </summary>
public static readonly UUKeypressTriggerType KT_INPUT_2 = new();

/// <summary>
/// Declares a keypress trigger input.
/// </summary>
public static readonly UUKeypressTriggerType KT_INPUT_3 = new();
}
}
5 changes: 5 additions & 0 deletions Exiled.API/Exiled.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Exiled.Events</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Exiled.Loader</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopVersion)" IncludeAssets="All" PrivateAssets="All" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Lib.Harmony" Version="$(HarmonyVersion)" />
<PackageReference Include="YamlDotNet" Version="$(YamlDotNetVersion)" />
</ItemGroup>

<ItemGroup>
Expand All @@ -32,6 +36,7 @@
<Reference Include="Mirror" HintPath="$(EXILED_REFERENCES)\Mirror.dll" Private="false" />
<Reference Include="NorthwoodLib" HintPath="$(EXILED_REFERENCES)\NorthwoodLib.dll" Private="false" />
<Reference Include="PluginAPI" HintPath="$(EXILED_REFERENCES)\PluginAPI.dll" Private="false" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="UnityEngine" HintPath="$(EXILED_REFERENCES)\UnityEngine.dll" Private="false" />
<Reference Include="UnityEngine.CoreModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll" Private="false" />
<Reference Include="UnityEngine.ParticleSystemModule">
Expand Down
48 changes: 48 additions & 0 deletions Exiled.API/Extensions/AnimationCurveExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// -----------------------------------------------------------------------
// <copyright file="AnimationCurveExtensions.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Extensions
{
using System;
using System.Collections.Generic;

using UnityEngine;

/// <summary>
/// A set of extensions for animation curves.
/// </summary>
public static class AnimationCurveExtensions
{
/// <summary>
/// Modify the curve with the amount used.
/// </summary>
/// <param name="curve">The AnimationCurve to modify.</param>
/// <param name="amount">The multiplier number.</param>
/// <returns>The new modified curve.</returns>
public static AnimationCurve Multiply(this AnimationCurve curve, float amount)
{
for (int i = 0; i < curve.length; i++)
curve.keys[i].value *= amount;

return curve;
}

/// <summary>
/// Modify the curve with the amount used.
/// </summary>
/// <param name="curve">The AnimationCurve to modify.</param>
/// <param name="amount">The add number.</param>
/// <returns>The new modified curve.</returns>
public static AnimationCurve Add(this AnimationCurve curve, float amount)
{
for (int i = 0; i < curve.length; i++)
curve.keys[i].value += amount;

return curve;
}
}
}
Loading

0 comments on commit 90281e0

Please sign in to comment.