mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 20:20:46 +01:00
Compare commits
4 Commits
v270.1.0
...
v248.0.3-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72e0d24f7b | ||
|
|
6ff060c7f6 | ||
|
|
3ae65f9e3d | ||
|
|
af6fc51def |
@@ -19,7 +19,7 @@ resharper_place_field_attribute_on_same_line = if_owner_is_single_line
|
||||
resharper_wrap_chained_binary_patterns = chop_if_long
|
||||
resharper_wrap_chained_method_calls = chop_if_long
|
||||
|
||||
[*.{csproj,xml,yml,dll.config,targets,props,slnx}]
|
||||
[*.{csproj,xml,yml,dll.config,targets,props}]
|
||||
indent_size = 2
|
||||
|
||||
[nuget.config]
|
||||
|
||||
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -8,3 +8,5 @@
|
||||
*Command.cs @moonheart08
|
||||
*Commands.cs @moonheart08
|
||||
|
||||
# Physics
|
||||
**/Robust.Shared/Physics/** @metalgearsloth
|
||||
|
||||
34
.github/workflows/build-all-configurations.yml
vendored
34
.github/workflows/build-all-configurations.yml
vendored
@@ -1,34 +0,0 @@
|
||||
name: Build All Configurations
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
targetOS: [Windows, Linux, MacOS]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build Debug
|
||||
run: dotnet build --no-restore --configuration Debug /p:WarningsAsErrors=nullable /p:TargetOS=${{ matrix.targetOS }}
|
||||
- name: Build Tools
|
||||
run: dotnet build --no-restore --configuration Tools /p:WarningsAsErrors=nullable /p:TargetOS=${{ matrix.targetOS }}
|
||||
- name: Build Release
|
||||
run: dotnet build --no-restore --configuration Release /p:WarningsAsErrors=nullable /p:TargetOS=${{ matrix.targetOS }}
|
||||
2
.github/workflows/build-docfx.yml
vendored
2
.github/workflows/build-docfx.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
|
||||
10
.github/workflows/build-test.yml
vendored
10
.github/workflows/build-test.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
os: [ubuntu-latest, windows-latest] # , macos-latest] - temporarily disabled due to libfreetype.dll errors.
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
@@ -22,10 +22,12 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
dotnet-version: 9.0.x
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --no-restore /p:WarningsAsErrors=nullable
|
||||
- name: Run tests
|
||||
run: dotnet test --no-build -- NUnit.ConsoleOut=0
|
||||
- name: Robust.UnitTesting
|
||||
run: dotnet test --no-build Robust.UnitTesting/Robust.UnitTesting.csproj -- NUnit.ConsoleOut=0
|
||||
- name: Robust.Analyzers.Tests
|
||||
run: dotnet test --no-build Robust.Analyzers.Tests/Robust.Analyzers.Tests.csproj -- NUnit.ConsoleOut=0
|
||||
|
||||
4
.github/workflows/publish-client.yml
vendored
4
.github/workflows/publish-client.yml
vendored
@@ -23,10 +23,10 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Package client
|
||||
run: Tools/package_client_build.py
|
||||
run: Tools/package_client_build.py -p windows mac linux
|
||||
|
||||
- name: Shuffle files around
|
||||
run: |
|
||||
|
||||
4
.github/workflows/test-content.yml
vendored
4
.github/workflows/test-content.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
dotnet-version: 9.0.x
|
||||
- name: Disable submodule autoupdate
|
||||
run: touch BuildChecker/DISABLE_SUBMODULE_AUTOUPDATE
|
||||
|
||||
@@ -30,8 +30,6 @@ jobs:
|
||||
git fetch origin ${{ github.sha }}
|
||||
git checkout FETCH_HEAD
|
||||
git submodule update --init --recursive
|
||||
- name: Replace global.json
|
||||
run: cp RobustToolbox/global.json .
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<Project>
|
||||
<ItemDefinitionGroup>
|
||||
<PackageReference>
|
||||
<!--
|
||||
Make all packages used by RT default to having everything private except what's needed to run the game (runtime, native)
|
||||
This is to avoid having them leak to content, as they are primarily an implementation detail.
|
||||
Where necessary, this can be overriden by doing PrivateAssets="none" on the PackageReference entry.
|
||||
-->
|
||||
<PrivateAssets>compile;contentFiles;build;buildMultitargeting;buildTransitive;analyzers</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
Disable transitive project references.
|
||||
This is just to avoid venues of leaky implementation details into content.
|
||||
Being strict is always good.
|
||||
-->
|
||||
<DisableTransitiveProjectReferences>True</DisableTransitiveProjectReferences>
|
||||
|
||||
<!--
|
||||
Shut up broken package pruning warnings.
|
||||
We need these unpruneable packages because of transitive dependency pinning.
|
||||
-->
|
||||
<NoWarn>$(NoWarn);NU1510</NoWarn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -10,75 +10,69 @@
|
||||
<ManagePackageVersionsCentrally />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
|
||||
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
|
||||
<PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" />
|
||||
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.4" />
|
||||
<PackageVersion Include="JetBrains.Profiler.Api" Version="1.4.10" />
|
||||
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
|
||||
<PackageVersion Include="JetBrains.Profiler.Api" Version="1.4.8" />
|
||||
<PackageVersion Include="Linguini.Bundle" Version="0.8.1" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzer.Testing" Version="1.1.2" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.0.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="5.0.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0" />
|
||||
<PackageVersion Include="Microsoft.CodeCoverage" Version="18.0.1" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="10.0.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.12.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.12.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.12.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.12.0" />
|
||||
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.12.0" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.DotNet.RemoteExecutor" Version="8.0.0-beta.24059.4" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="10.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="10.0.0" />
|
||||
<PackageVersion Include="Microsoft.ILVerification" Version="10.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.ILVerification" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
|
||||
<PackageVersion Include="Microsoft.NET.ILLink.Tasks" Version="10.0.0" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
||||
<PackageVersion Include="Microsoft.NET.ILLink.Tasks" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
||||
<PackageVersion Include="Moq" Version="4.20.72" />
|
||||
<PackageVersion Include="NUnit" Version="4.4.0" />
|
||||
<PackageVersion Include="NUnit.Analyzers" Version="4.11.2" />
|
||||
<PackageVersion Include="NUnit3TestAdapter" Version="5.2.0" />
|
||||
<PackageVersion Include="NUnit" Version="4.3.2" />
|
||||
<PackageVersion Include="NUnit.Analyzers" Version="4.5.0" />
|
||||
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
|
||||
<PackageVersion Include="Nett" Version="0.15.0" />
|
||||
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
|
||||
<PackageVersion Include="OpenTK.Audio.OpenAL" Version="4.9.4" />
|
||||
<PackageVersion Include="OpenTK.OpenAL" Version="4.7.7" />
|
||||
<PackageVersion Include="OpenToolkit.Graphics" Version="4.0.0-pre9.1" />
|
||||
<PackageVersion Include="Pidgin" Version="3.5.1" />
|
||||
<PackageVersion Include="Robust.Natives" Version="0.2.3" />
|
||||
<PackageVersion Include="Robust.Natives.Zstd" Version="0.1.1-zstd1.5.7" />
|
||||
<PackageVersion Include="Pidgin" Version="3.3.0" />
|
||||
<PackageVersion Include="Robust.Natives" Version="0.1.1" />
|
||||
<PackageVersion Include="Robust.Natives.Cef" Version="131.3.5" />
|
||||
<PackageVersion Include="Robust.Shared.AuthLib" Version="0.1.2" />
|
||||
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.2" />
|
||||
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.10" />
|
||||
<PackageVersion Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.10" />
|
||||
<PackageVersion Include="Serilog" Version="4.3.0" />
|
||||
<PackageVersion Include="Serilog" Version="4.2.0" />
|
||||
<PackageVersion Include="Serilog.Sinks.Loki" Version="4.0.0-beta3" />
|
||||
<PackageVersion Include="SharpZstd.Interop" Version="1.5.2-beta2" />
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.12" />
|
||||
<PackageVersion Include="SpaceWizards.HttpListener" Version="0.2.0" />
|
||||
<PackageVersion Include="SpaceWizards.NFluidsynth" Version="0.2.2" />
|
||||
<PackageVersion Include="SpaceWizards.Sdl" Version="1.0.0" />
|
||||
<PackageVersion Include="SpaceWizards.SharpFont" Version="1.1.0" />
|
||||
<PackageVersion Include="SpaceWizards.Sodium" Version="0.3.0" />
|
||||
<PackageVersion Include="SpaceWizards.Fontconfig.Interop" Version="1.0.0" />
|
||||
<PackageVersion Include="libsodium" Version="1.0.20.1" />
|
||||
<PackageVersion Include="System.Management" Version="10.0.0" />
|
||||
<PackageVersion Include="TerraFX.Interop.Windows" Version="10.0.26100.5" />
|
||||
<PackageVersion Include="TerraFX.Interop.Xlib" Version="6.4.0.2" />
|
||||
<!-- Intentionally kept back, there is a bug that breaks audio for systems without AVX instructions. And the fix is not yet published. -->
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.7" />
|
||||
<PackageVersion Include="SpaceWizards.HttpListener" Version="0.1.1" />
|
||||
<PackageVersion Include="SpaceWizards.NFluidsynth" Version="0.1.1" />
|
||||
<PackageVersion Include="SpaceWizards.SharpFont" Version="1.0.2" />
|
||||
<PackageVersion Include="SpaceWizards.Sodium" Version="0.2.1" />
|
||||
<PackageVersion Include="TerraFX.Interop.Windows" Version="10.0.26100.1" />
|
||||
<PackageVersion Include="TerraFX.Interop.Xlib" Version="6.4.0" />
|
||||
<PackageVersion Include="VorbisPizza" Version="1.3.0" />
|
||||
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
|
||||
<PackageVersion Include="prometheus-net" Version="8.2.1" />
|
||||
<PackageVersion Include="prometheus-net.DotNetRuntime" Version="4.4.1" />
|
||||
<PackageVersion Include="prometheus-net.DotNetRuntime" Version="4.4.0" />
|
||||
<PackageVersion Include="PolySharp" Version="1.15.0" />
|
||||
<PackageVersion Include="System.CommandLine" Version="2.0.1" />
|
||||
|
||||
<!-- Transitive deps that we need to pin versions for to avoid NuGet warnings. -->
|
||||
<PackageVersion Include="System.Formats.Asn1" Version="10.0.0" />
|
||||
<PackageVersion Include="System.Reflection.Metadata" Version="10.0.0" />
|
||||
<PackageVersion Include="System.Text.Json" Version="10.0.0" />
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0" />
|
||||
<PackageVersion Include="System.Formats.Asn1" Version="9.0.0" />
|
||||
<PackageVersion Include="System.Reflection.Metadata" Version="9.0.0" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.12.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<Project>
|
||||
<!-- Include this .props file from content to get access to the APIs in these projects. -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Benchmarks\Robust.Benchmarks.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Client\Robust.Client.csproj" />
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Avalonia.Base\Avalonia.Base.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<Project>
|
||||
<!-- Include this .props file from content to get access to the APIs in these projects. -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Lidgren.Network\Lidgren.Network.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<Project>
|
||||
<!-- Include this .props file from content to get access to the APIs in these projects. -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Packaging\Robust.Packaging.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<Project>
|
||||
<!-- Include this .props file from content to get access to the APIs in these projects. -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Server\Robust.Server.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,8 +0,0 @@
|
||||
<Project>
|
||||
<!-- Include this .props file from content to get access to the APIs in these projects. -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Shared\Robust.Shared.csproj" />
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Shared.Maths\Robust.Shared.Maths.csproj" />
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\NetSerializer\NetSerializer\NetSerializer.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,9 +0,0 @@
|
||||
<Project>
|
||||
<!-- Include this .props file from content to get access to the APIs in these projects. -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Shared.Maths.Testing\Robust.Shared.Maths.Testing.csproj" />
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Shared.Testing\Robust.Shared.Testing.csproj" />
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Server.Testing\Robust.Server.Testing.csproj" />
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.UnitTesting\Robust.UnitTesting.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,14 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- If you are using Robust.Client.WebView, import this to depend on it. -->
|
||||
|
||||
<Import Condition="'$(_RTMacOSAppBundle_targets_imported)' != 'True'"
|
||||
Project="$(MSBuildThisFileDirectory)\..\MSBuild\MacOSAppBundle.targets" />
|
||||
|
||||
<PropertyGroup>
|
||||
<_RTMacOSAppBundle_for_webview>--webview</_RTMacOSAppBundle_for_webview>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Client.WebView\Robust.Client.WebView.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,24 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!--
|
||||
Depend on this in your client project (e.g. Content.Client) to generate a development app bundle for macOS.
|
||||
This is required for WebView.
|
||||
-->
|
||||
|
||||
<PropertyGroup>
|
||||
<RTMakeAppBundle Condition="'$(TargetOS)' == 'MacOS' And '$(RTMakeAppBundle)' == '' And '$(FullRelease)' != 'True'">True</RTMakeAppBundle>
|
||||
<RTAppBundleName Condition="'$(RTAppBundleName)' == ''">RobustToolbox Project</RTAppBundleName>
|
||||
<RTAppBundleIdentifier Condition="'$(RTAppBundleIdentifier)' == ''">org.robusttoolbox.project</RTAppBundleIdentifier>
|
||||
<!-- RTAppBundleIcon controls icon -->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<_RTMacOSAppBundle_targets_imported>True</_RTMacOSAppBundle_targets_imported>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="RTMakeAppBundleAfterBuild" Condition="'$(RTMakeAppBundle)' == 'True'" AfterTargets="AfterBuild">
|
||||
<PropertyGroup>
|
||||
<_RTMacOSAppBundle_icon Condition="'$(RTAppBundleIcon)' != ''">--icon "$(RTAppBundleIcon)"</_RTMacOSAppBundle_icon>
|
||||
</PropertyGroup>
|
||||
<Exec Command="$(MSBuildThisFileDirectory)/../Tools/macos_make_appbundle.py $(_RTMacOSAppBundle_for_webview) --name "$(RTAppBundleName)" --directory "$(OutputPath)" --apphost "$(AssemblyName)" --identifier "$(RTAppBundleIdentifier)" $(_RTMacOSAppBundle_icon)" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -13,7 +13,7 @@
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);LINUX;UNIX;FREEDESKTOP</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);LINUX;UNIX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
<Project>
|
||||
<Project>
|
||||
|
||||
<!-- This file automatically reset by Tools/version.py -->
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project>
|
||||
<!-- Engine-specific properties. Content should not use this file. -->
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>14</LangVersion>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<LangVersion>13</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<WarningsAsErrors>nullable</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -31,6 +31,5 @@
|
||||
<Python>python3</Python>
|
||||
<Python Condition="'$(ActualOS)' == 'Windows'">py -3</Python>
|
||||
<UseSystemSqlite Condition="'$(TargetOS)' == 'FreeBSD'">True</UseSystemSqlite>
|
||||
<IsFreedesktop Condition="'$(TargetOS)' == 'FreeBSD' Or '$(TargetOS)' == 'Linux'">True</IsFreedesktop>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<Project>
|
||||
<!--
|
||||
Disallow content from using direct references to Robust project files.
|
||||
Content should use the .props files in Imports/ instead.
|
||||
-->
|
||||
|
||||
<PropertyGroup>
|
||||
<AllowDirectRobustReferences Condition="'$(AllowDirectRobustReferences)' != ''">false</AllowDirectRobustReferences>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="_RTCheckForDirectReferences" BeforeTargets="BeforeResolveReferences"
|
||||
Condition="'$(AllowDirectRobustReferences)' != 'true'">
|
||||
<Error File="%(ProjectReference.DefiningProjectFullPath)"
|
||||
Text="Content may not reference %(Filename) directly"
|
||||
Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', 'RobustToolbox')) and !$([System.Text.RegularExpressions.Regex]::IsMatch('%(DefiningProjectFullPath)', '([Mm]icrosoft|RobustToolbox)'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -3,9 +3,8 @@
|
||||
<!-- Import this at the end of any project files in Robust and Content. -->
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<RTCullDotnetAnalyzers Condition="'$(RTCullDotnetAnalyzers)' == ''">true</RTCullDotnetAnalyzers>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Robust.Custom.targets" Condition="Exists('Robust.Custom.targets')"/>
|
||||
@@ -30,18 +29,4 @@
|
||||
|
||||
<!-- serialization generator -->
|
||||
<Import Project="Robust.Serialization.Generator.targets" Condition="'$(SkipRobustAnalyzer)' != 'true'" />
|
||||
|
||||
<!-- Robust API system -->
|
||||
<Import Project="Robust.ProjectReferences.targets" />
|
||||
|
||||
<!--
|
||||
We don't use these features and they add a not-insignificant amount of time to build perf.
|
||||
Am I micro-optimizing? Maybe.
|
||||
-->
|
||||
<Target Name="_RTRemoveSlowAnalyzers" BeforeTargets="AfterResolveReferences" Returns="@(Analyzer)">
|
||||
<ItemGroup Condition="'$(RTCullDotnetAnalyzers)' == 'true'">
|
||||
<Analyzer Remove="@(Analyzer)" Condition="'%(Analyzer.AssemblyName)' == 'Microsoft.Interop.ComInterfaceGenerator'" />
|
||||
<Analyzer Remove="@(Analyzer)" Condition="'%(Analyzer.AssemblyName)' == 'Microsoft.Interop.JavaScript.JSImportGenerator'" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -16,10 +16,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Client.NameGenerator\Robust.Client.NameGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Client.Injectors\Robust.Client.Injectors.csproj" ReferenceOutputAssembly="false">
|
||||
<SetConfiguration Condition="'$(Configuration)' == 'DebugOpt'">Configuration=Debug</SetConfiguration>
|
||||
<SetConfiguration Condition="'$(Configuration)' == 'Tools'">Configuration=Release</SetConfiguration>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\Robust.Client.Injectors\Robust.Client.Injectors.csproj" ReferenceOutputAssembly="false"/>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- XamlIL does not make use of special Robust configurations like DebugOpt. Convert these down. -->
|
||||
@@ -74,6 +71,6 @@
|
||||
</PropertyGroup>
|
||||
<Exec
|
||||
Condition="'$(_RobustUseExternalMSBuild)' == 'true'"
|
||||
Command=""$(DOTNET_HOST_PATH)" msbuild /nodereuse:false $(MSBuildProjectFile) /t:CompileRobustXaml /p:_RobustForceInternalMSBuild=true /p:Configuration=$(Configuration) /p:RuntimeIdentifier=$(RuntimeIdentifier) /p:TargetFramework=$(TargetFramework) /p:BuildProjectReferences=false /p:IntermediateOutputPath="$(IntermediateOutputPath.TrimEnd('\'))/""/>
|
||||
Command=""$(DOTNET_HOST_PATH)" msbuild /nodereuse:false $(MSBuildProjectFile) /t:CompileRobustXaml /p:_RobustForceInternalMSBuild=true /p:Configuration=$(Configuration) /p:RuntimeIdentifier=$(RuntimeIdentifier) /p:TargetFramework=$(TargetFramework) /p:BuildProjectReferences=false"/>
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
Submodule NetSerializer updated: 61b47fbbbd...4882400f2c
18
OpenToolkit.GraphicsLibraryFramework/Cursor.cs
Normal file
18
OpenToolkit.GraphicsLibraryFramework/Cursor.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Cursor.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Opaque handle to a GLFW cursor.
|
||||
/// </summary>
|
||||
public struct Cursor
|
||||
{
|
||||
}
|
||||
}
|
||||
33
OpenToolkit.GraphicsLibraryFramework/Enums/ClientApi.cs
Normal file
33
OpenToolkit.GraphicsLibraryFramework/Enums/ClientApi.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// ClientApi.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// The context client APIs.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintClientApi,ClientApi)"/>
|
||||
public enum ClientApi
|
||||
{
|
||||
/// <summary>
|
||||
/// No context API is created.
|
||||
/// </summary>
|
||||
NoApi = 0,
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL context is created.
|
||||
/// </summary>
|
||||
OpenGlApi = 0x00030001,
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL ES context is created.
|
||||
/// </summary>
|
||||
OpenGlEsApi = 0x00030002
|
||||
}
|
||||
}
|
||||
27
OpenToolkit.GraphicsLibraryFramework/Enums/ConnectedState.cs
Normal file
27
OpenToolkit.GraphicsLibraryFramework/Enums/ConnectedState.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// ConnectedState.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies connected state of devices.
|
||||
/// </summary>
|
||||
public enum ConnectedState
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that a device is connected.
|
||||
/// </summary>
|
||||
Connected = 0x00040001,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that a device is disconnected.
|
||||
/// </summary>
|
||||
Disconnected = 0x00040002
|
||||
}
|
||||
}
|
||||
27
OpenToolkit.GraphicsLibraryFramework/Enums/ContextApi.cs
Normal file
27
OpenToolkit.GraphicsLibraryFramework/Enums/ContextApi.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// ContextApi.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// The context API used to create the window context.
|
||||
/// </summary>
|
||||
public enum ContextApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Uses the native context API to create the window context.
|
||||
/// </summary>
|
||||
NativeContextApi = 0x00036001,
|
||||
|
||||
/// <summary>
|
||||
/// Uses Egl to create the window context.
|
||||
/// </summary>
|
||||
EglContextApi = 0x00036002
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// CursorModeValue.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// The GLFW cursor modes.
|
||||
/// See <a href="https://www.glfw.org/docs/latest/input_guide.html#cursor_mode">cursor modes</a>.
|
||||
/// </summary>
|
||||
public enum CursorModeValue
|
||||
{
|
||||
/// <summary>
|
||||
/// The regular arrow cursor (or another cursor set with <see cref="GLFW.SetCursor"/>) is used
|
||||
/// and cursor motion is not limited.
|
||||
/// </summary>
|
||||
CursorNormal = 0x00034001,
|
||||
|
||||
/// <summary>
|
||||
/// Hides the arrow cursor when over a window.
|
||||
/// </summary>
|
||||
CursorHidden = 0x00034002,
|
||||
|
||||
/// <summary>
|
||||
/// Will hide the cursor and lock it to the specified window.
|
||||
/// GLFW will then take care of all the details of cursor re-centering and offset calculation
|
||||
/// and providing the application with a virtual cursor position.
|
||||
/// This virtual position is provided normally via both the cursor position callback and through polling.
|
||||
/// </summary>
|
||||
CursorDisabled = 0x00034003
|
||||
}
|
||||
}
|
||||
47
OpenToolkit.GraphicsLibraryFramework/Enums/CursorShape.cs
Normal file
47
OpenToolkit.GraphicsLibraryFramework/Enums/CursorShape.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// CursorShape.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Standard cursor shapes.
|
||||
/// </summary>
|
||||
public enum CursorShape
|
||||
{
|
||||
/// <summary>
|
||||
/// The standard arrow shape. Used in almost all situations.
|
||||
/// </summary>
|
||||
Arrow = 0x00036001,
|
||||
|
||||
/// <summary>
|
||||
/// The I-Beam shape. Used when mousing over a place where text can be entered.
|
||||
/// </summary>
|
||||
IBeam = 0x00036002,
|
||||
|
||||
/// <summary>
|
||||
/// The crosshair shape. Used when dragging and dropping.
|
||||
/// </summary>
|
||||
Crosshair = 0x00036003,
|
||||
|
||||
/// <summary>
|
||||
/// The hand shape. Used when mousing over something that can be dragged around.
|
||||
/// </summary>
|
||||
Hand = 0x00036004,
|
||||
|
||||
/// <summary>
|
||||
/// The horizontal resize shape. Used when mousing over something that can be horizontally resized.
|
||||
/// </summary>
|
||||
HResize = 0x00036005,
|
||||
|
||||
/// <summary>
|
||||
/// The vertical resize shape. Used when mousing over something that can be vertically resized.
|
||||
/// </summary>
|
||||
VResize = 0x00036006
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// CursorStateAttribute.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Attribute for setting <see cref="CursorModeValue"/> of the cursor.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.SetInputMode(Window*,CursorStateAttribute,CursorModeValue)"/>
|
||||
/// <seealso cref="GLFW.GetInputMode(Window*,CursorStateAttribute)"/>
|
||||
public enum CursorStateAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Attribute for setting <see cref="CursorModeValue"/> of the cursor.
|
||||
/// </summary>
|
||||
Cursor = 0x00033001,
|
||||
}
|
||||
}
|
||||
103
OpenToolkit.GraphicsLibraryFramework/Enums/ErrorCode.cs
Normal file
103
OpenToolkit.GraphicsLibraryFramework/Enums/ErrorCode.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// ErrorCode.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Error codes, used in the error callback.
|
||||
/// </summary>
|
||||
public enum ErrorCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Everything is running as intended. Yay!
|
||||
/// </summary>
|
||||
NoError = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Called a function before calling <see cref="GLFW.Init"/>. Initialize GLFW and then try again.
|
||||
/// </summary>
|
||||
NotInitialized = 0x00010001,
|
||||
|
||||
/// <summary>
|
||||
/// No OpenGL/OpenGL ES context on this thread.
|
||||
/// </summary>
|
||||
NoContext = 0x00010002,
|
||||
|
||||
/// <summary>
|
||||
/// Used an invalid enum value on a function.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This should hopefully never happen in the bindings, due to the added type safety of C# enums VS. GLFW's native #defines
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
InvalidEnum = 0x00010003,
|
||||
|
||||
/// <summary>
|
||||
/// Called a function with an invalid argument.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This can happen if you request an OpenGL version that doesn't exist, like 2.7.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If you request a version of OpenGL that exists, but isn't supported by this graphics card, it will return VersionUnavailable instead.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
InvalidValue = 0x00010004,
|
||||
|
||||
/// <summary>
|
||||
/// A memory allocation failed on GLFW's end.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Report this to the GLFW issue tracker if encountered.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
OutOfMemory = 0x00010005,
|
||||
|
||||
/// <summary>
|
||||
/// The requested API is not available on the system.
|
||||
/// </summary>
|
||||
ApiUnavailable = 0x00010006,
|
||||
|
||||
/// <summary>
|
||||
/// The requested OpenGL version is not available on the system.
|
||||
/// </summary>
|
||||
VersionUnavailable = 0x00010007,
|
||||
|
||||
/// <summary>
|
||||
/// A platform-specific error occurred that doesn't fit into any more specific category.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Report this to the GLFW issue tracker if encountered.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
PlatformError = 0x00010008,
|
||||
|
||||
/// <summary>
|
||||
/// The requested format is unavailable.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// If emitted during window creation, the requested pixel format isn't available.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If emitted when using the clipboard, the contents of the clipboard couldn't be converted to the requested format.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
FormatUnavailable = 0x00010009,
|
||||
|
||||
/// <summary>
|
||||
/// There is no OpenGL/OpenGL ES context attached to this window.
|
||||
/// </summary>
|
||||
NoWindowContext = 0x0001000A
|
||||
}
|
||||
}
|
||||
46
OpenToolkit.GraphicsLibraryFramework/Enums/InitHintBool.cs
Normal file
46
OpenToolkit.GraphicsLibraryFramework/Enums/InitHintBool.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// InitHint.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialization hints are set before <see cref="GLFW.Init"/> and affect how the library behaves until termination.
|
||||
/// Hints are set with <see cref="GLFW.InitHint(InitHintBool, bool)"/>.
|
||||
/// </summary>
|
||||
public enum InitHintBool
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to specify whether to also expose joystick hats as buttons,
|
||||
/// for compatibility with earlier versions of GLFW that did not have
|
||||
/// <see cref="GLFW.GetJoystickHats"/>.
|
||||
/// Set this with <see cref="GLFW.InitHint(InitHintBool, bool)"/>.
|
||||
/// </summary>
|
||||
JoystickHatButtons = 0x00050001,
|
||||
|
||||
/// <summary>
|
||||
/// Used to specify whether to set the current directory to the application to the Contents/Resources
|
||||
/// subdirectory of the application's bundle, if present.
|
||||
/// Set this with <see cref="GLFW.InitHint(InitHintBool, bool)"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only affects macOS; no effect on other platforms.
|
||||
/// </remarks>
|
||||
CocoaChdirResources = 0x00051001,
|
||||
|
||||
/// <summary>
|
||||
/// Used to specify whether to create a basic menu bar, either from a nib or manually,
|
||||
/// when the first window is created, which is when AppKit is initialized.
|
||||
/// Set this with <see cref="GLFW.InitHint(InitHintBool, bool)"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only affects macOS; no effect on other platforms.
|
||||
/// </remarks>
|
||||
CocoaMenubar = 0x00051002
|
||||
}
|
||||
}
|
||||
15
OpenToolkit.GraphicsLibraryFramework/Enums/InitHintInt.cs
Normal file
15
OpenToolkit.GraphicsLibraryFramework/Enums/InitHintInt.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialization hints are set before <see cref="GLFW.Init"/> and affect how the library behaves until termination.
|
||||
/// Hints are set with <see cref="GLFW.InitHint(InitHintInt, int)"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// While this enum has no members,
|
||||
/// it can still be useful because it allows you to access the direct <c>glfwInitHint(int, int)</c> API.
|
||||
/// In case a future version of GLFW adds an int-taking int hint and we don't handle it.
|
||||
/// </remarks>
|
||||
public enum InitHintInt
|
||||
{
|
||||
}
|
||||
}
|
||||
33
OpenToolkit.GraphicsLibraryFramework/Enums/InputAction.cs
Normal file
33
OpenToolkit.GraphicsLibraryFramework/Enums/InputAction.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// InputAction.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines event information for <see cref="GLFWCallbacks.KeyCallback"/>
|
||||
/// or <see cref="GLFWCallbacks.MouseButtonCallback"/>.
|
||||
/// </summary>
|
||||
public enum InputAction : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// The key or mouse button was released.
|
||||
/// </summary>
|
||||
Release = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The key or mouse button was pressed.
|
||||
/// </summary>
|
||||
Press = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The key was held down until it repeated.
|
||||
/// </summary>
|
||||
Repeat = 2
|
||||
}
|
||||
}
|
||||
53
OpenToolkit.GraphicsLibraryFramework/Enums/JoystickHats.cs
Normal file
53
OpenToolkit.GraphicsLibraryFramework/Enums/JoystickHats.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Status of a joystick hat.
|
||||
/// </summary>
|
||||
public enum JoystickHats : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Hat is centered.
|
||||
/// </summary>
|
||||
Centered = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing up.
|
||||
/// </summary>
|
||||
Up = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing right.
|
||||
/// </summary>
|
||||
Right = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing down.
|
||||
/// </summary>
|
||||
Down = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing left.
|
||||
/// </summary>
|
||||
Left = 8,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing up and to the right.
|
||||
/// </summary>
|
||||
RightUp = Right | Up,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing down and to the right.
|
||||
/// </summary>
|
||||
RightDown = Right | Down,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing up and to the left.
|
||||
/// </summary>
|
||||
LeftUp = Left | Up,
|
||||
|
||||
/// <summary>
|
||||
/// Hat is pointing down and to the left.
|
||||
/// </summary>
|
||||
LeftDown = Left | Down,
|
||||
}
|
||||
}
|
||||
50
OpenToolkit.GraphicsLibraryFramework/Enums/KeyModifiers.cs
Normal file
50
OpenToolkit.GraphicsLibraryFramework/Enums/KeyModifiers.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// KeyModifiers.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Key modifiers, such as Shift or CTRL.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum KeyModifiers : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// if one or more Shift keys were held down.
|
||||
/// </summary>
|
||||
Shift = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// If one or more Control keys were held down.
|
||||
/// </summary>
|
||||
Control = 0x0002,
|
||||
|
||||
/// <summary>
|
||||
/// If one or more Alt keys were held down.
|
||||
/// </summary>
|
||||
Alt = 0x0004,
|
||||
|
||||
/// <summary>
|
||||
/// If one or more Super keys were held down.
|
||||
/// </summary>
|
||||
Super = 0x0008,
|
||||
|
||||
/// <summary>
|
||||
/// If caps lock is enabled.
|
||||
/// </summary>
|
||||
CapsLock = 0x0010,
|
||||
|
||||
/// <summary>
|
||||
/// If num lock is enabled.
|
||||
/// </summary>
|
||||
NumLock = 0x0020,
|
||||
}
|
||||
}
|
||||
627
OpenToolkit.GraphicsLibraryFramework/Enums/Keys.cs
Normal file
627
OpenToolkit.GraphicsLibraryFramework/Enums/Keys.cs
Normal file
@@ -0,0 +1,627 @@
|
||||
//
|
||||
// Keys.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies key codes and modifiers in US keyboard layout.
|
||||
/// </summary>
|
||||
public enum Keys : short
|
||||
{
|
||||
/// <summary>
|
||||
/// An unknown key.
|
||||
/// </summary>
|
||||
Unknown = -1,
|
||||
|
||||
/// <summary>
|
||||
/// The spacebar key.
|
||||
/// </summary>
|
||||
Space = 32,
|
||||
|
||||
/// <summary>
|
||||
/// The apostrophe key.
|
||||
/// </summary>
|
||||
Apostrophe = 39 /* ' */,
|
||||
|
||||
/// <summary>
|
||||
/// The comma key.
|
||||
/// </summary>
|
||||
Comma = 44 /* , */,
|
||||
|
||||
/// <summary>
|
||||
/// The minus key.
|
||||
/// </summary>
|
||||
Minus = 45 /* - */,
|
||||
|
||||
/// <summary>
|
||||
/// The period key.
|
||||
/// </summary>
|
||||
Period = 46 /* . */,
|
||||
|
||||
/// <summary>
|
||||
/// The slash key.
|
||||
/// </summary>
|
||||
Slash = 47 /* / */,
|
||||
|
||||
/// <summary>
|
||||
/// The 0 key.
|
||||
/// </summary>
|
||||
D0 = 48,
|
||||
|
||||
/// <summary>
|
||||
/// The 1 key.
|
||||
/// </summary>
|
||||
D1 = 49,
|
||||
|
||||
/// <summary>
|
||||
/// The 2 key.
|
||||
/// </summary>
|
||||
D2 = 50,
|
||||
|
||||
/// <summary>
|
||||
/// The 3 key.
|
||||
/// </summary>
|
||||
D3 = 51,
|
||||
|
||||
/// <summary>
|
||||
/// The 4 key.
|
||||
/// </summary>
|
||||
D4 = 52,
|
||||
|
||||
/// <summary>
|
||||
/// The 5 key.
|
||||
/// </summary>
|
||||
D5 = 53,
|
||||
|
||||
/// <summary>
|
||||
/// The 6 key.
|
||||
/// </summary>
|
||||
D6 = 54,
|
||||
|
||||
/// <summary>
|
||||
/// The 7 key.
|
||||
/// </summary>
|
||||
D7 = 55,
|
||||
|
||||
/// <summary>
|
||||
/// The 8 key.
|
||||
/// </summary>
|
||||
D8 = 56,
|
||||
|
||||
/// <summary>
|
||||
/// The 9 key.
|
||||
/// </summary>
|
||||
D9 = 57,
|
||||
|
||||
/// <summary>
|
||||
/// The semicolon key.
|
||||
/// </summary>
|
||||
Semicolon = 59 /* ; */,
|
||||
|
||||
/// <summary>
|
||||
/// The equal key.
|
||||
/// </summary>
|
||||
Equal = 61 /* = */,
|
||||
|
||||
/// <summary>
|
||||
/// The A key.
|
||||
/// </summary>
|
||||
A = 65,
|
||||
|
||||
/// <summary>
|
||||
/// The B key.
|
||||
/// </summary>
|
||||
B = 66,
|
||||
|
||||
/// <summary>
|
||||
/// The C key.
|
||||
/// </summary>
|
||||
C = 67,
|
||||
|
||||
/// <summary>
|
||||
/// The D key.
|
||||
/// </summary>
|
||||
D = 68,
|
||||
|
||||
/// <summary>
|
||||
/// The E key.
|
||||
/// </summary>
|
||||
E = 69,
|
||||
|
||||
/// <summary>
|
||||
/// The F key.
|
||||
/// </summary>
|
||||
F = 70,
|
||||
|
||||
/// <summary>
|
||||
/// The G key.
|
||||
/// </summary>
|
||||
G = 71,
|
||||
|
||||
/// <summary>
|
||||
/// The H key.
|
||||
/// </summary>
|
||||
H = 72,
|
||||
|
||||
/// <summary>
|
||||
/// The I key.
|
||||
/// </summary>
|
||||
I = 73,
|
||||
|
||||
/// <summary>
|
||||
/// The J key.
|
||||
/// </summary>
|
||||
J = 74,
|
||||
|
||||
/// <summary>
|
||||
/// The K key.
|
||||
/// </summary>
|
||||
K = 75,
|
||||
|
||||
/// <summary>
|
||||
/// The L key.
|
||||
/// </summary>
|
||||
L = 76,
|
||||
|
||||
/// <summary>
|
||||
/// The M key.
|
||||
/// </summary>
|
||||
M = 77,
|
||||
|
||||
/// <summary>
|
||||
/// The N key.
|
||||
/// </summary>
|
||||
N = 78,
|
||||
|
||||
/// <summary>
|
||||
/// The O key.
|
||||
/// </summary>
|
||||
O = 79,
|
||||
|
||||
/// <summary>
|
||||
/// The P key.
|
||||
/// </summary>
|
||||
P = 80,
|
||||
|
||||
/// <summary>
|
||||
/// The Q key.
|
||||
/// </summary>
|
||||
Q = 81,
|
||||
|
||||
/// <summary>
|
||||
/// The R key.
|
||||
/// </summary>
|
||||
R = 82,
|
||||
|
||||
/// <summary>
|
||||
/// The S key.
|
||||
/// </summary>
|
||||
S = 83,
|
||||
|
||||
/// <summary>
|
||||
/// The T key.
|
||||
/// </summary>
|
||||
T = 84,
|
||||
|
||||
/// <summary>
|
||||
/// The U key.
|
||||
/// </summary>
|
||||
U = 85,
|
||||
|
||||
/// <summary>
|
||||
/// The V key.
|
||||
/// </summary>
|
||||
V = 86,
|
||||
|
||||
/// <summary>
|
||||
/// The W key.
|
||||
/// </summary>
|
||||
W = 87,
|
||||
|
||||
/// <summary>
|
||||
/// The X key.
|
||||
/// </summary>
|
||||
X = 88,
|
||||
|
||||
/// <summary>
|
||||
/// The Y key.
|
||||
/// </summary>
|
||||
Y = 89,
|
||||
|
||||
/// <summary>
|
||||
/// The Z key.
|
||||
/// </summary>
|
||||
Z = 90,
|
||||
|
||||
/// <summary>
|
||||
/// The left bracket(opening bracket) key.
|
||||
/// </summary>
|
||||
LeftBracket = 91 /* [ */,
|
||||
|
||||
/// <summary>
|
||||
/// The backslash.
|
||||
/// </summary>
|
||||
Backslash = 92 /* \ */,
|
||||
|
||||
/// <summary>
|
||||
/// The right bracket(closing bracket) key.
|
||||
/// </summary>
|
||||
RightBracket = 93 /* ] */,
|
||||
|
||||
/// <summary>
|
||||
/// The grave accent key.
|
||||
/// </summary>
|
||||
GraveAccent = 96 /* ` */,
|
||||
|
||||
/// <summary>
|
||||
/// Non US keyboard layout key 1.
|
||||
/// </summary>
|
||||
World1 = 161 /* non-US #1 */,
|
||||
|
||||
/// <summary>
|
||||
/// Non US keyboard layout key 2.
|
||||
/// </summary>
|
||||
World2 = 162 /* non-US #2 */,
|
||||
|
||||
/// <summary>
|
||||
/// The escape key.
|
||||
/// </summary>
|
||||
Escape = 256,
|
||||
|
||||
/// <summary>
|
||||
/// The enter key.
|
||||
/// </summary>
|
||||
Enter = 257,
|
||||
|
||||
/// <summary>
|
||||
/// The tab key.
|
||||
/// </summary>
|
||||
Tab = 258,
|
||||
|
||||
/// <summary>
|
||||
/// The backspace key.
|
||||
/// </summary>
|
||||
Backspace = 259,
|
||||
|
||||
/// <summary>
|
||||
/// The insert key.
|
||||
/// </summary>
|
||||
Insert = 260,
|
||||
|
||||
/// <summary>
|
||||
/// The delete key.
|
||||
/// </summary>
|
||||
Delete = 261,
|
||||
|
||||
/// <summary>
|
||||
/// The right arrow key.
|
||||
/// </summary>
|
||||
Right = 262,
|
||||
|
||||
/// <summary>
|
||||
/// The left arrow key.
|
||||
/// </summary>
|
||||
Left = 263,
|
||||
|
||||
/// <summary>
|
||||
/// The down arrow key.
|
||||
/// </summary>
|
||||
Down = 264,
|
||||
|
||||
/// <summary>
|
||||
/// The up arrow key.
|
||||
/// </summary>
|
||||
Up = 265,
|
||||
|
||||
/// <summary>
|
||||
/// The page up key.
|
||||
/// </summary>
|
||||
PageUp = 266,
|
||||
|
||||
/// <summary>
|
||||
/// The page down key.
|
||||
/// </summary>
|
||||
PageDown = 267,
|
||||
|
||||
/// <summary>
|
||||
/// The home key.
|
||||
/// </summary>
|
||||
Home = 268,
|
||||
|
||||
/// <summary>
|
||||
/// The end key.
|
||||
/// </summary>
|
||||
End = 269,
|
||||
|
||||
/// <summary>
|
||||
/// The caps lock key.
|
||||
/// </summary>
|
||||
CapsLock = 280,
|
||||
|
||||
/// <summary>
|
||||
/// The scroll lock key.
|
||||
/// </summary>
|
||||
ScrollLock = 281,
|
||||
|
||||
/// <summary>
|
||||
/// The num lock key.
|
||||
/// </summary>
|
||||
NumLock = 282,
|
||||
|
||||
/// <summary>
|
||||
/// The print screen key.
|
||||
/// </summary>
|
||||
PrintScreen = 283,
|
||||
|
||||
/// <summary>
|
||||
/// The pause key.
|
||||
/// </summary>
|
||||
Pause = 284,
|
||||
|
||||
/// <summary>
|
||||
/// The F1 key.
|
||||
/// </summary>
|
||||
F1 = 290,
|
||||
|
||||
/// <summary>
|
||||
/// The F2 key.
|
||||
/// </summary>
|
||||
F2 = 291,
|
||||
|
||||
/// <summary>
|
||||
/// The F3 key.
|
||||
/// </summary>
|
||||
F3 = 292,
|
||||
|
||||
/// <summary>
|
||||
/// The F4 key.
|
||||
/// </summary>
|
||||
F4 = 293,
|
||||
|
||||
/// <summary>
|
||||
/// The F5 key.
|
||||
/// </summary>
|
||||
F5 = 294,
|
||||
|
||||
/// <summary>
|
||||
/// The F6 key.
|
||||
/// </summary>
|
||||
F6 = 295,
|
||||
|
||||
/// <summary>
|
||||
/// The F7 key.
|
||||
/// </summary>
|
||||
F7 = 296,
|
||||
|
||||
/// <summary>
|
||||
/// The F8 key.
|
||||
/// </summary>
|
||||
F8 = 297,
|
||||
|
||||
/// <summary>
|
||||
/// The F9 key.
|
||||
/// </summary>
|
||||
F9 = 298,
|
||||
|
||||
/// <summary>
|
||||
/// The F10 key.
|
||||
/// </summary>
|
||||
F10 = 299,
|
||||
|
||||
/// <summary>
|
||||
/// The F11 key.
|
||||
/// </summary>
|
||||
F11 = 300,
|
||||
|
||||
/// <summary>
|
||||
/// The F12 key.
|
||||
/// </summary>
|
||||
F12 = 301,
|
||||
|
||||
/// <summary>
|
||||
/// The F13 key.
|
||||
/// </summary>
|
||||
F13 = 302,
|
||||
|
||||
/// <summary>
|
||||
/// The F14 key.
|
||||
/// </summary>
|
||||
F14 = 303,
|
||||
|
||||
/// <summary>
|
||||
/// The F15 key.
|
||||
/// </summary>
|
||||
F15 = 304,
|
||||
|
||||
/// <summary>
|
||||
/// The F16 key.
|
||||
/// </summary>
|
||||
F16 = 305,
|
||||
|
||||
/// <summary>
|
||||
/// The F17 key.
|
||||
/// </summary>
|
||||
F17 = 306,
|
||||
|
||||
/// <summary>
|
||||
/// The F18 key.
|
||||
/// </summary>
|
||||
F18 = 307,
|
||||
|
||||
/// <summary>
|
||||
/// The F19 key.
|
||||
/// </summary>
|
||||
F19 = 308,
|
||||
|
||||
/// <summary>
|
||||
/// The F20 key.
|
||||
/// </summary>
|
||||
F20 = 309,
|
||||
|
||||
/// <summary>
|
||||
/// The F21 key.
|
||||
/// </summary>
|
||||
F21 = 310,
|
||||
|
||||
/// <summary>
|
||||
/// The F22 key.
|
||||
/// </summary>
|
||||
F22 = 311,
|
||||
|
||||
/// <summary>
|
||||
/// The F23 key.
|
||||
/// </summary>
|
||||
F23 = 312,
|
||||
|
||||
/// <summary>
|
||||
/// The F24 key.
|
||||
/// </summary>
|
||||
F24 = 313,
|
||||
|
||||
/// <summary>
|
||||
/// The F25 key.
|
||||
/// </summary>
|
||||
F25 = 314,
|
||||
|
||||
/// <summary>
|
||||
/// The 0 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad0 = 320,
|
||||
|
||||
/// <summary>
|
||||
/// The 1 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad1 = 321,
|
||||
|
||||
/// <summary>
|
||||
/// The 2 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad2 = 322,
|
||||
|
||||
/// <summary>
|
||||
/// The 3 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad3 = 323,
|
||||
|
||||
/// <summary>
|
||||
/// The 4 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad4 = 324,
|
||||
|
||||
/// <summary>
|
||||
/// The 5 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad5 = 325,
|
||||
|
||||
/// <summary>
|
||||
/// The 6 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad6 = 326,
|
||||
|
||||
/// <summary>
|
||||
/// The 7 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad7 = 327,
|
||||
|
||||
/// <summary>
|
||||
/// The 8 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad8 = 328,
|
||||
|
||||
/// <summary>
|
||||
/// The 9 key on the key pad.
|
||||
/// </summary>
|
||||
KeyPad9 = 329,
|
||||
|
||||
/// <summary>
|
||||
/// The decimal key on the key pad.
|
||||
/// </summary>
|
||||
KeyPadDecimal = 330,
|
||||
|
||||
/// <summary>
|
||||
/// The divide key on the key pad.
|
||||
/// </summary>
|
||||
KeyPadDivide = 331,
|
||||
|
||||
/// <summary>
|
||||
/// The multiply key on the key pad.
|
||||
/// </summary>
|
||||
KeyPadMultiply = 332,
|
||||
|
||||
/// <summary>
|
||||
/// The subtract key on the key pad.
|
||||
/// </summary>
|
||||
KeyPadSubtract = 333,
|
||||
|
||||
/// <summary>
|
||||
/// The add key on the key pad.
|
||||
/// </summary>
|
||||
KeyPadAdd = 334,
|
||||
|
||||
/// <summary>
|
||||
/// The enter key on the key pad.
|
||||
/// </summary>
|
||||
KeyPadEnter = 335,
|
||||
|
||||
/// <summary>
|
||||
/// The equal key on the key pad.
|
||||
/// </summary>
|
||||
KeyPadEqual = 336,
|
||||
|
||||
/// <summary>
|
||||
/// The left shift key.
|
||||
/// </summary>
|
||||
LeftShift = 340,
|
||||
|
||||
/// <summary>
|
||||
/// The left control key.
|
||||
/// </summary>
|
||||
LeftControl = 341,
|
||||
|
||||
/// <summary>
|
||||
/// The left alt key.
|
||||
/// </summary>
|
||||
LeftAlt = 342,
|
||||
|
||||
/// <summary>
|
||||
/// The left super key.
|
||||
/// </summary>
|
||||
LeftSuper = 343,
|
||||
|
||||
/// <summary>
|
||||
/// The right shift key.
|
||||
/// </summary>
|
||||
RightShift = 344,
|
||||
|
||||
/// <summary>
|
||||
/// The right control key.
|
||||
/// </summary>
|
||||
RightControl = 345,
|
||||
|
||||
/// <summary>
|
||||
/// The right alt key.
|
||||
/// </summary>
|
||||
RightAlt = 346,
|
||||
|
||||
/// <summary>
|
||||
/// The right super key.
|
||||
/// </summary>
|
||||
RightSuper = 347,
|
||||
|
||||
/// <summary>
|
||||
/// The menu key.
|
||||
/// </summary>
|
||||
Menu = 348,
|
||||
|
||||
/// <summary>
|
||||
/// The last valid key in this enum.
|
||||
/// </summary>
|
||||
LastKey = Menu
|
||||
}
|
||||
}
|
||||
68
OpenToolkit.GraphicsLibraryFramework/Enums/MouseButton.cs
Normal file
68
OpenToolkit.GraphicsLibraryFramework/Enums/MouseButton.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the buttons of a mouse.
|
||||
/// </summary>
|
||||
public enum MouseButton : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// The first button.
|
||||
/// </summary>
|
||||
Button1 = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The second button.
|
||||
/// </summary>
|
||||
Button2 = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The third button.
|
||||
/// </summary>
|
||||
Button3 = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The fourth button.
|
||||
/// </summary>
|
||||
Button4 = 3,
|
||||
|
||||
/// <summary>
|
||||
/// The fifth button.
|
||||
/// </summary>
|
||||
Button5 = 4,
|
||||
|
||||
/// <summary>
|
||||
/// The sixth button.
|
||||
/// </summary>
|
||||
Button6 = 5,
|
||||
|
||||
/// <summary>
|
||||
/// The seventh button.
|
||||
/// </summary>
|
||||
Button7 = 6,
|
||||
|
||||
/// <summary>
|
||||
/// The eighth button.
|
||||
/// </summary>
|
||||
Button8 = 7,
|
||||
|
||||
/// <summary>
|
||||
/// The left mouse button. This corresponds to <see cref="Button1"/>.
|
||||
/// </summary>
|
||||
Left = Button1,
|
||||
|
||||
/// <summary>
|
||||
/// The right mouse button. This corresponds to <see cref="Button2"/>.
|
||||
/// </summary>
|
||||
Right = Button2,
|
||||
|
||||
/// <summary>
|
||||
/// The middle mouse button. This corresponds to <see cref="Button3"/>.
|
||||
/// </summary>
|
||||
Middle = Button3,
|
||||
|
||||
/// <summary>
|
||||
/// The highest mouse button available.
|
||||
/// </summary>
|
||||
Last = Button8,
|
||||
}
|
||||
}
|
||||
32
OpenToolkit.GraphicsLibraryFramework/Enums/OpenGlProfile.cs
Normal file
32
OpenToolkit.GraphicsLibraryFramework/Enums/OpenGlProfile.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// OpenGlProfile.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// The OpenGL context profiles.
|
||||
/// </summary>
|
||||
public enum OpenGlProfile
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for unknown OpenGL profile or OpenGL ES.
|
||||
/// </summary>
|
||||
Any = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Known OpenGL Core profile.
|
||||
/// </summary>
|
||||
Core = 0x00032001,
|
||||
|
||||
/// <summary>
|
||||
/// Known OpenGL compatibility profile.
|
||||
/// </summary>
|
||||
Compat = 0x00032002
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// ReleaseBehavior.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// The context release behaviors.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintReleaseBehavior,ReleaseBehavior)"/>
|
||||
public enum ReleaseBehavior
|
||||
{
|
||||
/// <summary>
|
||||
/// Use the default release behavior of the platform.
|
||||
/// </summary>
|
||||
Any = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The pipeline will be flushed whenever the context is released from being the current one.
|
||||
/// </summary>
|
||||
Flush = 0x00035001,
|
||||
|
||||
/// <summary>
|
||||
/// The pipeline will not be flushed on release.
|
||||
/// </summary>
|
||||
None = 0x00035002
|
||||
}
|
||||
}
|
||||
32
OpenToolkit.GraphicsLibraryFramework/Enums/Robustness.cs
Normal file
32
OpenToolkit.GraphicsLibraryFramework/Enums/Robustness.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Robustness.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// OpenGL context robustness strategy.
|
||||
/// </summary>
|
||||
public enum Robustness
|
||||
{
|
||||
/// <summary>
|
||||
/// No context robustness strategy.
|
||||
/// </summary>
|
||||
NoRobustness = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Robust context without a reset notification.
|
||||
/// </summary>
|
||||
NoResetNotification = 0x00031001,
|
||||
|
||||
/// <summary>
|
||||
/// Lose context on reset.
|
||||
/// </summary>
|
||||
LoseContextOnReset = 0x00031002
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// StickyAttributes.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Attributes related to sticky keys and buttons.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.SetInputMode(Window*,StickyAttributes,bool)"/>
|
||||
/// <seealso cref="GLFW.GetInputMode(Window*,StickyAttributes)"/>
|
||||
public enum StickyAttributes
|
||||
{
|
||||
/// <summary>
|
||||
/// Specify whether keyboard input should be sticky or not.
|
||||
/// </summary>
|
||||
StickyKeys = 0x00033002,
|
||||
|
||||
/// <summary>
|
||||
/// Specify whether mouse button input should be sticky or not.
|
||||
/// </summary>
|
||||
StickyMouseButtons = 0x00033003
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// WindowAttributeSetter.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to get window related attributes.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.GetWindowAttrib"/>
|
||||
public enum WindowAttributeGetter
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window has input focus.
|
||||
/// Initial input focus is controlled by the window hint with the same name
|
||||
/// </summary>
|
||||
Focused = WindowHintBool.Focused,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is iconified,
|
||||
/// whether by the user or with <see cref="GLFW.IconifyWindow"/>.
|
||||
/// </summary>
|
||||
Iconified = WindowHintBool.Iconified,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is resizable by the user.
|
||||
/// This is set on creation with the window hint with the same name.
|
||||
/// </summary>
|
||||
Resizable = WindowHintBool.Resizable,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is visible.
|
||||
/// Window visibility can be controlled with <see cref="GLFW.ShowWindow"/> and <see cref="GLFW.HideWindow"/>
|
||||
/// and initial visibility is controlled by the window hint with the same name.
|
||||
/// </summary>
|
||||
Visible = WindowHintBool.Visible,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window has decorations such as a border,a close widget, etc.
|
||||
/// This is set on creation with the window hint with the same name.
|
||||
/// </summary>
|
||||
Decorated = WindowHintBool.Decorated,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the full screen window will automatically iconify and restore
|
||||
/// the previous video mode on input focus loss.
|
||||
/// Possible values are <c>true</c> and <c>false</c>. This hint is ignored for windowed mode windows.
|
||||
/// </summary>
|
||||
AutoIconify = WindowHintBool.AutoIconify,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is floating, also called topmost or always-on-top.
|
||||
/// This is controlled by the window hint with the same name.
|
||||
/// </summary>
|
||||
Floating = WindowHintBool.Floating,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is maximized,
|
||||
/// whether by the user or with <see cref="GLFW.MaximizeWindow"/>.
|
||||
/// </summary>
|
||||
Maximized = WindowHintBool.Maximized,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the cursor should be centered over newly created full screen windows.
|
||||
/// Possible values are <c>true</c> and <c>false</c>. This hint is ignored for windowed mode windows.
|
||||
/// </summary>
|
||||
CenterCursor = WindowHintBool.CenterCursor,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the window framebuffer will be transparent.
|
||||
/// If enabled and supported by the system, the window framebuffer alpha channel will be used
|
||||
/// to combine the framebuffer with the background.
|
||||
/// This does not affect window decorations. Possible values are <c>true</c> and <c>false</c>.
|
||||
/// </summary>
|
||||
TransparentFramebuffer = WindowHintBool.TransparentFramebuffer,
|
||||
|
||||
/// <summary>
|
||||
/// indicates whether the cursor is currently directly over the client area of the window,
|
||||
/// with no other windows between.
|
||||
/// See <a href="https://www.glfw.org/docs/3.3/input_guide.html#cursor_enter">Cursor enter/leave events</a>
|
||||
/// for details.
|
||||
/// </summary>
|
||||
Hovered = WindowHintBool.Hovered,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the window will be given input focus when <see cref="GLFW.ShowWindow"/> is called.
|
||||
/// Possible values are <c>true</c> and <c>false</c>.
|
||||
/// </summary>
|
||||
FocusOnShow = WindowHintBool.FocusOnShow,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// WindowAttributeSetter.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to set window related attributes.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.SetWindowAttrib"/>
|
||||
public enum WindowAttributeSetter
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is resizable by the user.
|
||||
/// This is set on creation with the window hint with the same name.
|
||||
/// </summary>
|
||||
Resizable = WindowHintBool.Resizable,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window has decorations such as a border,a close widget, etc.
|
||||
/// This is set on creation with the window hint with the same name.
|
||||
/// </summary>
|
||||
Decorated = WindowHintBool.Decorated,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the full screen window will automatically iconify and restore
|
||||
/// the previous video mode on input focus loss.
|
||||
/// Possible values are <c>true</c> and <c>false</c>. This hint is ignored for windowed mode windows.
|
||||
/// </summary>
|
||||
AutoIconify = WindowHintBool.AutoIconify,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is floating, also called topmost or always-on-top.
|
||||
/// This is controlled by the window hint with the same name.
|
||||
/// </summary>
|
||||
Floating = WindowHintBool.Floating,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the window will be given input focus when <see cref="GLFW.ShowWindow"/> is called.
|
||||
/// Possible values are <c>true</c> and <c>false</c>.
|
||||
/// </summary>
|
||||
FocusOnShow = WindowHintBool.FocusOnShow
|
||||
}
|
||||
}
|
||||
135
OpenToolkit.GraphicsLibraryFramework/Enums/WindowHintBool.cs
Normal file
135
OpenToolkit.GraphicsLibraryFramework/Enums/WindowHintBool.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// WindowHintBool.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Context related boolean attributes.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintBool,bool)"/>
|
||||
public enum WindowHintBool
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window has input focus.
|
||||
/// Initial input focus is controlled by the window hint with the same name
|
||||
/// </summary>
|
||||
Focused = 0x00020001,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is iconified,
|
||||
/// whether by the user or with <see cref="GLFW.IconifyWindow"/>.
|
||||
/// </summary>
|
||||
Iconified = 0x00020002,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is resizable by the user.
|
||||
/// This is set on creation with the window hint with the same name.
|
||||
/// </summary>
|
||||
Resizable = 0x00020003,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is visible.
|
||||
/// Window visibility can be controlled with <see cref="GLFW.ShowWindow"/> and <see cref="GLFW.HideWindow"/>
|
||||
/// and initial visibility is controlled by the window hint with the same name.
|
||||
/// </summary>
|
||||
Visible = 0x00020004,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window has decorations such as a border,a close widget, etc.
|
||||
/// This is set on creation with the window hint with the same name.
|
||||
/// </summary>
|
||||
Decorated = 0x00020005,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the full screen window will automatically iconify and restore
|
||||
/// the previous video mode on input focus loss.
|
||||
/// Possible values are <c>true</c> and <c>false</c>. This hint is ignored for windowed mode windows.
|
||||
/// </summary>
|
||||
AutoIconify = 0x00020006,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is floating, also called topmost or always-on-top.
|
||||
/// This is controlled by the window hint with the same name.
|
||||
/// </summary>
|
||||
Floating = 0x00020007,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the specified window is maximized,
|
||||
/// whether by the user or with <see cref="GLFW.MaximizeWindow"/>.
|
||||
/// </summary>
|
||||
Maximized = 0x00020008,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the cursor should be centered over newly created full screen windows.
|
||||
/// Possible values are <c>true</c> and <c>false</c>. This hint is ignored for windowed mode windows.
|
||||
/// </summary>
|
||||
CenterCursor = 0x00020009,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the window framebuffer will be transparent.
|
||||
/// If enabled and supported by the system, the window framebuffer alpha channel will be used
|
||||
/// to combine the framebuffer with the background.
|
||||
/// This does not affect window decorations. Possible values are <c>true</c> and <c>false</c>.
|
||||
/// </summary>
|
||||
TransparentFramebuffer = 0x0002000A,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the cursor is currently directly over the client area of the window,
|
||||
/// with no other windows between.
|
||||
/// See <a href="https://www.glfw.org/docs/3.3/input_guide.html#cursor_enter">Cursor enter/leave events</a>
|
||||
/// for details.
|
||||
/// </summary>
|
||||
Hovered = 0x0002000B,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the window will be given input focus when <see cref="GLFW.ShowWindow"/> is called.
|
||||
/// Possible values are <c>true</c> and <c>false</c>.
|
||||
/// </summary>
|
||||
FocusOnShow = 0x0002000C,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the window's context is an OpenGL forward-compatible one.
|
||||
/// Possible values are <c>true</c> and <c>false</c>.
|
||||
/// </summary>
|
||||
OpenGLForwardCompat = 0x00022006,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the window's context is an OpenGL debug context.
|
||||
/// Possible values are <c>true</c> and <c>false</c>.
|
||||
/// </summary>
|
||||
OpenGLDebugContext = 0x00022007,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether errors should be generated by the context.
|
||||
/// If enabled, situations that would have generated errors instead cause undefined behavior.
|
||||
/// </summary>
|
||||
ContextNoError = 0x0002200A,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether to use stereoscopic rendering. This is a hard constraint.
|
||||
/// </summary>
|
||||
Stereo = 0x0002100C,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the framebuffer should be double buffered.
|
||||
/// You nearly always want to use double buffering. This is a hard constraint.
|
||||
/// </summary>
|
||||
DoubleBuffer = 0x00021010,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether the framebuffer should be sRGB capable.
|
||||
/// If supported, a created OpenGL context will support the
|
||||
/// <c>GL_FRAMEBUFFER_SRGB</c> enable( also called <c>GL_FRAMEBUFFER_SRGB_EXT</c>)
|
||||
/// for controlling sRGB rendering and a created OpenGL ES context will always have sRGB rendering enabled.
|
||||
/// </summary>
|
||||
SrgbCapable = 0x0002100E,
|
||||
|
||||
ScaleToMonitor = 0x0002200C,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// WindowHintClientApi.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Context related client API attribute.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintClientApi,ClientApi)"/>
|
||||
public enum WindowHintClientApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the client API provided by the window's context;
|
||||
/// either <see cref="GraphicsLibraryFramework.ClientApi.OpenGlApi"/>,
|
||||
/// <see cref="GraphicsLibraryFramework.ClientApi.OpenGlEsApi"/> or
|
||||
/// <see cref="GraphicsLibraryFramework.ClientApi.NoApi"/>.
|
||||
/// </summary>
|
||||
ClientApi = 0x00022001,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// WindowHintContextApi.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to specify the context creation API.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintContextApi,ContextApi)"/>
|
||||
public enum WindowHintContextApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the context creation API used to create the window's context;
|
||||
/// either <see cref="ContextApi.NativeContextApi"/> or <see cref="ContextApi.EglContextApi"/>.
|
||||
/// </summary>
|
||||
ContextCreationApi = 0x0002200B,
|
||||
}
|
||||
}
|
||||
117
OpenToolkit.GraphicsLibraryFramework/Enums/WindowHintInt.cs
Normal file
117
OpenToolkit.GraphicsLibraryFramework/Enums/WindowHintInt.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
//
|
||||
// WindowHintInt.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Context related attributes.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintInt,int)"/>
|
||||
public enum WindowHintInt
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicate the client API version(major part) of the window's context.
|
||||
/// </summary>
|
||||
ContextVersionMajor = 0x00022002,
|
||||
|
||||
/// <summary>
|
||||
/// Indicate the client API version(minor part) of the window's context.
|
||||
/// </summary>
|
||||
ContextVersionMinor = 0x00022003,
|
||||
|
||||
/// <summary>
|
||||
/// Indicate the client API version(revision part) of the window's context.
|
||||
/// </summary>
|
||||
ContextRevision = 0x00022004,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the red component of the default framebuffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
RedBits = 0x00021001,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the green component of the default framebuffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
GreenBits = 0x00021002,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the blue component of the default framebuffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
BlueBits = 0x00021003,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the alpha component of the default framebuffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
AlphaBits = 0x00021004,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the depth component of the default framebuffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
DepthBits = 0x00021005,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the stencil component of the default framebuffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
StencilBits = 0x00021006,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the red component of the accumulation buffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
/// <remarks>Accumulation buffers are a legacy OpenGL feature and should not be used in new code.</remarks>
|
||||
AccumRedBits = 0x00021007,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the green component of the accumulation buffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
/// <remarks>Accumulation buffers are a legacy OpenGL feature and should not be used in new code.</remarks>
|
||||
AccumGreenBits = 0x00021008,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the blue component of the accumulation buffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
/// <remarks>Accumulation buffers are a legacy OpenGL feature and should not be used in new code.</remarks>
|
||||
AccumBlueBits = 0x00021009,
|
||||
|
||||
/// <summary>
|
||||
/// Specify the desired bit depths of the alpha component of the accumulation buffer.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
/// <remarks>Accumulation buffers are a legacy OpenGL feature and should not be used in new code.</remarks>
|
||||
AccumAlphaBits = 0x0002100A,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the desired number of auxiliary buffers.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
/// <remarks>Auxiliary buffers are a legacy OpenGL feature and should not be used in new code.</remarks>
|
||||
AuxBuffers = 0x0002100B,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the desired number of samples to use for multisampling. Zero disables multisampling.
|
||||
/// <see cref="GLFW.DontCare"/> means the application has no preference.
|
||||
/// </summary>
|
||||
Samples = 0x0002100D,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the desired refresh rate for full screen windows.
|
||||
/// If set to <see cref="GLFW.DontCare"/>,
|
||||
/// the highest available refresh rate will be used. This hint is ignored for windowed mode windows.
|
||||
/// </summary>
|
||||
RefreshRate = 0x0002100F,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// WindowHintOpenGlProfile.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to set the OpenGlProfile attribute.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintOpenGlProfile,OpenGlProfile)"/>
|
||||
public enum WindowHintOpenGlProfile
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the OpenGL profile used by the context.
|
||||
/// This is <see cref="GraphicsLibraryFramework.OpenGlProfile.Core"/>
|
||||
/// or <see cref="GraphicsLibraryFramework.OpenGlProfile.Compat"/>
|
||||
/// if the context uses a known profile, or <see cref="GraphicsLibraryFramework.OpenGlProfile.Any"/>
|
||||
/// if the OpenGL profile is unknown or the context is an OpenGL ES context.
|
||||
/// Note that the returned profile may not match the profile bits of the context flags,
|
||||
/// as GLFW will try other means of detecting the profile when no bits are set. TODO: enum for missing crefs
|
||||
/// </summary>
|
||||
OpenGlProfile = 0x00022008,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// WindowHintReleaseBehavior.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to specify the release behavior used by the local context.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintReleaseBehavior,ReleaseBehavior)"/>
|
||||
public enum WindowHintReleaseBehavior
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the release behavior to be used by the context.
|
||||
/// Possible values are one of <see cref="ReleaseBehavior.Any"/>,
|
||||
/// <see cref="ReleaseBehavior.Flush"/> or <see cref="ReleaseBehavior.None"/>.
|
||||
/// If the behavior is <see cref="ReleaseBehavior"/>, the default behavior
|
||||
/// of the context creation API will be used.
|
||||
/// If the behavior is <see cref="ReleaseBehavior.Flush"/>, the pipeline will be flushed
|
||||
/// whenever the context is released from being the current one.
|
||||
/// If the behavior is <see cref="ReleaseBehavior.None"/>, the pipeline will not be flushed on release.
|
||||
/// </summary>
|
||||
ContextReleaseBehavior = 0x00022009,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// WindowHintRobustness.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to set context robustness attribute.
|
||||
/// </summary>
|
||||
/// <seealso cref="GLFW.WindowHint(WindowHintRobustness,Robustness)"/>
|
||||
public enum WindowHintRobustness
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the robustness strategy used by the context.
|
||||
/// This is <see cref="Robustness.LoseContextOnReset"/> or <see cref="Robustness.NoResetNotification"/>
|
||||
/// if the window's context supports robustness, or <see cref="Robustness.NoRobustness"/> otherwise.
|
||||
/// </summary>
|
||||
ContextRobustness = 0x00022005,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Window hints for the WindowHintString function.
|
||||
/// </summary>
|
||||
public enum WindowHintString
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the frame name on Cocoa. On any other platform, this does nothing.
|
||||
/// </summary>
|
||||
CocoaFrameName = 0x00023002,
|
||||
|
||||
/// <summary>
|
||||
/// Sets the class name on X11. On any other platform, this does nothing.
|
||||
/// </summary>
|
||||
X11ClassName = 0x00024001,
|
||||
|
||||
/// <summary>
|
||||
/// Sets the instance name on X11. on any other platform, this does nothing.
|
||||
/// </summary>
|
||||
X11InstanceName = 0x00024002,
|
||||
}
|
||||
}
|
||||
5564
OpenToolkit.GraphicsLibraryFramework/GLFW.cs
Normal file
5564
OpenToolkit.GraphicsLibraryFramework/GLFW.cs
Normal file
File diff suppressed because it is too large
Load Diff
180
OpenToolkit.GraphicsLibraryFramework/GLFWCallbacks.cs
Normal file
180
OpenToolkit.GraphicsLibraryFramework/GLFWCallbacks.cs
Normal file
@@ -0,0 +1,180 @@
|
||||
//
|
||||
// GLFWCallbacks.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Class containing GLFW related callbacks.
|
||||
/// </summary>
|
||||
public static unsafe class GLFWCallbacks
|
||||
{
|
||||
/// <summary>
|
||||
/// The function signature for Unicode character callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="codepoint">The Unicode code point of the character.</param>
|
||||
/// <seealso cref="GLFW.SetCharCallback"/>
|
||||
public delegate void CharCallback(Window* window, uint codepoint);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for Unicode character with modifiers callback functions.
|
||||
/// It is called for each input character, regardless of what modifier keys are held down.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="codepoint">The Unicode code point of the character.</param>
|
||||
/// <param name="modifiers">Bit field describing which modifier keys were held down.</param>
|
||||
/// <seealso cref="GLFW.SetCharModsCallback"/>
|
||||
public delegate void CharModsCallback(Window* window, uint codepoint, KeyModifiers modifiers);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for cursor enter/leave callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="entered"><c>true</c> if the cursor entered the window's client area, or <c>false</c> if it left it.</param>
|
||||
/// <seealso cref="GLFW.SetCursorEnterCallback"/>
|
||||
public delegate void CursorEnterCallback(Window* window, bool entered);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for cursor position callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="x">The new cursor x-coordinate, relative to the left edge of the client area.</param>
|
||||
/// <param name="y">The new cursor y-coordinate, relative to the top edge of the client area.</param>
|
||||
/// <seealso cref="GLFW.SetCursorPosCallback"/>
|
||||
public delegate void CursorPosCallback(Window* window, double x, double y);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for file drop callbacks.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="count">The number of dropped files.</param>
|
||||
/// <param name="paths">The UTF-8 encoded file and/or directory path names.</param>
|
||||
/// <seealso cref="GLFW.SetDropCallback"/>
|
||||
public delegate void DropCallback(Window* window, int count, byte** paths);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for joystick configuration callback functions.
|
||||
/// </summary>
|
||||
/// <param name="joystick">The joystick that was connected or disconnected.</param>
|
||||
/// <param name="state">
|
||||
/// One of <see cref="ConnectedState.Connected"/> or <see cref="ConnectedState.Disconnected"/>.
|
||||
/// </param>
|
||||
/// <seealso cref="GLFW.SetJoystickCallback"/>
|
||||
public delegate void JoystickCallback(int joystick, ConnectedState state);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for keyboard key callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="key">The keyboard key that was pressed or released.</param>
|
||||
/// <param name="scanCode">The system-specific scancode of the key.</param>
|
||||
/// <param name="action">The <see cref="InputAction"/> for that <paramref name="key"/>.</param>
|
||||
/// <param name="mods">Bit field describing which modifier keys were held down.</param>
|
||||
/// <seealso cref="GLFW.SetKeyCallback"/>
|
||||
public delegate void KeyCallback(Window* window, Keys key, int scanCode, InputAction action, KeyModifiers mods);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for mouse button callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="button">The mouse button that was pressed or released.</param>
|
||||
/// <param name="action">One of <see cref="InputAction.Press"/> or <see cref="InputAction.Release"/>.</param>
|
||||
/// <param name="mods">Bit field describing which modifier keys were held down.</param>
|
||||
/// <seealso cref="GLFW.SetMouseButtonCallback"/>
|
||||
public delegate void MouseButtonCallback(Window* window, MouseButton button, InputAction action, KeyModifiers mods); // TODO: Make enums for int params in callback
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for scroll callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that received the event.</param>
|
||||
/// <param name="offsetX">The scroll offset along the x-axis.</param>
|
||||
/// <param name="offsetY">The scroll offset along the y-axis.</param>
|
||||
/// <seealso cref="GLFW.SetScrollCallback"/>
|
||||
public delegate void ScrollCallback(Window* window, double offsetX, double offsetY);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for monitor configuration callback functions.
|
||||
/// </summary>
|
||||
/// <param name="monitor">The monitor that was connected or disconnected.</param>
|
||||
/// <param name="state">
|
||||
/// One <see cref="ConnectedState.Connected"/> of or <see cref="ConnectedState.Disconnected"/>.
|
||||
/// </param>
|
||||
/// <seealso cref="GLFW.SetMonitorCallback"/>
|
||||
public delegate void MonitorCallback(Monitor* monitor, ConnectedState state);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for window close callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that the user attempted to close.</param>
|
||||
/// <seealso cref="GLFW.SetWindowCloseCallback"/>
|
||||
public delegate void WindowCloseCallback(Window* window);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for window focus callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that gained or lost input focus.</param>
|
||||
/// <param name="focused"><c>true</c> if the window was given input focus, or <c>false</c> if it lost it.</param>
|
||||
/// <seealso cref="GLFW.SetWindowFocusCallback"/>
|
||||
public delegate void WindowFocusCallback(Window* window, bool focused);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for window iconify/restore callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that was iconified or restored.</param>
|
||||
/// <param name="iconified"><c>true</c> if the window was iconified(minimized), or <c>false</c> if it was restored.</param>
|
||||
/// <seealso cref="GLFW.SetWindowIconifyCallback"/>
|
||||
public delegate void WindowIconifyCallback(Window* window, bool iconified);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for window position callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that was moved.</param>
|
||||
/// <param name="x">
|
||||
/// The new x-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
|
||||
/// </param>
|
||||
/// <param name="y">
|
||||
/// The new y-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
|
||||
/// </param>
|
||||
/// <seealso cref="GLFW.SetWindowPosCallback"/>
|
||||
public delegate void WindowPosCallback(Window* window, int x, int y);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for window size callback functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that was resized.</param>
|
||||
/// <param name="width">The new width, in screen coordinates, of the window.</param>
|
||||
/// <param name="height">The new height, in screen coordinates, of the window.</param>
|
||||
/// <seealso cref="GLFW.SetWindowSizeCallback"/>
|
||||
public delegate void WindowSizeCallback(Window* window, int width, int height);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for error callback functions.
|
||||
/// </summary>
|
||||
/// <param name="error">An error code.</param>
|
||||
/// <param name="description">A UTF-8 encoded string describing the error.</param>
|
||||
public delegate void ErrorCallback(ErrorCode error, string description);
|
||||
|
||||
/// <summary>
|
||||
/// The function signature for window refresh functions.
|
||||
/// </summary>
|
||||
/// <param name="window">The window that needs to be refreshed.</param>
|
||||
public delegate void WindowRefreshCallback(Window* window);
|
||||
|
||||
/// <summary>
|
||||
/// This is the function pointer type for window content scale callbacks.
|
||||
/// </summary>
|
||||
/// <param name="window">The window whose content scale changed. </param>
|
||||
/// <param name="xscale">The new x-axis content scale of the window. </param>
|
||||
/// <param name="yscale">The new y-axis content scale of the window.</param>
|
||||
/// <seealso cref="GLFW.SetWindowContentScaleCallback"/>
|
||||
public delegate void WindowContentScaleCallback(Window* window, float xscale, float yscale);
|
||||
}
|
||||
}
|
||||
65
OpenToolkit.GraphicsLibraryFramework/GLFWException.cs
Normal file
65
OpenToolkit.GraphicsLibraryFramework/GLFWException.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// GLFWException.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents errors that occur within GLFW.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GLFWException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the underlying GLFW-error code.
|
||||
/// </summary>
|
||||
public ErrorCode ErrorCode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GLFWException"/> class.
|
||||
/// </summary>
|
||||
public GLFWException()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GLFWException"/> class with the specified detailed description.
|
||||
/// </summary>
|
||||
/// <param name="message">A detailed description of the error.</param>
|
||||
public GLFWException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GLFWException"/> class
|
||||
/// with the specified detailed description and GLFW error code.
|
||||
/// </summary>
|
||||
/// <param name="message">A detailed description of the error.</param>
|
||||
/// <param name="errorCode">The GLFW error code causing the exception.</param>
|
||||
public GLFWException(string message, ErrorCode errorCode)
|
||||
: base(message)
|
||||
{
|
||||
ErrorCode = errorCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GLFWException"/> class with the specified detailed description
|
||||
/// and the specified exception.
|
||||
/// </summary>
|
||||
/// <param name="message">A detailed description of the error.</param>
|
||||
/// <param name="innerException">A reference to the inner exception that is the cause of this exception.</param>
|
||||
public GLFWException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
414
OpenToolkit.GraphicsLibraryFramework/GLFWNative.cs
Normal file
414
OpenToolkit.GraphicsLibraryFramework/GLFWNative.cs
Normal file
@@ -0,0 +1,414 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
internal static unsafe class GLFWNative
|
||||
{
|
||||
private const string LibraryName = "glfw3.dll";
|
||||
|
||||
public const int GLFW_TRUE = 1;
|
||||
public const int GLFW_FALSE = 0;
|
||||
|
||||
#if NETCOREAPP
|
||||
static GLFWNative()
|
||||
{
|
||||
// Register DllImport resolver so that the correct dynamic library is loaded on all platforms.
|
||||
// On net472, we rely on Mono's DllMap for this. See the .dll.config file.
|
||||
NativeLibrary.SetDllImportResolver(typeof(GLFWNative).Assembly, (name, assembly, path) =>
|
||||
{
|
||||
// Please keep in sync with what Robust.Shared/DllMapHelper.cs does.
|
||||
|
||||
if (name != "glfw3.dll")
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
string rName = null;
|
||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsFreeBSD()) rName = "libglfw.so.3";
|
||||
else if (OperatingSystem.IsMacOS()) rName = "libglfw.3.dylib";
|
||||
|
||||
if ((rName != null) && NativeLibrary.TryLoad(rName, assembly, path, out var handle))
|
||||
return handle;
|
||||
|
||||
return IntPtr.Zero;
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwInit();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwTerminate();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwInitHint(int hint, int value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetVersion(int* major, int* minor, int* revision);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte* glfwGetVersionString();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern ErrorCode glfwGetError(byte** description);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern Monitor** glfwGetMonitors(int* count);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetMonitorPos(Monitor* monitor, int* x, int* y);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetMonitorPhysicalSize(Monitor* monitor, int* width, int* height);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetMonitorContentScale(Monitor* monitor, float* xscale, float* yscale);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte* glfwGetMonitorName(Monitor* monitor);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetMonitorUserPointer(Monitor* monitor, void* pointer);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void* glfwGetMonitorUserPointer(Monitor* monitor);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern VideoMode* glfwGetVideoModes(Monitor* monitor, int* count);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetGamma(Monitor* monitor, float gamma);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern GammaRamp* glfwGetGammaRamp(Monitor* monitor);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetGammaRamp(Monitor* monitor, GammaRamp* ramp);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwDefaultWindowHints();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHintString(int hint, byte* value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowSizeLimits(Window* window, int minwidth, int minheight, int maxwidth, int maxheight);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowAspectRatio(Window* window, int numer, int denom);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetWindowFrameSize(Window* window, int* left, int* top, int* right, int* bottom);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetWindowContentScale(Window* window, float* xscale, float* yscale);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern float glfwGetWindowOpacity(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowOpacity(Window* window, float opacity);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwRequestWindowAttention(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowAttrib(Window* window, WindowAttributeSetter attrib, int value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwRawMouseMotionSupported();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte* glfwGetKeyName(Keys key, int scancode);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwGetKeyScancode(Keys key);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern InputAction glfwGetKey(Window* window, Keys key);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern InputAction glfwGetMouseButton(Window* window, MouseButton button);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetCursorPos(Window* window, double* xpos, double* ypos);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetCursorPos(Window* window, double xpos, double ypos);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern Cursor* glfwCreateCursor(Image* image, int xhot, int yhot);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern Cursor* glfwCreateStandardCursor(CursorShape shape);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwDestroyCursor(Cursor* cursor);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetCursor(Window* window, Cursor* cursor);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwJoystickPresent(int jid);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern float* glfwGetJoystickAxes(int jid, int* count);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern InputAction* glfwGetJoystickButtons(int jid, int* count);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern JoystickHats* glfwGetJoystickHats(int jid, int* count);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte* glfwGetJoystickName(int jid);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte* glfwGetJoystickGUID(int jid);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetJoystickUserPointer(int jid, void* ptr);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void* glfwGetJoystickUserPointer(int jid);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwJoystickIsGamepad(int jid);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwUpdateGamepadMappings(byte* newMapping);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte* glfwGetGamepadName(int jid);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwGetGamepadState(int jid, GamepadState* state);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern double glfwGetTime();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetTime(double time);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern long glfwGetTimerValue();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern long glfwGetTimerFrequency();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern Window* glfwGetCurrentContext();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSwapBuffers(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwExtensionSupported(byte* extensionName);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwGetProcAddress(byte* procame);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern Window* glfwCreateWindow(int width, int height, byte* title, Monitor* monitor, Window* share);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern Monitor* glfwGetPrimaryMonitor();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwDestroyWindow(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwFocusWindow(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetFramebufferSize(Window* window, int* width, int* height);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern CursorModeValue glfwGetInputMode(Window* window, CursorStateAttribute mode);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwGetInputMode(Window* window, StickyAttributes mode);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwRestoreWindow(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern VideoMode* glfwGetVideoMode(Monitor* monitor);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwGetWindowAttrib(Window* window, WindowAttributeGetter attribute);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetWindowSize(Window* window, int* width, int* height);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwGetWindowPos(Window* window, int* x, int* y);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern Monitor* glfwGetWindowMonitor(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwHideWindow(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwIconifyWindow(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwMakeContextCurrent(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwMaximizeWindow(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwPollEvents();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwPostEmptyEvent();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHint(WindowHintInt hint, int value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHint(WindowHintBool hint, int value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHint(WindowHintClientApi hint, ClientApi value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHint(WindowHintReleaseBehavior hint, ReleaseBehavior value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHint(WindowHintContextApi hint, ContextApi value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHint(WindowHintRobustness hint, Robustness value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWindowHint(WindowHintOpenGlProfile hint, OpenGlProfile value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwWindowShouldClose(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetCharCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetCharModsCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetCursorEnterCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetCursorPosCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetDropCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetErrorCallback(IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetInputMode(Window* window, CursorStateAttribute mode, CursorModeValue value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetInputMode(Window* window, StickyAttributes mode, int value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetJoystickCallback(IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetKeyCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetScrollCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetMonitorCallback(IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetMouseButtonCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetWindowCloseCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetWindowFocusCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowIcon(Window* window, int count, Image* images);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetWindowIconifyCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetWindowContentScaleCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowTitle(Window* window, byte* title);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwShowWindow(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowSize(Window* window, int width, int height);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetWindowSizeCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowShouldClose(Window* window, int value);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowMonitor(Window* window, Monitor* monitor, int x, int y, int width, int height, int refreshRate);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetWindowPos(Window* window, int x, int y);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetWindowPosCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwSetWindowRefreshCallback(Window* window, IntPtr callback);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSwapInterval(int interval);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWaitEvents();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwWaitEventsTimeout(double timeout);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte* glfwGetClipboardString(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void glfwSetClipboardString(Window* window, byte* data);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwVulkanSupported();
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern byte** glfwGetRequiredInstanceExtensions(uint* count);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwGetInstanceProcAddress(VkHandle instance, byte* procName);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwGetPhysicalDevicePresentationSupport(VkHandle instance, VkHandle device, int queueFamily);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern int glfwCreateWindowSurface(VkHandle instance, Window* window, void* allocator, VkHandle surface);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern uint glfwGetX11Window(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwGetX11Display(Window* window);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern IntPtr glfwGetWin32Window(Window* window);
|
||||
}
|
||||
}
|
||||
27
OpenToolkit.GraphicsLibraryFramework/GamepadState.cs
Normal file
27
OpenToolkit.GraphicsLibraryFramework/GamepadState.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// GamepadState.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// This describes the input state of a gamepad.
|
||||
/// </summary>
|
||||
public struct GamepadState
|
||||
{
|
||||
/// <summary>
|
||||
/// State of each of the 15 gamepad buttons, equal to <see cref="InputAction.Press"/> or <see cref="InputAction.Release"/>.
|
||||
/// </summary>
|
||||
public unsafe fixed byte Buttons[15];
|
||||
|
||||
/// <summary>
|
||||
/// State of each of the 6 gamepad axes, ranging from -1.0 to 1.0.
|
||||
/// </summary>
|
||||
public unsafe fixed float Axes[6];
|
||||
}
|
||||
}
|
||||
37
OpenToolkit.GraphicsLibraryFramework/GammaRamp.cs
Normal file
37
OpenToolkit.GraphicsLibraryFramework/GammaRamp.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// GammaRamp.cs
|
||||
//
|
||||
// Copyright (C) 2019 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Gamma ramp for a <see cref="Monitor"/>.
|
||||
/// </summary>
|
||||
public unsafe struct GammaRamp
|
||||
{
|
||||
/// <summary>
|
||||
/// Red components of the gamma ramp.
|
||||
/// </summary>
|
||||
public ushort* Red;
|
||||
|
||||
/// <summary>
|
||||
/// Green components of the gamma ramp.
|
||||
/// </summary>
|
||||
public ushort* Green;
|
||||
|
||||
/// <summary>
|
||||
/// Blue components of the gamma ramp.
|
||||
/// </summary>
|
||||
public ushort* Blue;
|
||||
|
||||
/// <summary>
|
||||
/// Length of the arrays.
|
||||
/// </summary>
|
||||
public uint Size;
|
||||
}
|
||||
}
|
||||
47
OpenToolkit.GraphicsLibraryFramework/Image.cs
Normal file
47
OpenToolkit.GraphicsLibraryFramework/Image.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// Image.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains GLFW Image data.
|
||||
/// </summary>
|
||||
public unsafe struct Image
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Image"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="width">The width of the image in pixels.</param>
|
||||
/// <param name="height">The height of the image in pixels.</param>
|
||||
/// <param name="pixels"><see cref="IntPtr"/> pointing to the RGBA pixel data of the image.</param>
|
||||
public Image(int width, int height, byte* pixels)
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
Pixels = pixels;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The width, in pixels, of this <see cref="Image"/>.
|
||||
/// </summary>
|
||||
public int Width;
|
||||
|
||||
/// <summary>
|
||||
/// The height, in pixels, of this <see cref="Image"/>.
|
||||
/// </summary>
|
||||
public int Height;
|
||||
|
||||
/// <summary>
|
||||
/// A <see cref="byte"/> pointer pointing to the RGBA pixel data.
|
||||
/// </summary>
|
||||
public byte* Pixels;
|
||||
}
|
||||
}
|
||||
23
OpenToolkit.GraphicsLibraryFramework/LICENSE.md
Normal file
23
OpenToolkit.GraphicsLibraryFramework/LICENSE.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# MIT License
|
||||
|
||||
Copyright (c) 2006-2019 Stefanos Apostolopoulos for the Open Toolkit project.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
- The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
#### Third party licenses may be applicable. These have been disclosed in [THIRD_PARTIES.md](THIRD_PARTIES.md)
|
||||
18
OpenToolkit.GraphicsLibraryFramework/Monitor.cs
Normal file
18
OpenToolkit.GraphicsLibraryFramework/Monitor.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Monitor.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Opaque handle to a GLFW monitor.
|
||||
/// </summary>
|
||||
public struct Monitor
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
<SkipRobustAnalyzer>true</SkipRobustAnalyzer>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\MSBuild\Robust.Properties.targets" />
|
||||
</Project>
|
||||
20
OpenToolkit.GraphicsLibraryFramework/THIRD_PARTIES.md
Normal file
20
OpenToolkit.GraphicsLibraryFramework/THIRD_PARTIES.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Third parties
|
||||
|
||||
## AdvancedDLSupport
|
||||
> OpenTK uses AdvancedDLSupport for native interoperability. To enable compatibility with the LGPLv3 License, Firwood has given us a licensing exception.
|
||||
|
||||
* Read the [license grant](AdvancedDLSupport-LICENSE.pdf).
|
||||
* Read the [license summary](Short-LICENSE.md) for an easy-to-understand version.
|
||||
|
||||
## OpenEXR
|
||||
|
||||
> OpenTK.Half offers Half-to-Single and Single-to-Half conversions based on OpenEXR source code, which is covered by the following license:
|
||||
|
||||
Copyright (c) 2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Industrial Light & Magic nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
50
OpenToolkit.GraphicsLibraryFramework/VideoMode.cs
Normal file
50
OpenToolkit.GraphicsLibraryFramework/VideoMode.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// VideoMode.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Replicated handle to a GLFW VideoMode.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct VideoMode
|
||||
{
|
||||
/// <summary>
|
||||
/// The width, in screen coordinates, of the <see cref="VideoMode"/>.
|
||||
/// </summary>
|
||||
public int Width;
|
||||
|
||||
/// <summary>
|
||||
/// The height, in screen coordinates, of the <see cref="VideoMode"/>.
|
||||
/// </summary>
|
||||
public int Height;
|
||||
|
||||
/// <summary>
|
||||
/// The bit depth of the red channel of the <see cref="VideoMode"/>.
|
||||
/// </summary>
|
||||
public int RedBits;
|
||||
|
||||
/// <summary>
|
||||
/// The bit depth of the green channel of the <see cref="VideoMode"/>.
|
||||
/// </summary>
|
||||
public int GreenBits;
|
||||
|
||||
/// <summary>
|
||||
/// The bit depth of the blue channel of the <see cref="VideoMode"/>.
|
||||
/// </summary>
|
||||
public int BlueBits;
|
||||
|
||||
/// <summary>
|
||||
/// The refresh rate, in Hz, of the <see cref="VideoMode"/>.
|
||||
/// </summary>
|
||||
public int RefreshRate;
|
||||
}
|
||||
}
|
||||
29
OpenToolkit.GraphicsLibraryFramework/VkHandle.cs
Normal file
29
OpenToolkit.GraphicsLibraryFramework/VkHandle.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// A handle to a Vulkan object.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct VkHandle
|
||||
{
|
||||
/// <summary>
|
||||
/// The actual value of the Vulkan handle.
|
||||
/// </summary>
|
||||
public IntPtr Handle;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="VkHandle"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="handle">
|
||||
/// The native Vulkan handle.
|
||||
/// This is NOT a pointer to a field containing the handle, this is the actual handle itself.
|
||||
/// </param>
|
||||
public VkHandle(IntPtr handle)
|
||||
{
|
||||
Handle = handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
OpenToolkit.GraphicsLibraryFramework/Window.cs
Normal file
18
OpenToolkit.GraphicsLibraryFramework/Window.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Window.cs
|
||||
//
|
||||
// Copyright (C) 2018 OpenTK
|
||||
//
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
namespace OpenToolkit.GraphicsLibraryFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Opaque handle to a GLFW window.
|
||||
/// </summary>
|
||||
public struct Window
|
||||
{
|
||||
}
|
||||
}
|
||||
988
RELEASE-NOTES.md
988
RELEASE-NOTES.md
@@ -54,994 +54,10 @@ END TEMPLATE-->
|
||||
*None yet*
|
||||
|
||||
|
||||
## 270.1.0
|
||||
## 248.0.3-source-gen-debug
|
||||
|
||||
### New features
|
||||
|
||||
* macOS: there is now tooling in place to build a content start binary to an app bundle in the development environment. This is a prerequisite for WebView support.
|
||||
* Added override of `SharedPhysicsSystem.GetHardCollision` that takes a sole component.
|
||||
* Added more parameters to `OutputPanel.AddMessage` & overloads.
|
||||
|
||||
### Other
|
||||
|
||||
* `ILocalizationManager.GetString` now logs a warning when failing to find a string. In cases where you expect this to happen use `TryGetString` instead.
|
||||
* `run_server.bat` in published servers now `cd`s to the correct directory.
|
||||
* `IRobustRandom.GetRandom()` is now obsolete. This API should've never existed.
|
||||
* Started work on macOS support for WebView. This is not complete yet and will not work out of the box.
|
||||
* Re-enable GPU compositing as the proper solution to the resizing bug has been found.
|
||||
* `RichTextLabel.Text` sets all tags as allowed again, unlike `SetMessage()`.
|
||||
* `EntProtoId<T>.TryGet` no longer throws if the prototype ID is invalid.
|
||||
|
||||
|
||||
## 270.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Fixed `IClydeWindowInternal` erroneously being public.
|
||||
* Added a new `[NotContentImplementable]` attribute and made many interfaces in the engine have it. This attribute marks that we may add members to these interfaces in the future, so content should not implement them.
|
||||
* Removed unused `IRenderableComponent`, `IRand`, and `IPlayerInput` interfaces.
|
||||
|
||||
### New features
|
||||
|
||||
* Added `IsUiOpen` and `IsAnyUiOpen` to `SharedUserInterfaceSystem`. (was in previous engine release, missed in changelog)
|
||||
* Added `game.time_scale` CVar.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix a fake error being logged every time when setting the clipboard.
|
||||
* Fixed audio loading by reverting dependency update to `VorbisPizza`.
|
||||
|
||||
### Other
|
||||
|
||||
* The size of the serializer string map is now logged.
|
||||
|
||||
|
||||
## 269.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed transitive project dependencies in content triggering "no direct project reference" detection.
|
||||
|
||||
|
||||
## 269.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* The project now targets .NET 10. You will have to install the new runtime on game servers when updating.
|
||||
* We have adopted a new "solution management" system for games.
|
||||
* This enables us to add new projects to RT (e.g. split stuff up) without causing breaking changes.
|
||||
* Games must move to `.slnx` solutions and run `dotnet run --project ./RobustToolbox/Tools/Robust.SolutionGen/ -- update` after updating RT. This should be done after *every* RT feature update.
|
||||
* Games may no longer directly reference RT projects. To depend on these, import the various `.props` files in the `Imports/` folder.
|
||||
* We've tidied up all the transitive dependencies RT projects used to expose, meaning packages used by *Robust* aren't automatically visible to content projects anymore. You will likely have both accidental usages that are now erroring, or valid usages that you will need to add a `<PackageReference>` for.
|
||||
* `OutputPanel` and `RichTextLabel` now set a default set of "safe" markup tags when using overloads that don't take in a `Type[]? allowedTags`. These tags are formatting only, so dangerous stuff like `[cmdlink]` is blocked by default.
|
||||
* The constructor of `EntityQuery<TComp1>` has been made internal.
|
||||
|
||||
### New features
|
||||
|
||||
* Added `ExtensionMarkerAttribute`, used by the new C# 14 extension members, for the sandbox.
|
||||
* Added `CommandWhenUIFocused` property to `Command` keybinds, to make them not fire when a UI control is focused.
|
||||
* Startup logging now lists total memory and AVX10 intrinsics.
|
||||
* Added new `FormattedString` type that represents a plain `string` that has markup formatting.
|
||||
* Added an analyzer to detect redundant `[Prototype("foobar")]` strings.
|
||||
* Added an analyzer to detect `DirtyField()` calls with incorrect field names.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed `FormattedMessage` not escaping plain text content properly with `.ToMarkup()`.
|
||||
* Fixed wrapping on inline rich text controls like links.
|
||||
* Fixed some native libs getting packaged for Linux clients when they shouldn't.
|
||||
* Fixed `TilesEnumerator` being able to stack overflow due to the recursive implementation.
|
||||
* Fixed some typos in `EntityDeserializer` log messages.
|
||||
* Fixed WebView control resizing being fucky.
|
||||
* Fixed `DataDefinitionAnalyzer` to recognize `[MeansDataDefinition]` attributes.
|
||||
|
||||
### Other
|
||||
|
||||
* Updated NuGet package dependencies.
|
||||
* Prototype loading now tries to do some basic interning to avoid duplicate string objects being stored. This saves some memory.
|
||||
* Avoid redundant texture uploads on WebView controls.
|
||||
* Updated and added a lot of documentation to various parts of the engine.
|
||||
* Moved to `.slnx`, and changed the default marker filename for hot reload to `.slnx` too.
|
||||
* Removed GLFW windowing implementation.
|
||||
* `EntityQuery.Resolve` now logs more info on error.
|
||||
* Disabled some unnecessary .NET SDK source generators that slowed down build.
|
||||
* Removed kdialog/nfd file dialog implementation.
|
||||
|
||||
### Internal
|
||||
|
||||
* Added a prototype `AspectRatioPanel` control. Not stabilized yet.
|
||||
* Added gay colors to uitest.
|
||||
* "Test content master" RT workflow now replaces `global.json` in SS14.
|
||||
* Updated `Robust.LoaderApi` and `NetSerializer` to .NET 10.
|
||||
* Fixed all the configurations in `RobustToolbox.sln`.
|
||||
* Split up `Robust.UnitTesting` into many more projects.
|
||||
* Internal warning fixes.
|
||||
|
||||
|
||||
## 268.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Added `IReplayFileWriter.WriteYaml()`, for writing yaml documents to a replay zip file.
|
||||
* Added Caps Lock as a proper bindable key.
|
||||
* Added `IParallelBulkRobustJob` as an alternative to `IParallelRobustJob`, taking ranges instead of indices.
|
||||
* Allow content to override `ProcessStream` and `GetOcclusion` in `AudioSystem`
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* `ActorComponent` now has the `UnsavedComponentAttribute`
|
||||
* Previously it was unintentionally get serialized to yaml, which could result in NREs when deserializing.
|
||||
* Don't spam error messages on startup trying to draw splash logos for projects that don't have one.
|
||||
* Fix `SpriteSystem.LayerExists` saying that layer 0 is invalid.
|
||||
* Fix `ButtonGroup`s unpressing buttons in an edge case with UI rebuilding.
|
||||
* Added `CreatedTime` to `NetUserData`.
|
||||
* Fix loading of `WebView`.
|
||||
|
||||
### Other
|
||||
|
||||
* Reverted undocumented change from 268.0.0 which obsoleted many `IoCManager` methods.
|
||||
* Fix .NET 10 serializer compatibility of `BitArray`. (backported to older engines).
|
||||
* Revert performance change to physics due to issues (double-buffered contact events).
|
||||
* Audio entities are marked as `HideSpawnMenu` now.
|
||||
* Make `SharedAudioSystem.Stop` not do nothing when the current tick has already been predicted.
|
||||
* Warning cleanup.
|
||||
|
||||
### Internal
|
||||
|
||||
* Consolidated and updated physics benchmarks.
|
||||
|
||||
|
||||
## 268.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Events that are raised via `IEventBus.RaiseComponentEvent()` now **must** be annotated with the `ComponentEventAttribute`.
|
||||
* By default, events annotated with this attribute can **only** be raised via `IEventBus.RaiseComponentEvent()`. This can be configured via `ComponentEventAttribute.Exclusive`
|
||||
* StartCollide and EndCollide events are now buffered until the end of physics substeps instead of being raised during the CollideContacts step. EndCollide events are double-buffered and any new ones raised while the events are being dispatched will now go out on the next tick / substep.
|
||||
|
||||
### New features
|
||||
|
||||
* Added `IUserInterfaceManager.ControlSawmill` and `Control.Log` properties so that controls can easily use logging without using static methods.
|
||||
|
||||
|
||||
## 267.4.0
|
||||
|
||||
### New features
|
||||
|
||||
* Added two new custom yaml serializers `CustomListSerializer` and `CustomArraySerializer`.
|
||||
* CVars defined in `[CVarDefs]` can now be private or internal.
|
||||
* Added config rollback system to `IConfigurationManager`. This enables CVars to be snapshot and rolled back, even in the event of client crash.
|
||||
* `OptionButton` now has a `Filterable` property that gives it a text box to filter options.
|
||||
* Added `FontTagHijackHolder` to replace fonts resolved by `FontTag`.
|
||||
* Sandbox:
|
||||
* Exposed `System.Reflection.Metadata.MetadataUpdateHandlerAttribute`.
|
||||
* Exposed more overloads on `StringBuilder`.
|
||||
* The engine can now load system fonts.
|
||||
* At the moment only available on Windows.
|
||||
* See `ISystemFontManager` for API.
|
||||
* The client now display a loading screen during startup.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix `Menu` and `NumpadDecimal` key codes on SDL3.
|
||||
* client-side predicted entity deletion ( `EntityManager.PredictedQueueDeleteEntity`) now behaves more like it does on the server. In particular, entities will be deleted on the same tick after all system have been updated. Previously, it would process deletions at the beginning of the next tick.
|
||||
* Fix modifying `Label.FontOverride` not causing a layout update.
|
||||
* Controls created by rich-text tags now get arranged to a proper size.
|
||||
* Fix `OutputPanel` scrollbar breaking if a style update changes the font size.
|
||||
|
||||
### Other
|
||||
|
||||
* ComponentNameSerializer will now ignore any components that have been ignored via `IComponentFactory.RegisterIgnore`.
|
||||
* Add pure to some SharedTransformSystem methods.
|
||||
* Significantly optimised collision detection in SharedBroadphaseSystem.
|
||||
* `Control.Stylesheet` does not do any work if assigning the value it already has.
|
||||
* XAML hot reload now JITs UIs when first opened rather than doing every single one at client startup. This reduces dev startup overhead significantly and probably helps with memory usage too.
|
||||
|
||||
### Internal
|
||||
|
||||
* The `dmetamem` command now sorts its output, and doesn't output to log anymore to avoid output interleaving.
|
||||
|
||||
|
||||
## 267.3.0
|
||||
|
||||
### New features
|
||||
|
||||
* Sandbox:
|
||||
* Added `System.DateOnly` and `System.TimeOnly`.
|
||||
* `MapId`, `MapCoordinates`, and `EntityCoordinates` are now yaml serialisable
|
||||
* The base component tree lookup system has new methods including several new `QueryAabb()` overloads that take in a collection and various new `IntersectRay()` overloads that should replace `IntersectRayWithPredicate`.
|
||||
* Added `OccluderSystem.InRangeUnoccluded()` for checking for occluders that lie between two points.
|
||||
* `LocalizedCommands` now pass the command name as an argument to the localized help text.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed `MapLoaderSystem.SerializeEntitiesRecursive()` not properly serialising when given multiple root entities (e.g., multiple maps)
|
||||
* Fixed yaml hot reloading throwing invalid path exceptions.
|
||||
* The `EntityManager.CreateEntityUninitialized` overload that uses MapCoordinates now actually attaches entities to a grid if one is present at those coordinates, as was stated in it's documentation.
|
||||
* Fixed physics joint relays not being properly updated when an entity is removed from a container.
|
||||
|
||||
### Other
|
||||
|
||||
* Updated natives again to attempt to fix issues caused by the previous update.
|
||||
|
||||
|
||||
## 267.2.1
|
||||
|
||||
|
||||
## 267.2.0
|
||||
|
||||
### New features
|
||||
|
||||
* Sprites and Sprite layers have a new `Loop` data field that can be set to false to automatically pause animations once they have finished.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed `CollectionExtensions.TryGetValue` throwing an exception when given a negative list index.
|
||||
* Fixed `EntityManager.PredictedQueueDeleteEntity()` not deferring changes for networked entities until the end of the tick.
|
||||
* Fixed `EntityManager.IsQueuedForDeletion` not returning true foe entities getting deleted via `PredictedQueueDeleteEntity()`
|
||||
|
||||
### Other
|
||||
|
||||
* `IResourceManager.GetContentRoots()` has been obsoleted and returns no more results.
|
||||
|
||||
### Internal
|
||||
|
||||
* `IResourceManager.GetContentRoots()` has been replaced with a similar method on `IResourceManagerInternal`. This new method returns `string`s instead of `ResPath`s, and usage code has been updated to use these paths correctly.
|
||||
|
||||
|
||||
## 267.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Animation:
|
||||
* `AnimationTrackProperty.KeyFrame` can now have easings functions applied.
|
||||
* Graphics:
|
||||
* `PointLightComponent` now has two fields, `falloff` and `curveFactor`, for controlling light falloff and the shape of the light attenuation curve.
|
||||
* `IClydeViewport` now has an `Id` and `ClearCachedResources` event. Together, these allow you to properly cache rendering resources per viewport.
|
||||
* Miscellaneous:
|
||||
* Added `display.max_fps` CVar.
|
||||
* Added `IGameTiming.FrameStartTime`.
|
||||
* Sandbox:
|
||||
* Added `System.WeakReference<T>`.
|
||||
* Added `SpaceWizards.Sodium.CryptoGenericHashBlake2B.Hash()`.
|
||||
* Added `System.Globalization.UnicodeCategory`.
|
||||
* Serialization:
|
||||
* Added a new entity yaml deserialization option (`SerializationOptions.EntityExceptionBehaviour`) that can optionally make deserialization more exception tolerant.
|
||||
* Tooling:
|
||||
* `devwindow` now has a tab listing active `IRenderTarget`s, allowing insight into resource consumption.
|
||||
* `loadgrid` now creates a map if passed an invalid map ID.
|
||||
* Added game version information to F3 overlay.
|
||||
* Added completions to more map commands.
|
||||
* UI system:
|
||||
* `Control.OrderedChildCollection` (gotten from `.Children`) now implements `IReadOnlyList<Control>`, allowing it to be indexed directly.
|
||||
* Added `WrapContainer` control. This lays out multiple elements along an axis, wrapping them if there's not enough space. It comes with many options and can handle multiple axes.
|
||||
* Popups/modals now work in secondary windows. This entails putting roots for these on each UI root.
|
||||
* If you are not using `OSWindow` and are instead creating secondary windows manually, you need to call `WindowRoot.CreateRootControls()` manually for this to work.
|
||||
* Added `Axis` enum, `IAxisImplementation` interface and axis implementations. These allow writing general-purpose UI layout code that can work on multiple axis at once.
|
||||
* WebView:
|
||||
* Added `web.remote_debug_port` CVar to change Chromium's remote debug port.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Audio:
|
||||
* Fix audio occlusion & velocity being calculated with the audio entity instead of the source entity.
|
||||
* Bound UI:
|
||||
* Try to fix an assert related to `UserInterfaceComponent` delta states.
|
||||
* Configuration:
|
||||
* The client no longer tries to send `CLIENT | REPLICATED` CVars when not connected to a server. This could cause test failures.
|
||||
* Math:
|
||||
* Fixed `Matrix3Helpers.TransformBounds()` returning an incorrect result. Now it effectively behaves like `Matrix3Helpers.TransformBox()` and has been marked as obsolete.
|
||||
* Physics:
|
||||
* Work around an undiagnosed crash processing entities without parents.
|
||||
* Serialization:
|
||||
* Fix `[DataRecord]`s with computed get-only properties.
|
||||
* Resources:
|
||||
* Fix some edge case broken path joining in `DirLoader` and `WritableDirProvider`.
|
||||
* Tests:
|
||||
* Fix `PlacementManager.CurrentMousePosition` in integration tests.
|
||||
* UI system:
|
||||
* Animations for the debug console and scrolling are no longer framerate dependent.
|
||||
* Fix `OutputPanel.SetMessage` triggering a scrolling animation when editing messages other than the last one.
|
||||
* Fix word wrapping with two-`char` runes in `RichTextLabel` and `OutputPanel`.
|
||||
* WebView:
|
||||
* Multiple clients with WebView can now run at the same time, thanks to better CEF cache management.
|
||||
|
||||
### Other
|
||||
|
||||
* Audio:
|
||||
* Improved error logging for invalid file names in `SharedAudioSystem`.
|
||||
* Configuration:
|
||||
* Fix crash if more than 255 `REPLICATED` CVars exist. Also increased the max size of the CVar replication message.
|
||||
* Entities:
|
||||
* Transform:
|
||||
* `AnchorEntity` logs instead of using an assert for invalid arguments.
|
||||
* Containers:
|
||||
* `SharedContainerSystem.CleanContainer` now uses `PredictedDel()` instead.
|
||||
* Networking:
|
||||
* The client now logs an error when attempting to send a network message without server connection. Previously, it would be silently dropped.
|
||||
* `net.interp` and `net.buffer_size` CVars are now `REPLICATED`.
|
||||
* Graphics:
|
||||
* The function used for pointlight attenuation has been modified to be c1 continuous as opposed to simply c0 continuous, resulting in smoother boundary behavior.
|
||||
* RSI validator no longer allows empty (`""`) state names.
|
||||
* Packaging:
|
||||
* Server packaging now excludes all files in the `Audio/` directory.
|
||||
* Server packaging now excludes engine resources `EngineFonts/` and `Midi/`.
|
||||
* ACZ explicitly specifies manifest charset as UTF-8.
|
||||
* Serialization:
|
||||
* `CurTime`-relative `TimeSpan` values that are `MaxValue` now deserialize without overflow.
|
||||
* `SpriteSpecifier.Texture` will now fail to validate if the path is inside a `.rsi`. Use RSI sprite specifiers instead.
|
||||
* Resources:
|
||||
* `IWritableDirProvider.RootDir` is now null on clients.
|
||||
* WebView:
|
||||
* CEF cache is no longer in the content-accessible user data directory.
|
||||
|
||||
### Internal
|
||||
|
||||
* Added some debug commands for debugging viewport resource management: `vp_clear_all_cached` & `vp_test_finalize`
|
||||
* `uitest` command now supports command argument for tab selection, like `uitest2`.
|
||||
* Rewrote `BoxContainer` implementation to make use of new axis system.
|
||||
* Moved `uitest2` and `devwindow` to use the `OSWindow` control.
|
||||
* SDL3 binding has been moved to `SpaceWizards.Sdl` NuGet package.
|
||||
* `dmetamem` command has been moved from `DEBUG` to `TOOLS`.
|
||||
* Consolidate `AttachToGridOrMap` with `TryGetMapOrGridCoordinates`.
|
||||
* Secondary window render targets have clear names specified.
|
||||
* Updated `SpaceWizards.NFluidsynth` to `0.2.2`.
|
||||
* `Robust.Client.WebView.Cef.Program` is now internal.
|
||||
* `download_manifest_file.py` script in repo now always decodes as UTF-8 correctly.
|
||||
* Added a new debug assert to game state processing.
|
||||
|
||||
## 267.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* When a player disconnects, the relevant callbacks are now fired *after* removing the channel from `INetManager`.
|
||||
|
||||
### New features
|
||||
|
||||
* Engine builds are now published for ARM64 & FreeBSD.
|
||||
* CPU model names are now detected on Windows & Linux ARM64.
|
||||
* Toolshed's `spawn:in` command now works on entities without `Physics` component.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* SDL3 windowing backend fixes:
|
||||
* Avoid macOS freezes with multiple windows.
|
||||
* Fix macOS rendering breaking when closing secondary windows.
|
||||
* File dialogs properly associate parent windows.
|
||||
* Fix IME positions not working with UI scaling properly.
|
||||
* Properly specify library names for loading native library.
|
||||
|
||||
* WinBit threads don't permanently stay stuck when their window closes.
|
||||
* Checking for the "`null`" literal in serialization is now culture invariant.
|
||||
|
||||
### Other
|
||||
|
||||
* Compat mode on the client now defaults to on for Windows Snapdragon devices, to work around driver bugs.
|
||||
* Update various libraries & natives. This enables out-of-the-box ARM64 support on all platforms and is a long-overdue modernization.
|
||||
* Key name displays now use proper Unicode symbols for macOS ⌥ and ⌘.
|
||||
* Automated CI for RobustToolbox runs on macOS again.
|
||||
* Autocompletions for `ProtoId<T>` in Toolshed now use `PrototypeIdsLimited` instead of arbitrarily cutting out if more than 256 of a prototype exists.
|
||||
|
||||
|
||||
## 266.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* A new analyzer has been added that will error if you attempt to subscribe to `AfterAutoHandleStateEvent` on a
|
||||
component that doesn't have the `AutoGenerateComponentState` attribute, or doesn't have the first argument of that
|
||||
attribute set to `true`. In most cases you will want to set said argument to `true`.
|
||||
* The fields on `AutoGenerateComponentStateAttribute` are now `readonly`. Setting these directly (instead of using the constructor arguments) never worked in the first place, so this change only catches existing programming errors.
|
||||
* When a player disconnects, `ISharedPlayerManager.PlayerStatusChanged` is now fired *after* removing the session from the `Sessions` list.
|
||||
* `.rsi` files are now compacted into individual `.rsic` files on packaging. This should significantly reduce file count & improve performance all over release builds, but breaks the ability to access `.png` files into RSIs directly. To avoid this, `"rsic": false` can be specified in the RSI's JSON metadata.
|
||||
* The `scale` command has been removed, with the intent of it being moved to content instead.
|
||||
|
||||
### New features
|
||||
|
||||
* ViewVariables editors for `ProtoId` fields now have a Select button which opens a window listing all available prototypes of the appropriate type.
|
||||
* added **IConfigurationManager**.*SubscribeMultiple* ext. method to provide simpler way to unsubscribe from multiple cvar at once
|
||||
* Added `SharedMapSystem.QueueDeleteMap`, which deletes a map with the specified MapId in the next tick.
|
||||
* Added generic version of `ComponentRegistry.TryGetComponent`.
|
||||
* `AttributeHelper.HasAttribute` has had an overload's type signature loosened from `INamedTypeSymbol` to `ITypeSymbol`.
|
||||
* Errors are now logged when sending messages to disconnected `INetChannel`s.
|
||||
* Warnings are now logged if sending a message via Lidgren failed for some reason.
|
||||
* `.yml` and `.ftl` files in the same directory are now concatenated onto each other, to reduce file count in packaged builds. This is done through the new `AssetPassMergeTextDirectories` pass.
|
||||
* Added `System.Linq.ImmutableArrayExtensions` to sandbox.
|
||||
* `ImmutableDictionary<TKey, TValue>` and `ImmutableHashSet<T>` can now be network serialized.
|
||||
* `[AutoPausedField]` now works on fields of type `Dictionary<TKey, TimeSpan>`.
|
||||
* `[NotYamlSerializable]` analyzer now detects nullable fields of the not-serializable type.
|
||||
* `ItemList` items can now have a scale applied for the icon.
|
||||
* Added new OS mouse cursor shapes for the SDL3 backend. These are not available on the GLFW backend.
|
||||
* Added `IMidiRenderer.MinVolume` to scale the volume of MIDI notes.
|
||||
* Added `SharedPhysicsSystem.ScaleFixtures`, to apply the physics-only changes of the prior `scale` command.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* `LayoutContainer.SetMarginsPreset` and `SetAnchorAndMarginPreset` now correctly use the provided control's top anchor when calculating the margins for its presets; it previously used the bottom anchor instead. This may result in a few UI differences, by a few pixels at most.
|
||||
* `IConfigurationManager` no longer logs a warning when saving configuration in an integration test.
|
||||
* Fixed impossible-to-source `ChannelClosedException`s when sending some net messages to disconnected `INetChannel`s.
|
||||
* Fixed an edge case causing some color values to throw an error in `ColorNaming`.
|
||||
* Fresh builds from specific projects should no longer cause errors related to `Robust.Client.Injectors` not being found.
|
||||
* Stopped errors getting logged about `NoteOff` and `NoteOn` operations failing in MIDI.
|
||||
* Fixed MIDI players not resuming properly when re-entering PVS range.
|
||||
|
||||
### Other
|
||||
|
||||
* Updated ImageSharp to 3.1.11 to stop the warning about a DoS vulnerability.
|
||||
* Prototype YAML documents that are completely empty are now skipped by the prototype loader. Previously they would cause a load error for the whole file.
|
||||
* `TileSpawnWindow` can now be localized.
|
||||
* `BaseWindow` uses the new mouse cursor shapes for diagonal resizing.
|
||||
* `NFluidsynth` has been updated to 0.2.0
|
||||
|
||||
### Internal
|
||||
|
||||
* Added `uitest` tab for standard mouse cursor shapes.
|
||||
|
||||
|
||||
## 265.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* More members in `IntegrationInstance` now enforce that the instance is idle before accessing it.
|
||||
* `Prototype.ValidateDirectory` now requires that prototype IDs have no spaces or periods in them.
|
||||
* `IPrototypeManager.TryIndex` no longer logs errors unless using the overload with an optional parameter. Use `Resolve()` instead if error logging is desired.
|
||||
* `LocalizedCommands` now has a `Loc` property that refers to `LocalizationManager`. This can cause compile failures if you have static methods in child types that referenced static `Loc`.
|
||||
* `[AutoGenerateComponentState]` now works on parent members for inherited classes. This can cause compile failures in certain formerly silently broken cases with overriden properties.
|
||||
* `Vector3`, `Vector4`, `Quaternion`, and `Matrix4` have been removed from `Robust.Shared.Maths`. Use the `System.Numerics` types instead.
|
||||
|
||||
### New features
|
||||
|
||||
* `RobustClientPackaging.WriteClientResources()` and `RobustServerPackaging.WriteServerResources()` now have an overload taking in a set of things to ignore in the content resources directory.
|
||||
* Added `IPrototypeManager.Resolve()`, which logs an error if the resolved prototype does not exist. This is effectively the previous (but not original) default behavior of `IPrototypeManager.TryIndex`.
|
||||
* There's now a ViewVariables property editor for tuples.
|
||||
* Added `ColorNaming` helper functions for getting textual descriptions of color values.
|
||||
* Added Oklab/Oklch conversion functions for `Color`.
|
||||
* `ColorSelectorSliders` now displays textual descriptions of color values.
|
||||
* Added `TimeSpanExt.TryTimeSpan` to parse `TimeSpan`s with the `1.5h` format available in YAML.
|
||||
* Added `ITestContextLike` and related classes to allow controlling pooled integration instances better.
|
||||
* `EntProtoId` VV prop editors now don't allow setting invalid prototype IDs, inline with `ProtoId<T>`.
|
||||
* Custom VV controls can now be registered using `IViewVariableControlFactory`.
|
||||
* The entity spawn window now shows all placement modes registered with `IPlacementManager`.
|
||||
* Added `VectorHelpers.InterpolateCubic` for `System.Numerics` `Vector3` and `Vector4`.
|
||||
* Added deconstruct helpers for `System.Numerics` `Vector3` and `Vector4`.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Pooled integration instances returned by `RobustIntegrationTest` are now treated as non-idle, for consistency with non-pooled startups.
|
||||
* `SharedAudioSystem.SetState` no longer calls `DirtyField` on `PlaybackPosition`, an unnetworked field.
|
||||
* Fix loading texture files from the root directory.
|
||||
* Fix integration test pooling leaking non-reusable instances.
|
||||
* Fix multiple bugs where VV displayed the wrong property editor for remote values.
|
||||
* VV displays group headings again in member list.
|
||||
* Fix a stack overflow that could occur with `ColorSelectorSliders`.
|
||||
* `MidiRenderer` now properly handles `NoteOn` events with 0 velocity (which should actually be treated as `NoteOff` events).
|
||||
|
||||
### Other
|
||||
|
||||
* The debug assert for `RobustRandom.Next(TimeSpan, TimeSpan)` now allows for the two arguments to be equal.
|
||||
* The configuration system will now report an error instead of warning if it fails to load the config file.
|
||||
* Members in `IntegrationInstance` that enforce the instance is idle now always allow access from the instance's thread (e.g. from a callback).
|
||||
* `IPrototypeManager` methods now have `[ForbidLiteral]` where appropriate.
|
||||
* Performance improvements to physics system.
|
||||
* `[ValidatePrototypeIdAttribute]` has been marked as obsolete.
|
||||
* `ParallelManager` no longer cuts out exception information for caught job exceptions.
|
||||
* Improved logging for PVS uninitialized/deleted entity errors.
|
||||
|
||||
### Internal
|
||||
|
||||
* General code & warning cleanup.
|
||||
* Fix `VisibilityTest` being unreliable.
|
||||
* `ColorSelectorSliders` has been internally refactored.
|
||||
* Added CI workflows that test all RT build configurations.
|
||||
|
||||
## 264.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `IPrototypeManager.Index(Type kind, string id)` now throws `UnknownPrototypeException` instead of `KeyNotFoundException`, for consistency with `IPrototypeManager.Index<T>`.
|
||||
|
||||
### New features
|
||||
|
||||
* Types can now implement the new interface `IRobustCloneable<T>` to be cloned by the component state source generator.
|
||||
* Added extra Roslyn Analyzers to detect some misuse of prototypes:
|
||||
* Network serializing prototypes (tagging them with `[Serializable, NetSerializable]`).
|
||||
* Constructing new instances of prototypes directly.
|
||||
* Add `PrototypeManagerExt.Index` helper function that takes a nullable `ProtoId<T>`, returning null if the ID is null.
|
||||
* Added an `AlwaysActive` field to `WebViewControl` to make a browser window active even when not in the UI tree.
|
||||
* Made some common dependencies accessible through `IPlacementManager`.
|
||||
* Added a new `GENITIVE()` localization helper function, which is useful for certain languages.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Sprite scale is now correctly applied to sprite boundaries in `SpriteSystem.GetLocalBounds`.
|
||||
* Fixed documentation for `IPrototypeManager.Index<T>` stating that `KeyNotFoundException` gets thrown, when in actuality `UnknownPrototypeException` gets thrown.
|
||||
|
||||
### Other
|
||||
|
||||
* More tiny optimizations to `DataDefinitionAnalyzer`.
|
||||
* NetSerializer has been updated. On debug, it will now report *where* a type that can't be serialized is referenced from.
|
||||
|
||||
### Internal
|
||||
|
||||
* Minor internal code cleanup.
|
||||
|
||||
|
||||
## 263.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Fully removed some non-`Entity<T>` container methods.
|
||||
|
||||
### New features
|
||||
|
||||
* `IMidiRenderer.LoadSoundfont` has been split into `LoadSoundfontResource` and `LoadSoundfontUser`, the original now being deprecated.
|
||||
* Client command execution now properly catches errors instead of letting them bubble up through the input stack.
|
||||
* Added `CompletionHelper.PrototypeIdsLimited` API to allow commands to autocomplete entity prototype IDs.
|
||||
* Added `spawn:in` Toolshed command.
|
||||
* Added `MapLoaderSystem.TryLoadGeneric` overload to load from a `Stream`.
|
||||
* Added `OutputPanel.GetMessage()` and `OutputPanel.SetMessage()` to allow replacing individual messages.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed debug asserts when using MIDI on Windows.
|
||||
* Fixed an error getting logged on startup on macOS related to window icons.
|
||||
* `CC-BY-NC-ND-4.0` is now a valid license for the RGA validator.
|
||||
* Fixed `TabContainer.CurrentTab` clamping against the wrong value.
|
||||
* Fix culture-based parsing in `TimespanSerializer`.
|
||||
* Fixed grid rendering blowing up on tile IDs that aren't registered.
|
||||
* Fixed debug assert when loading MIDI soundfonts on Windows.
|
||||
* Make `ColorSelectorSliders` properly update the dropdown when changing `SelectorType`.
|
||||
* Fixed `tpto` allowing teleports to oneself, thereby causing them to be deleted.
|
||||
* Fix OpenAL extensions being requested incorrectly, causing an error on macOS.
|
||||
* Fixed horizontal measuring of markup controls in rich text.
|
||||
|
||||
### Other
|
||||
|
||||
* Improved logging for some audio entity errors.
|
||||
* Avoided more server stutters when using `csci`.
|
||||
* Improved physics performance.
|
||||
* Made various localization functions like `GENDER()` not throw if passed a string instead of an `EntityUid`.
|
||||
* The generic clause on `EntitySystem.AddComp<T>` has been changed to `IComponent` (from `Component`) for consistency with `IEntityManager.AddComponent<T>`.
|
||||
* `DataDefinitionAnalyzer` has been optimized somewhat.
|
||||
* Improved assert logging error message when static data fields are encountered.
|
||||
|
||||
### Internal
|
||||
|
||||
* Warning cleanup.
|
||||
* Added more tests for `DataDefinitionAnalyzer`.
|
||||
* Consistently use `EntitySystem` proxy methods in engine.
|
||||
|
||||
|
||||
## 262.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Toolshed commands will now validate that each non-generic command argument is parseable (i.e., has a corresponding type parser). This check can be disabled by explicitly marking the argument as unparseable via `CommandArgumentAttribute.Unparseable`.
|
||||
|
||||
### New features
|
||||
|
||||
* `ToolshedManager.TryParse` now also supports nullable value types.
|
||||
* Add an ignoredComponents arg to IsDefault.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix `SpriteComponent.Layer.Visible` setter not marking a sprite's bounding box as dirty.
|
||||
* The audio params in the passed SoundSpecifier for PlayStatic(SoundSpecifier, Filter, ...) will now be used as a default like other PlayStatic overrides.
|
||||
* Fix windows not saving their positions correctly when their x position is <= 0.
|
||||
* Fix transform state handling overriding PVS detachment.
|
||||
|
||||
|
||||
## 261.2.0
|
||||
|
||||
### New features
|
||||
|
||||
* Implement IEquatable for ResolvedPathSpecifier & ResolvedCollectionSpecifier.
|
||||
* Add NearestChunkEnumerator.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix static entities not having the center of mass updated.
|
||||
* Fix TryQueueDelete.
|
||||
* Fix tpto potentially parenting grids to non-map entities.
|
||||
|
||||
### Other
|
||||
|
||||
* TileChangedEvent is now raised once in clientside grid state handling rather than per tile.
|
||||
* Removed ITileDefinition.ID as it was redundant.
|
||||
* Change the lifestage checks on predicted entity deletion to check for terminating.
|
||||
|
||||
### Internal
|
||||
|
||||
* Update some `GetComponentName<T>` uses to generic.
|
||||
|
||||
|
||||
## 261.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Automatically create logger sawmills for `UIController`s similar to `EntitySystem`s.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix physics forces not auto-clearing / respecting the cvar.
|
||||
|
||||
### Internal
|
||||
|
||||
* Cleanup more compiler warnings in unit tests.
|
||||
|
||||
|
||||
## 261.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Remove unused TryGetContainingContainer override.
|
||||
* Stop recursive FrameUpdates for controls that are not visible.
|
||||
* Initialize LocMgr earlier in the callstack for GameController.
|
||||
* Fix FastNoiseLise fractal bounding and remove its DataField property as it should be derived on other properties updating.
|
||||
* Make RaiseMoveEvent internal.
|
||||
* MovedGridsComponent and PhysicsMapComponent are now purged and properties on `SharedPhysicsSystem`. Additionally the TransformComponent for Awake entities is stored alongside the PhysicsComponent for them.
|
||||
* TransformComponent is now stored on physics contacts.
|
||||
* Gravity2DComponent and Gravity2DController were moved to SharedPhysicsSystem.
|
||||
|
||||
### New features
|
||||
|
||||
* `IFileDialogManager` now allows specifying `FileAccess` and `FileShare` modes.
|
||||
* Add Intersects and Enlarged to Box2i in line with Box2.
|
||||
* Make `KeyFrame`s on `AnimationTrackProperty` public settable.
|
||||
* Add the spawned entities to a returned array from `SpawnEntitiesAttachedTo`.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed SDL3 file dialog implementation having a memory leak and not opening files read-write.
|
||||
* Fix GetMapLinearVelocity.
|
||||
|
||||
### Other
|
||||
|
||||
* `uploadfile` and `loadprototype` commands now only open files with read access.
|
||||
* Optimize `ToMapCoordinates`.
|
||||
|
||||
### Internal
|
||||
|
||||
* Cleanup on internals of `IFileDialogManager`, removing duplicate code.
|
||||
* Fix Contacts not correctly being marked as `Touching` while contact is ongoing.
|
||||
|
||||
|
||||
## 260.2.0
|
||||
|
||||
### New features
|
||||
|
||||
* Add `StringBuilder.Insert(int, string)` to sandbox.
|
||||
* Add the WorldNormal to the StartCollideEvent.
|
||||
|
||||
|
||||
## 260.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* `ComponentFactory` is now exposed to `EntitySystem` as `Factory`
|
||||
|
||||
### Other
|
||||
|
||||
* Cleanup warnings in PLacementManager
|
||||
* Cleanup warnings in Clide.Sprite
|
||||
|
||||
## 260.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Fix / change `StartCollideEvent.WorldPoint` to return all points for the collision which may be up to 2 instead of 1.
|
||||
|
||||
### New features
|
||||
|
||||
* Add SpriteSystem dependency to VisualizerSystem.
|
||||
* Add Vertical property to progress bars
|
||||
* Add some `EntProtoId` overloads for group entity spawn methods.
|
||||
|
||||
|
||||
## 259.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* TileChangedEvent now has an array of tile changed entries rather than raising an individual event for every single tile changed.
|
||||
|
||||
### Other
|
||||
|
||||
* `Entity<T>` methods were marked as `readonly` as appropriate.
|
||||
|
||||
|
||||
## 258.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix static physics bodies not generating contacts if they spawn onto sleeping bodies.
|
||||
|
||||
|
||||
## 258.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `IMarkupTag` and related methods in `MarkupTagManager` have been obsoleted and should be replaced with the new `IMarkupTagHandler` interface. Various engine tags (e.g., `BoldTag`, `ColorTag`, etc) no longer implement the old interface.
|
||||
|
||||
### New features
|
||||
|
||||
* Add IsValidPath to ResPath and make some minor performance improvements.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* OutputPanel and RichTextLabel now remove controls associated with rich text tags when the text is updated.
|
||||
* Fix `SpriteComponent.Visible` datafield not being read from yaml.
|
||||
* Fix container state handling not forcing inserts.
|
||||
|
||||
### Other
|
||||
|
||||
* `SpriteSystem.LayerMapReserve()` no longer throws an exception if the specified layer already exists. This makes it behave like the obsoleted `SpriteComponent.LayerMapReserveBlank()`.
|
||||
|
||||
|
||||
## 257.0.2
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix unshaded sprite layers not rendering correctly.
|
||||
|
||||
|
||||
## 257.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix sprite layer bounding box calculations. This was causing various sprite rendering & render-tree lookup issues.
|
||||
|
||||
|
||||
## 257.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* The client will now automatically pause any entities that leave their PVS range.
|
||||
* Contacts for terminating entities no longer raise wake events.
|
||||
|
||||
### New features
|
||||
|
||||
* Added `IPrototypeManager.IsIgnored()` for checking whether a given prototype kind has been marked as ignored via `RegisterIgnore()`.
|
||||
* Added `PoolManager` & `TestPair` classes to `Robust.UnitTesting`. These classes make it easier to create & use pooled server/client instance pairs in integration tests.
|
||||
* Catch NotYamlSerializable DataFields with an analyzer.
|
||||
* Optimized RSI preloading and texture atlas creation.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix clients unintentionally un-pausing paused entities that re-enter pvs range
|
||||
|
||||
### Other
|
||||
|
||||
* The yaml prototype id serialiser now provides better feedback when trying to validate an id for a prototype kind that has been ignored via `IPrototypeManager.RegisterIgnore()`
|
||||
* Several SpriteComponent methods have been marked as obsolete, and should be replaced with new methods in SpriteSystem.
|
||||
* Rotation events no longer check for grid traversal.
|
||||
|
||||
|
||||
## 256.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `ITypeReaderWriter<TType, TNode>` has been removed due to being unused. Implement `ITypeSerializer<TType, TNode>` instead
|
||||
* Moved AsNullable extension methods to the Entity struct.
|
||||
|
||||
### New features
|
||||
|
||||
* Add DevWindow tab to show all loaded textures.
|
||||
* Add Vector2i / bitmask converfsion helpers.
|
||||
* Allow texture preload to be skipped for some textures.
|
||||
* Check audio file signatures instead of extensions.
|
||||
* Add CancellationTokenRegistration to sandbox.
|
||||
* Add the ability to serialize TimeSpan from text.
|
||||
* Add support for rotated / mirrored tiles.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix yaml hot reloading.
|
||||
* Fix a linear dictionary lookup in PlacementManager.
|
||||
|
||||
### Other
|
||||
|
||||
* Make ItemList not run deselection callback on all items if they aren't selected.
|
||||
* Cleanup warnings for CS0649 & CS0414.
|
||||
|
||||
### Internal
|
||||
|
||||
* Move PointLight component states to shared.
|
||||
|
||||
|
||||
## 255.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* The client localisation manager now supports hot-reloading ftl files.
|
||||
* TransformSystem can now raise `GridUidChangedEvent` and `MapUidChangedEvent` when a entity's grid or map changes. This event is only raised if the `ExtraTransformEvents` metadata flag is enabled.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed a server crash due to a `NullReferenceException` in PVS system when a player's local entity is also one of their view subscriptions.
|
||||
* Fix CompileRobustXamlTask for benchmarks.
|
||||
* .ftl files will now hot reload.
|
||||
* Fix placementmanager sometimes not clearing.
|
||||
|
||||
### Other
|
||||
|
||||
* Container events are now documented.
|
||||
|
||||
|
||||
## 255.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `RobustIntegrationTest` now pools server/client instances by default. If a custom settings class is provided, it will still disable pooling unless explicitly enabled.
|
||||
* Server/Client instances that are returned to the pool should be disconnected. This might require you to update some tests.
|
||||
* Pooled instances also require you to use `RobustIntegrationTest` methods like `WaitPost()` to ensure the correct thread is used.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix `EntityDeserializer` improperly setting entity lifestages when loading a post-mapinit map.
|
||||
* Fix `EntityManager.PredictedDeleteEntity()` not deleting pure client-side entities.
|
||||
* Fix grid fixtures using a locale dependent id. This could cause some clients to crash/freeze when connected to a server with a different locale.
|
||||
|
||||
### Other
|
||||
|
||||
* Add logic to block cycles in master MIDI renderers, which could otherwise cause client freezes.
|
||||
|
||||
|
||||
## 254.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Add CC ND licences to the RGA validator.
|
||||
* Add entity spawn prediction and entity deletion prediction. This is currently limited as you are unable to predict interactions with these entities. These are done via the new methods prefixed with "Predicted". You can also manually flag an entity as a predicted spawn with the `FlagPredicted` method which will clean it up when prediction is reset.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix tile edge rendering for neighbor tiles being the same priority.
|
||||
|
||||
### Other
|
||||
|
||||
* Fix SpawnAttachedTo's system proxy method not the rotation arg like EntityManager.
|
||||
|
||||
|
||||
## 254.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Yaml mappings/dictionaries now only support string keys instead of generic nodes
|
||||
* Several MappingDataNode method arguments or return values now use strings instead of a DataNode object
|
||||
* The MappingDataNode class has various helper methods that still accept a ValueDataNode, but these methods are marked as obsolete and may be removed in the future.
|
||||
* yaml validators should use `MappingDataNode.GetKeyNode()` when validating mapping keys, so that errors can print node start & end information
|
||||
* ValueTuple yaml serialization has changed
|
||||
* Previously they would get serialized into a single mapping with one entry (i.e., `{foo : bar }`)
|
||||
* Now they serialize into a sequence (i.e., `[foo, bar]`)
|
||||
* The ValueTuple serializer will still try to read mappings, but due to the MappingDataNode this may fail if the previously serialized "key" can't be read as a simple string
|
||||
|
||||
### New features
|
||||
|
||||
* Add cvar to disable tile edges.
|
||||
* Add GetContainingContainers method to ContainerSystem to recursively get containers upwards on an entity.
|
||||
|
||||
### Internal
|
||||
|
||||
* Make component lifecycle methods use generics.
|
||||
|
||||
|
||||
## 253.0.0
|
||||
|
||||
### New features
|
||||
|
||||
* Add a new `SerializationManager.PushComposition()` overload that takes in a single parent instead of an array of parents.
|
||||
* `BoundUserInterfaceMessageAttempt` once again gets raised as a broadcast event, in addition to being directed.
|
||||
* This effectively reverts the breaking part of the changes made in v252.0.0
|
||||
* Fix CreateDistanceJoint using an int instead of a float for minimum distance.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix deferred component removal not setting the component's life stage to `ComponentLifeStage.Stopped` if the component has not yet been initialised.
|
||||
* Fix some `EntitySystem.Resolve()` overloads not respecting the optional `logMissing` argument.
|
||||
* Fix screen-space overlays not being useable without first initializing/starting entity manager & systems
|
||||
* ItemList is now significantly optimized. VV's `AddComponent` window in particular should be much faster.
|
||||
* Fix some more MapValidator fields.
|
||||
* Fix popup text overflowing the sides of the screen.
|
||||
* Improve location reporting for non-writeable datafields via analyzer.
|
||||
|
||||
### Other
|
||||
|
||||
* TestPoint now uses generics rather than IPhysShape directly.
|
||||
|
||||
|
||||
## 252.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* BoundUserInterfaceMessageAttempt is raised directed against entities and no longer broadcast.
|
||||
|
||||
|
||||
## 251.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Localization is now separate between client and server and is handled via cvar.
|
||||
* Contacting entities no longer can be disabled for CollisionWake to avoid destroying the contacts unnecessarily.
|
||||
|
||||
### New features
|
||||
|
||||
* Added `DirectionExtensions.AllDirections`, which contains a list of all `Direction`s for easy enumeration.
|
||||
* Add ForbidLiteralAttribute.
|
||||
* Log late MsgEntity again.
|
||||
* Show entity name in `physics shapeinfo` output.
|
||||
* Make SubscribeLocalEvent not require EntityEventArgs.
|
||||
* Add autocomplete to `tp` command.
|
||||
* Add button to jump to live chat when scrolled up.
|
||||
* Add autocomplete to `savemap` and `savegrid`.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix velocity not re-applying correctly on re-parenting.
|
||||
* Fix Equatable on FormattedMessage.
|
||||
* Fix SharedTransformSystem methods logging errors on resolves.
|
||||
|
||||
### Other
|
||||
|
||||
* Significantly optimized tile edge rendering.
|
||||
|
||||
### Internal
|
||||
|
||||
* Remove duplicate GetMassData method.
|
||||
* Inline manifold points for physics.
|
||||
|
||||
|
||||
## 250.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* The default shader now interprets negative color modulation as a flag that indicates that the light map should be ignored.
|
||||
* This can be used to avoid having to change the light map texture, thus reducing draw batches.
|
||||
* Sprite layers that are set to use the "unshaded" shader prototype now use this.
|
||||
* Any fragment shaders that previously the `VtxModulate` colour modulation variable should instead use the new `MODULATE` variable, as the former may now contain negative values.
|
||||
|
||||
### New features
|
||||
|
||||
* Add OtherBody API to contacts.
|
||||
* Make FormattedMessages Equatable.
|
||||
* AnimationCompletionEvent now has the AnimationPlayerComponent.
|
||||
* Add entity description as a tooltip on the entity spawn panel.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix serialization source generator breaking if a class has two partial locations.
|
||||
* Fix map saving throwing a `DirectoryNotFoundException` when given a path with a non-existent directory. Now it once again creates any missing directories.
|
||||
* Fix map loading taking a significant time due to MappingDataNode.Equals calls being slow.
|
||||
|
||||
### Other
|
||||
|
||||
* Add Pure to some Angle methods.
|
||||
|
||||
### Internal
|
||||
|
||||
* Cleanup some warnings in classes.
|
||||
|
||||
|
||||
## 249.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Layer is now read-only on VisibilityComponent and isn't serialized.
|
||||
|
||||
### New features
|
||||
|
||||
* Added a debug overlay for the linear and angular velocity of all entities on the screen. Use the `showvel` and `showangvel` commands to toggle it.
|
||||
* Add a GetWorldManifold overload that doesn't require a span of points.
|
||||
* Added a GetVisMaskEvent. Calling `RefreshVisibilityMask` will raise it and subscribers can update the vismask via the event rather than subscribers having to each manually try and handle the vismask directly.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* `BoxContainer` no longer causes stretching children to go below their minimum size.
|
||||
* Fix lights on other grids getting clipped due to ignoring the light range cvar.
|
||||
* Fix the `showvelocities` command.
|
||||
* Fix the DirtyFields overload not being sandbox safe for content.
|
||||
|
||||
### Internal
|
||||
|
||||
* Polygon vertices are now inlined with FixedArray8 and a separate SlimPolygon using FixedArray4 for hot paths rather than using pooled arrays.
|
||||
## 248.0.2-source-gen-debug
|
||||
|
||||
|
||||
## 248.0.2
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
id: Audio
|
||||
name: Audio
|
||||
description: Audio entity used by engine
|
||||
save: false # TODO PERSISTENCE what about looping or long sounds?
|
||||
categories: [ HideSpawnMenu ]
|
||||
save: false
|
||||
components:
|
||||
- type: Transform
|
||||
gridTraversal: false
|
||||
|
||||
@@ -21,8 +21,7 @@ zzzz-object-pronoun = { GENDER($ent) ->
|
||||
}
|
||||
|
||||
# Used internally by the DAT-OBJ() function.
|
||||
# Not used in en-US. Created to support other languages.
|
||||
# (e.g., "to him," "for her")
|
||||
# Not used in en-US. Created for supporting other languages.
|
||||
zzzz-dat-object = { GENDER($ent) ->
|
||||
[male] him
|
||||
[female] her
|
||||
@@ -30,16 +29,6 @@ zzzz-dat-object = { GENDER($ent) ->
|
||||
*[neuter] it
|
||||
}
|
||||
|
||||
# Used internally by the GENITIVE() function.
|
||||
# Not used in en-US. Created to support other languages.
|
||||
# e.g., "у него" (Russian), "seines Vaters" (German).
|
||||
zzzz-genitive = { GENDER($ent) ->
|
||||
[male] his
|
||||
[female] her
|
||||
[epicene] their
|
||||
*[neuter] its
|
||||
}
|
||||
|
||||
# Used internally by the POSS-PRONOUN() function.
|
||||
zzzz-possessive-pronoun = { GENDER($ent) ->
|
||||
[male] his
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
generic-map = map
|
||||
generic-grid = grid
|
||||
generic-mapid = map Id
|
||||
@@ -1,16 +1,16 @@
|
||||
# Loc strings for various entity state & client-side PVS related commands
|
||||
|
||||
cmd-reset-ent-help = Usage: {$command} <Entity UID>
|
||||
cmd-reset-ent-desc = Reset an entity to the most recently received server state. This will also reset entities that have been detached to null-space.
|
||||
cmd-reset-ent-help = Usage: resetent <Entity UID>
|
||||
cmd-reset-ent-desc = Reset an entity to the most recently received server state. This will also reset entities that have been detached to null-space.
|
||||
|
||||
cmd-reset-all-ents-help = Usage: {$command}
|
||||
cmd-reset-all-ents-desc = Resets all entities to the most recently received server state. This only impacts entities that have not been detached to null-space.
|
||||
cmd-reset-all-ents-help = Usage: resetallents
|
||||
cmd-reset-all-ents-desc = Resets all entities to the most recently received server state. This only impacts entities that have not been detached to null-space.
|
||||
|
||||
cmd-detach-ent-help = Usage: {$command} <Entity UID>
|
||||
cmd-detach-ent-help = Usage: detachent <Entity UID>
|
||||
cmd-detach-ent-desc = Detach an entity to null-space, as if it had left PVS range.
|
||||
|
||||
cmd-local-delete-help = Usage: {$command} <Entity UID>
|
||||
cmd-local-delete-help = Usage: localdelete <Entity UID>
|
||||
cmd-local-delete-desc = Deletes an entity. Unlike the normal delete command, this is CLIENT-SIDE. Unless the entity is a client-side entity, this will likely cause errors.
|
||||
|
||||
cmd-full-state-reset-help = Usage: {$command}
|
||||
cmd-full-state-reset-help = Usage: fullstatereset
|
||||
cmd-full-state-reset-desc = Discards any entity state information and requests a full-state from the server.
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
color-hue-chroma-lightness = {$lightness} {$chroma} {$hue}
|
||||
color-hue-chroma = {$chroma} {$hue}
|
||||
color-hue-lightness = {$lightness} {$hue}
|
||||
color-very-dark = very dark
|
||||
color-dark = dark
|
||||
color-light = light
|
||||
color-very-light = very light
|
||||
color-mixed-hue = {$a} {$b}
|
||||
color-pale = pale
|
||||
color-gray-adjective = gray
|
||||
color-strong = strong
|
||||
color-pink = pink
|
||||
color-red = red
|
||||
color-orange = orange
|
||||
color-yellow = yellow
|
||||
color-green = green
|
||||
color-cyan = cyan
|
||||
color-blue = blue
|
||||
color-purple = purple
|
||||
color-brown = brown
|
||||
color-white = white
|
||||
color-gray = gray
|
||||
color-black = black
|
||||
color-unknown = unknown color, you should not see this
|
||||
|
||||
color-pink-color-red = pinkish red
|
||||
color-red-color-orange = reddish orange
|
||||
color-orange-color-yellow = orangeish yellow
|
||||
color-yellow-color-green = yellowish green
|
||||
color-green-color-cyan = greenish cyan
|
||||
color-cyan-color-blue = cyanish blue
|
||||
color-blue-color-purple = blueish purple
|
||||
color-purple-color-pink = purpleish pink
|
||||
@@ -1,7 +1,5 @@
|
||||
### Localization for engine console commands
|
||||
|
||||
cmd-hint-float = [float]
|
||||
|
||||
## generic command errors
|
||||
|
||||
cmd-invalid-arg-number-error = Invalid number of arguments.
|
||||
@@ -13,7 +11,6 @@ cmd-parse-failure-uid = {$arg} is not a valid entity UID.
|
||||
cmd-parse-failure-mapid = {$arg} is not a valid MapId.
|
||||
cmd-parse-failure-enum = {$arg} is not a {$enum} Enum.
|
||||
cmd-parse-failure-grid = {$arg} is not a valid grid.
|
||||
cmd-parse-failure-cultureinfo = "{$arg}" is not valid CultureInfo.
|
||||
cmd-parse-failure-entity-exist = UID {$arg} does not correspond to an existing entity.
|
||||
cmd-parse-failure-session = There is no session with username: {$username}
|
||||
|
||||
@@ -23,8 +20,8 @@ cmd-error-dir-not-found = Could not find directory: {$dir}.
|
||||
cmd-failure-no-attached-entity = There is no entity attached to this shell.
|
||||
|
||||
## 'help' command
|
||||
cmd-help-desc = Display general help or help text for a specific command.
|
||||
cmd-help-help = Usage: {$command} [command name]
|
||||
cmd-help-desc = Display general help or help text for a specific command
|
||||
cmd-help-help = Usage: help [command name]
|
||||
When no command name is provided, displays general-purpose help text. If a command name is provided, displays help text for that command.
|
||||
|
||||
cmd-help-no-args = To display help for a specific command, write 'help <command>'. To list all available commands, write 'list'. To search for commands, use 'list <filter>'.
|
||||
@@ -35,7 +32,7 @@ cmd-help-arg-cmdname = [command name]
|
||||
|
||||
## 'cvar' command
|
||||
cmd-cvar-desc = Gets or sets a CVar.
|
||||
cmd-cvar-help = Usage: {$command} <name | ?> [value]
|
||||
cmd-cvar-help = Usage: cvar <name | ?> [value]
|
||||
If a value is passed, the value is parsed and stored as the new value of the CVar.
|
||||
If not, the current value of the CVar is displayed.
|
||||
Use 'cvar ?' to get a list of all registered CVars.
|
||||
@@ -49,14 +46,14 @@ cmd-cvar-value-hidden = <value hidden>
|
||||
|
||||
## 'cvar_subs' command
|
||||
cmd-cvar_subs-desc = Lists the OnValueChanged subscriptions for a CVar.
|
||||
cmd-cvar_subs-help = Usage: {$command} <name>
|
||||
cmd-cvar_subs-help = Usage: cvar_subs <name>
|
||||
|
||||
cmd-cvar_subs-invalid-args = Must provide exactly one argument.
|
||||
cmd-cvar_subs-arg-name = <name>
|
||||
|
||||
## 'list' command
|
||||
cmd-list-desc = Lists available commands, with optional search filter.
|
||||
cmd-list-help = Usage: {$command} [filter]
|
||||
cmd-list-desc = Lists available commands, with optional search filter
|
||||
cmd-list-help = Usage: list [filter]
|
||||
Lists all available commands. If an argument is provided, it will be used to filter commands by name.
|
||||
|
||||
cmd-list-heading = SIDE NAME DESC{"\u000A"}-------------------------{"\u000A"}
|
||||
@@ -64,13 +61,13 @@ cmd-list-heading = SIDE NAME DESC{"\u000A"}-------------------------{
|
||||
cmd-list-arg-filter = [filter]
|
||||
|
||||
## '>' command, aka remote exec
|
||||
cmd-remoteexec-desc = Executes server-side commands.
|
||||
cmd-remoteexec-desc = Executes server-side commands
|
||||
cmd-remoteexec-help = Usage: > <command> [arg] [arg] [arg...]
|
||||
Executes a command on the server. This is necessary if a command with the same name exists on the client, as simply running the command would run the client command first.
|
||||
|
||||
## 'gc' command
|
||||
cmd-gc-desc = Run the GC (Garbage Collector).
|
||||
cmd-gc-help = Usage: {$command} [generation]
|
||||
cmd-gc-desc = Run the GC (Garbage Collector)
|
||||
cmd-gc-help = Usage: gc [generation]
|
||||
Uses GC.Collect() to execute the Garbage Collector.
|
||||
If an argument is provided, it is parsed as a GC generation number and GC.Collect(int) is used.
|
||||
Use the 'gfc' command to do an LOH-compacting full GC.
|
||||
@@ -79,13 +76,13 @@ cmd-gc-arg-generation = [generation]
|
||||
|
||||
## 'gcf' command
|
||||
cmd-gcf-desc = Run the GC, fully, compacting LOH and everything.
|
||||
cmd-gcf-help = Usage: {$command}
|
||||
cmd-gcf-help = Usage: gcf
|
||||
Does a full GC.Collect(2, GCCollectionMode.Forced, true, true) while also compacting LOH.
|
||||
This will probably lock up for hundreds of milliseconds, be warned.
|
||||
|
||||
## 'gc_mode' command
|
||||
cmd-gc_mode-desc = Change/Read the GC Latency mode.
|
||||
cmd-gc_mode-help = Usage: {$command} [type]
|
||||
cmd-gc_mode-desc = Change/Read the GC Latency mode
|
||||
cmd-gc_mode-help = Usage: gc_mode [type]
|
||||
If no argument is provided, returns the current GC latency mode.
|
||||
If an argument is passed, it is parsed as GCLatencyMode and set as the GC latency mode.
|
||||
|
||||
@@ -98,8 +95,8 @@ cmd-gc_mode-result = resulting gc latency mode: { $mode }
|
||||
cmd-gc_mode-arg-type = [type]
|
||||
|
||||
## 'mem' command
|
||||
cmd-mem-desc = Prints managed memory info.
|
||||
cmd-mem-help = Usage: {$command}
|
||||
cmd-mem-desc = Prints managed memory info
|
||||
cmd-mem-help = Usage: mem
|
||||
|
||||
cmd-mem-report = Heap Size: { TOSTRING($heapSize, "N0") }
|
||||
Total Allocated: { TOSTRING($totalAllocated, "N0") }
|
||||
@@ -108,26 +105,26 @@ cmd-mem-report = Heap Size: { TOSTRING($heapSize, "N0") }
|
||||
cmd-physics-overlay = {$overlay} is not a recognised overlay
|
||||
|
||||
## 'lsasm' command
|
||||
cmd-lsasm-desc = Lists loaded assemblies by load context.
|
||||
cmd-lsasm-desc = Lists loaded assemblies by load context
|
||||
cmd-lsasm-help = Usage: lsasm
|
||||
|
||||
## 'exec' command
|
||||
cmd-exec-desc = Executes a script file from the game's writeable user data.
|
||||
cmd-exec-help = Usage: {$command} <fileName>
|
||||
cmd-exec-desc = Executes a script file from the game's writeable user data
|
||||
cmd-exec-help = Usage: exec <fileName>
|
||||
Each line in the file is executed as a single command, unless it starts with a #
|
||||
|
||||
cmd-exec-arg-filename = <fileName>
|
||||
|
||||
## 'dump_net_comps' command
|
||||
cmd-dump_net_comps-desc = Prints the table of networked components.
|
||||
cmd-dump_net_comps-help = Usage: {$command}
|
||||
cmd-dump_net_comps-help = Usage: dump_net-comps
|
||||
|
||||
cmd-dump_net_comps-error-writeable = Registration still writeable, network ids have not been generated.
|
||||
cmd-dump_net_comps-header = Networked Component Registrations:
|
||||
|
||||
## 'dump_event_tables' command
|
||||
cmd-dump_event_tables-desc = Prints directed event tables for an entity.
|
||||
cmd-dump_event_tables-help = Usage: {$command} <entityUid>
|
||||
cmd-dump_event_tables-help = Usage: dump_event_tables <entityUid>
|
||||
|
||||
cmd-dump_event_tables-missing-arg-entity = Missing entity argument
|
||||
cmd-dump_event_tables-error-entity = Invalid entity
|
||||
@@ -135,7 +132,7 @@ cmd-dump_event_tables-arg-entity = <entityUid>
|
||||
|
||||
## 'monitor' command
|
||||
cmd-monitor-desc = Toggles a debug monitor in the F3 menu.
|
||||
cmd-monitor-help = Usage: {$command} <name>
|
||||
cmd-monitor-help = Usage: monitor <name>
|
||||
Possible monitors are: { $monitors }
|
||||
You can also use the special values "-all" and "+all" to hide or show all monitors, respectively.
|
||||
|
||||
@@ -148,13 +145,13 @@ cmd-monitor-plus-all-hint = Shows all monitors
|
||||
|
||||
## 'setambientlight' command
|
||||
cmd-set-ambient-light-desc = Allows you to set the ambient light for the specified map, in SRGB.
|
||||
cmd-set-ambient-light-help = Usage: {$command} [mapid] [r g b a]
|
||||
cmd-set-ambient-light-help = setambientlight [mapid] [r g b a]
|
||||
cmd-set-ambient-light-parse = Unable to parse args as a byte values for a color.
|
||||
|
||||
## Mapping commands
|
||||
|
||||
cmd-savemap-desc = Serializes a map to disk. Will not save a post-init map unless forced.
|
||||
cmd-savemap-help = Usage: {$command} <MapID> <Path> [force]
|
||||
cmd-savemap-help = savemap <MapID> <Path> [force]
|
||||
cmd-savemap-not-exist = Target map does not exist.
|
||||
cmd-savemap-init-warning = Attempted to save a post-init map without forcing the save.
|
||||
cmd-savemap-attempt = Attempting to save map {$mapId} to {$path}.
|
||||
@@ -165,7 +162,7 @@ cmd-hint-savemap-path = <Path>
|
||||
cmd-hint-savemap-force = [bool]
|
||||
|
||||
cmd-loadmap-desc = Loads a map from disk into the game.
|
||||
cmd-loadmap-help = Usage: {$command} <MapID> <Path> [x] [y] [rotation] [consistentUids]
|
||||
cmd-loadmap-help = loadmap <MapID> <Path> [x] [y] [rotation] [consistentUids]
|
||||
cmd-loadmap-nullspace = You cannot load into map 0.
|
||||
cmd-loadmap-exists = Map {$mapId} already exists.
|
||||
cmd-loadmap-success = Map {$mapId} has been loaded from {$path}.
|
||||
@@ -180,74 +177,73 @@ cmd-hint-savebp-id = <Grid EntityID>
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
cmd-flushcookies-desc = Flush CEF cookie storage to disk.
|
||||
cmd-flushcookies-help = Usage: {$command}
|
||||
This ensure cookies are properly saved to disk in the event of unclean shutdowns.
|
||||
cmd-flushcookies-desc = Flush CEF cookie storage to disk
|
||||
cmd-flushcookies-help = This ensure cookies are properly saved to disk in the event of unclean shutdowns.
|
||||
Note that the actual operation is asynchronous.
|
||||
|
||||
cmd-ldrsc-desc = Pre-caches a resource.
|
||||
cmd-ldrsc-help = Usage: {$command} <path> <type>
|
||||
cmd-ldrsc-help = Usage: ldrsc <path> <type>
|
||||
|
||||
cmd-rldrsc-desc = Reloads a resource.
|
||||
cmd-rldrsc-help = Usage: {$command} <path> <type>
|
||||
cmd-rldrsc-help = Usage: rldrsc <path> <type>
|
||||
|
||||
cmd-gridtc-desc = Gets the tile count of a grid.
|
||||
cmd-gridtc-help = Usage: {$command} <gridId>
|
||||
cmd-gridtc-help = Usage: gridtc <gridId>
|
||||
|
||||
|
||||
# Client-side commands
|
||||
cmd-guidump-desc = Dump GUI tree to /guidump.txt in user data.
|
||||
cmd-guidump-help = Usage: {$command}
|
||||
cmd-guidump-help = Usage: guidump
|
||||
|
||||
cmd-uitest-desc = Open a dummy UI testing window.
|
||||
cmd-uitest-help = Usage: {$command}
|
||||
cmd-uitest-desc = Open a dummy UI testing window
|
||||
cmd-uitest-help = Usage: uitest
|
||||
|
||||
## 'uitest2' command
|
||||
cmd-uitest2-desc = Opens a UI control testing OS window.
|
||||
cmd-uitest2-help = Usage: {$command} <tab>
|
||||
cmd-uitest2-desc = Opens a UI control testing OS window
|
||||
cmd-uitest2-help = Usage: uitest2 <tab>
|
||||
cmd-uitest2-arg-tab = <tab>
|
||||
cmd-uitest2-error-args = Expected at most one argument
|
||||
cmd-uitest2-error-tab = Invalid tab: '{$value}'
|
||||
cmd-uitest2-title = UITest2
|
||||
|
||||
|
||||
cmd-setclipboard-desc = Sets the system clipboard.
|
||||
cmd-setclipboard-help = Usage: {$command} <text>
|
||||
cmd-setclipboard-desc = Sets the system clipboard
|
||||
cmd-setclipboard-help = Usage: setclipboard <text>
|
||||
|
||||
cmd-getclipboard-desc = Gets the system clipboard.
|
||||
cmd-getclipboard-help = Usage: {$command}
|
||||
cmd-getclipboard-desc = Gets the system clipboard
|
||||
cmd-getclipboard-help = Usage: Getclipboard
|
||||
|
||||
cmd-togglelight-desc = Toggles light rendering.
|
||||
cmd-togglelight-help = Usage: {$command}
|
||||
cmd-togglelight-help = Usage: togglelight
|
||||
|
||||
cmd-togglefov-desc = Toggles fov for client.
|
||||
cmd-togglefov-help = Usage: {$command}
|
||||
cmd-togglefov-help = Usage: togglefov
|
||||
|
||||
cmd-togglehardfov-desc = Toggles hard fov for client. (for debugging space-station-14#2353)
|
||||
cmd-togglehardfov-help = Usage: {$command}
|
||||
cmd-togglehardfov-help = Usage: togglehardfov
|
||||
|
||||
cmd-toggleshadows-desc = Toggles shadow rendering.
|
||||
cmd-toggleshadows-help = Usage: {$command}
|
||||
cmd-toggleshadows-help = Usage: toggleshadows
|
||||
|
||||
cmd-togglelightbuf-desc = Toggles lighting rendering. This includes shadows but not FOV.
|
||||
cmd-togglelightbuf-help = Usage: {$command}
|
||||
cmd-togglelightbuf-help = Usage: togglelightbuf
|
||||
|
||||
cmd-chunkinfo-desc = Gets info about a chunk under your mouse cursor.
|
||||
cmd-chunkinfo-help = Usage: {$command}
|
||||
cmd-chunkinfo-help = Usage: chunkinfo
|
||||
|
||||
cmd-rldshader-desc = Reloads all shaders.
|
||||
cmd-rldshader-help = Usage: {$command}
|
||||
cmd-rldshader-help = Usage: rldshader
|
||||
|
||||
cmd-cldbglyr-desc = Toggle fov and light debug layers.
|
||||
cmd-cldbglyr-help= Usage: {$command} <layer>: Toggle <layer>
|
||||
cmd-cldbglyr-help= Usage: cldbglyr <layer>: Toggle <layer>
|
||||
cldbglyr: Turn all Layers off
|
||||
|
||||
cmd-key-info-desc = Keys key info for a key.
|
||||
cmd-key-info-help = Usage: {$command} <Key>
|
||||
cmd-key-info-help = Usage: keyinfo <Key>
|
||||
|
||||
## 'bind' command
|
||||
cmd-bind-desc = Binds an input key combination to an input command.
|
||||
cmd-bind-help = Usage: {$command} { cmd-bind-arg-key } { cmd-bind-arg-mode } { cmd-bind-arg-command }
|
||||
cmd-bind-help = Usage: bind { cmd-bind-arg-key } { cmd-bind-arg-mode } { cmd-bind-arg-command }
|
||||
Note that this DOES NOT automatically save bindings.
|
||||
Use the 'svbind' command to save binding configuration.
|
||||
|
||||
@@ -256,322 +252,310 @@ cmd-bind-arg-mode = <BindMode>
|
||||
cmd-bind-arg-command = <InputCommand>
|
||||
|
||||
cmd-net-draw-interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net-draw-interp-help = Usage: {$command}
|
||||
cmd-net-draw-interp-help = Usage: net_draw_interp
|
||||
|
||||
cmd-net-watch-ent-desc = Dumps all network updates for an EntityId to the console.
|
||||
cmd-net-watch-ent-help = Usage: {$command} <0|EntityUid>
|
||||
cmd-net-watch-ent-help = Usage: net_watchent <0|EntityUid>
|
||||
|
||||
cmd-net-refresh-desc = Requests a full server state.
|
||||
cmd-net-refresh-help = Usage: {$command}
|
||||
cmd-net-refresh-help = Usage: net_refresh
|
||||
|
||||
cmd-net-entity-report-desc = Toggles the net entity report panel.
|
||||
cmd-net-entity-report-help = Usage: {$command}
|
||||
cmd-net-entity-report-help = Usage: net_entityreport
|
||||
|
||||
cmd-fill-desc = Fill up the console for debugging.
|
||||
cmd-fill-help = Usage: {$command}
|
||||
Fills the console with some nonsense for debugging.
|
||||
cmd-fill-help = Fills the console with some nonsense for debugging.
|
||||
|
||||
cmd-cls-desc = Clears the console.
|
||||
cmd-cls-help = Usage: {$command}
|
||||
Clears the debug console of all messages.
|
||||
cmd-cls-help = Clears the debug console of all messages.
|
||||
|
||||
cmd-sendgarbage-desc = Sends garbage to the server.
|
||||
cmd-sendgarbage-help = Usage: {$command}
|
||||
The server will reply with 'no u'
|
||||
cmd-sendgarbage-help = The server will reply with 'no u'
|
||||
|
||||
cmd-loadgrid-desc = Loads a grid from a file into an existing map.
|
||||
cmd-loadgrid-help = Usage: {$command} <MapID> <Path> [x y] [rotation] [storeUids]
|
||||
cmd-loadgrid-help = loadgrid <MapID> <Path> [x y] [rotation] [storeUids]
|
||||
|
||||
cmd-loc-desc = Prints the absolute location of the player's entity to console.
|
||||
cmd-loc-help = Usage: {$command}
|
||||
cmd-loc-help = loc
|
||||
|
||||
cmd-tpgrid-desc = Teleports a grid to a new location.
|
||||
cmd-tpgrid-help = Usage: {$command} <gridId> <X> <Y> [<MapId>]
|
||||
cmd-tpgrid-help = tpgrid <gridId> <X> <Y> [<MapId>]
|
||||
|
||||
cmd-rmgrid-desc = Removes a grid from a map. You cannot remove the default grid.
|
||||
cmd-rmgrid-help = Usage: {$command} <gridId>
|
||||
cmd-rmgrid-help = rmgrid <gridId>
|
||||
|
||||
cmd-mapinit-desc = Runs map init on a map.
|
||||
cmd-mapinit-help = Usage: {$command} <mapID>
|
||||
cmd-mapinit-help = mapinit <mapID>
|
||||
|
||||
cmd-lsmap-desc = Lists maps.
|
||||
cmd-lsmap-help = Usage: {$command}
|
||||
cmd-lsmap-help = lsmap
|
||||
|
||||
cmd-lsgrid-desc = Lists grids.
|
||||
cmd-lsgrid-help = Usage: {$command}
|
||||
cmd-lsgrid-help = lsgrid
|
||||
|
||||
cmd-addmap-desc = Adds a new empty map to the round. If the mapID already exists, this command does nothing.
|
||||
cmd-addmap-help = Usage: {$command} <mapID> [pre-init]
|
||||
cmd-addmap-help = addmap <mapID> [pre-init]
|
||||
|
||||
cmd-rmmap-desc = Removes a map from the world. You cannot remove nullspace.
|
||||
cmd-rmmap-help = Usage: {$command} <mapId>
|
||||
cmd-rmmap-help = rmmap <mapId>
|
||||
|
||||
cmd-savegrid-desc = Serializes a grid to disk.
|
||||
cmd-savegrid-help = Usage: {$command} <gridID> <Path>
|
||||
cmd-savegrid-help = savegrid <gridID> <Path>
|
||||
|
||||
cmd-testbed-desc = Loads a physics testbed on the specified map.
|
||||
cmd-testbed-help = Usage: {$command} <mapid> <test>
|
||||
cmd-testbed-help = testbed <mapid> <test>
|
||||
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
## 'addcomp' command
|
||||
cmd-addcomp-desc = Adds a component to an entity.
|
||||
cmd-addcomp-help = Usage: {$command} <uid> <componentName>
|
||||
cmd-addcomp-help = addcomp <uid> <componentName>
|
||||
cmd-addcompc-desc = Adds a component to an entity on the client.
|
||||
cmd-addcompc-help = Usage: {$command} <uid> <componentName>
|
||||
cmd-addcompc-help = addcompc <uid> <componentName>
|
||||
|
||||
## 'rmcomp' command
|
||||
cmd-rmcomp-desc = Removes a component from an entity.
|
||||
cmd-rmcomp-help = Usage: {$command} <uid> <componentName>
|
||||
cmd-rmcomp-help = rmcomp <uid> <componentName>
|
||||
cmd-rmcompc-desc = Removes a component from an entity on the client.
|
||||
cmd-rmcompc-help = Usage: {$command} <uid> <componentName>
|
||||
cmd-rmcompc-help = rmcomp <uid> <componentName>
|
||||
|
||||
## 'addview' command
|
||||
cmd-addview-desc = Allows you to subscribe to an entity's view for debugging purposes.
|
||||
cmd-addview-help = Usage: {$command} <entityUid>
|
||||
cmd-addview-help = addview <entityUid>
|
||||
cmd-addviewc-desc = Allows you to subscribe to an entity's view for debugging purposes.
|
||||
cmd-addviewc-help = Usage: {$command} <entityUid>
|
||||
cmd-addviewc-help = addview <entityUid>
|
||||
|
||||
## 'removeview' command
|
||||
cmd-removeview-desc = Allows you to unsubscribe to an entity's view for debugging purposes.
|
||||
cmd-removeview-help = Usage: {$command} <entityUid>
|
||||
cmd-removeview-help = removeview <entityUid>
|
||||
|
||||
## 'loglevel' command
|
||||
cmd-loglevel-desc = Changes the log level for a provided sawmill.
|
||||
cmd-loglevel-help = Usage: {$command} <sawmill> <level>
|
||||
cmd-loglevel-help = Usage: loglevel <sawmill> <level>
|
||||
sawmill: A label prefixing log messages. This is the one you're setting the level for.
|
||||
level: The log level. Must match one of the values of the LogLevel enum.
|
||||
|
||||
cmd-testlog-desc = Writes a test log to a sawmill.
|
||||
cmd-testlog-help = Usage: {$command} <sawmill> <level> <message>
|
||||
cmd-testlog-help = Usage: testlog <sawmill> <level> <message>
|
||||
sawmill: A label prefixing the logged message.
|
||||
level: The log level. Must match one of the values of the LogLevel enum.
|
||||
message: The message to be logged. Wrap this in double quotes if you want to use spaces.
|
||||
|
||||
## 'vv' command
|
||||
cmd-vv-desc = Opens View Variables.
|
||||
cmd-vv-help = Usage: {$command} <entity ID|IoC interface name|SIoC interface name>
|
||||
cmd-vv-help = Usage: vv <entity ID|IoC interface name|SIoC interface name>
|
||||
|
||||
## 'showvelocities' command
|
||||
cmd-showvelocities-desc = Displays your angular and linear velocities.
|
||||
cmd-showvelocities-help = Usage: {$command}
|
||||
cmd-showvelocities-help = Usage: showvelocities
|
||||
|
||||
## 'setinputcontext' command
|
||||
cmd-setinputcontext-desc = Sets the active input context.
|
||||
cmd-setinputcontext-help = Usage: {$command} <context>
|
||||
cmd-setinputcontext-help = Usage: setinputcontext <context>
|
||||
|
||||
## 'forall' command
|
||||
cmd-forall-desc = Runs a command over all entities with a given component.
|
||||
cmd-forall-help = Usage: {$command} <bql query> do <command...>
|
||||
cmd-forall-help = Usage: forall <bql query> do <command...>
|
||||
|
||||
## 'delete' command
|
||||
cmd-delete-desc = Deletes the entity with the specified ID.
|
||||
cmd-delete-help = Usage: {$command} <entity UID>
|
||||
cmd-delete-help = delete <entity UID>
|
||||
|
||||
# System commands
|
||||
cmd-showtime-desc = Shows the server time.
|
||||
cmd-showtime-help = Usage: {$command}
|
||||
cmd-showtime-help = showtime
|
||||
|
||||
cmd-restart-desc = Gracefully restarts the server (not just the round).
|
||||
cmd-restart-help = Usage: {$command}
|
||||
cmd-restart-help = restart
|
||||
|
||||
cmd-shutdown-desc = Gracefully shuts down the server.
|
||||
cmd-shutdown-help = Usage: {$command}
|
||||
cmd-shutdown-help = shutdown
|
||||
|
||||
cmd-saveconfig-desc = Saves the server configuration to the config file.
|
||||
cmd-saveconfig-help = Usage: {$command}
|
||||
cmd-saveconfig-help = saveconfig
|
||||
|
||||
cmd-netaudit-desc = Prints into about NetMsg security.
|
||||
cmd-netaudit-help = Usage: {$command}
|
||||
cmd-netaudit-help = netaudit
|
||||
|
||||
# Player commands
|
||||
cmd-tp-desc = Teleports a player to any location in the round.
|
||||
cmd-tp-help = Usage: {$command} <x> <y> [<mapID>]
|
||||
cmd-tp-help = tp <x> <y> [<mapID>]
|
||||
|
||||
cmd-tpto-desc = Teleports the current player or the specified players/entities to the location of the first player/entity.
|
||||
cmd-tpto-help = Usage: {$command} <username|uid> [username|NetEntity]...
|
||||
cmd-tpto-help = tpto <username|uid> [username|NetEntity]...
|
||||
cmd-tpto-destination-hint = destination (NetEntity or username)
|
||||
cmd-tpto-victim-hint = entity to teleport (NetEntity or username)
|
||||
cmd-tpto-parse-error = Cant resolve entity or player: {$str}
|
||||
|
||||
cmd-listplayers-desc = Lists all players currently connected.
|
||||
cmd-listplayers-help = Usage: {$command}
|
||||
cmd-listplayers-help = listplayers
|
||||
|
||||
cmd-kick-desc = Kicks a connected player out of the server, disconnecting them.
|
||||
cmd-kick-help = Usage: {$command} <PlayerIndex> [<Reason>]
|
||||
cmd-kick-help = kick <PlayerIndex> [<Reason>]
|
||||
|
||||
# Spin command
|
||||
cmd-spin-desc = Causes an entity to spin. Default entity is the attached player's parent.
|
||||
cmd-spin-help = Usage: {$command} velocity [drag] [entityUid]
|
||||
cmd-spin-help = spin velocity [drag] [entityUid]
|
||||
|
||||
# Localization command
|
||||
cmd-rldloc-desc = Reloads localization (client & server).
|
||||
cmd-rldloc-help = Usage: {$command}
|
||||
cmd-rldloc-help = Usage: rldloc
|
||||
|
||||
# Debug entity controls
|
||||
cmd-spawn-desc = Spawns an entity with specific type.
|
||||
cmd-spawn-help = Usage: {$command} <prototype> | {$command} <prototype> <relative entity ID> | {$command} <prototype> <x> <y>
|
||||
cmd-spawn-help = spawn <prototype> OR spawn <prototype> <relative entity ID> OR spawn <prototype> <x> <y>
|
||||
cmd-cspawn-desc = Spawns a client-side entity with specific type at your feet.
|
||||
cmd-cspawn-help = Usage: {$command} <entity type>
|
||||
cmd-cspawn-help = cspawn <entity type>
|
||||
|
||||
cmd-scale-desc = Increases or decreases an entity's size naively.
|
||||
cmd-scale-help = scale <entityUid> <float>
|
||||
|
||||
cmd-dumpentities-desc = Dump entity list.
|
||||
cmd-dumpentities-help = Usage: {$command}
|
||||
Dumps entity list of UIDs and prototype.
|
||||
cmd-dumpentities-help = Dumps entity list of UIDs and prototype.
|
||||
|
||||
cmd-getcomponentregistration-desc = Gets component registration information.
|
||||
cmd-getcomponentregistration-help = Usage: {$command} <componentName>
|
||||
cmd-getcomponentregistration-help = Usage: getcomponentregistration <componentName>
|
||||
|
||||
cmd-showrays-desc = Toggles debug drawing of physics rays. An integer for <raylifetime> must be provided.
|
||||
cmd-showrays-help = Usage: {$command} <raylifetime>
|
||||
cmd-showrays-help = Usage: showrays <raylifetime>
|
||||
|
||||
cmd-disconnect-desc = Immediately disconnect from the server and go back to the main menu.
|
||||
cmd-disconnect-help = Usage: {$command}
|
||||
cmd-disconnect-help = Usage: disconnect
|
||||
|
||||
cmd-entfo-desc = Displays verbose diagnostics for an entity.
|
||||
cmd-entfo-help = Usage: {$command} <entityuid>
|
||||
cmd-entfo-help = Usage: entfo <entityuid>
|
||||
The entity UID can be prefixed with 'c' to convert it to a client entity UID.
|
||||
|
||||
cmd-fuck-desc = Throws an exception.
|
||||
cmd-fuck-help = Usage: {$command}
|
||||
cmd-fuck-desc = Throws an exception
|
||||
cmd-fuck-help = Throws an exception
|
||||
|
||||
cmd-showpos-desc = Show the position of all entities on the screen.
|
||||
cmd-showpos-help = Usage: {$command}
|
||||
|
||||
cmd-showrot-desc = Show the rotation of all entities on the screen.
|
||||
cmd-showrot-help = Usage: {$command}
|
||||
|
||||
cmd-showvel-desc = Show the local velocity of all entites on the screen.
|
||||
cmd-showvel-help = Usage: {$command}
|
||||
|
||||
cmd-showangvel-desc = Show the angular velocity of all entities on the screen.
|
||||
cmd-showangvel-help = Usage: {$command}
|
||||
cmd-showpos-desc = Enables debug drawing over all entity positions in the game.
|
||||
cmd-showpos-help = Usage: showpos
|
||||
|
||||
cmd-sggcell-desc = Lists entities on a snap grid cell.
|
||||
cmd-sggcell-help = Usage: {$command} <gridID> <vector2i>\nThat vector2i param is in the form x<int>,y<int>.
|
||||
cmd-sggcell-help = Usage: sggcell <gridID> <vector2i>\nThat vector2i param is in the form x<int>,y<int>.
|
||||
|
||||
cmd-overrideplayername-desc = Changes the name used when attempting to connect to the server.
|
||||
cmd-overrideplayername-help = Usage: {$command} <name>
|
||||
cmd-overrideplayername-help = Usage: overrideplayername <name>
|
||||
|
||||
cmd-showanchored-desc = Shows anchored entities on a particular tile.
|
||||
cmd-showanchored-help = Usage: {$command}
|
||||
cmd-showanchored-desc = Shows anchored entities on a particular tile
|
||||
cmd-showanchored-help = Usage: showanchored
|
||||
|
||||
cmd-dmetamem-desc = Dumps a type's members in a format suitable for the sandbox configuration file.
|
||||
cmd-dmetamem-help = Usage: {$command} <type>
|
||||
cmd-dmetamem-help = Usage: dmetamem <type>
|
||||
|
||||
cmd-launchauth-desc = Load authentication tokens from launcher data to aid in testing of live servers.
|
||||
cmd-launchauth-help = Usage: {$command} <account name>
|
||||
cmd-launchauth-help = Usage: launchauth <account name>
|
||||
|
||||
cmd-lightbb-desc = Toggles whether to show light bounding boxes.
|
||||
cmd-lightbb-help = Usage: {$command}
|
||||
cmd-lightbb-help = Usage: lightbb
|
||||
|
||||
cmd-monitorinfo-desc = Monitors info.
|
||||
cmd-monitorinfo-help = Usage: {$command} <id>
|
||||
cmd-monitorinfo-desc = Monitors info
|
||||
cmd-monitorinfo-help = Usage: monitorinfo <id>
|
||||
|
||||
cmd-setmonitor-desc = Set monitor.
|
||||
cmd-setmonitor-help = Usage: {$command} <id>
|
||||
cmd-setmonitor-desc = Set monitor
|
||||
cmd-setmonitor-help = Usage: setmonitor <id>
|
||||
|
||||
cmd-physics-desc = Shows a debug physics overlay. The arg supplied specifies the overlay.
|
||||
cmd-physics-help = Usage: {$command} <aabbs / com / contactnormals / contactpoints / distance / joints / shapeinfo / shapes>
|
||||
cmd-physics-help = Usage: physics <aabbs / com / contactnormals / contactpoints / distance / joints / shapeinfo / shapes>
|
||||
|
||||
cmd-hardquit-desc = Kills the game client instantly.
|
||||
cmd-hardquit-help = Usage: {$command}
|
||||
Kills the game client instantly, leaving no traces. No telling the server goodbye.
|
||||
cmd-hardquit-help = Kills the game client instantly, leaving no traces. No telling the server goodbye.
|
||||
|
||||
cmd-quit-desc = Shuts down the game client gracefully.
|
||||
cmd-quit-help = Usage: {$command}
|
||||
Properly shuts down the game client, notifying the connected server and such.
|
||||
cmd-quit-help = Properly shuts down the game client, notifying the connected server and such.
|
||||
|
||||
cmd-csi-desc = Opens a C# interactive console.
|
||||
cmd-csi-help = Usage: {$command}
|
||||
cmd-csi-help = Usage: csi
|
||||
|
||||
cmd-scsi-desc = Opens a C# interactive console on the server.
|
||||
cmd-scsi-help = Usage: {$command}
|
||||
cmd-scsi-help = Usage: scsi
|
||||
|
||||
cmd-watch-desc = Opens a variable watch window.
|
||||
cmd-watch-help = Usage: {$command}
|
||||
cmd-watch-help = Usage: watch
|
||||
|
||||
cmd-showspritebb-desc = Toggle whether sprite bounds are shown.
|
||||
cmd-showspritebb-help = Usage: {$command}
|
||||
cmd-showspritebb-desc = Toggle whether sprite bounds are shown
|
||||
cmd-showspritebb-help = Usage: showspritebb
|
||||
|
||||
cmd-togglelookup-desc = Shows / hides entitylookup bounds via an overlay.
|
||||
cmd-togglelookup-help = Usage: {$command}
|
||||
cmd-togglelookup-help = Usage: togglelookup
|
||||
|
||||
cmd-net_entityreport-desc = Toggles the net entity report panel.
|
||||
cmd-net_entityreport-help = Usage: {$command}
|
||||
cmd-net_entityreport-help = Usage: net_entityreport
|
||||
|
||||
cmd-net_refresh-desc = Requests a full server state.
|
||||
cmd-net_refresh-help = Usage: {$command}
|
||||
cmd-net_refresh-help = Usage: net_refresh
|
||||
|
||||
cmd-net_graph-desc = Toggles the net statistics panel.
|
||||
cmd-net_graph-help = Usage: {$command}
|
||||
cmd-net_graph-help = Usage: net_graph
|
||||
|
||||
cmd-net_watchent-desc = Dumps all network updates for an EntityId to the console.
|
||||
cmd-net_watchent-help = Usage: {$command} <0|EntityUid>
|
||||
cmd-net_watchent-help = Usage: net_watchent <0|EntityUid>
|
||||
|
||||
cmd-net_draw_interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net_draw_interp-help = Usage: {$command} <0|EntityUid>
|
||||
cmd-net_draw_interp-help = Usage: net_draw_interp <0|EntityUid>
|
||||
|
||||
cmd-vram-desc = Displays video memory usage statics by the game.
|
||||
cmd-vram-help = Usage: {$command}
|
||||
cmd-vram-help = Usage: vram
|
||||
|
||||
cmd-showislands-desc = Shows the current physics bodies involved in each physics island.
|
||||
cmd-showislands-help = Usage: {$command}
|
||||
cmd-showislands-help = Usage: showislands
|
||||
|
||||
cmd-showgridnodes-desc = Shows the nodes for grid split purposes.
|
||||
cmd-showgridnodes-help = Usage: {$command}
|
||||
cmd-showgridnodes-help = Usage: showgridnodes
|
||||
|
||||
cmd-profsnap-desc = Make a profiling snapshot.
|
||||
cmd-profsnap-help = Usage: {$command}
|
||||
cmd-profsnap-help = Usage: profsnap
|
||||
|
||||
cmd-devwindow-desc = Dev Window.
|
||||
cmd-devwindow-help = Usage: {$command}
|
||||
cmd-devwindow-desc = Dev Window
|
||||
cmd-devwindow-help = Usage: devwindow
|
||||
|
||||
cmd-scene-desc = Immediately changes the UI scene/state.
|
||||
cmd-scene-help = Usage: {$command} <className>
|
||||
cmd-scene-help = Usage: scene <className>
|
||||
|
||||
cmd-szr_stats-desc = Report serializer statistics.
|
||||
cmd-szr_stats-help = Usage: {$command}
|
||||
cmd-szr_stats-help = Usage: szr_stats
|
||||
|
||||
cmd-hwid-desc = Returns the current HWID (HardWare ID).
|
||||
cmd-hwid-help = Usage: {$command}
|
||||
cmd-hwid-help = Usage: hwid
|
||||
|
||||
cmd-vvread-desc = Retrieve a path's value using VV (View Variables).
|
||||
cmd-vvread-help = Usage: {$command} <path>
|
||||
cmd-vvread-help = Usage: vvread <path>
|
||||
|
||||
cmd-vvwrite-desc = Modify a path's value using VV (View Variables).
|
||||
cmd-vvwrite-help = Usage: {$command} <path>
|
||||
cmd-vvwrite-help = Usage: vvwrite <path>
|
||||
|
||||
cmd-vvinvoke-desc = Invoke/Call a path with arguments using VV.
|
||||
cmd-vvinvoke-help = Usage: {$command} <path> [arguments...]
|
||||
cmd-vvinvoke-help = Usage: vvinvoke <path> [arguments...]
|
||||
|
||||
cmd-dump_dependency_injectors-desc = Dump IoCManager's dependency injector cache.
|
||||
cmd-dump_dependency_injectors-help = Usage: {$command}
|
||||
cmd-dump_dependency_injectors-help = Usage: dump_dependency_injectors
|
||||
cmd-dump_dependency_injectors-total-count = Total count: { $total }
|
||||
|
||||
cmd-dump_netserializer_type_map-desc = Dump NetSerializer's type map and serializer hash.
|
||||
cmd-dump_netserializer_type_map-help = Usage: {$command}
|
||||
cmd-dump_netserializer_type_map-help = Usage: dump_netserializer_type_map
|
||||
|
||||
cmd-hub_advertise_now-desc = Immediately advertise to the master hub server.
|
||||
cmd-hub_advertise_now-help = Usage: {$command}
|
||||
cmd-hub_advertise_now-desc = Immediately advertise to the master hub server
|
||||
cmd-hub_advertise_now-help = Usage: hub_advertise_now
|
||||
|
||||
cmd-echo-desc = Echo arguments back to the console.
|
||||
cmd-echo-help = Usage: {$command} "<message>"
|
||||
cmd-echo-desc = Echo arguments back to the console
|
||||
cmd-echo-help = Usage: echo "<message>"
|
||||
|
||||
## 'vfs_ls' command
|
||||
cmd-vfs_ls-desc = List directory contents in the VFS.
|
||||
cmd-vfs_ls-help = Usage: {$command} <path>
|
||||
cmd-vfs_ls-help = Usage: vfs_list <path>
|
||||
Example:
|
||||
vfs_list /Assemblies
|
||||
|
||||
cmd-vfs_ls-err-args = Need exactly 1 argument.
|
||||
cmd-vfs_ls-hint-path = <path>
|
||||
|
||||
cmd-reloadtiletextures-desc = Reloads the tile texture atlas to allow hot reloading tile sprites.
|
||||
cmd-reloadtiletextures-help = Usage: {$command}
|
||||
cmd-reloadtiletextures-desc = Reloads the tile texture atlas to allow hot reloading tile sprites
|
||||
cmd-reloadtiletextures-help = Usage: reloadtiletextures
|
||||
|
||||
cmd-audio_length-desc = Shows the length of an audio file
|
||||
cmd-audio_length-help = Usage: {$command} { cmd-audio_length-arg-file-name }
|
||||
cmd-audio_length-help = Usage: audio_length { cmd-audio_length-arg-file-name }
|
||||
cmd-audio_length-arg-file-name = <file name>
|
||||
|
||||
## PVS
|
||||
@@ -579,10 +563,3 @@ cmd-pvs-override-info-desc = Prints information about any PVS overrides associat
|
||||
cmd-pvs-override-info-empty = Entity {$nuid} has no PVS overrides.
|
||||
cmd-pvs-override-info-global = Entity {$nuid} has a global override.
|
||||
cmd-pvs-override-info-clients = Entity {$nuid} has a session override for {$clients}.
|
||||
|
||||
cmd-localization_set_culture-desc = Set DefaultCulture for the client LocalizationManager.
|
||||
cmd-localization_set_culture-help = Usage: {$command} <cultureName>
|
||||
cmd-localization_set_culture-culture-name = <cultureName>
|
||||
cmd-localization_set_culture-changed = Localization changed to { $code } ({ $nativeName } / { $englishName })
|
||||
|
||||
cmd-addmap-hint-2 = runMapInit [true / false]
|
||||
|
||||
@@ -8,5 +8,3 @@ color-selector-sliders-alpha = A
|
||||
|
||||
color-selector-sliders-rgb = RGB
|
||||
color-selector-sliders-hsv = HSV
|
||||
|
||||
option-button-filter = Filter
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
## EntitySpawnWindow
|
||||
|
||||
entity-spawn-window-title = Entity Spawn Panel
|
||||
entity-spawn-window-search-bar-placeholder = search
|
||||
entity-spawn-window-clear-button = Clear
|
||||
entity-spawn-window-replace-button-text = Replace
|
||||
entity-spawn-window-override-menu-tooltip = Override placement
|
||||
|
||||
## TileSpawnWindow
|
||||
|
||||
tile-spawn-window-title = Place Tiles
|
||||
tile-spawn-window-mirror-button-text = Mirror Tiles
|
||||
|
||||
## Console
|
||||
|
||||
console-line-edit-placeholder = Command Here
|
||||
|
||||
## OutputPanel
|
||||
|
||||
output-panel-scroll-down-button-text = Scroll Down
|
||||
|
||||
## Common Used
|
||||
|
||||
window-erase-button-text = Erase Mode
|
||||
window-search-bar-placeholder = Search
|
||||
window-clear-button = Clear
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
## "Textures" dev window tab
|
||||
|
||||
dev-window-tab-textures-title = Textures
|
||||
dev-window-tab-textures-reload = Reload
|
||||
dev-window-tab-textures-filter = Filter
|
||||
dev-window-tab-textures-summary = Total (est): { $bytes }
|
||||
dev-window-tab-textures-info = Width: { $width } Height: { $height }
|
||||
PixelType: { $pixelType } sRGB: { $srgb }
|
||||
Name: { $name }
|
||||
Est. memory usage: { $bytes }
|
||||
|
||||
## "Render Targets" dev window tab
|
||||
dev-window-tab-render-targets-title = Render Targets
|
||||
dev-window-tab-render-targets-reload = Reload
|
||||
dev-window-tab-render-targets-filter = Filter
|
||||
dev-window-tab-render-targets-column-id = ID
|
||||
dev-window-tab-render-targets-column-name = Name
|
||||
dev-window-tab-render-targets-column-size = Size
|
||||
dev-window-tab-render-targets-column-type = Type
|
||||
dev-window-tab-render-targets-column-vram = VRAM
|
||||
dev-window-tab-render-targets-column-thumbnail = Thumbnail
|
||||
|
||||
dev-window-tab-render-targets-value-null = null
|
||||
dev-window-tab-render-targets-value-not-available = Not available
|
||||
dev-window-tab-render-targets-summary = Total VRAM: { $vram }
|
||||
@@ -2,7 +2,6 @@ input-key-Escape = Escape
|
||||
input-key-Control = Control
|
||||
input-key-Shift = Shift
|
||||
input-key-Alt = Alt
|
||||
input-key-Alt-mac = ⌥
|
||||
input-key-Menu = Menu
|
||||
input-key-F1 = F1
|
||||
input-key-F2 = F2
|
||||
@@ -68,12 +67,11 @@ input-key-MouseButton6 = Mouse 6
|
||||
input-key-MouseButton7 = Mouse 7
|
||||
input-key-MouseButton8 = Mouse 8
|
||||
input-key-MouseButton9 = Mouse 9
|
||||
input-key-CapsLock = Caps Lock
|
||||
|
||||
input-key-LSystem-win = Left Win
|
||||
input-key-RSystem-win = Right Win
|
||||
input-key-LSystem-mac = Left ⌘
|
||||
input-key-RSystem-mac = Right ⌘
|
||||
input-key-LSystem-mac = Left Cmd
|
||||
input-key-RSystem-mac = Right Cmd
|
||||
input-key-LSystem-linux = Left Meta
|
||||
input-key-RSystem-linux = Right Meta
|
||||
|
||||
|
||||
@@ -195,8 +195,6 @@ command-description-spawn-at =
|
||||
Spawns an entity at the given coordinates.
|
||||
command-description-spawn-on =
|
||||
Spawns an entity on the given entity, at it's coordinates.
|
||||
command-description-spawn-in =
|
||||
Spawns an entity in the given container on the given entity, dropping it at its coordinates if it doesn't fit
|
||||
command-description-spawn-attached =
|
||||
Spawns an entity attached to the given entity, at (0 0) relative to it.
|
||||
command-description-mappos =
|
||||
@@ -428,7 +426,3 @@ command-description-cmd-info =
|
||||
On its own, this means it'll print the command's help message.
|
||||
command-description-comp-rm =
|
||||
Removes the given component from the entity.
|
||||
|
||||
command-description-overlay-toggle = Toggle an overlay on or off
|
||||
command-description-overlay-add = Add an overlay (if it does not already exist)
|
||||
command-description-overlay-remove = Remove an overlay
|
||||
|
||||
@@ -25,9 +25,3 @@ vv-sound-reference-distance = Reference Distance
|
||||
vv-sound-loop = Loop
|
||||
vv-sound-play-offset = Play Offset (s)
|
||||
vv-sound-variation = Pitch variation
|
||||
|
||||
|
||||
## ProtoId
|
||||
vv-protoid-id-placeholder = Prototype ID
|
||||
vv-protoid-select-button-label = Select
|
||||
vv-protoid-addwindow-title = Set Prototype
|
||||
|
||||
@@ -43,7 +43,6 @@ input-key-MouseButton6 = Mouse 6
|
||||
input-key-MouseButton7 = Mouse 7
|
||||
input-key-MouseButton8 = Mouse 8
|
||||
input-key-MouseButton9 = Mouse 9
|
||||
input-key-CapsLock = Caps Lock
|
||||
|
||||
input-key-LSystem-win = Left Win
|
||||
input-key-RSystem-win = Right Win
|
||||
|
||||
@@ -14,8 +14,6 @@ uniform highp vec2 lightCenter;
|
||||
uniform highp float lightRange;
|
||||
uniform highp float lightPower;
|
||||
uniform highp float lightSoftness;
|
||||
uniform highp float lightFalloff;
|
||||
uniform highp float lightCurveFactor;
|
||||
uniform highp float lightIndex;
|
||||
uniform sampler2D shadowMap;
|
||||
|
||||
@@ -49,15 +47,8 @@ void fragment()
|
||||
discard;
|
||||
}
|
||||
|
||||
// this implementation of light attenuation primarily adapted from
|
||||
// https://lisyarus.github.io/blog/posts/point-light-attenuation.html
|
||||
highp float sqr_dist = dot(diff, diff) + LIGHTING_HEIGHT;
|
||||
|
||||
highp float s = clamp(sqrt(sqr_dist) / lightRange, 0.0, 1.0);
|
||||
highp float s2 = s * s;
|
||||
// controls curve by lerping between two variants (inverse-shape and inversequadratic-shape)
|
||||
highp float curveFactor = mix(s, s2, clamp(lightCurveFactor, 0.0, 1.0));
|
||||
highp float val = clamp(((1.0 - s2) * (1.0 - s2)) / (1.0 + lightFalloff * curveFactor), 0.0, 1.0);
|
||||
highp float dist = dot(diff, diff) + LIGHTING_HEIGHT;
|
||||
highp float val = clamp((1.0 - clamp(sqrt(dist) / lightRange, 0.0, 1.0)) * (1.0 / (sqrt(dist + 1.0))), 0.0, 1.0);
|
||||
|
||||
val *= lightPower;
|
||||
val *= mask;
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.CSharp.Testing;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.AfterAutoHandleStateAnalyzer,
|
||||
Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
|
||||
[TestFixture, TestOf(typeof(AfterAutoHandleStateAnalyzer))]
|
||||
public sealed class AfterAutoHandleStateAnalyzerTest
|
||||
{
|
||||
private const string SubscribeEventDef = """
|
||||
using System;
|
||||
namespace Robust.Shared.GameObjects;
|
||||
|
||||
public readonly struct EntityUid;
|
||||
|
||||
public abstract class EntitySystem
|
||||
{
|
||||
public void SubscribeLocalEvent<T, TEvent>() where TEvent : notnull { }
|
||||
}
|
||||
|
||||
public interface IComponent;
|
||||
public interface IComponentState;
|
||||
""";
|
||||
|
||||
// A rare case for block-scoped namespace, I thought. Then I realized this
|
||||
// only needed the one type definition.
|
||||
private const string OtherTypeDefs = """
|
||||
using System;
|
||||
|
||||
namespace JetBrains.Annotations
|
||||
{
|
||||
public sealed class BaseTypeRequiredAttribute(Type baseType) : Attribute;
|
||||
}
|
||||
""";
|
||||
|
||||
private static Task Verifier(string code, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new CSharpAnalyzerTest<AfterAutoHandleStateAnalyzer, DefaultVerifier>
|
||||
{
|
||||
TestState = { Sources = { code } }
|
||||
};
|
||||
|
||||
TestHelper.AddEmbeddedSources(test.TestState,
|
||||
"Robust.Shared.Analyzers.ComponentNetworkGeneratorAuxiliary.cs",
|
||||
"Robust.Shared.GameObjects.EventBusAttributes.cs");
|
||||
|
||||
test.TestState.Sources.Add(("EntitySystem.Subscriptions.cs", SubscribeEventDef));
|
||||
test.TestState.Sources.Add(("Types.cs", OtherTypeDefs));
|
||||
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
[AutoGenerateComponentState(true)]
|
||||
public sealed class AutoGenTrue;
|
||||
[AutoGenerateComponentState(true, true)]
|
||||
public sealed class AutoGenTrueTrue;
|
||||
|
||||
public sealed class NotAutoGen;
|
||||
[AutoGenerateComponentState]
|
||||
public sealed class AutoGenNoArgs;
|
||||
[AutoGenerateComponentState(false)]
|
||||
public sealed class AutoGenFalse;
|
||||
|
||||
public sealed class Foo : EntitySystem
|
||||
{
|
||||
public void Good()
|
||||
{
|
||||
// Subscribing to other events works
|
||||
SubscribeLocalEvent<AutoGenNoArgs, object>();
|
||||
// First arg true allows subscribing
|
||||
SubscribeLocalEvent<AutoGenTrue, AfterAutoHandleStateEvent>();
|
||||
SubscribeLocalEvent<AutoGenTrueTrue, AfterAutoHandleStateEvent>();
|
||||
}
|
||||
|
||||
public void Bad()
|
||||
{
|
||||
// Can't subscribe if AutoGenerateComponentState isn't even present
|
||||
SubscribeLocalEvent<NotAutoGen, AfterAutoHandleStateEvent>();
|
||||
|
||||
// Can't subscribe if first arg is not specified/false
|
||||
SubscribeLocalEvent<AutoGenNoArgs, AfterAutoHandleStateEvent>();
|
||||
SubscribeLocalEvent<AutoGenFalse, AfterAutoHandleStateEvent>();
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(29,9): error RA0040: Tried to subscribe to AfterAutoHandleStateEvent for 'NotAutoGen' which doesn't have an AutoGenerateComponentState attribute
|
||||
VerifyCS.Diagnostic(AfterAutoHandleStateAnalyzer.MissingAttribute).WithSpan(29, 9, 29, 69).WithArguments("NotAutoGen"),
|
||||
// /0/Test0.cs(32,9): error RA0041: Tried to subscribe to AfterAutoHandleStateEvent for 'AutoGenNoArgs' which doesn't have raiseAfterAutoHandleState set
|
||||
VerifyCS.Diagnostic(AfterAutoHandleStateAnalyzer.MissingAttributeParam).WithSpan(32, 9, 32, 72).WithArguments("AutoGenNoArgs"),
|
||||
// /0/Test0.cs(33,9): error RA0041: Tried to subscribe to AfterAutoHandleStateEvent for 'AutoGenFalse' which doesn't have raiseAfterAutoHandleState set
|
||||
VerifyCS.Diagnostic(AfterAutoHandleStateAnalyzer.MissingAttributeParam).WithSpan(33, 9, 33, 71).WithArguments("AutoGenFalse")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
extern alias SerializationGenerator;
|
||||
extern alias SerializationGenerator;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.CodeAnalysis;
|
||||
@@ -126,48 +126,6 @@ public sealed class ComponentPauseGeneratorTest
|
||||
""");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDictionary()
|
||||
{
|
||||
var result = RunGenerator("""
|
||||
[AutoGenerateComponentPause]
|
||||
public sealed partial class FooComponent : IComponent
|
||||
{
|
||||
[AutoPausedField]
|
||||
public Dictionary<string, TimeSpan> Foo;
|
||||
}
|
||||
""");
|
||||
|
||||
ExpectNoDiagnostics(result);
|
||||
ExpectSource(
|
||||
result,
|
||||
"""
|
||||
// <auto-generated />
|
||||
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
public partial class FooComponent
|
||||
{
|
||||
[RobustAutoGenerated]
|
||||
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public sealed class FooComponent_AutoPauseSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<FooComponent, EntityUnpausedEvent>(OnEntityUnpaused);
|
||||
}
|
||||
|
||||
private void OnEntityUnpaused(EntityUid uid, FooComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
foreach (var key in component.Foo.Keys)
|
||||
component.Foo[key] += args.PausedTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
""");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAutoState()
|
||||
{
|
||||
|
||||
@@ -21,53 +21,47 @@ public sealed class DataDefinitionAnalyzerTest
|
||||
},
|
||||
};
|
||||
|
||||
test.TestState.Sources.Add(("TestTypeDefs.cs", TestTypeDefs));
|
||||
|
||||
// ExpectedDiagnostics cannot be set, so we need to AddRange here...
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
private const string TestTypeDefs = """
|
||||
using System;
|
||||
|
||||
namespace Robust.Shared.ViewVariables
|
||||
{
|
||||
public sealed class ViewVariablesAttribute : Attribute
|
||||
{
|
||||
public readonly VVAccess Access = VVAccess.ReadOnly;
|
||||
|
||||
public ViewVariablesAttribute() { }
|
||||
|
||||
public ViewVariablesAttribute(VVAccess access)
|
||||
{
|
||||
Access = access;
|
||||
}
|
||||
}
|
||||
public enum VVAccess : byte
|
||||
{
|
||||
ReadOnly = 0,
|
||||
ReadWrite = 1,
|
||||
}
|
||||
}
|
||||
|
||||
namespace Robust.Shared.Serialization.Manager.Attributes
|
||||
{
|
||||
public class DataFieldBaseAttribute : Attribute;
|
||||
public class DataFieldAttribute(string? tag = null) : DataFieldBaseAttribute;
|
||||
public sealed class DataDefinitionAttribute : Attribute;
|
||||
public sealed class NotYamlSerializableAttribute : Attribute;
|
||||
}
|
||||
""";
|
||||
|
||||
[Test]
|
||||
public async Task NoVVReadOnlyTest()
|
||||
public async Task Test()
|
||||
{
|
||||
const string code = """
|
||||
using System;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Robust.Shared.ViewVariables
|
||||
{
|
||||
public sealed class ViewVariablesAttribute : Attribute
|
||||
{
|
||||
public readonly VVAccess Access = VVAccess.ReadOnly;
|
||||
|
||||
public ViewVariablesAttribute() { }
|
||||
|
||||
public ViewVariablesAttribute(VVAccess access)
|
||||
{
|
||||
Access = access;
|
||||
}
|
||||
}
|
||||
public enum VVAccess : byte
|
||||
{
|
||||
ReadOnly = 0,
|
||||
ReadWrite = 1,
|
||||
}
|
||||
}
|
||||
|
||||
namespace Robust.Shared.Serialization.Manager.Attributes
|
||||
{
|
||||
public class DataFieldBaseAttribute : Attribute;
|
||||
public class DataFieldAttribute : DataFieldBaseAttribute;
|
||||
public sealed class DataDefinitionAttribute : Attribute;
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
public sealed partial class Foo
|
||||
{
|
||||
@@ -89,168 +83,8 @@ public sealed class DataDefinitionAnalyzerTest
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(7,17): info RA0028: Data field Bad in data definition Foo has ViewVariables attribute with ReadWrite access, which is redundant
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldNoVVReadWriteRule).WithSpan(7, 17, 7, 50).WithArguments("Bad", "Foo")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ReadOnlyFieldTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed partial class Foo
|
||||
{
|
||||
[DataField]
|
||||
public readonly int Bad;
|
||||
|
||||
[DataField]
|
||||
public int Good;
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(7,12): error RA0019: Data field Bad in data definition Foo is readonly
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldWritableRule).WithSpan(7, 12, 7, 20).WithArguments("Bad", "Foo")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task PartialDataDefinitionTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class Foo { }
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(4,15): error RA0017: Type Foo is a DataDefinition but is not partial
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataDefinitionPartialRule).WithSpan(4, 15, 4, 20).WithArguments("Foo")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task NestedPartialDataDefinitionTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
public sealed class Foo
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed partial class Nested { }
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(3,15): error RA0018: Type Foo contains nested data definition Nested but is not partial
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.NestedDataDefinitionPartialRule).WithSpan(3, 15, 3, 20).WithArguments("Foo", "Nested")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task RedundantDataFieldTagTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed partial class Foo
|
||||
{
|
||||
[DataField("someValue")]
|
||||
public int SomeValue;
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(6,6): info RA0027: Data field SomeValue in data definition Foo has an explicitly set tag that matches autogenerated tag
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldRedundantTagRule).WithSpan(6, 6, 6, 28).WithArguments("SomeValue", "Foo")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ReadOnlyPropertyTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed partial class Foo
|
||||
{
|
||||
[DataField]
|
||||
public int Bad { get; }
|
||||
|
||||
[DataField]
|
||||
public int Good { get; private set; }
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(7,20): error RA0020: Data field property Bad in data definition Foo does not have a setter
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldPropertyWritableRule).WithSpan(7, 20, 7, 28).WithArguments("Bad", "Foo")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task NotYamlSerializableTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
[NotYamlSerializable]
|
||||
public sealed class NotSerializableClass { }
|
||||
[NotYamlSerializable]
|
||||
public readonly struct NotSerializableStruct { }
|
||||
|
||||
[DataDefinition]
|
||||
public sealed partial class Foo
|
||||
{
|
||||
[DataField]
|
||||
public NotSerializableClass BadField;
|
||||
|
||||
[DataField]
|
||||
public NotSerializableClass BadProperty { get; set; }
|
||||
|
||||
[DataField]
|
||||
public NotSerializableClass? BadNullableField;
|
||||
|
||||
[DataField]
|
||||
public NotSerializableStruct BadStructField;
|
||||
|
||||
[DataField]
|
||||
public NotSerializableStruct BadStructProperty { get; set; }
|
||||
|
||||
[DataField]
|
||||
public NotSerializableStruct? BadNullableStructField;
|
||||
|
||||
[DataField]
|
||||
public NotSerializableStruct? BadNullableStructProperty { get; set; }
|
||||
|
||||
public NotSerializableClass GoodField; // Not a DataField, not a problem
|
||||
|
||||
public NotSerializableClass GoodProperty { get; set; } // Not a DataField, not a problem
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(12,12): error RA0033: Data field BadField in data definition Foo is type NotSerializableClass, which is not YAML serializable
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldYamlSerializableRule).WithSpan(12, 12, 12, 32).WithArguments("BadField", "Foo", "NotSerializableClass"),
|
||||
// /0/Test0.cs(15,12): error RA0033: Data field BadProperty in data definition Foo is type NotSerializableClass, which is not YAML serializable
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldYamlSerializableRule).WithSpan(15, 12, 15, 32).WithArguments("BadProperty", "Foo", "NotSerializableClass"),
|
||||
// /0/Test0.cs(18,12): error RA0036: Data field BadNullableField in data definition Foo is type NotSerializableClass, which is not YAML serializable
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldYamlSerializableRule).WithSpan(18, 12, 18, 33).WithArguments("BadNullableField", "Foo", "NotSerializableClass"),
|
||||
// /0/Test0.cs(21,12): error RA0036: Data field BadStructField in data definition Foo is type NotSerializableStruct, which is not YAML serializable
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldYamlSerializableRule).WithSpan(21, 12, 21, 33).WithArguments("BadStructField", "Foo", "NotSerializableStruct"),
|
||||
// /0/Test0.cs(24,12): error RA0036: Data field BadStructProperty in data definition Foo is type NotSerializableStruct, which is not YAML serializable
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldYamlSerializableRule).WithSpan(24, 12, 24, 33).WithArguments("BadStructProperty", "Foo", "NotSerializableStruct"),
|
||||
// /0/Test0.cs(27,12): error RA0036: Data field BadNullableStructField in data definition Foo is type NotSerializableStruct, which is not YAML serializable
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldYamlSerializableRule).WithSpan(27, 12, 27, 34).WithArguments("BadNullableStructField", "Foo", "NotSerializableStruct"),
|
||||
// /0/Test0.cs(30,12): error RA0036: Data field BadNullableStructProperty in data definition Foo is type NotSerializableStruct, which is not YAML serializable
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldYamlSerializableRule).WithSpan(30, 12, 30, 34).WithArguments("BadNullableStructProperty", "Foo", "NotSerializableStruct")
|
||||
// /0/Test0.cs(35,17): info RA0028: Data field Bad in data definition Foo has ViewVariables attribute with ReadWrite access, which is redundant
|
||||
VerifyCS.Diagnostic(DataDefinitionAnalyzer.DataFieldNoVVReadWriteRule).WithSpan(35, 17, 35, 50).WithArguments("Bad", "Foo")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.CSharp.Testing;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.ForbidLiteralAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
|
||||
[TestFixture]
|
||||
public sealed class ForbidLiteralAnalyzerTest
|
||||
{
|
||||
private static Task Verifier(string code, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new CSharpAnalyzerTest<ForbidLiteralAnalyzer, DefaultVerifier>()
|
||||
{
|
||||
TestState =
|
||||
{
|
||||
Sources = { code },
|
||||
},
|
||||
};
|
||||
|
||||
TestHelper.AddEmbeddedSources(
|
||||
test.TestState,
|
||||
"Robust.Shared.Analyzers.ForbidLiteralAttribute.cs"
|
||||
);
|
||||
|
||||
test.TestState.Sources.Add(("TestTypeDefs.cs", TestTypeDefs));
|
||||
|
||||
// ExpectedDiagnostics cannot be set, so we need to AddRange here...
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
private const string TestTypeDefs = """
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.Analyzers;
|
||||
|
||||
public sealed class TestClass
|
||||
{
|
||||
public static void OneParameterForbidden([ForbidLiteral] string value) { }
|
||||
public static void TwoParametersFirstForbidden([ForbidLiteral] string first, string second) { }
|
||||
public static void TwoParametersBothForbidden([ForbidLiteral] string first, [ForbidLiteral] string second) { }
|
||||
public static void ListParameterForbidden([ForbidLiteral] List<string> values) { }
|
||||
public static void ParamsListParameterForbidden([ForbidLiteral] params List<string> values) { }
|
||||
}
|
||||
|
||||
public record struct StringWrapper(string value)
|
||||
{
|
||||
private readonly string _value = value;
|
||||
|
||||
public static implicit operator string(StringWrapper wrapper)
|
||||
{
|
||||
return wrapper._value;
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
[Test]
|
||||
public async Task TestOneParameter()
|
||||
{
|
||||
const string code = """
|
||||
public sealed class Tester
|
||||
{
|
||||
private const string _constValue = "foo";
|
||||
private static readonly string StaticValue = "bar";
|
||||
private static readonly StringWrapper WrappedValue = new("biz");
|
||||
|
||||
public void Test()
|
||||
{
|
||||
TestClass.OneParameterForbidden(_constValue);
|
||||
TestClass.OneParameterForbidden(StaticValue);
|
||||
TestClass.OneParameterForbidden(WrappedValue);
|
||||
TestClass.OneParameterForbidden("baz");
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(12,41): error RA0033: The "value" parameter of OneParameterForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(12, 41, 12, 46).WithArguments("value", "OneParameterForbidden")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestTwoParametersFirstForbidden()
|
||||
{
|
||||
const string code = """
|
||||
public sealed class Tester
|
||||
{
|
||||
private const string _constValue = "foo";
|
||||
|
||||
public void Test()
|
||||
{
|
||||
TestClass.TwoParametersFirstForbidden(_constValue, "whatever");
|
||||
TestClass.TwoParametersFirstForbidden(_constValue, _constValue);
|
||||
TestClass.TwoParametersFirstForbidden("foo", "whatever");
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(9,47): error RA0033: The "first" parameter of TwoParametersFirstForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(9, 47, 9, 52).WithArguments("first", "TwoParametersFirstForbidden")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestTwoParametersBothForbidden()
|
||||
{
|
||||
const string code = """
|
||||
public sealed class Tester
|
||||
{
|
||||
private const string _constValue = "foo";
|
||||
private static readonly string StaticValue = "bar";
|
||||
|
||||
public void Test()
|
||||
{
|
||||
TestClass.TwoParametersBothForbidden(_constValue, _constValue);
|
||||
TestClass.TwoParametersBothForbidden(_constValue, StaticValue);
|
||||
TestClass.TwoParametersBothForbidden(_constValue, "whatever");
|
||||
TestClass.TwoParametersBothForbidden("whatever", _constValue);
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(10,59): error RA0033: The "second" parameter of TwoParametersBothForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(10, 59, 10, 69).WithArguments("second", "TwoParametersBothForbidden"),
|
||||
// /0/Test0.cs(11,46): error RA0033: The "first" parameter of TwoParametersBothForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(11, 46, 11, 56).WithArguments("first", "TwoParametersBothForbidden")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestListParameter()
|
||||
{
|
||||
const string code = """
|
||||
public sealed class Tester
|
||||
{
|
||||
private const string _constValue = "foo";
|
||||
private static readonly string StaticValue = "bar";
|
||||
private static readonly StringWrapper WrappedValue = new("biz");
|
||||
|
||||
public void Test()
|
||||
{
|
||||
TestClass.ListParameterForbidden([_constValue, StaticValue, WrappedValue]);
|
||||
TestClass.ListParameterForbidden(["foo", _constValue, "bar"]);
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(10,43): warning RA0033: The "values" parameter of ListParameterForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(10, 43, 10, 48).WithArguments("values", "ListParameterForbidden"),
|
||||
// /0/Test0.cs(10,63): warning RA0033: The "values" parameter of ListParameterForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(10, 63, 10, 68).WithArguments("values", "ListParameterForbidden")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestParamsListParameter()
|
||||
{
|
||||
const string code = """
|
||||
public sealed class Tester
|
||||
{
|
||||
private const string _constValue = "foo";
|
||||
private static readonly string StaticValue = "bar";
|
||||
private static readonly StringWrapper WrappedValue = new("biz");
|
||||
|
||||
public void Test()
|
||||
{
|
||||
TestClass.ParamsListParameterForbidden(_constValue, StaticValue, WrappedValue);
|
||||
TestClass.ParamsListParameterForbidden("foo", _constValue, "bar");
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(10,48): warning RA0033: The "values" parameter of ParamsListParameterForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(10, 48, 10, 53).WithArguments("values", "ParamsListParameterForbidden"),
|
||||
// /0/Test0.cs(10,68): warning RA0033: The "values" parameter of ParamsListParameterForbidden forbids literal values
|
||||
VerifyCS.Diagnostic().WithSpan(10, 68, 10, 73).WithArguments("values", "ParamsListParameterForbidden")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.CSharp.Testing;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.ObsoleteInheritanceAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Analyzer that implements <c>[ObsoleteInheritance]</c> checking, to give obsoletion warnings for inheriting types
|
||||
/// that should never have been virtual.
|
||||
/// </summary>
|
||||
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
|
||||
[TestFixture]
|
||||
public sealed class ObsoleteInheritanceAnalyzerTest
|
||||
{
|
||||
private static Task Verifier(string code, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new CSharpAnalyzerTest<ObsoleteInheritanceAnalyzer, DefaultVerifier>()
|
||||
{
|
||||
TestState =
|
||||
{
|
||||
Sources = { code },
|
||||
},
|
||||
};
|
||||
|
||||
TestHelper.AddEmbeddedSources(
|
||||
test.TestState,
|
||||
"Robust.Shared.Analyzers.ObsoleteInheritanceAttribute.cs"
|
||||
);
|
||||
|
||||
// ExpectedDiagnostics cannot be set, so we need to AddRange here...
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestBasic()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Analyzers;
|
||||
|
||||
[ObsoleteInheritance]
|
||||
public class Base;
|
||||
|
||||
public class NotAllowed : Base;
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(6,14): warning RA0034: Type 'NotAllowed' inherits from 'Base', which has obsoleted inheriting from itself
|
||||
VerifyCS.Diagnostic(ObsoleteInheritanceAnalyzer.Rule).WithSpan(6, 14, 6, 24).WithArguments("NotAllowed", "Base")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestMessage()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Analyzers;
|
||||
|
||||
[ObsoleteInheritance("Sus")]
|
||||
public class Base;
|
||||
|
||||
public class NotAllowed : Base;
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(6,14): warning RA0034: Type 'NotAllowed' inherits from 'Base', which has obsoleted inheriting from itself: "Sus"
|
||||
VerifyCS.Diagnostic(ObsoleteInheritanceAnalyzer.RuleWithMessage).WithSpan(6, 14, 6, 24).WithArguments("NotAllowed", "Base", "Sus")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestNormal()
|
||||
{
|
||||
const string code = """
|
||||
public class Base;
|
||||
|
||||
public class AllowedAllowed : Base;
|
||||
""";
|
||||
|
||||
await Verifier(code);
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.PrototypeAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
|
||||
[TestFixture]
|
||||
[TestOf(typeof(PrototypeAnalyzer))]
|
||||
public sealed class PrototypeAnalyzerTest
|
||||
{
|
||||
private static Task Verifier(string code, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new RTAnalyzerTest<PrototypeAnalyzer>()
|
||||
{
|
||||
TestState =
|
||||
{
|
||||
Sources = { code }
|
||||
},
|
||||
};
|
||||
|
||||
TestHelper.AddEmbeddedSources(
|
||||
test.TestState,
|
||||
"Robust.Shared.Prototypes.Attributes.cs",
|
||||
"Robust.Shared.Prototypes.IPrototype.cs",
|
||||
"Robust.Shared.Serialization.Manager.Attributes.DataFieldAttribute.cs"
|
||||
);
|
||||
|
||||
// ExpectedDiagnostics cannot be set, so we need to AddRange here...
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task RedundantTypeTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
[Prototype]
|
||||
public sealed partial class GoodAutoPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[Prototype("someOtherName")]
|
||||
public sealed partial class GoodUnmatchedPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[Prototype("badMatched")]
|
||||
public sealed partial class BadMatchedPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[Prototype(ProtoName)]
|
||||
public sealed partial class GoodNonLiteralMatchedPrototype : IPrototype
|
||||
{
|
||||
public const string ProtoName = "goodNonLiteralMatched";
|
||||
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[Prototype(ProtoName)]
|
||||
public sealed partial class GoodNonLiteralUnmatchedPrototype : IPrototype
|
||||
{
|
||||
public const string ProtoName = "someOtherNameEntirely";
|
||||
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[Prototype("goodDoesNotEndWithPrototypeWord")]
|
||||
public sealed partial class GoodDoesNotEndWithPrototypeWord : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(9,2): warning RA0033: Prototype BadMatchedPrototype has explicitly set type "badMatched" that matches autogenerated value
|
||||
VerifyCS.Diagnostic(PrototypeAnalyzer.PrototypeRedundantTypeRule).WithSpan(17, 12, 17, 24).WithArguments("BadMatchedPrototype", "badMatched")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AliasTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Prototypes;
|
||||
using PPrototypeAttribute = Robust.Shared.Prototypes.PrototypeAttribute;
|
||||
|
||||
[PPrototype("badMatched")]
|
||||
public sealed partial class BadMatchedPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(4,2): warning RA0042: Prototype BadMatchedPrototype has explicitly set type "badMatched" that matches autogenerated value
|
||||
VerifyCS.Diagnostic(PrototypeAnalyzer.PrototypeRedundantTypeRule).WithSpan(4, 13, 4, 25).WithArguments("BadMatchedPrototype", "badMatched")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public async Task MoreAttributesTest()
|
||||
{
|
||||
const string code = """
|
||||
using System;
|
||||
using Robust.Shared.Prototypes;
|
||||
using PPrototypeAttribute = Robust.Shared.Prototypes.PrototypeAttribute;
|
||||
|
||||
[FooBarAttribute]
|
||||
[PPrototype("badMatched")]
|
||||
public sealed partial class BadMatchedPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
|
||||
public sealed class FooBarAttribute : Attribute;
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(4,2): warning RA0042: Prototype BadMatchedPrototype has explicitly set type "badMatched" that matches autogenerated value
|
||||
VerifyCS.Diagnostic(PrototypeAnalyzer.PrototypeRedundantTypeRule).WithSpan(6, 13, 6, 25).WithArguments("BadMatchedPrototype", "badMatched")
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task NameEndsWithPrototypeTest()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
[Prototype]
|
||||
public sealed partial class GoodAutoPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[Prototype("ThisIsFine")]
|
||||
public sealed partial class GoodManual : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
[Prototype]
|
||||
public sealed partial class BadAuto : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(18,29): error RA0043: Prototype BadAuto does not end with the word Prototype
|
||||
VerifyCS.Diagnostic(PrototypeAnalyzer.PrototypeEndsWithPrototypeRule).WithSpan(18, 29, 18, 36).WithArguments("BadAuto")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.CSharp.Testing;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.PrototypeAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
public sealed class PrototypeFixerTest
|
||||
{
|
||||
private static Task Verifier(string code, string fixedCode, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new CSharpCodeFixTest<PrototypeAnalyzer, PrototypeFixer, DefaultVerifier>()
|
||||
{
|
||||
TestState =
|
||||
{
|
||||
Sources = { code },
|
||||
},
|
||||
FixedState =
|
||||
{
|
||||
Sources = { fixedCode },
|
||||
}
|
||||
};
|
||||
|
||||
test.TestState.Sources.Add(("PrototypeAttribute.cs", PrototypeAttributeDef));
|
||||
test.FixedState.Sources.Add(("PrototypeAttribute.cs", PrototypeAttributeDef));
|
||||
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
private const string PrototypeAttributeDef = """
|
||||
using System;
|
||||
|
||||
namespace Robust.Shared.Prototypes
|
||||
{
|
||||
public class PrototypeAttribute : Attribute
|
||||
{
|
||||
public string? Type { get; internal set; }
|
||||
public readonly int LoadPriority = 1;
|
||||
|
||||
public PrototypeAttribute(string? type = null, int loadPriority = 1)
|
||||
{
|
||||
Type = type;
|
||||
LoadPriority = loadPriority;
|
||||
}
|
||||
|
||||
public PrototypeAttribute(int loadPriority)
|
||||
{
|
||||
Type = null;
|
||||
LoadPriority = loadPriority;
|
||||
}
|
||||
}
|
||||
public interface IPrototype;
|
||||
}
|
||||
""";
|
||||
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
[Prototype]
|
||||
public sealed partial class GoodAutoPrototype : IPrototype;
|
||||
|
||||
[Prototype("someOtherName")]
|
||||
public sealed partial class GoodUnmatchedPrototype : IPrototype;
|
||||
|
||||
[Prototype("badMatched")]
|
||||
public sealed partial class BadMatchedPrototype : IPrototype;
|
||||
""";
|
||||
|
||||
const string fixedCode = """
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
[Prototype]
|
||||
public sealed partial class GoodAutoPrototype : IPrototype;
|
||||
|
||||
[Prototype("someOtherName")]
|
||||
public sealed partial class GoodUnmatchedPrototype : IPrototype;
|
||||
|
||||
[Prototype]
|
||||
public sealed partial class BadMatchedPrototype : IPrototype;
|
||||
""";
|
||||
|
||||
await Verifier(code, fixedCode,
|
||||
// /0/Test0.cs(9,2): warning RA0033: Prototype BadMatchedPrototype has explicitly set type "badMatched" that matches autogenerated value
|
||||
VerifyCS.Diagnostic(PrototypeAnalyzer.PrototypeRedundantTypeRule).WithSpan(9, 12, 9, 24).WithArguments("BadMatchedPrototype", "badMatched")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.PrototypeInstantiationAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
|
||||
[TestFixture]
|
||||
[TestOf(typeof(PrototypeInstantiationAnalyzer))]
|
||||
public sealed class PrototypeInstantiationAnalyzerTest
|
||||
{
|
||||
private static Task Verifier(string code, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new RTAnalyzerTest<PrototypeInstantiationAnalyzer>()
|
||||
{
|
||||
TestState =
|
||||
{
|
||||
Sources = { code }
|
||||
},
|
||||
};
|
||||
|
||||
TestHelper.AddEmbeddedSources(
|
||||
test.TestState,
|
||||
"Robust.Shared.Prototypes.Attributes.cs",
|
||||
"Robust.Shared.Prototypes.IPrototype.cs",
|
||||
"Robust.Shared.Serialization.Manager.Attributes.DataFieldAttribute.cs"
|
||||
);
|
||||
|
||||
// ExpectedDiagnostics cannot be set, so we need to AddRange here...
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
const string code = """
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
[Prototype]
|
||||
public sealed class FooPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
|
||||
public static class Bad
|
||||
{
|
||||
public static FooPrototype Real()
|
||||
{
|
||||
return new FooPrototype();
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(15,16): warning RA0039: Do not instantiate prototypes directly. Prototypes should always be instantiated by the prototype manager.
|
||||
VerifyCS.Diagnostic().WithSpan(15, 16, 15, 34));
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.PrototypeNetSerializableAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
|
||||
[TestFixture]
|
||||
[TestOf(typeof(PrototypeNetSerializableAnalyzer))]
|
||||
public sealed class PrototypeNetSerializableAnalyzerTest
|
||||
{
|
||||
private static Task Verifier(string code, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new RTAnalyzerTest<PrototypeNetSerializableAnalyzer>()
|
||||
{
|
||||
TestState =
|
||||
{
|
||||
Sources = { code }
|
||||
},
|
||||
};
|
||||
|
||||
TestHelper.AddEmbeddedSources(
|
||||
test.TestState,
|
||||
"Robust.Shared.Serialization.NetSerializableAttribute.cs",
|
||||
"Robust.Shared.Prototypes.Attributes.cs",
|
||||
"Robust.Shared.Prototypes.IPrototype.cs",
|
||||
"Robust.Shared.Serialization.Manager.Attributes.DataFieldAttribute.cs"
|
||||
);
|
||||
|
||||
// ExpectedDiagnostics cannot be set, so we need to AddRange here...
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
const string code = """
|
||||
using System;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
[Prototype]
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class FooPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(7,21): warning RA0037: Type FooPrototype is a prototype and marked as [NetSerializable]. Prototypes should not be directly sent over the network, send their IDs instead.
|
||||
VerifyCS.Diagnostic(PrototypeNetSerializableAnalyzer.RuleNetSerializable).WithSpan(7, 21, 7, 33).WithArguments("FooPrototype"),
|
||||
// /0/Test0.cs(7,21): warning RA0038: Type FooPrototype is a prototype and marked as [Serializable]. Prototypes should not be directly sent over the network, send their IDs instead.
|
||||
VerifyCS.Diagnostic(PrototypeNetSerializableAnalyzer.RuleSerializable).WithSpan(7, 21, 7, 33).WithArguments("FooPrototype"));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Testing;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
public sealed class RTAnalyzerTest<TAnalyzer> : CSharpAnalyzerTest<TAnalyzer, DefaultVerifier>
|
||||
where TAnalyzer : DiagnosticAnalyzer, new()
|
||||
{
|
||||
protected override ParseOptions CreateParseOptions()
|
||||
{
|
||||
var baseOptions = (CSharpParseOptions) base.CreateParseOptions();
|
||||
return baseOptions.WithPreprocessorSymbols("ROBUST_ANALYZERS_TEST");
|
||||
}
|
||||
}
|
||||
@@ -10,19 +10,11 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\AccessAttribute.cs" LogicalName="Robust.Shared.Analyzers.AccessAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\AccessPermissions.cs" LogicalName="Robust.Shared.Analyzers.AccessPermissions.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\ComponentNetworkGeneratorAuxiliary.cs" LogicalName="Robust.Shared.Analyzers.ComponentNetworkGeneratorAuxiliary.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\MustCallBaseAttribute.cs" LogicalName="Robust.Shared.IoC.MustCallBaseAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\PreferNonGenericVariantForAttribute.cs" LogicalName="Robust.Shared.Analyzers.PreferNonGenericVariantForAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\PreferOtherTypeAttribute.cs" LogicalName="Robust.Shared.Analyzers.PreferOtherTypeAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\ForbidLiteralAttribute.cs" LogicalName="Robust.Shared.Analyzers.ForbidLiteralAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\ObsoleteInheritanceAttribute.cs" LogicalName="Robust.Shared.Analyzers.ObsoleteInheritanceAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Analyzers\ValidateMemberAttribute.cs" LogicalName="Robust.Shared.Analyzers.ValidateMemberAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\IoC\DependencyAttribute.cs" LogicalName="Robust.Shared.IoC.DependencyAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\GameObjects\EventBusAttributes.cs" LogicalName="Robust.Shared.GameObjects.EventBusAttributes.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Serialization\NetSerializableAttribute.cs" LogicalName="Robust.Shared.Serialization.NetSerializableAttribute.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Prototypes\Attributes.cs" LogicalName="Robust.Shared.Prototypes.Attributes.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Prototypes\IPrototype.cs" LogicalName="Robust.Shared.Prototypes.IPrototype.cs" LinkBase="Implementations" />
|
||||
<EmbeddedResource Include="..\Robust.Shared\Serialization\Manager\Attributes\DataFieldAttribute.cs" LogicalName="Robust.Shared.Serialization.Manager.Attributes.DataFieldAttribute.cs" LinkBase="Implementations" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.CSharp.Testing;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using NUnit.Framework;
|
||||
using VerifyCS =
|
||||
Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Robust.Analyzers.ValidateMemberAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>;
|
||||
|
||||
|
||||
namespace Robust.Analyzers.Tests;
|
||||
|
||||
public sealed class ValidateMemberAnalyzerTest
|
||||
{
|
||||
private static Task Verifier(string code, params DiagnosticResult[] expected)
|
||||
{
|
||||
var test = new CSharpAnalyzerTest<ValidateMemberAnalyzer, DefaultVerifier>()
|
||||
{
|
||||
TestState =
|
||||
{
|
||||
Sources = { code },
|
||||
},
|
||||
};
|
||||
|
||||
TestHelper.AddEmbeddedSources(
|
||||
test.TestState,
|
||||
"Robust.Shared.Analyzers.ValidateMemberAttribute.cs"
|
||||
);
|
||||
|
||||
// ExpectedDiagnostics cannot be set, so we need to AddRange here...
|
||||
test.TestState.ExpectedDiagnostics.AddRange(expected);
|
||||
|
||||
return test.RunAsync();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
const string code = """
|
||||
using System;
|
||||
using Robust.Shared.Analyzers;
|
||||
|
||||
public sealed class TestComponent
|
||||
{
|
||||
public int IntField;
|
||||
public bool BoolField;
|
||||
}
|
||||
|
||||
public sealed class OtherComponent
|
||||
{
|
||||
public float FloatField;
|
||||
public double DoubleField;
|
||||
}
|
||||
|
||||
public sealed class TestManager
|
||||
{
|
||||
public static void DirtyField<T>(T comp, [ValidateMember]string fieldName) { }
|
||||
public static void DirtyTwoFields<T>(T comp, [ValidateMember]string first, [ValidateMember]string second) { }
|
||||
}
|
||||
|
||||
public sealed class TestCaller
|
||||
{
|
||||
public void Test()
|
||||
{
|
||||
var testComp = new TestComponent();
|
||||
var otherComp = new OtherComponent();
|
||||
|
||||
TestManager.DirtyField(testComp, nameof(TestComponent.IntField));
|
||||
|
||||
TestManager.DirtyField(testComp, nameof(OtherComponent.FloatField));
|
||||
|
||||
TestManager.DirtyField(otherComp, nameof(TestComponent.IntField));
|
||||
|
||||
TestManager.DirtyField(otherComp, nameof(OtherComponent.FloatField));
|
||||
|
||||
TestManager.DirtyTwoFields(testComp, nameof(TestComponent.IntField), nameof(TestComponent.BoolField));
|
||||
|
||||
TestManager.DirtyTwoFields(testComp, nameof(TestComponent.IntField), nameof(OtherComponent.FloatField));
|
||||
|
||||
TestManager.DirtyTwoFields(testComp, nameof(OtherComponent.FloatField), nameof(OtherComponent.DoubleField));
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await Verifier(code,
|
||||
// /0/Test0.cs(31,42): error RA0033: FloatField is not a member of TestComponent
|
||||
VerifyCS.Diagnostic().WithSpan(31, 42, 31, 75).WithArguments("FloatField", "TestComponent"),
|
||||
// /0/Test0.cs(33,43): error RA0033: IntField is not a member of OtherComponent
|
||||
VerifyCS.Diagnostic().WithSpan(33, 43, 33, 73).WithArguments("IntField", "OtherComponent"),
|
||||
// /0/Test0.cs(39,78): error RA0033: FloatField is not a member of TestComponent
|
||||
VerifyCS.Diagnostic().WithSpan(39, 78, 39, 111).WithArguments("FloatField", "TestComponent"),
|
||||
// /0/Test0.cs(41,46): error RA0033: FloatField is not a member of TestComponent
|
||||
VerifyCS.Diagnostic().WithSpan(41, 46, 41, 79).WithArguments("FloatField", "TestComponent"),
|
||||
// /0/Test0.cs(41,81): error RA0033: DoubleField is not a member of TestComponent
|
||||
VerifyCS.Diagnostic().WithSpan(41, 81, 41, 115).WithArguments("DoubleField", "TestComponent")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
#nullable enable
|
||||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
using Robust.Roslyn.Shared;
|
||||
|
||||
namespace Robust.Analyzers;
|
||||
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
||||
public sealed class AfterAutoHandleStateAnalyzer : DiagnosticAnalyzer
|
||||
{
|
||||
private const string AfterAutoHandleStateEventName = "AfterAutoHandleStateEvent";
|
||||
private const string AutoGenStateAttribute = "Robust.Shared.Analyzers.AutoGenerateComponentStateAttribute";
|
||||
private const string SubscribeLocalEventName = "SubscribeLocalEvent";
|
||||
|
||||
public static readonly DiagnosticDescriptor MissingAttribute = new(
|
||||
Diagnostics.IdAutoGenStateAttributeMissing,
|
||||
"Unreachable AfterAutoHandleState subscription",
|
||||
"Tried to subscribe to AfterAutoHandleStateEvent for '{0}' which doesn't have an "
|
||||
+ "AutoGenerateComponentState attribute",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
// Does this even show up anywhere in Rider? >:(
|
||||
"You must mark your component with '[AutoGenerateComponentState(true)]' to subscribe to this event."
|
||||
);
|
||||
|
||||
public static readonly DiagnosticDescriptor MissingAttributeParam = new(
|
||||
Diagnostics.IdAutoGenStateParamMissing,
|
||||
"Unreachable AfterAutoHandleState subscription",
|
||||
"Tried to subscribe to AfterAutoHandleStateEvent for '{0}' which doesn't have "
|
||||
+ "raiseAfterAutoHandleState set",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"The AutoGenerateComponentState attribute must be passed 'true' in order to subscribe to this event."
|
||||
);
|
||||
|
||||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>
|
||||
[MissingAttribute, MissingAttributeParam];
|
||||
|
||||
public override void Initialize(AnalysisContext context)
|
||||
{
|
||||
// This is more to stop user error rather than code generation error
|
||||
// (Plus this shouldn't affect code gen anyway)
|
||||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
|
||||
context.EnableConcurrentExecution();
|
||||
|
||||
context.RegisterCompilationStartAction(compilationContext =>
|
||||
{
|
||||
var autoGenStateAttribute = compilationContext.Compilation.GetTypeByMetadataName(AutoGenStateAttribute);
|
||||
// No attribute, no analyzer.
|
||||
if (autoGenStateAttribute is null)
|
||||
return;
|
||||
|
||||
compilationContext.RegisterOperationAction(
|
||||
analysisContext => CheckEventSubscription(analysisContext, autoGenStateAttribute),
|
||||
OperationKind.Invocation);
|
||||
});
|
||||
}
|
||||
|
||||
private static void CheckEventSubscription(OperationAnalysisContext context, ITypeSymbol autoGenStateAttribute)
|
||||
{
|
||||
if (context.Operation is not IInvocationOperation operation)
|
||||
return;
|
||||
|
||||
// Check the method has the right name and has the right type args
|
||||
if (operation.TargetMethod is not
|
||||
{ Name: SubscribeLocalEventName, TypeArguments: [var component, { Name: AfterAutoHandleStateEventName }] })
|
||||
return;
|
||||
|
||||
// Search the component's attributes for something matching autoGenStateAttribute
|
||||
AttributeHelper.HasAttribute(component, autoGenStateAttribute, out var autoGenAttribute);
|
||||
|
||||
// First argument is raiseAfterAutoHandleState—note it shouldn't ever
|
||||
// be null, since it has a default, but eh.
|
||||
if (autoGenAttribute?.ConstructorArguments[0].Value is true)
|
||||
return;
|
||||
|
||||
context.ReportDiagnostic(Diagnostic.Create(autoGenAttribute is null ? MissingAttribute : MissingAttributeParam,
|
||||
operation.Syntax.GetLocation(),
|
||||
component.Name));
|
||||
}
|
||||
}
|
||||
@@ -16,14 +16,12 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
{
|
||||
private const string DataDefinitionNamespace = "Robust.Shared.Serialization.Manager.Attributes.DataDefinitionAttribute";
|
||||
private const string ImplicitDataDefinitionNamespace = "Robust.Shared.Serialization.Manager.Attributes.ImplicitDataDefinitionForInheritorsAttribute";
|
||||
private const string MeansDataDefinitionNamespace = "Robust.Shared.Serialization.Manager.Attributes.MeansDataDefinitionAttribute";
|
||||
private const string DataFieldBaseNamespace = "Robust.Shared.Serialization.Manager.Attributes.DataFieldBaseAttribute";
|
||||
private const string ViewVariablesNamespace = "Robust.Shared.ViewVariables.ViewVariablesAttribute";
|
||||
private const string NotYamlSerializableName = "Robust.Shared.Serialization.Manager.Attributes.NotYamlSerializableAttribute";
|
||||
private const string DataFieldAttributeName = "DataField";
|
||||
private const string ViewVariablesAttributeName = "ViewVariables";
|
||||
|
||||
public static readonly DiagnosticDescriptor DataDefinitionPartialRule = new(
|
||||
private static readonly DiagnosticDescriptor DataDefinitionPartialRule = new(
|
||||
Diagnostics.IdDataDefinitionPartial,
|
||||
"Type must be partial",
|
||||
"Type {0} is a DataDefinition but is not partial",
|
||||
@@ -33,7 +31,7 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
"Make sure to mark any type that is a data definition as partial."
|
||||
);
|
||||
|
||||
public static readonly DiagnosticDescriptor NestedDataDefinitionPartialRule = new(
|
||||
private static readonly DiagnosticDescriptor NestedDataDefinitionPartialRule = new(
|
||||
Diagnostics.IdNestedDataDefinitionPartial,
|
||||
"Type must be partial",
|
||||
"Type {0} contains nested data definition {1} but is not partial",
|
||||
@@ -43,7 +41,7 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
"Make sure to mark any type containing a nested data definition as partial."
|
||||
);
|
||||
|
||||
public static readonly DiagnosticDescriptor DataFieldWritableRule = new(
|
||||
private static readonly DiagnosticDescriptor DataFieldWritableRule = new(
|
||||
Diagnostics.IdDataFieldWritable,
|
||||
"Data field must not be readonly",
|
||||
"Data field {0} in data definition {1} is readonly",
|
||||
@@ -53,7 +51,7 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
"Make sure to remove the readonly modifier."
|
||||
);
|
||||
|
||||
public static readonly DiagnosticDescriptor DataFieldPropertyWritableRule = new(
|
||||
private static readonly DiagnosticDescriptor DataFieldPropertyWritableRule = new(
|
||||
Diagnostics.IdDataFieldPropertyWritable,
|
||||
"Data field property must have a setter",
|
||||
"Data field property {0} in data definition {1} does not have a setter",
|
||||
@@ -63,7 +61,7 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
"Make sure to add a setter."
|
||||
);
|
||||
|
||||
public static readonly DiagnosticDescriptor DataFieldRedundantTagRule = new(
|
||||
private static readonly DiagnosticDescriptor DataFieldRedundantTagRule = new(
|
||||
Diagnostics.IdDataFieldRedundantTag,
|
||||
"Data field has redundant tag specified",
|
||||
"Data field {0} in data definition {1} has an explicitly set tag that matches autogenerated tag",
|
||||
@@ -83,19 +81,9 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
"Make sure to remove the ViewVariables attribute."
|
||||
);
|
||||
|
||||
public static readonly DiagnosticDescriptor DataFieldYamlSerializableRule = new(
|
||||
Diagnostics.IdDataFieldYamlSerializable,
|
||||
"Data field type is not YAML serializable",
|
||||
"Data field {0} in data definition {1} is type {2}, which is not YAML serializable",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"Make sure to use a type that is YAML serializable."
|
||||
);
|
||||
|
||||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(
|
||||
DataDefinitionPartialRule, NestedDataDefinitionPartialRule, DataFieldWritableRule, DataFieldPropertyWritableRule,
|
||||
DataFieldRedundantTagRule, DataFieldNoVVReadWriteRule, DataFieldYamlSerializableRule
|
||||
DataFieldRedundantTagRule, DataFieldNoVVReadWriteRule
|
||||
);
|
||||
|
||||
public override void Initialize(AnalysisContext context)
|
||||
@@ -103,31 +91,23 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.None);
|
||||
context.EnableConcurrentExecution();
|
||||
|
||||
context.RegisterSymbolStartAction(symbolContext =>
|
||||
{
|
||||
if (symbolContext.Symbol is not INamedTypeSymbol typeSymbol)
|
||||
return;
|
||||
context.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.ClassDeclaration);
|
||||
context.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.StructDeclaration);
|
||||
context.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.RecordDeclaration);
|
||||
context.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.RecordStructDeclaration);
|
||||
context.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.InterfaceDeclaration);
|
||||
|
||||
if (!IsDataDefinition(typeSymbol))
|
||||
return;
|
||||
|
||||
symbolContext.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.ClassDeclaration);
|
||||
symbolContext.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.StructDeclaration);
|
||||
symbolContext.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.RecordDeclaration);
|
||||
symbolContext.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.RecordStructDeclaration);
|
||||
symbolContext.RegisterSyntaxNodeAction(AnalyzeDataDefinition, SyntaxKind.InterfaceDeclaration);
|
||||
|
||||
symbolContext.RegisterSyntaxNodeAction(AnalyzeDataField, SyntaxKind.FieldDeclaration);
|
||||
symbolContext.RegisterSyntaxNodeAction(AnalyzeDataFieldProperty, SyntaxKind.PropertyDeclaration);
|
||||
}, SymbolKind.NamedType);
|
||||
context.RegisterSyntaxNodeAction(AnalyzeDataField, SyntaxKind.FieldDeclaration);
|
||||
context.RegisterSyntaxNodeAction(AnalyzeDataFieldProperty, SyntaxKind.PropertyDeclaration);
|
||||
}
|
||||
|
||||
private static void AnalyzeDataDefinition(SyntaxNodeAnalysisContext context)
|
||||
private void AnalyzeDataDefinition(SyntaxNodeAnalysisContext context)
|
||||
{
|
||||
if (context.Node is not TypeDeclarationSyntax declaration)
|
||||
return;
|
||||
|
||||
if (context.ContainingSymbol is not INamedTypeSymbol type)
|
||||
var type = context.SemanticModel.GetDeclaredSymbol(declaration)!;
|
||||
if (!IsDataDefinition(type))
|
||||
return;
|
||||
|
||||
if (!IsPartial(declaration))
|
||||
@@ -138,7 +118,7 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
var containingType = type.ContainingType;
|
||||
while (containingType != null)
|
||||
{
|
||||
var containingTypeDeclaration = (TypeDeclarationSyntax)containingType.DeclaringSyntaxReferences[0].GetSyntax();
|
||||
var containingTypeDeclaration = (TypeDeclarationSyntax) containingType.DeclaringSyntaxReferences[0].GetSyntax();
|
||||
if (!IsPartial(containingTypeDeclaration))
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(NestedDataDefinitionPartialRule, containingTypeDeclaration.Keyword.GetLocation(), containingType.Name, type.Name));
|
||||
@@ -148,31 +128,31 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
}
|
||||
}
|
||||
|
||||
private static void AnalyzeDataField(SyntaxNodeAnalysisContext context)
|
||||
private void AnalyzeDataField(SyntaxNodeAnalysisContext context)
|
||||
{
|
||||
if (context.Node is not FieldDeclarationSyntax field)
|
||||
return;
|
||||
|
||||
if (context.ContainingSymbol?.ContainingType is not INamedTypeSymbol type)
|
||||
var typeDeclaration = field.FirstAncestorOrSelf<TypeDeclarationSyntax>();
|
||||
if (typeDeclaration == null)
|
||||
return;
|
||||
|
||||
var type = context.SemanticModel.GetDeclaredSymbol(typeDeclaration)!;
|
||||
if (!IsDataDefinition(type))
|
||||
return;
|
||||
|
||||
foreach (var variable in field.Declaration.Variables)
|
||||
{
|
||||
var fieldSymbol = context.SemanticModel.GetDeclaredSymbol(variable);
|
||||
|
||||
if (fieldSymbol == null)
|
||||
continue;
|
||||
|
||||
if (!IsDataField(fieldSymbol, out _, out var datafieldAttribute))
|
||||
continue;
|
||||
|
||||
if (IsReadOnlyDataField(type, fieldSymbol))
|
||||
{
|
||||
TryGetModifierLocation(field, SyntaxKind.ReadOnlyKeyword, out var location);
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldWritableRule, location, fieldSymbol.Name, type.Name));
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldWritableRule, context.Node.GetLocation(), fieldSymbol.Name, type.Name));
|
||||
}
|
||||
|
||||
if (HasRedundantTag(fieldSymbol, datafieldAttribute))
|
||||
if (HasRedundantTag(fieldSymbol))
|
||||
{
|
||||
TryGetAttributeLocation(field, DataFieldAttributeName, out var location);
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldRedundantTagRule, location, fieldSymbol.Name, type.Name));
|
||||
@@ -183,51 +163,32 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
TryGetAttributeLocation(field, ViewVariablesAttributeName, out var location);
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldNoVVReadWriteRule, location, fieldSymbol.Name, type.Name));
|
||||
}
|
||||
|
||||
if (context.SemanticModel.GetSymbolInfo(field.Declaration.Type).Symbol is not ITypeSymbol fieldTypeSymbol)
|
||||
continue;
|
||||
|
||||
fieldTypeSymbol = TypeSymbolHelper.GetNullableUnderlyingTypeOrSelf(fieldTypeSymbol);
|
||||
|
||||
if (IsNotYamlSerializable(fieldSymbol, fieldTypeSymbol))
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldYamlSerializableRule,
|
||||
(context.Node as FieldDeclarationSyntax)?.Declaration.Type.GetLocation(),
|
||||
fieldSymbol.Name,
|
||||
type.Name,
|
||||
fieldTypeSymbol.MetadataName
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void AnalyzeDataFieldProperty(SyntaxNodeAnalysisContext context)
|
||||
private void AnalyzeDataFieldProperty(SyntaxNodeAnalysisContext context)
|
||||
{
|
||||
if (context.Node is not PropertyDeclarationSyntax property)
|
||||
return;
|
||||
|
||||
if (context.ContainingSymbol is not IPropertySymbol propertySymbol)
|
||||
var typeDeclaration = property.FirstAncestorOrSelf<TypeDeclarationSyntax>();
|
||||
if (typeDeclaration == null)
|
||||
return;
|
||||
|
||||
if (propertySymbol.ContainingType is not INamedTypeSymbol type)
|
||||
return;
|
||||
|
||||
if (type.IsRecord || type.IsValueType)
|
||||
var type = context.SemanticModel.GetDeclaredSymbol(typeDeclaration)!;
|
||||
if (!IsDataDefinition(type) || type.IsRecord || type.IsValueType)
|
||||
return;
|
||||
|
||||
var propertySymbol = context.SemanticModel.GetDeclaredSymbol(property);
|
||||
if (propertySymbol == null)
|
||||
return;
|
||||
|
||||
if (!IsDataField(propertySymbol, out _, out var datafieldAttribute))
|
||||
return;
|
||||
|
||||
if (IsReadOnlyDataField(type, propertySymbol))
|
||||
{
|
||||
var location = property.AccessorList != null ? property.AccessorList.GetLocation() : property.GetLocation();
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldPropertyWritableRule, location, propertySymbol.Name, type.Name));
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldPropertyWritableRule, context.Node.GetLocation(), propertySymbol.Name, type.Name));
|
||||
}
|
||||
|
||||
if (HasRedundantTag(propertySymbol, datafieldAttribute))
|
||||
if (HasRedundantTag(propertySymbol))
|
||||
{
|
||||
TryGetAttributeLocation(property, DataFieldAttributeName, out var location);
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldRedundantTagRule, location, propertySymbol.Name, type.Name));
|
||||
@@ -238,25 +199,13 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
TryGetAttributeLocation(property, ViewVariablesAttributeName, out var location);
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldNoVVReadWriteRule, location, propertySymbol.Name, type.Name));
|
||||
}
|
||||
|
||||
if (context.SemanticModel.GetSymbolInfo(property.Type).Symbol is not ITypeSymbol propertyTypeSymbol)
|
||||
return;
|
||||
|
||||
propertyTypeSymbol = TypeSymbolHelper.GetNullableUnderlyingTypeOrSelf(propertyTypeSymbol);
|
||||
|
||||
if (IsNotYamlSerializable(propertySymbol, propertyTypeSymbol))
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(DataFieldYamlSerializableRule,
|
||||
(context.Node as PropertyDeclarationSyntax)?.Type.GetLocation(),
|
||||
propertySymbol.Name,
|
||||
type.Name,
|
||||
propertyTypeSymbol.Name
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsReadOnlyDataField(ITypeSymbol type, ISymbol field)
|
||||
{
|
||||
if (!IsDataField(field, out _, out _))
|
||||
return false;
|
||||
|
||||
return IsReadOnlyMember(type, field);
|
||||
}
|
||||
|
||||
@@ -271,7 +220,6 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
return false;
|
||||
|
||||
return HasAttribute(type, DataDefinitionNamespace) ||
|
||||
MeansDataDefinition(type) ||
|
||||
IsImplicitDataDefinition(type);
|
||||
}
|
||||
|
||||
@@ -337,20 +285,6 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool TryGetModifierLocation(MemberDeclarationSyntax syntax, SyntaxKind modifierKind, out Location location)
|
||||
{
|
||||
foreach (var modifier in syntax.Modifiers)
|
||||
{
|
||||
if (modifier.IsKind(modifierKind))
|
||||
{
|
||||
location = modifier.GetLocation();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
location = syntax.GetLocation();
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsReadOnlyMember(ITypeSymbol type, ISymbol member)
|
||||
{
|
||||
if (member is IFieldSymbol field)
|
||||
@@ -382,14 +316,17 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool HasRedundantTag(ISymbol symbol, AttributeData datafieldAttribute)
|
||||
private static bool HasRedundantTag(ISymbol symbol)
|
||||
{
|
||||
if (!IsDataField(symbol, out var _, out var attribute))
|
||||
return false;
|
||||
|
||||
// No args, no problem
|
||||
if (datafieldAttribute.ConstructorArguments.Length == 0)
|
||||
if (attribute.ConstructorArguments.Length == 0)
|
||||
return false;
|
||||
|
||||
// If a tag is explicitly specified, it will be the first argument...
|
||||
var tagArgument = datafieldAttribute.ConstructorArguments[0];
|
||||
var tagArgument = attribute.ConstructorArguments[0];
|
||||
// ...but the first arg could also something else, since tag is optional
|
||||
// so we make sure that it's a string
|
||||
if (tagArgument.Value is not string explicitName)
|
||||
@@ -404,6 +341,9 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
|
||||
private static bool HasVVReadWrite(ISymbol symbol)
|
||||
{
|
||||
if (!IsDataField(symbol, out _, out _))
|
||||
return false;
|
||||
|
||||
// Make sure it has ViewVariablesAttribute
|
||||
AttributeData? viewVariablesAttribute = null;
|
||||
foreach (var attr in symbol.GetAttributes())
|
||||
@@ -427,24 +367,6 @@ public sealed class DataDefinitionAnalyzer : DiagnosticAnalyzer
|
||||
return (VVAccess)accessByte == VVAccess.ReadWrite;
|
||||
}
|
||||
|
||||
private static bool MeansDataDefinition(ITypeSymbol type)
|
||||
{
|
||||
foreach (var attribute in type.GetAttributes())
|
||||
{
|
||||
if (attribute.AttributeClass is null)
|
||||
continue;
|
||||
|
||||
if (HasAttribute(attribute.AttributeClass, MeansDataDefinitionNamespace))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsNotYamlSerializable(ISymbol field, ITypeSymbol type)
|
||||
{
|
||||
return HasAttribute(type, NotYamlSerializableName);
|
||||
}
|
||||
|
||||
private static bool IsImplicitDataDefinition(ITypeSymbol type)
|
||||
{
|
||||
if (HasAttribute(type, ImplicitDataDefinitionNamespace))
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
using Robust.Roslyn.Shared;
|
||||
|
||||
namespace Robust.Analyzers;
|
||||
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
||||
public sealed class ForbidLiteralAnalyzer : DiagnosticAnalyzer
|
||||
{
|
||||
private const string ForbidLiteralType = "Robust.Shared.Analyzers.ForbidLiteralAttribute";
|
||||
|
||||
public static DiagnosticDescriptor ForbidLiteralRule = new(
|
||||
Diagnostics.IdForbidLiteral,
|
||||
"Parameter forbids literal values",
|
||||
"The {0} parameter of {1} forbids literal values",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Warning,
|
||||
true,
|
||||
"Pass in a validated wrapper type like ProtoId, or a const or static value."
|
||||
);
|
||||
|
||||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [ForbidLiteralRule];
|
||||
|
||||
public override void Initialize(AnalysisContext context)
|
||||
{
|
||||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
|
||||
context.EnableConcurrentExecution();
|
||||
context.RegisterOperationAction(AnalyzeOperation, OperationKind.Invocation);
|
||||
}
|
||||
|
||||
private void AnalyzeOperation(OperationAnalysisContext context)
|
||||
{
|
||||
if (context.Operation is not IInvocationOperation invocationOperation)
|
||||
return;
|
||||
|
||||
// Check each parameter of the method invocation
|
||||
foreach (var argumentOperation in invocationOperation.Arguments)
|
||||
{
|
||||
// Check for our attribute on the parameter
|
||||
if (!AttributeHelper.HasAttribute(argumentOperation.Parameter, ForbidLiteralType, out _))
|
||||
continue;
|
||||
|
||||
// Handle parameters using the params keyword
|
||||
if (argumentOperation.Syntax is InvocationExpressionSyntax subExpressionSyntax)
|
||||
{
|
||||
// Check each param value
|
||||
foreach (var subArgument in subExpressionSyntax.ArgumentList.Arguments)
|
||||
{
|
||||
CheckArgumentSyntax(context, argumentOperation, subArgument);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Not params, so just check the single parameter
|
||||
if (argumentOperation.Syntax is not ArgumentSyntax argumentSyntax)
|
||||
continue;
|
||||
|
||||
CheckArgumentSyntax(context, argumentOperation, argumentSyntax);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckArgumentSyntax(OperationAnalysisContext context, IArgumentOperation operation, ArgumentSyntax argumentSyntax)
|
||||
{
|
||||
// Handle collection types
|
||||
if (argumentSyntax.Expression is CollectionExpressionSyntax collectionExpressionSyntax)
|
||||
{
|
||||
// Check each value of the collection
|
||||
foreach (var elementSyntax in collectionExpressionSyntax.Elements)
|
||||
{
|
||||
if (elementSyntax is not ExpressionElementSyntax expressionSyntax)
|
||||
continue;
|
||||
|
||||
// Check if a literal was passed in
|
||||
if (expressionSyntax.Expression is not LiteralExpressionSyntax)
|
||||
continue;
|
||||
|
||||
context.ReportDiagnostic(Diagnostic.Create(ForbidLiteralRule,
|
||||
expressionSyntax.GetLocation(),
|
||||
operation.Parameter.Name,
|
||||
(context.Operation as IInvocationOperation).TargetMethod.Name
|
||||
));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Not a collection, just a single value to check
|
||||
// Check if it's a literal
|
||||
if (argumentSyntax.Expression is not LiteralExpressionSyntax)
|
||||
return;
|
||||
|
||||
context.ReportDiagnostic(Diagnostic.Create(ForbidLiteralRule,
|
||||
argumentSyntax.GetLocation(),
|
||||
operation.Parameter.Name,
|
||||
(context.Operation as IInvocationOperation).TargetMethod.Name
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace Robust.Analyzers;
|
||||
|
||||
public static class ITypeSymbolExtensions
|
||||
{
|
||||
public static IEnumerable<ITypeSymbol> GetBaseTypesAndThis(this ITypeSymbol type)
|
||||
{
|
||||
var current = type;
|
||||
while (current != null)
|
||||
{
|
||||
yield return current;
|
||||
current = current.BaseType;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user