Merge pull request #96 from notpeelz/hook-api-il-patch

Improve Hook.Patch API
This commit is contained in:
Evil Factory
2022-08-10 16:30:12 -03:00
committed by GitHub
187 changed files with 5802 additions and 15692 deletions

View File

@@ -1,4 +1,38 @@
[*.cs]
root = true
[*]
charset = utf-8
insert_final_newline = true
[*.{sln,cs}]
# VS defaults to utf-8 with BOM -- let's not create more merge conflicts
# XXX: csproj files dont't have a BOM for some reason?
charset = utf-8-bom
[*.cs]
indent_style = space
indent_size = 4
csharp_prefer_braces = when_multiline:warning
csharp_indent_case_contents_when_block = false
# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none
[*.{html,xml,csproj}]
indent_style = space
indent_size = 2
[*.{sh,ps1}]
indent_style = space
indent_size = 2
[*.py]
indent_style = space
indent_size = 4
[*.{js,json}]
indent_style = space
indent_size = 2
[*.lua]
indent_style = space
indent_size = 2

View File

@@ -1,17 +0,0 @@
name: Clean Docs
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs-landing-page

View File

@@ -1,80 +0,0 @@
name: .NET Pre-Release
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
include-prerelease: true
dotnet-version: |
6.0.x
5.0.x
- name: Restore dependencies
run: dotnet restore LinuxSolution.sln
- name: Build
run: dotnet build LinuxSolution.sln --no-restore
- name: Test
run: dotnet test LinuxSolution.sln --no-build --verbosity normal
- name: Publish WindowsServer
run: dotnet publish Barotrauma/BarotraumaServer/WindowsServer.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r win-x64 \/p:Platform="x64"
- name: Publish WindowsClient
run: dotnet publish Barotrauma/BarotraumaClient/WindowsClient.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r win-x64 \/p:Platform="x64"
- name: Publish LinuxServer
run: dotnet publish Barotrauma/BarotraumaServer/LinuxServer.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r linux-x64 \/p:Platform="x64"
- name: Publish LinuxClient
run: dotnet publish Barotrauma/BarotraumaClient/LinuxClient.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r linux-x64 \/p:Platform="x64"
- name: Publish MacServer
run: dotnet publish Barotrauma/BarotraumaServer/MacServer.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r osx-x64 \/p:Platform="x64"
- name: Publish MacClient
run: dotnet publish Barotrauma/BarotraumaClient/MacClient.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r osx-x64 \/p:Platform="x64"
- name: Archive Windows Release
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'barotrauma_lua_windows.zip'
#exclusions: '*.git* /*node_modules/* .editorconfig'
directory: 'Barotrauma/bin/ReleaseWindows/netcoreapp3.1/win-x64/publish'
- name: Archive Linux Release
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'barotrauma_lua_linux.zip'
#exclusions: '*.git* /*node_modules/* .editorconfig'
directory: 'Barotrauma/bin/ReleaseLinux/netcoreapp3.1/linux-x64/publish'
- name: Archive Mac Release
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'barotrauma_lua_mac.zip'
#exclusions: '*.git* /*node_modules/* .editorconfig'
directory: 'Barotrauma/bin/ReleaseMac/netcoreapp3.1/osx-x64/publish'
- name: Automatic Release
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Automatic Build"
files: |
Barotrauma/bin/ReleaseWindows/netcoreapp3.1/win-x64/publish/barotrauma_lua_windows.zip
Barotrauma/bin/ReleaseLinux/netcoreapp3.1/linux-x64/publish/barotrauma_lua_linux.zip
Barotrauma/bin/ReleaseMac/netcoreapp3.1/osx-x64/publish/barotrauma_lua_mac.zip

View File

@@ -1,43 +0,0 @@
name: Generate Docs - Cs
on:
workflow_run:
workflows: ["Clean Docs"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Create directories
run: mkdir -p doxygen/build ; mkdir -p doxygen/build/baro-server ; mkdir -p doxygen/build/baro-client
- name: Build server documentation
uses: mattnotmitt/doxygen-action@v1.9.1
with:
working-directory: 'doxygen/baro-server'
doxyfile-path: './Doxyfile'
- name: Build client documentation
uses: mattnotmitt/doxygen-action@v1.9.1
with:
working-directory: 'doxygen/baro-client'
doxyfile-path: './Doxyfile'
- name: Build containing documentation
uses: mattnotmitt/doxygen-action@v1.9.1
with:
working-directory: 'doxygen/'
doxyfile-path: './Doxyfile'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doxygen/build
destination_dir: cs-docs
keep_files: true

View File

@@ -1,47 +0,0 @@
name: Generate Docs - Lua
on:
workflow_run:
workflows: ["Clean Docs"]
types:
- completed
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
- uses: leafo/gh-actions-lua@v8.0.0
with:
luaVersion: "5.2"
- uses: leafo/gh-actions-luarocks@v4.0.0
- name: Pull LDoc
uses: actions/checkout@v2
with:
repository: impulsh/LDoc
path: ldoc
- name: Build LDoc
working-directory: ldoc
run: luarocks make
- name: Build docs
run: ldoc .
- name: Copy assets
run: |
cp -v docs/css/* docs/html
cp -v docs/js/* docs/html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/html
destination_dir: lua-docs
keep_files: true

17
.github/workflows/on-push-master.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: On push to master branch
on:
push:
branches: [master]
jobs:
run-tests:
uses: ./.github/workflows/run-tests.yml
with:
ref: ${{ github.event.ref }}
publish-release:
needs: [run-tests]
uses: ./.github/workflows/publish-release.yml

View File

@@ -0,0 +1,13 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: On push to a secondary branch
on:
push:
branches-ignore: [master]
jobs:
run-tests:
uses: ./.github/workflows/run-tests.yml
with:
ref: ${{ github.event.ref }}

12
.github/workflows/on-push-pr.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: On push to a PR
on:
pull_request:
jobs:
run-tests-for-pr:
uses: ./.github/workflows/run-tests.yml
with:
ref: ${{ github.event.pull_request.head.sha }}

72
.github/workflows/publish-release.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Publish release
on:
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
6.0.x
- name: "Build: WindowsServer"
run: dotnet publish Barotrauma/BarotraumaServer/WindowsServer.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r win-x64 \/p:Platform="x64"
- name: "Build: WindowsClient"
run: dotnet publish Barotrauma/BarotraumaClient/WindowsClient.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r win-x64 \/p:Platform="x64"
- name: "Build: LinuxServer"
run: dotnet publish Barotrauma/BarotraumaServer/LinuxServer.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r linux-x64 \/p:Platform="x64"
- name: "Build: LinuxClient"
run: dotnet publish Barotrauma/BarotraumaClient/LinuxClient.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r linux-x64 \/p:Platform="x64"
- name: "Build: MacServer"
run: dotnet publish Barotrauma/BarotraumaServer/MacServer.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r osx-x64 \/p:Platform="x64"
- name: "Build: MacClient"
run: dotnet publish Barotrauma/BarotraumaClient/MacClient.csproj -c Release -clp:"ErrorsOnly;Summary" --self-contained -r osx-x64 \/p:Platform="x64"
- name: "Create zip file: windows"
uses: thedoctor0/zip-release@main
with:
type: zip
filename: barotrauma_lua_windows.zip
directory: Barotrauma/bin/ReleaseWindows/netcoreapp3.1/win-x64/publish
- name: "Create zip file: linux"
uses: thedoctor0/zip-release@main
with:
type: zip
filename: barotrauma_lua_linux.zip
directory: Barotrauma/bin/ReleaseLinux/netcoreapp3.1/linux-x64/publish
- name: "Create zip file: mac"
uses: thedoctor0/zip-release@main
with:
type: zip
filename: barotrauma_lua_mac.zip
directory: Barotrauma/bin/ReleaseMac/netcoreapp3.1/osx-x64/publish
- name: Publish release
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: false
title: Automatic Build
files: |
Barotrauma/bin/ReleaseWindows/netcoreapp3.1/win-x64/publish/barotrauma_lua_windows.zip
Barotrauma/bin/ReleaseLinux/netcoreapp3.1/linux-x64/publish/barotrauma_lua_linux.zip
Barotrauma/bin/ReleaseMac/netcoreapp3.1/osx-x64/publish/barotrauma_lua_mac.zip

50
.github/workflows/run-tests.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Run tests
on:
workflow_call:
inputs:
ref:
required: true
type: string
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
6.0.x
- name: Initialize environment
run: |
mkdir -p ~/".local/share/Daedalic Entertainment GmbH/Barotrauma"
- name: Run tests
continue-on-error: true
run: dotnet test LinuxSolution.sln -clp:"ErrorsOnly;Summary" --logger "trx;LogFileName=$PWD/test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test-results.trx
- name: Report test results
uses: dorny/test-reporter@v1
with:
name: Test results
path: test-results.trx
fail-on-error: true
reporter: dotnet-trx

119
.github/workflows/update-docs.yml vendored Normal file
View File

@@ -0,0 +1,119 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Update documentation
on:
workflow_dispatch:
env:
CI_DEPLOY_DIR: luacs-docs/ci-deploy
CI_ARTIFACTS_DIR: luacs-docs/ci-artifacts
DOCS_LUA_ROOT: luacs-docs/lua
DOCS_CS_ROOT: luacs-docs/cs
DOCS_LANDINGPAGE_ROOT: luacs-docs/landing-page
jobs:
update-docs-lua:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
6.0.x
- uses: leafo/gh-actions-lua@v8
with:
luaVersion: "5.2"
- uses: leafo/gh-actions-luarocks@v4
- name: Run install script
working-directory: ${{ env.DOCS_LUA_ROOT }}
run: ./scripts/install.sh
- name: Run docs generator script
working-directory: ${{ env.DOCS_LUA_ROOT }}
run: ./scripts/generate_docs.sh
- name: Run build script
working-directory: ${{ env.DOCS_LUA_ROOT }}
run: ./scripts/build.sh
- name: Create tarball
run: |
mkdir -p "$CI_ARTIFACTS_DIR"
tar -czf "$CI_ARTIFACTS_DIR"/lua.tar.gz -C "$DOCS_LUA_ROOT"/build .
- name: Upload tarball
uses: actions/upload-artifact@v3
with:
name: docs-lua
path: ${{ env.CI_ARTIFACTS_DIR }}/lua.tar.gz
update-docs-cs:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Install doxygen
run: sudo apt-get update && sudo apt-get install -y doxygen
- name: Run build script
working-directory: ${{ env.DOCS_CS_ROOT }}
run: ./scripts/build.sh
- name: Create tarball
run: |
mkdir -p "$CI_ARTIFACTS_DIR"
tar -czf "$CI_ARTIFACTS_DIR"/cs.tar.gz -C "$DOCS_CS_ROOT"/build .
- name: Upload tarball
uses: actions/upload-artifact@v3
with:
name: docs-cs
path: ${{ env.CI_ARTIFACTS_DIR }}/cs.tar.gz
deploy-docs:
runs-on: ubuntu-latest
needs: [update-docs-lua, update-docs-cs]
steps:
- name: Checkout branch
uses: actions/checkout@v3
- run: mkdir -p "$CI_ARTIFACTS_DIR" "$CI_DEPLOY_DIR"
- name: "Download build artifacts: lua docs"
uses: actions/download-artifact@v3
with:
name: docs-lua
path: ${{ env.CI_ARTIFACTS_DIR }}
- name: "Download build artifacts: cs docs"
uses: actions/download-artifact@v3
with:
name: docs-cs
path: ${{ env.CI_ARTIFACTS_DIR }}
- name: Extract lua and cs tarballs
run: |
mkdir -p "$CI_DEPLOY_DIR"/{lua,cs}-docs
tar -xzf "$CI_ARTIFACTS_DIR"/lua.tar.gz -C "$CI_DEPLOY_DIR"/lua-docs
tar -xzf "$CI_ARTIFACTS_DIR"/cs.tar.gz -C "$CI_DEPLOY_DIR"/cs-docs
- name: Copy landing page files
run: cp -r "$DOCS_LANDINGPAGE_ROOT"/. "$CI_DEPLOY_DIR"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.CI_DEPLOY_DIR }}
keep_files: true

7
.gitignore vendored
View File

@@ -13,12 +13,8 @@ bld/
[Rr]elease*/
*.o
*/Barotrauma*/doc/
doxygen/html/
doxygen/*/html/
doxygen/*/*.tag
doxygen/build
# Misc vs crap
# Misc vs crap
*.v12.suo
*.suo
*.csproj.user
@@ -51,7 +47,6 @@ desktop.ini
# Merge script
temp.txt
docs/html
# Private assets
Barotrauma/BarotraumaShared/Content/*
Barotrauma/**/GameAnalyticsKeys.cs

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "Libraries/moonsharp"]
path = Libraries/moonsharp
url = https://github.com/evilfactory/moonsharp.git
[submodule "luacs-docs/lua/libs/ldoc"]
path = luacs-docs/lua/libs/ldoc
url = https://github.com/evilfactory/LDoc.git

View File

@@ -3256,7 +3256,8 @@ namespace Barotrauma
}
});
commands.Add(new Command("cl_lua", "lua_cl: runs a string on the client", (string[] args) =>
const string CMD_CL_LUA = "cl_lua";
commands.Add(new Command(CMD_CL_LUA, $"{CMD_CL_LUA}: runs a string on the client", (string[] args) =>
{
if (GameMain.Client != null && !GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands))
{
@@ -3270,10 +3271,12 @@ namespace Barotrauma
}
catch(Exception ex)
{
GameMain.LuaCs.HandleException(ex);
GameMain.LuaCs.HandleException(ex, LuaCsMessageOrigin.LuaMod);
}
}));
commands.Add(new Command("cl_cs", "cs_cl: runs a string on the client", (string[] args) =>
const string CMD_CL_CS = "cl_cs";
commands.Add(new Command(CMD_CL_CS, $"{CMD_CL_CS}: runs a string on the client", (string[] args) =>
{
if (LuaCsSetup.GetPackage("CsForBarotrauma", false, true) == null) { return; }

View File

@@ -20,7 +20,7 @@ namespace Barotrauma
{
class GameMain : Game
{
public static LuaCsSetup LuaCs;
internal static LuaCsSetup LuaCs;
public static bool ShowFPS = false;
public static bool ShowPerf = false;

View File

@@ -31,6 +31,7 @@ namespace Barotrauma
{
"Barotrauma.dll", "Barotrauma.deps.json",
"0harmony.dll", "Mono.Cecil.dll",
"Sigil.dll",
"Mono.Cecil.Mdb.dll", "Mono.Cecil.Pdb.dll",
"Mono.Cecil.Rocks.dll", "MonoMod.Common.dll",
"MoonSharp.Interpreter.dll",

View File

@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
<ItemGroup>
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
</ItemGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -138,21 +143,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.5.1.1" />
<PackageReference Include="NVorbis" Version="0.8.6" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="MoonSharp.Interpreter">
<HintPath>..\..\Libraries\MoonSharp.Interpreter.dll</HintPath>
</Reference>
</ItemGroup>
<!-- Sourced from https://stackoverflow.com/a/45248069 -->
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">
<PropertyGroup>
@@ -222,4 +216,4 @@
</PropertyGroup>
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
</Project>
</Project>

View File

@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
<ItemGroup>
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
</ItemGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -130,8 +135,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.5.1.1" />
<PackageReference Include="NVorbis" Version="0.8.6" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
@@ -143,14 +146,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="MoonSharp.Interpreter">
<HintPath>..\..\Libraries\MoonSharp.Interpreter.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="libfreetype6.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -224,4 +219,4 @@
</PropertyGroup>
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
</Project>
</Project>

View File

@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
<ItemGroup>
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
</ItemGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -137,21 +142,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.5.1.1" />
<PackageReference Include="NVorbis" Version="0.8.6" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="MoonSharp.Interpreter">
<HintPath>..\..\Libraries\MoonSharp.Interpreter.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Update="..\BarotraumaShared\Content\Lights\divinghelmetlight.psd">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>

View File

@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
<ItemGroup>
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -86,19 +91,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.5.1.1" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="MoonSharp.Interpreter">
<HintPath>..\..\Libraries\MoonSharp.Interpreter.dll</HintPath>
</Reference>
</ItemGroup>
<!-- Sourced from https://stackoverflow.com/a/45248069 -->
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">

View File

@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
<ItemGroup>
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -83,8 +88,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.5.1.1" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
@@ -95,14 +98,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="MoonSharp.Interpreter">
<HintPath>..\..\Libraries\MoonSharp.Interpreter.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">
<PropertyGroup>
<!-- temp file for the git version (lives in "obj" folder)-->

View File

@@ -1249,7 +1249,7 @@ namespace Barotrauma
}
catch (Exception ex)
{
GameMain.LuaCs.HandleException(ex);
GameMain.LuaCs.HandleException(ex, LuaCsMessageOrigin.LuaMod);
}
}));
commands.Add(new Command("cs", "cs: runs a string", (string[] args) =>
@@ -1284,6 +1284,7 @@ namespace Barotrauma
{
"Barotrauma.dll", "Barotrauma.deps.json",
"0harmony.dll", "Mono.Cecil.dll",
"Sigil.dll",
"Mono.Cecil.Mdb.dll", "Mono.Cecil.Pdb.dll",
"Mono.Cecil.Rocks.dll", "MonoMod.Common.dll",
"MoonSharp.Interpreter.dll",
@@ -1318,13 +1319,13 @@ namespace Barotrauma
}
catch (UnauthorizedAccessException e)
{
GameMain.LuaCs.PrintError("You seem to already have Client Side Lua installed, if you are trying to reinstall, make sure uninstall it first (mainmenu button located top left).");
GameMain.LuaCs.PrintError("You seem to already have Client Side Lua installed, if you are trying to reinstall, make sure uninstall it first (mainmenu button located top left).", LuaCsMessageOrigin.LuaCs);
return;
}
catch (Exception e)
{
GameMain.LuaCs.HandleException(e);
GameMain.LuaCs.HandleException(e, LuaCsMessageOrigin.LuaCs);
return;
}

View File

@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
<ItemGroup>
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -85,19 +90,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.5.1.1" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="MoonSharp.Interpreter">
<HintPath>..\..\Libraries\MoonSharp.Interpreter.dll</HintPath>
</Reference>
</ItemGroup>
<!-- Sourced from https://stackoverflow.com/a/45248069 -->
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">

View File

@@ -1,81 +1,87 @@
Hook.HookMethod(
"Barotrauma.Item", "TryInteract",
{
"Barotrauma.Character",
"System.Boolean",
"System.Boolean",
"System.Boolean"
},
function (instance, p)
if Hook.Call("item.interact", instance, p.picker, p.ignoreRequiredItems, p.forceSelectKey, p.forceActionKey) == true then
return false
end
end,
Hook.HookMethodType.Before
Hook.Patch(
"Barotrauma.Item", "TryInteract",
{
"Barotrauma.Character",
"System.Boolean",
"System.Boolean",
"System.Boolean"
},
function(instance, p)
if Hook.Call("item.interact", instance, p["user"], p["ignoreRequiredItems"], p["forceSelectKey"], p["forceUseKey"]) == true then
p.PreventExecution = true
return false
end
end,
Hook.HookMethodType.Before
)
Hook.HookMethod(
"Barotrauma.Item", "ApplyTreatment",
{
"Barotrauma.Character",
"Barotrauma.Character",
"Barotrauma.Limb"
},
function (instance, p)
if Hook.Call("item.applyTreatment", instance, p.user, p.character, p.targetLimb) then
return false
end
end,
Hook.HookMethodType.Before
Hook.Patch(
"Barotrauma.Item", "ApplyTreatment",
{
"Barotrauma.Character",
"Barotrauma.Character",
"Barotrauma.Limb"
},
function(instance, p)
if Hook.Call("item.applyTreatment", instance, p["user"], p["character"], p["targetLimb"]) then
p.PreventExecution = true
return false
end
end,
Hook.HookMethodType.Before
)
Hook.HookMethod(
"Barotrauma.Item", "Combine",
{
"Barotrauma.Item",
"Barotrauma.Character"
},
function (instance, p)
if Hook.Call("item.combine", instance, p.item, p.user) == true then
return false
end
end,
Hook.HookMethodType.Before
Hook.Patch(
"Barotrauma.Item", "Combine",
{
"Barotrauma.Item",
"Barotrauma.Character"
},
function(instance, p)
if Hook.Call("item.combine", instance, p["item"], p["user"]) == true then
p.PreventExecution = true
return false
end
end,
Hook.HookMethodType.Before
)
Hook.HookMethod(
"Barotrauma.Item", "Drop",
function (instance, p)
if Hook.Call("item.drop", instance, p.dropper) == true then
return false
end
end,
Hook.HookMethodType.Before
Hook.Patch(
"Barotrauma.Item", "Drop",
function(instance, p)
if Hook.Call("item.drop", instance, p["dropper"]) == true then
p.PreventExecution = true
return false
end
end,
Hook.HookMethodType.Before
)
Hook.HookMethod(
"Barotrauma.Item", "Equip",
{
"Barotrauma.Character"
},
function (instance, p)
if Hook.Call("item.equip", instance, p.character) == true then
return false
end
end,
Hook.HookMethodType.Before
Hook.Patch(
"Barotrauma.Item", "Equip",
{
"Barotrauma.Character"
},
function(instance, p)
if Hook.Call("item.equip", instance, p["character"]) == true then
p.PreventExecution = true
return false
end
end,
Hook.HookMethodType.Before
)
Hook.HookMethod(
"Barotrauma.Item", "Unequip",
{
"Barotrauma.Character"
},
function (instance, p)
if Hook.Call("item.unequip", instance, p.character) == true then
return false
end
end,
Hook.HookMethodType.Before
Hook.Patch(
"Barotrauma.Item", "Unequip",
{
"Barotrauma.Character"
},
function(instance, p)
if Hook.Call("item.unequip", instance, p["character"]) == true then
p.PreventExecution = true
return false
end
end,
Hook.HookMethodType.Before
)

View File

@@ -6,9 +6,21 @@ local CreateEnum = LuaSetup.LuaUserData.CreateEnumTable
require("DefaultLib/Utils/SteamApi")
defaultLib["SByte"] = CreateStatic("Barotrauma.LuaSByte", true)
defaultLib["Byte"] = CreateStatic("Barotrauma.LuaByte", true)
defaultLib["UShort"] = CreateStatic("Barotrauma.LuaUShort", true)
defaultLib["Float"] = CreateStatic("Barotrauma.LuaFloat", true)
defaultLib["Int16"] = CreateStatic("Barotrauma.LuaInt16", true)
defaultLib["UInt16"] = CreateStatic("Barotrauma.LuaUInt16", true)
defaultLib["Int32"] = CreateStatic("Barotrauma.LuaInt32", true)
defaultLib["UInt32"] = CreateStatic("Barotrauma.LuaUInt32", true)
defaultLib["Int64"] = CreateStatic("Barotrauma.LuaInt64", true)
defaultLib["UInt64"] = CreateStatic("Barotrauma.LuaUInt64", true)
defaultLib["Single"] = CreateStatic("Barotrauma.LuaSingle", true)
defaultLib["Double"] = CreateStatic("Barotrauma.LuaDouble", true)
-- Backward compatibility
defaultLib["Float"] = CreateStatic("Barotrauma.LuaSingle", true)
defaultLib["Short"] = CreateStatic("Barotrauma.LuaInt16", true)
defaultLib["UShort"] = CreateStatic("Barotrauma.LuaUInt16", true)
defaultLib["SpawnType"] = CreateEnum("Barotrauma.SpawnType")
defaultLib["ChatMessageType"] = CreateEnum("Barotrauma.Networking.ChatMessageType")

View File

@@ -4,9 +4,16 @@ local RegisterBarotrauma = LuaSetup.LuaUserData.RegisterTypeBarotrauma
Register("System.TimeSpan")
Register("System.Exception")
RegisterBarotrauma("LuaSByte")
RegisterBarotrauma("LuaByte")
RegisterBarotrauma("LuaUShort")
RegisterBarotrauma("LuaFloat")
RegisterBarotrauma("LuaInt16")
RegisterBarotrauma("LuaUInt16")
RegisterBarotrauma("LuaInt32")
RegisterBarotrauma("LuaUInt32")
RegisterBarotrauma("LuaInt64")
RegisterBarotrauma("LuaUInt64")
RegisterBarotrauma("LuaSingle")
RegisterBarotrauma("LuaDouble")
RegisterBarotrauma("Range`1[System.Single]")
RegisterBarotrauma("Range`1[System.Int32]")

View File

@@ -0,0 +1,8 @@
<Project>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="Lib.Harmony" Version="2.2.2" />
<PackageReference Include="Sigil" Version="5.0.0" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\Libraries\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.csproj" />
</ItemGroup>
</Project>

View File

@@ -37,7 +37,7 @@ namespace Barotrauma
}
catch (Exception e)
{
GameMain.LuaCs.HandleException(e, null, LuaCsSetup.ExceptionType.CSharp);
GameMain.LuaCs.HandleException(e, LuaCsMessageOrigin.CSharpMod);
}
LoadedMods.Remove(this);

View File

@@ -367,13 +367,11 @@ namespace Barotrauma
public void AddCommand(string name, string help, LuaCsAction onExecute, LuaCsFunc getValidArgs = null, bool isCheat = false)
{
var cmd = new DebugConsole.Command(name, help, (string[] arg1) => { onExecute(new object[] { arg1 }); },
var cmd = new DebugConsole.Command(name, help, (string[] arg1) => onExecute(new object[] { arg1 }),
() =>
{
if (getValidArgs == null) { return null; }
var obj = getValidArgs();
if (obj is LuaResult lr) { return lr.DynValue().ToObject<string[][]>(); }
return (string[][])obj;
if (getValidArgs == null) return null;
return getValidArgs().ToObject<string[][]>();
}, isCheat);
luaAddedCommand.Add(cmd);

View File

@@ -1,105 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using MoonSharp.Interpreter;
using Microsoft.Xna.Framework;
using Barotrauma.Networking;
using Barotrauma.Items.Components;
using System.IO;
using System.Net;
using System.Linq;
using System.Xml.Linq;
using FarseerPhysics.Dynamics;
using System.Reflection;
using HarmonyLib;
using MoonSharp.Interpreter.Interop;
using System.Diagnostics;
namespace Barotrauma
{
public class LuaResult
{
object result;
public LuaResult(object arg)
{
result = arg;
}
public bool IsNull()
{
if (result == null)
return true;
if (result is DynValue dynValue)
return dynValue.IsNil();
return false;
}
public bool Bool()
{
if (result is DynValue dynValue)
{
return dynValue.CastToBool();
}
return false;
}
public float Float()
{
if (result is DynValue dynValue)
{
var num = dynValue.CastToNumber();
if (num == null) { return 0f; }
return (float)num.Value;
}
return 0f;
}
public double Double()
{
if (result is DynValue dynValue)
{
var num = dynValue.CastToNumber();
if (num == null) { return 0f; }
return num.Value;
}
return 0f;
}
public string String()
{
if (result is DynValue dynValue)
{
var str = dynValue.CastToString();
if (str == null) { return ""; }
return str;
}
return "";
}
public object Object()
{
if (result is DynValue dynValue)
{
return dynValue.ToObject();
}
return null;
}
public DynValue DynValue()
{
if (result is DynValue dynValue)
{
return dynValue;
}
return null;
}
}
}

View File

@@ -1,41 +1,184 @@
using System;
using System.ComponentModel;
namespace Barotrauma
{
public class LuaByte
{
public byte Value;
public struct LuaSByte
{
private readonly sbyte value;
public LuaByte(byte v)
{
Value = v;
}
public LuaSByte(double v)
{
value = (sbyte)v;
}
public static implicit operator byte(LuaByte lb) => lb.Value;
}
public LuaSByte(string v, int radix = 10)
{
value = Convert.ToSByte(v, radix);
}
public class LuaUShort
{
public ushort Value;
public static implicit operator sbyte(LuaSByte luaValue) => luaValue.value;
}
public LuaUShort(ushort v)
{
Value = v;
}
public struct LuaByte
{
private readonly byte value;
public static implicit operator ushort(LuaUShort lb) => lb.Value;
}
public LuaByte(double v)
{
value = (byte)v;
}
public class LuaFloat
{
public float Value;
public LuaByte(string v, int radix = 10)
{
value = Convert.ToByte(v, radix);
}
public LuaFloat(float v)
{
Value = v;
}
public static implicit operator byte(LuaByte luaValue) => luaValue.value;
}
public static implicit operator float(LuaFloat lb) => lb.Value;
}
public struct LuaInt16
{
private readonly short value;
public LuaInt16(double v)
{
value = (short)v;
}
public LuaInt16(string v, int radix = 10)
{
value = Convert.ToInt16(v, radix);
}
public static implicit operator short(LuaInt16 luaValue) => luaValue.value;
}
public struct LuaUInt16
{
private readonly ushort value;
public LuaUInt16(double v)
{
value = (ushort)v;
}
public LuaUInt16(string v, int radix = 10)
{
value = Convert.ToUInt16(v, radix);
}
public static implicit operator ushort(LuaUInt16 luaValue) => luaValue.value;
}
public struct LuaInt32
{
private readonly int value;
public LuaInt32(double v)
{
value = (int)v;
}
public LuaInt32(string v, int radix = 10)
{
value = Convert.ToInt32(v, radix);
}
public static implicit operator int(LuaInt32 luaValue) => luaValue.value;
}
public struct LuaUInt32
{
private readonly uint value;
public LuaUInt32(double v)
{
value = (uint)v;
}
public LuaUInt32(string v, int radix = 10)
{
value = Convert.ToUInt32(v, radix);
}
public static implicit operator uint(LuaUInt32 luaValue) => luaValue.value;
}
public struct LuaInt64
{
private readonly long value;
public LuaInt64(double v)
{
value = (long)v;
}
public LuaInt64(double lo, double hi)
{
value = Convert.ToUInt32(lo) | (long)Convert.ToInt32(hi) << 32;
}
public LuaInt64(string v, int radix = 10)
{
value = Convert.ToInt64(v, radix);
}
public static implicit operator long(LuaInt64 luaValue) => luaValue.value;
}
public struct LuaUInt64
{
private readonly ulong value;
public LuaUInt64(double v)
{
value = (ulong)v;
}
public LuaUInt64(double lo, double hi)
{
value = Convert.ToUInt32(lo) | (ulong)Convert.ToUInt32(hi) << 32;
}
public LuaUInt64(string v, int radix = 10)
{
value = Convert.ToUInt64(v, radix);
}
public static implicit operator ulong(LuaUInt64 luaValue) => luaValue.value;
}
public struct LuaSingle
{
private readonly float value;
public LuaSingle(double v)
{
value = (float)v;
}
public LuaSingle(string v)
{
value = float.Parse(v);
}
public static implicit operator float(LuaSingle luaValue) => luaValue.value;
}
public struct LuaDouble
{
private readonly double value;
public LuaDouble(double v)
{
value = v;
}
public LuaDouble(string v)
{
value = double.Parse(v);
}
public static implicit operator double(LuaDouble luaValue) => luaValue.value;
}
}

View File

@@ -11,20 +11,27 @@ namespace Barotrauma
{
public static Type GetType(string typeName)
{
var byRef = false;
if (typeName.StartsWith("out ") || typeName.StartsWith("ref "))
{
typeName = typeName.Remove(0, 4);
byRef = true;
}
var type = Type.GetType(typeName);
if (type != null) return type;
if (type != null) return byRef ? type.MakeByRefType() : type;
foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
{
if (CsScriptBase.LoadedAssemblyName.Contains(a.GetName().Name))
{
{
var attrs = a.GetCustomAttributes<AssemblyMetadataAttribute>();
var revision = attrs.FirstOrDefault(attr => attr.Key == "Revision")?.Value;
if (revision != null && int.Parse(revision) != (int)CsScriptBase.Revision[a.GetName().Name]) { continue; }
}
}
type = a.GetType(typeName);
if (type != null)
{
return type;
return byRef ? type.MakeByRefType() : type;
}
}
return null;

View File

@@ -1,127 +1,195 @@
using System;
using System.Collections.Generic;
using System.Text;
using MoonSharp.Interpreter;
using Microsoft.Xna.Framework;
using FarseerPhysics.Dynamics;
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
namespace Barotrauma
{
public delegate DynValue CallLuaFunctionFunc(object function, params object[] args);
internal static class LuaCustomConverters
{
private static CallLuaFunctionFunc CallLuaFunction;
public static void Initialize(CallLuaFunctionFunc callLuaFunction)
{
CallLuaFunction = callLuaFunction;
public static class LuaCustomConverters
{
public static void RegisterAll()
{
RegisterAction<Item>();
RegisterAction<Character>();
RegisterAction<Entity>();
RegisterAction();
RegisterFunc<Fixture, Vector2, Vector2, float, float>();
RegisterFunc<AIObjective, bool>();
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(LuaCsAction), v => (LuaCsAction)( args => GameMain.LuaCs.CallLuaFunction(v.Function, args) ));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(LuaCsFunc), v => (LuaCsFunc)( args => new LuaResult(GameMain.LuaCs.CallLuaFunction(v.Function, args)) ));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(LuaCsPatch), v => (LuaCsPatch)( (self, args) => new LuaResult(GameMain.LuaCs.CallLuaFunction(v.Function, self, args)) ));
Script.GlobalOptions.CustomConverters.SetClrToScriptCustomConversion(typeof(LuaResult), (Script s, object v) => (v as LuaResult).DynValue());
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
DataType.Function,
typeof(LuaCsAction),
v => (LuaCsAction)(args => CallLuaFunction(v.Function, args)));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
DataType.Function,
typeof(LuaCsFunc),
v => (LuaCsFunc)(args => CallLuaFunction(v.Function, args)));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
DataType.Function,
typeof(LuaCsCompatPatchFunc),
v => (LuaCsCompatPatchFunc)((self, args) => CallLuaFunction(v.Function, self, args)));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
DataType.Function,
typeof(LuaCsPatchFunc),
v => (LuaCsPatchFunc)((self, args) => CallLuaFunction(v.Function, self, args)));
#if CLIENT
RegisterAction<float>();
RegisterAction<Microsoft.Xna.Framework.Graphics.SpriteBatch, float>();
{
object Call(object function, params object[] arguments) => GameMain.LuaCs.CallLuaFunction(function, arguments);
DynValue Call(object function, params object[] arguments) => CallLuaFunction(function, arguments);
void RegisterHandler<T>(Func<Closure, T> converter)
=> Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(T), v => converter(v.Function));
RegisterHandler(f => (GUIComponent.SecondaryButtonDownHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (GUIButton.OnClickedHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (GUIButton.OnButtonDownHandler)(
() => new LuaResult(Call(f)).Bool()));
() => Call(f).CastToBool()));
RegisterHandler(f => (GUIButton.OnPressedHandler)(
() => new LuaResult(Call(f)).Bool()));
() => Call(f).CastToBool()));
RegisterHandler(f => (GUIColorPicker.OnColorSelectedHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (GUIDropDown.OnSelectedHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (GUIListBox.OnSelectedHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (GUIListBox.OnRearrangedHandler)(
(a1, a2) => Call(f, a1, a2)));
(a1, a2) => Call(f, a1, a2)));
RegisterHandler(f => (GUIListBox.CheckSelectedHandler)(
() => new LuaResult(Call(f)).Object()));
() => Call(f).ToObject()));
RegisterHandler(f => (GUINumberInput.OnValueEnteredHandler)(
(a1) => Call(f, a1)));
RegisterHandler(f => (GUINumberInput.OnValueChangedHandler)(
(a1) => Call(f, a1)));
(a1) => Call(f, a1)));
RegisterHandler(f => (GUIProgressBar.ProgressGetterHandler)(
() => new LuaResult(Call(f)).Float()));
() => (float)(Call(f).CastToNumber() ?? 0)));
RegisterHandler(f => (GUIRadioButtonGroup.RadioButtonGroupDelegate)(
(a1, a2) => Call(f, a1, a2)));
(a1, a2) => Call(f, a1, a2)));
RegisterHandler(f => (GUIScrollBar.OnMovedHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (GUIScrollBar.ScrollConversion)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Float()));
(a1, a2) => (float)(Call(f, a1, a2).CastToNumber() ?? 0)));
RegisterHandler(f => (GUITextBlock.TextGetterHandler)(
() => new LuaResult(Call(f, new object[] { })).String()));
() => Call(f, new object[0]).CastToString()));
RegisterHandler(f => (GUITextBox.OnEnterHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (GUITextBox.OnTextChangedHandler)(
(a1, a2) => new LuaResult(Call(f, a1, a2)).Bool()));
(a1, a2) => Call(f, a1, a2).CastToBool()));
RegisterHandler(f => (TextBoxEvent)(
(a1, a2) => Call(f, a1, a2)));
(a1, a2) => Call(f, a1, a2)));
RegisterHandler(f => (GUITickBox.OnSelectedHandler)(
(a1) => new LuaResult(Call(f, a1)).Bool()));
(a1) => Call(f, a1).CastToBool()));
}
#endif
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(Pair<JobPrefab, int>), v =>
{
return new Pair<JobPrefab, int>((JobPrefab)v.Table.Get(1).ToObject(), (int)v.Table.Get(2).CastToNumber());
});
Script.GlobalOptions.CustomConverters.SetClrToScriptCustomConversion<UInt64>((Script script, UInt64 v) =>
Script.GlobalOptions.CustomConverters.SetClrToScriptCustomConversion<ulong>((Script script, ulong v) =>
{
return DynValue.NewString(v.ToString());
});
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.String, typeof(UInt64), v =>
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.String, typeof(ulong), v =>
{
return UInt64.Parse(v.String);
return ulong.Parse(v.String);
});
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.UserData, typeof(object), v =>
{
if (v.UserData.Object is LuaByte lbyte)
{
return lbyte.Value;
}
else if (v.UserData.Object is LuaUShort lushort)
{
return lushort.Value;
}
else if (v.UserData.Object is LuaFloat lfloat)
{
return lfloat.Value;
}
return v.UserData.Object;
});
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(sbyte),
canConvert: luaValue => luaValue.UserData?.Object is LuaSByte,
converter: luaValue => luaValue.UserData.Object is LuaSByte v
? (sbyte)v
: throw new ScriptRuntimeException("use SByte(value) to pass primitive type 'sbyte' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(byte),
canConvert: luaValue => luaValue.UserData?.Object is LuaByte,
converter: luaValue => luaValue.UserData.Object is LuaByte v
? (byte)v
: throw new ScriptRuntimeException("use Byte(value) to pass primitive type 'byte' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(short),
canConvert: luaValue => luaValue.UserData?.Object is LuaInt16,
converter: luaValue => luaValue.UserData.Object is LuaInt16 v
? (short)v
: throw new ScriptRuntimeException("use Int16(value) to pass primitive type 'short' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(ushort),
canConvert: luaValue => luaValue.UserData?.Object is LuaUInt16,
converter: luaValue => luaValue.UserData.Object is LuaUInt16 v
? (ushort)v
: throw new ScriptRuntimeException("use UInt16(value) to pass primitive type 'ushort' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(int),
canConvert: luaValue => luaValue.UserData?.Object is LuaInt32,
converter: luaValue => luaValue.UserData.Object is LuaInt32 v
? (int)v
: throw new ScriptRuntimeException("use Int32(value) to pass primitive type 'int' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(uint),
canConvert: luaValue => luaValue.UserData?.Object is LuaUInt32,
converter: luaValue => luaValue.UserData.Object is LuaUInt32 v
? (uint)v
: throw new ScriptRuntimeException("use UInt32(value) to pass primitive type 'uint' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(long),
canConvert: luaValue => luaValue.UserData?.Object is LuaInt64,
converter: luaValue => luaValue.UserData.Object is LuaInt64 v
? (long)v
: throw new ScriptRuntimeException("use Int64(value) to pass primitive type 'long' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(ulong),
canConvert: luaValue => luaValue.UserData?.Object is LuaUInt64,
converter: luaValue => luaValue.UserData.Object is LuaUInt64 v
? (ulong)v
: throw new ScriptRuntimeException("use UInt64(value) to pass primitive type 'ulong' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(float),
canConvert: luaValue => luaValue.UserData?.Object is LuaSingle,
converter: luaValue => luaValue.UserData.Object is LuaSingle v
? (float)v
: throw new ScriptRuntimeException("use Single(value) to pass primitive type 'float' to C#"));
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(
scriptDataType: DataType.UserData,
clrDataType: typeof(double),
canConvert: luaValue => luaValue.UserData?.Object is LuaDouble,
converter: luaValue => luaValue.UserData.Object is LuaDouble v
? (double)v
: throw new ScriptRuntimeException("use Double(value) to pass primitive type 'double' to C#"));
}
public static void RegisterAction<T>()
@@ -129,13 +197,13 @@ namespace Barotrauma
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(Action<T>), v =>
{
var function = v.Function;
return (Action<T>)(p => GameMain.LuaCs.CallLuaFunction(function, p));
return (Action<T>)(p => CallLuaFunction(function, p));
});
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.ClrFunction, typeof(Action<T>), v =>
{
var function = v.Function;
return (Action<T>)(p => GameMain.LuaCs.CallLuaFunction(function, p));
return (Action<T>)(p => CallLuaFunction(function, p));
});
}
@@ -144,13 +212,13 @@ namespace Barotrauma
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(Action<T1, T2>), v =>
{
var function = v.Function;
return (Action<T1, T2>)((a1, a2) => GameMain.LuaCs.CallLuaFunction(function, a1, a2));
return (Action<T1, T2>)((a1, a2) => CallLuaFunction(function, a1, a2));
});
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.ClrFunction, typeof(Action<T1, T2>), v =>
{
var function = v.Function;
return (Action<T1, T2>)((a1, a2) => GameMain.LuaCs.CallLuaFunction(function, a1, a2));
return (Action<T1, T2>)((a1, a2) => CallLuaFunction(function, a1, a2));
});
}
@@ -159,13 +227,13 @@ namespace Barotrauma
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(Action), v =>
{
var function = v.Function;
return (Action)(() => GameMain.LuaCs.CallLuaFunction(function));
return (Action)(() => CallLuaFunction(function));
});
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.ClrFunction, typeof(Action), v =>
{
var function = v.Function;
return (Action)(() => GameMain.LuaCs.CallLuaFunction(function));
return (Action)(() => CallLuaFunction(function));
});
}
@@ -213,7 +281,5 @@ namespace Barotrauma
return (Func<T1, T2, T3, T4, T5>)((T1 a, T2 b, T3 c, T4 d) => function.Call(a, b, c, d).ToObject<T5>());
});
}
}
}

View File

@@ -1,263 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using MoonSharp.Interpreter;
using Microsoft.Xna.Framework;
using Barotrauma.Networking;
using System.Threading.Tasks;
using Barotrauma.Items.Components;
using System.IO;
using System.Net;
using System.Linq;
using System.Xml.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace Barotrauma
{
public static class LuaDocs
{
public static string ConvertTypeName(string type)
{
switch (type)
{
case "Boolean":
return "bool";
case "String":
return "string";
case "int":
return "number";
case "Single":
return "number";
case "Double":
return "number";
case "float":
return "number";
case "UInt16":
return "number";
case "UInt32":
return "number";
case "UInt64":
return "number";
case "Int32":
return "number";
case "List`1":
return "table";
case "Dictionary`2":
return "table";
}
if (type.StartsWith("Action"))
return "function";
if (type.StartsWith("Func"))
return "function";
if (type.StartsWith("IEnumerable"))
return "Enumerable";
return type;
}
public static string EscapeName(string n)
{
if (n == "end")
return "endparam";
return n;
}
public static void GenerateDocsAll()
{
GenerateDocs(typeof(Character), "Character.lua");
GenerateDocs(typeof(CharacterInfo), "CharacterInfo.lua");
GenerateDocs(typeof(CharacterHealth), "CharacterHealth.lua");
GenerateDocs(typeof(AnimController), "AnimController.lua");
GenerateDocs(typeof(Client), "Client.lua");
GenerateDocs(typeof(Entity), "Entity.lua");
GenerateDocs(typeof(EntitySpawner), "Entity.Spawner.lua", "Entity.Spawner");
GenerateDocs(typeof(Item), "Item.lua");
GenerateDocs(typeof(ItemPrefab), "ItemPrefab.lua");
GenerateDocs(typeof(Submarine), "Submarine.lua");
GenerateDocs(typeof(SubmarineInfo), "SubmarineInfo.lua");
GenerateDocs(typeof(Job), "Job.lua");
GenerateDocs(typeof(JobPrefab), "JobPrefab.lua");
GenerateDocs(typeof(GameSession), "GameSession.lua", "Game.GameSession");
GenerateDocs(typeof(NetLobbyScreen), "NetLobbyScreen.lua", "Game.NetLobbyScreen");
GenerateDocs(typeof(GameScreen), "GameScreen.lua", "Game.GameScreen");
GenerateDocs(typeof(FarseerPhysics.Dynamics.World), "World.lua", "Game.World");
GenerateDocs(typeof(Inventory), "Inventory.lua", "Inventory");
GenerateDocs(typeof(ItemInventory), "ItemInventory.lua", "ItemInventory");
GenerateDocs(typeof(CharacterInventory), "CharacterInventory.lua", "CharacterInventory");
GenerateDocs(typeof(Hull), "Hull.lua", "Hull");
GenerateDocs(typeof(Level), "Level.lua", "Level");
GenerateDocs(typeof(Affliction), "Affliction.lua", "Affliction");
GenerateDocs(typeof(AfflictionPrefab), "AfflictionPrefab.lua", "AfflictionPrefab");
GenerateDocs(typeof(WayPoint), "WayPoint.lua", "WayPoint");
GenerateDocs(typeof(ServerSettings), "ServerSettings.lua", "Game.ServerSettings");
GenerateDocs(typeof(GameSettings), "GameSettings.lua", "Game.Settings");
}
public static void GenerateDocs(Type type, string name, string categoryName = null)
{
GenerateDocs(type, "../../../../docs/baseluadocs/" + name, "../../../../docs/lua/generated/" + name, categoryName);
}
public static void GenerateDocs(Type type, string baselua, string fileresult, string categoryName = null)
{
var sb = new StringBuilder();
if (categoryName == null)
categoryName = type.Name;
var baseluatext = "";
if (!File.Exists(baselua))
{
const string EMPTY_TABLE = "{}";
baseluatext = @$"-- luacheck: ignore 111
--[[--
{type.FullName}
]]
-- @code {categoryName}
-- @pragma nostrip
local {type.Name} = {EMPTY_TABLE}";
File.WriteAllText(baselua, baseluatext);
}
else
baseluatext = File.ReadAllText(baselua);
HashSet<string> removed = new HashSet<string>();
foreach(var line in baseluatext.Split('\n'))
{
if(line.Contains("-- @remove "))
{
var replaced = line.Replace("-- @remove ", "").Replace("\r", "");
removed.Add(replaced);
}
}
sb.Append(baseluatext + "\n\n");
var members = type.GetMembers();
foreach(var member in members)
{
Console.WriteLine("'{0}' is a {1}", member.Name, member.MemberType);
if (member.MemberType == MemberTypes.Method)
{
var method = (MethodInfo)member;
if (method.Name.StartsWith("get_") || method.Name.StartsWith("set_"))
continue;
var lsb = new StringBuilder();
lsb.Append($"--- {method.Name}\n");
lsb.Append($"-- @realm shared\n");
var paramNames = "";
var parameters = method.GetParameters();
for(var i=0; i < parameters.Length; i++)
{
var parameter = parameters[i];
if(i == parameters.Length - 1)
paramNames = paramNames + EscapeName(parameter.Name);
else
paramNames = paramNames + EscapeName(parameter.Name) + ", ";
lsb.Append($"-- @tparam {ConvertTypeName(parameter.ParameterType.Name)} {EscapeName(parameter.Name)}\n");
}
if (method.ReturnType != typeof(void))
{
lsb.Append($"-- @treturn {ConvertTypeName(method.ReturnType.Name)}\n");
}
string functionDecoration;
if (method.IsStatic)
functionDecoration = $"function {type.Name}.{method.Name}({paramNames}) end";
else
functionDecoration = $"function {method.Name}({paramNames}) end";
if (removed.Contains(functionDecoration))
{
continue;
}
lsb.Append(functionDecoration);
lsb.Append("\n\n");
sb.Append(lsb);
}
if (member.MemberType == MemberTypes.Field)
{
var lsb = new StringBuilder();
var field = (FieldInfo)member;
lsb.Append($"---\n");
lsb.Append($"-- ");
var name = EscapeName(field.Name);
var returnName = ConvertTypeName(field.FieldType.Name);
if (field.IsStatic)
name = type.Name + "." + field.Name;
if (removed.Contains(name))
continue;
lsb.Append(name);
lsb.Append($", Field of type {returnName}\n");
lsb.Append($"-- @realm shared\n");
lsb.Append($"-- @{returnName} {name}\n");
lsb.Append("\n");
sb.Append(lsb);
}
if (member.MemberType == MemberTypes.Property)
{
var lsb = new StringBuilder();
var property = (PropertyInfo)member;
lsb.Append($"---\n");
lsb.Append($"-- ");
var name = EscapeName(property.Name);
var returnName = ConvertTypeName(property.PropertyType.Name);
if (property.GetGetMethod().IsStatic)
name = type.Name + "." + property.Name;
if (removed.Contains(name))
continue;
lsb.Append(name);
lsb.Append($", Field of type {returnName}\n");
lsb.Append($"-- @realm shared\n");
lsb.Append($"-- @{returnName} {name}\n");
lsb.Append("\n");
sb.Append(lsb);
}
}
File.WriteAllText(fileresult, sb.ToString());
}
}
}
[assembly: InternalsVisibleTo("LuaDocsGenerator")]

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +1,31 @@
using System;
using System.Linq;
using System.Reflection;
using MoonSharp.Interpreter;
using HarmonyLib;
using System.Collections.Generic;
using System.Text;
using MoonSharp.Interpreter.Interop;
using MoonSharp.Interpreter;
using static Barotrauma.LuaCsSetup;
using System.Threading;
using System.Diagnostics;
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
namespace Barotrauma
{
partial class LuaCsHook
{
private Dictionary<long, HashSet<(string, LuaCsPatch, ACsMod)>> compatHookPrefixMethods;
private Dictionary<long, HashSet<(string, LuaCsPatch, ACsMod)>> compatHookPostfixMethods;
// XXX: this can't be renamed because of backward compatibility with C# mods
public delegate object LuaCsPatch(object self, Dictionary<string, object> args);
private static void _hookLuaCsPatch(MethodBase __originalMethod, object[] __args, object __instance, out object result, HookMethodType hookMethodType)
partial class LuaCsHook
{
private Dictionary<long, HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>> compatHookPrefixMethods = new Dictionary<long, HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>>();
private Dictionary<long, HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>> compatHookPostfixMethods = new Dictionary<long, HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>>();
private static void _hookLuaCsPatch(MethodBase __originalMethod, object[] __args, object __instance, out object result, HookMethodType hookType)
{
result = null;
try
{
var funcAddr = ((long)__originalMethod.MethodHandle.GetFunctionPointer());
HashSet<(string, LuaCsPatch, ACsMod)> methodSet = null;
switch (hookMethodType)
HashSet<(string, LuaCsCompatPatchFunc, ACsMod)> methodSet = null;
switch (hookType)
{
case HookMethodType.Before:
instance.compatHookPrefixMethods.TryGetValue(funcAddr, out methodSet);
@@ -34,7 +34,7 @@ namespace Barotrauma
instance.compatHookPostfixMethods.TryGetValue(funcAddr, out methodSet);
break;
default:
break;
throw new ArgumentException($"Invalid {nameof(HookMethodType)} enum value.", nameof(hookType));
}
if (methodSet != null)
@@ -46,7 +46,7 @@ namespace Barotrauma
args.Add(@params[i].Name, __args[i]);
}
var outOfSocpe = new HashSet<(string, LuaCsPatch, ACsMod)>();
var outOfSocpe = new HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>();
foreach (var tuple in methodSet)
{
if (tuple.Item3 != null && tuple.Item3.IsDisposed)
@@ -58,17 +58,17 @@ namespace Barotrauma
var _result = tuple.Item2(__instance, args);
if (_result != null)
{
if (_result is LuaResult res)
if (_result is DynValue res)
{
if (!res.IsNull())
if (!res.IsNil())
{
if (__originalMethod is MethodInfo mi && mi.ReturnType != typeof(void))
{
result = res.DynValue().ToObject(mi.ReturnType);
result = res.ToObject(mi.ReturnType);
}
else
{
result = res.DynValue().ToObject();
result = res.ToObject();
}
}
}
@@ -84,7 +84,8 @@ namespace Barotrauma
}
catch (Exception ex)
{
GameMain.LuaCs.HandleException(ex, $"Error in {__originalMethod.Name}:", exceptionType: LuaCsSetup.ExceptionType.Both);
GameMain.LuaCs.PrintError($"Error in {__originalMethod.Name}:", LuaCsMessageOrigin.Unknown);
GameMain.LuaCs.HandleException(ex, LuaCsMessageOrigin.Unknown);
}
}
@@ -94,6 +95,7 @@ namespace Barotrauma
_hookLuaCsPatch(__originalMethod, __args, __instance, out object result, HookMethodType.Before);
return result == null;
}
private static void HookLuaCsPatchPostfix(MethodBase __originalMethod, object[] __args, object __instance) =>
_hookLuaCsPatch(__originalMethod, __args, __instance, out object _, HookMethodType.After);
@@ -107,61 +109,27 @@ namespace Barotrauma
}
else return true;
}
private static void HookLuaCsPatchRetPostfix(MethodBase __originalMethod, object[] __args, ref object __result, object __instance)
{
_hookLuaCsPatch(__originalMethod, __args, __instance, out object result, HookMethodType.After);
if (result != null) __result = result;
}
private static MethodInfo _miHookLuaCsPatchPrefix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchPrefix", BindingFlags.NonPublic | BindingFlags.Static);
private static MethodInfo _miHookLuaCsPatchPostfix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchPostfix", BindingFlags.NonPublic | BindingFlags.Static);
private static MethodInfo _miHookLuaCsPatchRetPrefix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchRetPrefix", BindingFlags.NonPublic | BindingFlags.Static);
private static MethodInfo _miHookLuaCsPatchRetPostfix = typeof(LuaCsHook).GetMethod("HookLuaCsPatchRetPostfix", BindingFlags.NonPublic | BindingFlags.Static);
private static MethodInfo ResolveMethod(string where, string className, string methodName, string[] parameterNames)
{
var classType = LuaUserData.GetType(className);
if (classType == null)
{
GameMain.LuaCs.HandleException(new Exception($"Tried to use {where} with an invalid class name '{className}'."));
return null;
}
MethodInfo methodInfo = null;
if (parameterNames != null)
{
Type[] parameterTypes = parameterNames.Select(x => LuaUserData.GetType(x)).ToArray();
methodInfo = classType.GetMethod(methodName, DefaultBindingFlags, null, parameterTypes, null);
}
else
{
methodInfo = classType.GetMethod(methodName, DefaultBindingFlags);
}
if (methodInfo == null)
{
string parameterNamesStr = parameterNames == null ? "" : string.Join(", ", parameterNames);
GameMain.LuaCs.HandleException(new Exception($"Method '{methodName}' with parameters '{parameterNamesStr}' not found in class '{className}'"));
}
return methodInfo;
}
public void HookMethod(string identifier, MethodInfo method, LuaCsPatch patch, HookMethodType hookType = HookMethodType.Before, ACsMod owner = null)
// TODO: deprecate this
public void HookMethod(string identifier, MethodInfo method, LuaCsCompatPatchFunc patch, HookMethodType hookType = HookMethodType.Before, ACsMod owner = null)
{
if (identifier == null || method == null || patch == null)
{
GameMain.LuaCs.HandleException(new ArgumentNullException("Identifier, Method and Patch arguments must not be null."), exceptionType: ExceptionType.Both);
return;
}
if (prohibitedHooks.Any(h => method.DeclaringType.FullName.StartsWith(h)))
{
GameMain.LuaCs.HandleException(new ArgumentException("Hooks into Modding Environment are prohibited."), exceptionType: ExceptionType.Both);
luaCs.HandleException(new ArgumentNullException("Identifier, Method and Patch arguments must not be null."), LuaCsMessageOrigin.Unknown);
return;
}
ValidatePatchTarget(method);
var funcAddr = ((long)method.MethodHandle.GetFunctionPointer());
var patches = Harmony.GetPatchInfo(method);
@@ -183,7 +151,7 @@ namespace Barotrauma
}
}
if (compatHookPrefixMethods.TryGetValue(funcAddr, out HashSet<(string, LuaCsPatch, ACsMod)> methodSet))
if (compatHookPrefixMethods.TryGetValue(funcAddr, out HashSet<(string, LuaCsCompatPatchFunc, ACsMod)> methodSet))
{
if (identifier != "")
{
@@ -194,7 +162,7 @@ namespace Barotrauma
}
else if (patch != null)
{
compatHookPrefixMethods.Add(funcAddr, new HashSet<(string, LuaCsPatch, ACsMod)>() { (identifier, patch, owner) });
compatHookPrefixMethods.Add(funcAddr, new HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>() { (identifier, patch, owner) });
}
}
@@ -215,7 +183,7 @@ namespace Barotrauma
}
}
if (compatHookPostfixMethods.TryGetValue(funcAddr, out HashSet<(string, LuaCsPatch, ACsMod)> methodSet))
if (compatHookPostfixMethods.TryGetValue(funcAddr, out HashSet<(string, LuaCsCompatPatchFunc, ACsMod)> methodSet))
{
if (identifier != "")
{
@@ -226,25 +194,25 @@ namespace Barotrauma
}
else if (patch != null)
{
compatHookPostfixMethods.Add(funcAddr, new HashSet<(string, LuaCsPatch, ACsMod)>() { (identifier, patch, owner) });
compatHookPostfixMethods.Add(funcAddr, new HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>() { (identifier, patch, owner) });
}
}
}
protected void HookMethod(string identifier, string className, string methodName, string[] parameterNames, LuaCsPatch patch, HookMethodType hookMethodType = HookMethodType.Before)
protected void HookMethod(string identifier, string className, string methodName, string[] parameterNames, LuaCsCompatPatchFunc patch, HookMethodType hookMethodType = HookMethodType.Before)
{
MethodInfo methodInfo = ResolveMethod("HookMethod", className, methodName, parameterNames);
var methodInfo = ResolveMethod(className, methodName, parameterNames);
if (methodInfo == null) return;
if (methodInfo.GetParameters().Any(x => x.ParameterType.IsByRef))
{
throw new InvalidOperationException($"{nameof(HookMethod)} doesn't support ByRef parameters; use {nameof(Patch)} instead.");
}
HookMethod(identifier, methodInfo, patch, hookMethodType);
}
protected void HookMethod(string identifier, string className, string methodName, LuaCsPatch patch, HookMethodType hookMethodType = HookMethodType.Before) =>
protected void HookMethod(string identifier, string className, string methodName, LuaCsCompatPatchFunc patch, HookMethodType hookMethodType = HookMethodType.Before) =>
HookMethod(identifier, className, methodName, null, patch, hookMethodType);
protected void HookMethod(string className, string methodName, LuaCsPatch patch, HookMethodType hookMethodType = HookMethodType.Before) =>
protected void HookMethod(string className, string methodName, LuaCsCompatPatchFunc patch, HookMethodType hookMethodType = HookMethodType.Before) =>
HookMethod("", className, methodName, null, patch, hookMethodType);
protected void HookMethod(string className, string methodName, string[] parameterNames, LuaCsPatch patch, HookMethodType hookMethodType = HookMethodType.Before) =>
protected void HookMethod(string className, string methodName, string[] parameterNames, LuaCsCompatPatchFunc patch, HookMethodType hookMethodType = HookMethodType.Before) =>
HookMethod("", className, methodName, parameterNames, patch, hookMethodType);
@@ -252,7 +220,7 @@ namespace Barotrauma
{
var funcAddr = ((long)method.MethodHandle.GetFunctionPointer());
Dictionary<long, HashSet<(string, LuaCsPatch, ACsMod)>> methods;
Dictionary<long, HashSet<(string, LuaCsCompatPatchFunc, ACsMod)>> methods;
if (hookType == HookMethodType.Before) methods = compatHookPrefixMethods;
else if (hookType == HookMethodType.After) methods = compatHookPostfixMethods;
else throw null;
@@ -261,7 +229,7 @@ namespace Barotrauma
}
protected void UnhookMethod(string identifier, string className, string methodName, string[] parameterNames, HookMethodType hookType = HookMethodType.Before)
{
MethodInfo methodInfo = ResolveMethod("UnhookMathod", className, methodName, parameterNames);
var methodInfo = ResolveMethod(className, methodName, parameterNames);
if (methodInfo == null) return;
UnhookMethod(identifier, methodInfo, hookType);
}

View File

@@ -73,7 +73,7 @@ namespace Barotrauma
{
if (luaModInterface.Any(i => i.Equals(modName)))
{
GameMain.LuaCs.HandleException(new ArgumentException($"'{modName}' entry already registered"), exceptionType: ExceptionType.Lua);
GameMain.LuaCs.HandleException(new ArgumentException($"'{modName}' entry already registered"), LuaCsMessageOrigin.LuaMod);
return null;
}
@@ -86,7 +86,7 @@ namespace Barotrauma
{
if (csModInterface.Any(i => i.Equals(mod)))
{
GameMain.LuaCs.HandleException(new ArgumentException($"'{mod.GetType().FullName}' entry already registered"), exceptionType: ExceptionType.CSharp);
GameMain.LuaCs.HandleException(new ArgumentException($"'{mod.GetType().FullName}' entry already registered"), LuaCsMessageOrigin.CSharpMod);
return null;
}

View File

@@ -93,9 +93,11 @@ namespace Barotrauma
{
LuaCsNetReceives[netMessageName](netMessage, client);
}
catch(Exception e)
catch (Exception e)
{
GameMain.LuaCs.HandleException(e, $"Exception thrown inside NetMessageReceive({netMessageName})", LuaCsSetup.ExceptionType.CSharp);
// TODO: make LuaCsNetworking hold a reference to LuaCsSetup instead of using this global
GameMain.LuaCs.PrintError($"Exception thrown inside NetMessageReceive({netMessageName})", LuaCsMessageOrigin.Unknown);
GameMain.LuaCs.HandleException(e, LuaCsMessageOrigin.Unknown);
}
}
}
@@ -120,7 +122,8 @@ namespace Barotrauma
}
catch (Exception e)
{
GameMain.LuaCs.HandleException(e, $"Exception thrown inside NetMessageReceive({netMessageName})", LuaCsSetup.ExceptionType.CSharp);
GameMain.LuaCs.PrintError($"Exception thrown inside NetMessageReceive({netMessageName})", LuaCsMessageOrigin.Unknown);
GameMain.LuaCs.HandleException(e, LuaCsMessageOrigin.Unknown);
}
}
}

View File

@@ -12,6 +12,7 @@ using System.Runtime.CompilerServices;
using System.Linq;
using System.Reflection;
using System.Threading;
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
[assembly: InternalsVisibleTo(Barotrauma.CsScriptBase.CsScriptAssembly, AllInternalsVisible = true)]
[assembly: InternalsVisibleTo(Barotrauma.CsScriptBase.CsOneTimeScriptAssembly, AllInternalsVisible = true)]
@@ -24,6 +25,18 @@ namespace Barotrauma
public LuaCsSetupConfig() { }
}
internal delegate void LuaCsMessageLogger(string prefix, object o);
internal delegate void LuaCsExceptionHandler(Exception ex, LuaCsMessageOrigin origin);
internal enum LuaCsMessageOrigin
{
LuaCs,
Unknown,
LuaMod,
CSharpMod,
}
partial class LuaCsSetup
{
public const string LuaSetupFile = "Lua/LuaSetup.lua";
@@ -55,7 +68,7 @@ namespace Barotrauma
/// </summary>
public void RecreateCsScript()
{
GameMain.LuaCs.CsScript = new CsScriptRunner(GameMain.LuaCs.CsScript.setup);
CsScript = new CsScriptRunner(CsScript.setup);
lua.Globals["CsScript"] = CsScript;
}
@@ -76,7 +89,10 @@ namespace Barotrauma
public LuaCsSetup()
{
Hook = new LuaCsHook();
MessageLogger = DefaultMessageLogger;
ExceptionHandler = DefaultExceptionHandler;
Hook = new LuaCsHook(this);
ModStore = new LuaCsModStore();
Game = new LuaGame();
@@ -136,123 +152,141 @@ namespace Barotrauma
return null;
}
public enum ExceptionType
private void DefaultExceptionHandler(Exception ex, LuaCsMessageOrigin origin)
{
Lua,
CSharp,
Both
switch (ex)
{
case NetRuntimeException netRuntimeException:
if (netRuntimeException.DecoratedMessage == null)
{
PrintError(netRuntimeException, origin);
}
else
{
// FIXME: netRuntimeException.ToString() doesn't print the InnerException's stack trace...
PrintError($"{netRuntimeException.DecoratedMessage}: {netRuntimeException}", origin);
}
break;
case InterpreterException interpreterException:
if (interpreterException.DecoratedMessage == null)
{
PrintError(interpreterException, origin);
}
else
{
PrintError(interpreterException.DecoratedMessage, origin);
}
break;
default:
var msg = ex.StackTrace != null
? ex.ToString()
: $"{ex}\n{Environment.StackTrace}";
PrintError(msg, origin);
break;
}
}
public void HandleException(Exception ex, string extra = "", ExceptionType exceptionType = ExceptionType.Lua)
{
if (!string.IsNullOrWhiteSpace(extra))
if (exceptionType == ExceptionType.Lua) PrintError(extra);
else if (exceptionType == ExceptionType.CSharp) PrintCsError(extra);
else PrintBothError(extra);
if (ex is NetRuntimeException netRuntimeException)
{
if (netRuntimeException.DecoratedMessage == null)
{
PrintError(netRuntimeException);
}
else
{
PrintError(netRuntimeException.DecoratedMessage + ": " + netRuntimeException.ToString());
}
}
else if (ex is InterpreterException interpreterException)
{
if (interpreterException.DecoratedMessage == null)
{
PrintError(interpreterException);
}
else
{
PrintError(interpreterException.DecoratedMessage);
}
}
else
{
string msg = ex.StackTrace != null
? ex.ToString()
: $"{ex}\n{Environment.StackTrace}";
internal LuaCsExceptionHandler ExceptionHandler { get; set; }
if (exceptionType == ExceptionType.Lua) { PrintError(msg); }
else if (exceptionType == ExceptionType.CSharp) { PrintCsError(msg); }
else { PrintBothError(msg); }
}
}
private static void PrintErrorBase(string prefix, object message, string empty)
internal void HandleException(Exception ex, LuaCsMessageOrigin origin)
{
if (message == null) { message = empty; }
string str = message.ToString();
this.ExceptionHandler?.Invoke(ex, origin);
}
for (int i = 0; i < str.Length; i += 1024)
{
string subStr = str.Substring(i, Math.Min(1024, str.Length - i));
string errorMsg = subStr;
if (i == 0) errorMsg = prefix + errorMsg;
DebugConsole.ThrowError(errorMsg);
#if SERVER
if (GameMain.Server != null)
{
foreach (var c in GameMain.Server.ConnectedClients)
{
GameMain.Server.SendDirectChatMessage(ChatMessage.Create("", errorMsg, ChatMessageType.Console, null, textColor: Color.Red), c);
}
GameServer.Log(errorMsg, ServerLog.MessageType.Error);
}
#endif
}
}
#if SERVER
public void PrintError(object message) => PrintErrorBase("[SV LUA ERROR] ", message, "nil");
public static void PrintCsError(object message) => PrintErrorBase("[SV CS ERROR] ", message, "Null");
public static void PrintBothError(object message) => PrintErrorBase("[SV ERROR] ", message, "Null");
#else
public void PrintError(object message) => PrintErrorBase("[CL LUA ERROR] ", message, "nil");
public static void PrintCsError(object message) => PrintErrorBase("[CL CS ERROR] ", message, "Null");
public static void PrintBothError(object message) => PrintErrorBase("[CL ERROR] ", message, "Null");
#endif
private static void PrintMessageBase(string prefix, object message, string empty)
private static void PrintErrorBase(string prefix, object message, string empty)
{
if (message == null) { message = empty; }
string str = message.ToString();
message ??= empty;
var str = message.ToString();
for (int i = 0; i < str.Length; i += 1024)
{
string subStr = str.Substring(i, Math.Min(1024, str.Length - i));
for (int i = 0; i < str.Length; i += 1024)
{
var subStr = str.Substring(i, Math.Min(1024, str.Length - i));
var errorMsg = subStr;
if (i == 0) errorMsg = prefix + errorMsg;
DebugConsole.ThrowError(errorMsg);
#if SERVER
if (GameMain.Server != null)
{
foreach (var c in GameMain.Server.ConnectedClients)
{
GameMain.Server.SendDirectChatMessage(ChatMessage.Create("", subStr, ChatMessageType.Console, null, textColor: Color.MediumPurple), c);
}
if (GameMain.Server != null)
{
foreach (var c in GameMain.Server.ConnectedClients)
{
GameMain.Server.SendDirectChatMessage(ChatMessage.Create("", errorMsg, ChatMessageType.Console, null, textColor: Color.Red), c);
}
GameServer.Log(prefix + subStr, ServerLog.MessageType.ServerMessage);
}
GameServer.Log(errorMsg, ServerLog.MessageType.Error);
}
#endif
}
}
}
#if SERVER
DebugConsole.NewMessage(message.ToString(), Color.MediumPurple);
private const string LOG_PREFIX = "SV";
#else
DebugConsole.NewMessage(message.ToString(), Color.Purple);
private const string LOG_PREFIX = "CL";
#endif
}
private void PrintMessage(object message) => PrintMessageBase("[LUA] ", message, "nil");
public static void PrintCsMessage(object message) => PrintMessageBase("[CS] ", message, "Null");
public static void PrintLogMessage(object message) => PrintMessageBase("[LuaCs LOG] ", message, "Null");
// TODO: deprecate this (in an effort to get rid of as much global state as possible)
public void PrintError(object o, LuaCsMessageOrigin origin)
{
switch (origin)
{
case LuaCsMessageOrigin.LuaCs:
PrintGenericError(o);
break;
case LuaCsMessageOrigin.LuaMod:
PrintLuaError(o);
break;
case LuaCsMessageOrigin.CSharpMod:
PrintCsError(o);
break;
}
}
private static void PrintLuaError(object o) => PrintErrorBase($"[{LOG_PREFIX} LUA ERROR] ", o, "nil");
// TODO: deprecate this
// XXX: this is only public so that we don't break backward compat with C# mods
public static void PrintCsError(object o) => PrintErrorBase($"[{LOG_PREFIX} CS ERROR] ", o, "Null");
private static void PrintGenericError(object o) => PrintErrorBase($"[{LOG_PREFIX} ERROR] ", o, "Null");
internal LuaCsMessageLogger MessageLogger { get; set; }
private static void DefaultMessageLogger(string prefix, object o)
{
var message = o.ToString();
for (int i = 0; i < message.Length; i += 1024)
{
var subStr = message.Substring(i, Math.Min(1024, message.Length - i));
#if SERVER
if (GameMain.Server != null)
{
foreach (var c in GameMain.Server.ConnectedClients)
{
GameMain.Server.SendDirectChatMessage(ChatMessage.Create("", subStr, ChatMessageType.Console, null, textColor: Color.MediumPurple), c);
}
GameServer.Log(prefix + subStr, ServerLog.MessageType.ServerMessage);
}
#endif
}
#if SERVER
DebugConsole.NewMessage(message.ToString(), Color.MediumPurple);
#else
DebugConsole.NewMessage(message.ToString(), Color.Purple);
#endif
}
private void PrintMessageBase(string prefix, object message, string empty) => MessageLogger?.Invoke(prefix, message ?? empty);
internal void PrintMessage(object message) => PrintMessageBase("[LuaCs] ", message, "nil");
// TODO: deprecate this (in an effort to get rid of as much global state as possible)
public static void PrintCsMessage(object message) => GameMain.LuaCs.PrintMessage(message);
private DynValue DoFile(string file, Table globalContext = null, string codeStringFriendly = null)
{
@@ -284,17 +318,17 @@ namespace Barotrauma
return lua.LoadFile(file, globalContext, codeStringFriendly);
}
public object CallLuaFunction(object function, params object[] arguments)
public DynValue CallLuaFunction(object function, params object[] args)
{
lock (lua)
{
try
{
return lua.Call(function, arguments);
return lua.Call(function, args);
}
catch (Exception e)
{
HandleException(e);
HandleException(e, LuaCsMessageOrigin.LuaMod);
}
return null;
}
@@ -375,7 +409,7 @@ namespace Barotrauma
LuaScriptLoader = new LuaScriptLoader();
LuaScriptLoader.ModulePaths = new string[] { };
LuaCustomConverters.RegisterAll();
LuaCustomConverters.Initialize(CallLuaFunction);
lua = new Script(CoreModules.Preset_SoftSandbox | CoreModules.Debug);
lua.Options.DebugPrint = PrintMessage;
@@ -396,7 +430,8 @@ namespace Barotrauma
UserData.RegisterType<LuaCsConfig>();
UserData.RegisterType<LuaCsAction>();
UserData.RegisterType<LuaCsFile>();
UserData.RegisterType<LuaCsPatch>();
UserData.RegisterType<LuaCsCompatPatchFunc>();
UserData.RegisterType<LuaCsPatchFunc>();
UserData.RegisterType<LuaCsConfig>();
UserData.RegisterType<CsScriptRunner>();
UserData.RegisterType<LuaGame>();
@@ -408,7 +443,7 @@ namespace Barotrauma
UserData.RegisterType<LuaCsPerformanceCounter>();
UserData.RegisterType<IUserDataDescriptor>();
lua.Globals["printerror"] = (Action<object>)PrintError;
lua.Globals["printerror"] = (Action<object>)PrintLuaError;
lua.Globals["setmodulepaths"] = (Action<string[]>)SetModulePaths;
@@ -463,13 +498,13 @@ namespace Barotrauma
}
catch (Exception ex)
{
HandleException(ex, exceptionType: ExceptionType.CSharp);
HandleException(ex, LuaCsMessageOrigin.CSharpMod);
}
});
}
catch (Exception ex)
{
HandleException(ex, exceptionType: ExceptionType.CSharp);
HandleException(ex, LuaCsMessageOrigin.CSharpMod);
}
}
@@ -489,7 +524,7 @@ namespace Barotrauma
}
catch (Exception e)
{
HandleException(e);
HandleException(e, LuaCsMessageOrigin.LuaMod);
}
}
else if (luaPackage != null)
@@ -505,20 +540,15 @@ namespace Barotrauma
}
catch (Exception e)
{
HandleException(e);
HandleException(e, LuaCsMessageOrigin.LuaMod);
}
}
else
{
PrintError("LuaSetup.lua not found! Lua/LuaSetup.lua, no Lua scripts will be executed or work.");
PrintLuaError("LuaSetup.lua not found! Lua/LuaSetup.lua, no Lua scripts will be executed or work.");
}
executionNumber++;
}
}
}
}
}

View File

@@ -68,7 +68,7 @@ namespace Barotrauma
}
catch (Exception e)
{
GameMain.LuaCs.HandleException(e, "", LuaCsSetup.ExceptionType.CSharp);
GameMain.LuaCs.HandleException(e, LuaCsMessageOrigin.CSharpMod);
}
timedActionsToRemove.Add(timedAction);

View File

@@ -79,7 +79,7 @@ namespace Barotrauma
return false;
}
public static bool IsPathAllowedException(string path, bool write = true, LuaCsSetup.ExceptionType exceptionType = LuaCsSetup.ExceptionType.Both)
public static bool IsPathAllowedException(string path, bool write = true, LuaCsMessageOrigin origin = LuaCsMessageOrigin.Unknown)
{
if (write)
{
@@ -106,9 +106,9 @@ namespace Barotrauma
}
public static bool IsPathAllowedLuaException(string path, bool write = true) =>
IsPathAllowedException(path, write, LuaCsSetup.ExceptionType.Lua);
IsPathAllowedException(path, write, LuaCsMessageOrigin.LuaMod);
public static bool IsPathAllowedCsException(string path, bool write = true) =>
IsPathAllowedException(path, write, LuaCsSetup.ExceptionType.CSharp);
IsPathAllowedException(path, write, LuaCsMessageOrigin.CSharpMod);
public static string Read(string path)
{

View File

@@ -0,0 +1,532 @@
using Barotrauma;
using Microsoft.Xna.Framework;
using MoonSharp.Interpreter;
using System.Runtime.ExceptionServices;
using Xunit;
using Xunit.Abstractions;
namespace TestProject.LuaCs
{
public class HookPatchTests
{
private readonly LuaCsSetup luaCs = new();
public HookPatchTests(ITestOutputHelper output)
{
UserData.RegisterType<TestValueType>();
UserData.RegisterType<IBogusInterface>();
UserData.RegisterType<InterfaceImplementingType>();
UserData.RegisterType<PatchTarget1>();
UserData.RegisterType<PatchTarget2>();
UserData.RegisterType<PatchTarget3>();
UserData.RegisterType<PatchTarget4>();
UserData.RegisterType<PatchTarget5>();
UserData.RegisterType<PatchTarget6>();
luaCs.MessageLogger = (prefix, o) =>
{
o ??= "null";
output.WriteLine(prefix + o);
};
luaCs.ExceptionHandler = (ex, _) =>
{
// Pretend we never caught the exception in the first place
// (this allows us to preserve the stack trace)
var di = ExceptionDispatchInfo.Capture(ex);
di.Throw();
};
luaCs.Initialize();
luaCs.Lua.Globals["TestValueType"] = UserData.CreateStatic<TestValueType>();
luaCs.Lua.Globals["InterfaceImplementingType"] = UserData.CreateStatic<InterfaceImplementingType>();
}
private DynValue AddPrefix<T>(string body, string testMethod = "Run", string? patchId = null)
{
var className = typeof(T).FullName;
if (patchId != null)
{
return luaCs.Lua.DoString(@$"
return Hook.Patch('{patchId}', '{className}', '{testMethod}', function(instance, ptable)
{body}
end, Hook.HookMethodType.Before)
");
}
else
{
return luaCs.Lua.DoString(@$"
return Hook.Patch('{className}', '{testMethod}', function(instance, ptable)
{body}
end, Hook.HookMethodType.Before)
");
}
}
private DynValue AddPostfix<T>(string body, string testMethod = "Run", string? patchId = null)
{
var className = typeof(T).FullName;
if (patchId != null)
{
return luaCs.Lua.DoString(@$"
return Hook.Patch('{patchId}', '{className}', '{testMethod}', function(instance, ptable)
{body}
end, Hook.HookMethodType.After)
");
}
else
{
return luaCs.Lua.DoString(@$"
return Hook.Patch('{className}', '{testMethod}', function(instance, ptable)
{body}
end, Hook.HookMethodType.After)
");
}
}
private DynValue RemovePrefix<T>(string patchName, string testMethod = "Run")
{
var className = typeof(T).FullName;
return luaCs.Lua.DoString($@"
return Hook.RemovePatch('{patchName}', '{className}', '{testMethod}', Hook.HookMethodType.Before)
");
}
private DynValue RemovePostfix<T>(string patchName, string testMethod = "Run")
{
var className = typeof(T).FullName;
return luaCs.Lua.DoString($@"
return Hook.RemovePatch('{patchName}', '{className}', '{testMethod}', Hook.HookMethodType.After)
");
}
public class PatchTarget1
{
public bool ran;
public void Run()
{
ran = true;
}
}
[Fact]
public void TestFullMethodReplacement()
{
var target = new PatchTarget1();
AddPrefix<PatchTarget1>("ptable.PreventExecution = true");
target.Run();
Assert.False(target.ran);
}
[Fact]
public void TestOverrideExistingPatch()
{
var target = new PatchTarget1();
AddPrefix<PatchTarget1>(@"
ptable.PreventExecution = true
originalPatchRan = true
", patchId: "test");
target.Run();
Assert.False(target.ran);
Assert.True(luaCs.Lua.Globals["originalPatchRan"] as bool?);
// Reset this global so we can test if the original patch ran
// after replacing it.
luaCs.Lua.Globals["originalPatchRan"] = false;
// Replace the existing prefix, but don't prevent execution this time
AddPrefix<PatchTarget1>("replacementPatchRan = true", patchId: "test");
target.Run();
Assert.True(target.ran);
// Make sure the original patch didn't run
Assert.False(luaCs.Lua.Globals["originalPatchRan"] as bool?);
// Test if the replacement patch ran
Assert.True(luaCs.Lua.Globals["replacementPatchRan"] as bool?);
}
[Fact]
public void TestRemovePrefix()
{
var target = new PatchTarget1();
var patchId = AddPrefix<PatchTarget1>(@"
ptable.PreventExecution = true
patchRan = true
");
target.Run();
Assert.False(target.ran);
Assert.True(luaCs.Lua.Globals["patchRan"] as bool?);
luaCs.Lua.Globals["patchRan"] = false;
Assert.Equal(DataType.String, patchId.Type);
RemovePrefix<PatchTarget1>(patchId.String);
target.Run();
Assert.True(target.ran);
Assert.False(luaCs.Lua.Globals["patchRan"] as bool?);
}
[Fact]
public void TestRemovePostfix()
{
var target = new PatchTarget1();
var patchId = AddPostfix<PatchTarget1>(@"
patchRan = true
");
target.Run();
Assert.True(target.ran);
Assert.True(luaCs.Lua.Globals["patchRan"] as bool?);
target.ran = false;
luaCs.Lua.Globals["patchRan"] = false;
Assert.Equal(DataType.String, patchId.Type);
RemovePostfix<PatchTarget1>(patchId.String);
target.Run();
Assert.True(target.ran);
Assert.False(luaCs.Lua.Globals["patchRan"] as bool?);
}
public struct TestValueType
{
public int foo;
public TestValueType(int foo)
{
this.foo = foo;
}
}
public class PatchTarget2
{
public bool ran;
public object Run()
{
ran = true;
return 5;
}
}
public interface IBogusInterface
{
int GetFoo();
}
public class InterfaceImplementingType : IBogusInterface
{
private readonly int foo;
public InterfaceImplementingType(int foo)
{
this.foo = foo;
}
public int GetFoo() => foo;
}
[Fact]
public void TestReturnBoxed()
{
var target = new PatchTarget2();
AddPrefix<PatchTarget2>(@"
ptable.PreventExecution = true
return 123
");
var returnValue = target.Run();
Assert.False(target.ran);
Assert.Equal(123, (int)(double)returnValue);
}
[Fact]
public void TestReturnVoid()
{
var target = new PatchTarget2();
// This should have no effect
AddPrefix<PatchTarget2>("return");
var returnValue = target.Run();
Assert.True(target.ran);
Assert.Equal(5, returnValue);
}
[Fact]
public void TestReturnNil()
{
var target = new PatchTarget2();
// This should modify the return value to "null"
AddPostfix<PatchTarget2>("return nil");
var returnValue = target.Run();
Assert.True(target.ran);
Assert.Null(returnValue);
}
[Fact]
public void TestReturnValueType()
{
var target = new PatchTarget2();
AddPostfix<PatchTarget2>(@"
return TestValueType.__new(100)
");
var returnValue = target.Run();
Assert.True(target.ran);
Assert.IsType<TestValueType>(returnValue);
Assert.Equal(100, ((TestValueType)returnValue).foo);
}
public class PatchTarget3
{
public bool ran;
public IBogusInterface Run()
{
ran = true;
return new InterfaceImplementingType(5);
}
}
[Fact]
public void TestReturnInterfaceImplementingType()
{
var target = new PatchTarget3();
AddPostfix<PatchTarget3>(@"
return InterfaceImplementingType.__new(100);
");
var returnValue = target.Run()!;
Assert.True(target.ran);
Assert.Equal(100, returnValue.GetFoo());
}
public class PatchTarget4
{
public bool ran;
public void Run(int a, out string outString, ref byte refByte, string b)
{
ran = true;
outString = a + b + refByte;
}
}
[Fact]
public void TestModifyParameters()
{
var target = new PatchTarget4();
AddPrefix<PatchTarget4>(@"
ptable['a'] = Int32(100)
ptable['b'] = 'abc'
ptable['refByte'] = Byte(4)
");
byte refByte = 123;
target.Run(5, out var outString, ref refByte, "foo");
Assert.True(target.ran);
Assert.Equal("100abc4", outString);
}
public class PatchTarget5
{
public bool ran;
public string Run(Vector2 vec)
{
ran = true;
return vec.ToString();
}
}
[Fact]
public void TestParameterValueType()
{
var target = new PatchTarget5();
AddPrefix<PatchTarget5>("patchRan = true");
var returnValue = target.Run(new Vector2(1, 2));
Assert.True(target.ran);
Assert.True(luaCs.Lua.Globals["patchRan"] as bool?);
Assert.Equal("{X:1 Y:2}", returnValue);
}
public class PatchTarget6
{
public bool ran;
public sbyte RunSByte(sbyte v)
{
ran = true;
return v;
}
public byte RunByte(byte v)
{
ran = true;
return v;
}
public short RunInt16(short v)
{
ran = true;
return v;
}
public ushort RunUInt16(ushort v)
{
ran = true;
return v;
}
public int RunInt32(int v)
{
ran = true;
return v;
}
public uint RunUInt32(uint v)
{
ran = true;
return v;
}
public long RunInt64(long v)
{
ran = true;
return v;
}
public ulong RunUInt64(ulong v)
{
ran = true;
return v;
}
public float RunSingle(float v)
{
ran = true;
return v;
}
public double RunDouble(double v)
{
ran = true;
return v;
}
}
[Fact]
public void TestCastPrimitiveWrapperSByte()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = SByte(-6)
", testMethod: nameof(PatchTarget6.RunSByte));
var returnValue = target.RunSByte(-5);
Assert.True(target.ran);
Assert.Equal(-6, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperByte()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = Byte(6)
", testMethod: nameof(PatchTarget6.RunByte));
var returnValue = target.RunByte(5);
Assert.True(target.ran);
Assert.Equal(6, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperInt16()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = Int16(-25000)
", testMethod: nameof(PatchTarget6.RunInt16));
var returnValue = target.RunInt16(30000);
Assert.True(target.ran);
Assert.Equal(-25000, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperUInt16()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = UInt16(60000)
", testMethod: nameof(PatchTarget6.RunUInt16));
var returnValue = target.RunUInt16(50000);
Assert.True(target.ran);
Assert.Equal(60000, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperInt32()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = Int32('7FFFFF00', 16)
", testMethod: nameof(PatchTarget6.RunInt32));
var returnValue = target.RunInt32(900000);
Assert.True(target.ran);
Assert.Equal(0x7FFFFF00, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperUInt32()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = UInt32('AFFFFFFF', 16)
", testMethod: nameof(PatchTarget6.RunUInt32));
var returnValue = target.RunUInt32(300500);
Assert.True(target.ran);
Assert.Equal(0xAFFFFFFF, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperInt64()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = Int64('7555555555555555', 16)
", testMethod: nameof(PatchTarget6.RunInt64));
var returnValue = target.RunInt64(0x7FFFFFFF00000000);
Assert.True(target.ran);
Assert.Equal(0x7555555555555555, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperUInt64()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = UInt64('F555555555555555', 16)
", testMethod: nameof(PatchTarget6.RunUInt64));
var returnValue = target.RunUInt64(0xFFFFFFFF00000000);
Assert.True(target.ran);
Assert.Equal(0xF555555555555555, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperSingle()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = Single(123.456)
", testMethod: nameof(PatchTarget6.RunSingle));
var returnValue = target.RunSingle(111.111f);
Assert.True(target.ran);
Assert.Equal(123.456f, returnValue);
}
[Fact]
public void TestCastPrimitiveWrapperDouble()
{
var target = new PatchTarget6();
AddPrefix<PatchTarget6>(@"
ptable['v'] = Double(123.456)
", testMethod: nameof(PatchTarget6.RunDouble));
var returnValue = target.RunDouble(111.111d);
Assert.True(target.ran);
Assert.Equal(123.456d, returnValue);
}
}
}

Binary file not shown.

Binary file not shown.

1
Libraries/moonsharp Submodule

Submodule Libraries/moonsharp added at b9fc22da9e

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29201.188
# Visual Studio Version 17
VisualStudioVersion = 17.1.32319.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D32A29D8-AC7B-4189-B734-8ED9EB4120D0}"
ProjectSection(SolutionItems) = preProject
@@ -40,7 +40,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinuxServer", "Barotrauma\B
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoGame.Framework.Linux.NetStandard", "Libraries\MonoGame.Framework\Src\MonoGame.Framework\MonoGame.Framework.Linux.NetStandard.csproj", "{33E95A21-E071-4432-819F-AA64CF3EF3F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinuxTest", "Barotrauma\BarotraumaTest\LinuxTest.csproj", "{F1B80D94-8BD6-48CE-8D17-BB2A5C98BCA3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinuxTest", "Barotrauma\BarotraumaTest\LinuxTest.csproj", "{F1B80D94-8BD6-48CE-8D17-BB2A5C98BCA3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoonSharp.Interpreter.netcore", "Libraries\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.csproj", "{382DFA63-78FC-41AC-BA85-630960A56E5C}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
@@ -199,6 +201,18 @@ Global
{F1B80D94-8BD6-48CE-8D17-BB2A5C98BCA3}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{F1B80D94-8BD6-48CE-8D17-BB2A5C98BCA3}.Unstable|x64.ActiveCfg = Debug|Any CPU
{F1B80D94-8BD6-48CE-8D17-BB2A5C98BCA3}.Unstable|x64.Build.0 = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Debug|x64.ActiveCfg = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Debug|x64.Build.0 = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Release|Any CPU.Build.0 = Release|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Release|x64.ActiveCfg = Release|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Release|x64.Build.0 = Release|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Unstable|x64.ActiveCfg = Debug|Any CPU
{382DFA63-78FC-41AC-BA85-630960A56E5C}.Unstable|x64.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -217,6 +231,7 @@ Global
{2B0881F6-9C67-4446-A1F2-FC042763A462} = {68B18BE6-9EE0-49DA-AE3A-4C7326F768F9}
{33E95A21-E071-4432-819F-AA64CF3EF3F1} = {DE36F45F-F09E-4719-B953-00D148F7722A}
{F1B80D94-8BD6-48CE-8D17-BB2A5C98BCA3} = {68B18BE6-9EE0-49DA-AE3A-4C7326F768F9}
{382DFA63-78FC-41AC-BA85-630960A56E5C} = {DE36F45F-F09E-4719-B953-00D148F7722A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {17032EAB-554B-4B44-A4F6-EFB177ACAB7A}

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29201.188
# Visual Studio Version 17
VisualStudioVersion = 17.1.32319.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D32A29D8-AC7B-4189-B734-8ED9EB4120D0}"
ProjectSection(SolutionItems) = preProject
@@ -37,7 +37,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoGame.Framework.MacOS.Ne
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks.Posix", "Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj", "{F10CE3BB-26B8-446E-84D2-86D25E850F61}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MacTest", "Barotrauma\BarotraumaTest\MacTest.csproj", "{20BC9336-B439-4BF1-8B65-D587DBF421D1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MacTest", "Barotrauma\BarotraumaTest\MacTest.csproj", "{20BC9336-B439-4BF1-8B65-D587DBF421D1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoonSharp.Interpreter.netcore", "Libraries\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.csproj", "{40BDE83D-61D5-481C-A53E-E0F5B23881E2}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
@@ -196,6 +198,18 @@ Global
{20BC9336-B439-4BF1-8B65-D587DBF421D1}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{20BC9336-B439-4BF1-8B65-D587DBF421D1}.Unstable|x64.ActiveCfg = Debug|Any CPU
{20BC9336-B439-4BF1-8B65-D587DBF421D1}.Unstable|x64.Build.0 = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Debug|x64.ActiveCfg = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Debug|x64.Build.0 = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Release|Any CPU.Build.0 = Release|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Release|x64.ActiveCfg = Release|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Release|x64.Build.0 = Release|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Unstable|x64.ActiveCfg = Debug|Any CPU
{40BDE83D-61D5-481C-A53E-E0F5B23881E2}.Unstable|x64.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -214,6 +228,7 @@ Global
{35DDDA7D-328D-4A5D-BCBB-2E60C830A899} = {DE36F45F-F09E-4719-B953-00D148F7722A}
{F10CE3BB-26B8-446E-84D2-86D25E850F61} = {DE36F45F-F09E-4719-B953-00D148F7722A}
{20BC9336-B439-4BF1-8B65-D587DBF421D1} = {DFD82BBD-8D05-403D-BEBC-F4C1CF783E18}
{40BDE83D-61D5-481C-A53E-E0F5B23881E2} = {DE36F45F-F09E-4719-B953-00D148F7722A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {17032EAB-554B-4B44-A4F6-EFB177ACAB7A}

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29201.188
# Visual Studio Version 17
VisualStudioVersion = 17.1.32319.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D32A29D8-AC7B-4189-B734-8ED9EB4120D0}"
ProjectSection(SolutionItems) = preProject
@@ -40,90 +40,179 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XNATypes", "Libraries\XNATy
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpFont.NetStandard", "Libraries\SharpFont\Source\SharpFont\SharpFont.NetStandard.csproj", "{6911872D-40EF-400C-B0A1-9985A19ED488}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsTest", "Barotrauma\BarotraumaTest\WindowsTest.csproj", "{C7212AE2-A925-4225-A639-AE0653EF65B0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsTest", "Barotrauma\BarotraumaTest\WindowsTest.csproj", "{C7212AE2-A925-4225-A639-AE0653EF65B0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoonSharp.Interpreter.netcore", "Libraries\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.csproj", "{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Libraries\GameAnalytics\GA-SDK-MONO-SHARED\GA-SDK-MONO-SHARED.projitems*{95c4d59d-9be4-4278-b4f8-46c0ba1a3916}*SharedItemsImports = 5
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Unstable|Any CPU = Unstable|Any CPU
Unstable|x64 = Unstable|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Debug|x64.ActiveCfg = Debug|x64
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Debug|x64.Build.0 = Debug|x64
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Release|Any CPU.Build.0 = Release|Any CPU
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Release|x64.ActiveCfg = Release|x64
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Release|x64.Build.0 = Release|x64
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Unstable|x64.ActiveCfg = Release|x64
{E1BBC67C-DC2A-40E8-89F3-B57299D7B16C}.Unstable|x64.Build.0 = Release|x64
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Debug|x64.ActiveCfg = Debug|x64
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Debug|x64.Build.0 = Debug|x64
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Release|Any CPU.Build.0 = Release|Any CPU
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Release|x64.ActiveCfg = Release|x64
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Release|x64.Build.0 = Release|x64
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Unstable|x64.ActiveCfg = Release|x64
{95C4D59D-9BE4-4278-B4F8-46C0BA1A3916}.Unstable|x64.Build.0 = Release|x64
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Debug|x64.ActiveCfg = Debug|x64
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Debug|x64.Build.0 = Debug|x64
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Release|Any CPU.Build.0 = Release|Any CPU
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Release|x64.ActiveCfg = Release|x64
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Release|x64.Build.0 = Release|x64
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Unstable|x64.ActiveCfg = Release|x64
{AD30AE95-7BF6-4CE5-AEED-B6C30A88F139}.Unstable|x64.Build.0 = Release|x64
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Debug|Any CPU.Build.0 = Debug|Any CPU
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Debug|x64.ActiveCfg = Debug|x64
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Debug|x64.Build.0 = Debug|x64
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Release|Any CPU.ActiveCfg = Release|Any CPU
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Release|Any CPU.Build.0 = Release|Any CPU
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Release|x64.ActiveCfg = Release|x64
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Release|x64.Build.0 = Release|x64
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Unstable|x64.ActiveCfg = Release|x64
{894D3518-A0E3-4B88-B9BF-9E1AFC3F9523}.Unstable|x64.Build.0 = Release|x64
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Debug|x64.ActiveCfg = Debug|x64
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Debug|x64.Build.0 = Debug|x64
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Release|Any CPU.Build.0 = Release|Any CPU
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Release|x64.ActiveCfg = Release|x64
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Release|x64.Build.0 = Release|x64
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Unstable|x64.ActiveCfg = Release|x64
{ED2873CA-C209-4CBC-ADD4-DAA753DFEEAF}.Unstable|x64.Build.0 = Release|x64
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Debug|x64.ActiveCfg = Debug|x64
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Debug|x64.Build.0 = Debug|x64
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Release|Any CPU.Build.0 = Release|Any CPU
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Release|x64.ActiveCfg = Release|x64
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Release|x64.Build.0 = Release|x64
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Unstable|Any CPU.ActiveCfg = Unstable|Any CPU
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Unstable|Any CPU.Build.0 = Unstable|Any CPU
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Unstable|x64.ActiveCfg = Unstable|x64
{978633A8-094A-4623-9B82-8533FC8BA1CC}.Unstable|x64.Build.0 = Unstable|x64
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Debug|x64.ActiveCfg = Debug|x64
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Debug|x64.Build.0 = Debug|x64
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Release|Any CPU.Build.0 = Release|Any CPU
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Release|x64.ActiveCfg = Release|x64
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Release|x64.Build.0 = Release|x64
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Unstable|x64.ActiveCfg = Release|x64
{39E52316-D6C1-4D1F-95FF-37F41C9AB5A7}.Unstable|x64.Build.0 = Release|x64
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Debug|x64.ActiveCfg = Debug|x64
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Debug|x64.Build.0 = Debug|x64
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Release|Any CPU.Build.0 = Release|Any CPU
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Release|x64.ActiveCfg = Release|x64
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Release|x64.Build.0 = Release|x64
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Unstable|x64.ActiveCfg = Release|x64
{D379BF8E-D696-4AB9-A27F-4D0C493BF484}.Unstable|x64.Build.0 = Release|x64
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Debug|x64.ActiveCfg = Debug|x64
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Debug|x64.Build.0 = Debug|x64
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Release|Any CPU.Build.0 = Release|Any CPU
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Release|x64.ActiveCfg = Release|x64
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Release|x64.Build.0 = Release|x64
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Unstable|Any CPU.ActiveCfg = Unstable|Any CPU
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Unstable|Any CPU.Build.0 = Unstable|Any CPU
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Unstable|x64.ActiveCfg = Unstable|x64
{47848C6E-C7A8-4EC3-96C2-3BC8A4234AFA}.Unstable|x64.Build.0 = Unstable|x64
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Debug|x64.ActiveCfg = Debug|x64
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Debug|x64.Build.0 = Debug|x64
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Release|Any CPU.Build.0 = Release|Any CPU
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Release|x64.ActiveCfg = Release|x64
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Release|x64.Build.0 = Release|x64
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Unstable|x64.ActiveCfg = Release|x64
{1F318AC4-F808-4130-867F-B98DF9AA8F95}.Unstable|x64.Build.0 = Release|x64
{6911872D-40EF-400C-B0A1-9985A19ED488}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6911872D-40EF-400C-B0A1-9985A19ED488}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6911872D-40EF-400C-B0A1-9985A19ED488}.Debug|x64.ActiveCfg = Debug|x64
{6911872D-40EF-400C-B0A1-9985A19ED488}.Debug|x64.Build.0 = Debug|x64
{6911872D-40EF-400C-B0A1-9985A19ED488}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6911872D-40EF-400C-B0A1-9985A19ED488}.Release|Any CPU.Build.0 = Release|Any CPU
{6911872D-40EF-400C-B0A1-9985A19ED488}.Release|x64.ActiveCfg = Release|x64
{6911872D-40EF-400C-B0A1-9985A19ED488}.Release|x64.Build.0 = Release|x64
{6911872D-40EF-400C-B0A1-9985A19ED488}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{6911872D-40EF-400C-B0A1-9985A19ED488}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{6911872D-40EF-400C-B0A1-9985A19ED488}.Unstable|x64.ActiveCfg = Release|x64
{6911872D-40EF-400C-B0A1-9985A19ED488}.Unstable|x64.Build.0 = Release|x64
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Debug|x64.ActiveCfg = Debug|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Debug|x64.Build.0 = Debug|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Release|Any CPU.Build.0 = Release|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Release|x64.ActiveCfg = Release|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Release|x64.Build.0 = Release|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Unstable|Any CPU.ActiveCfg = Release|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Unstable|Any CPU.Build.0 = Release|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Unstable|x64.ActiveCfg = Debug|Any CPU
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Unstable|x64.Build.0 = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|x64.ActiveCfg = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|x64.Build.0 = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|Any CPU.Build.0 = Release|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|x64.ActiveCfg = Release|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|x64.Build.0 = Release|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|Any CPU.Build.0 = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|x64.ActiveCfg = Debug|Any CPU
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|x64.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -142,6 +231,7 @@ Global
{1F318AC4-F808-4130-867F-B98DF9AA8F95} = {DE36F45F-F09E-4719-B953-00D148F7722A}
{6911872D-40EF-400C-B0A1-9985A19ED488} = {DE36F45F-F09E-4719-B953-00D148F7722A}
{C7212AE2-A925-4225-A639-AE0653EF65B0} = {78A9F0AA-5519-407A-9B72-2A09F5DF7068}
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED} = {DE36F45F-F09E-4719-B953-00D148F7722A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {17032EAB-554B-4B44-A4F6-EFB177ACAB7A}

View File

@@ -1,25 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>LuaCs For Barotrauma</title>
<link rel="stylesheet" href="landing.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<a href="lua-docs/index.html"><div id="lua-docs" class="common-docs">
<div id="lua-bg" class="inner-bg">
<div id="lua-inner" class="inner-docs">
<img src="lua_logo.png" />
</div>
</div>
</div></a>
<a href="cs-docs/html/index.html"><div id="cs-docs" class="common-docs">
<div id="cs-bg" class="inner-bg">
<div id="cs-inner" class="inner-docs">
<img src="cs_logo.png" />
</div>
</div>
</div></a>
</body>
</html>

View File

@@ -1,132 +0,0 @@
body{
overflow: hidden;
font-size: 100%;
background-color: #777;
}
.common-docs{
z-index: 1;
text-justify: auto;
position: fixed;
top: 0;
bottom: 0;
transition-property: transform;
transition-duration: 0.5s;
transition-timing-function: ease-in-out;
overflow: hidden;
}
#lua-docs{
left: -10%;
right: 50%;
}
#cs-docs{
right: -10%;
left: 50%;
}
#cs-docs::before,#lua-docs::before{
content: "";
background: url(bg.jpg) repeat;
background-size: 80%;
background-blend-mode: luminosity;
filter: blur(2px);
position: absolute;
height: 200%;
width: 200%;
}
#lua-docs::before{
background-color: rgba(49, 49, 135, 1);
}
#cs-docs::before{
background-color: rgba(105, 44, 120, 1);
}
.common-docs:hover{
z-index: 2;
font-size: 300%;
transform: scale(1.05);
}
.inner-bg{
position: relative;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
transition-duration: 0.5s;
transition-timing-function: ease-in-out;
}
.inner-bg:hover{
background-color: rgba(255, 255, 255, 0.35);
}
.inner-docs{
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
background: radial-gradient(circle, #222, rgba(0, 0, 0, 0));
}
@media (min-width: 80em) {
.inner-docs img{
height: 30%;
width: auto;
}
.common-docs{
transform: skewX(-11deg);
}
#cs-docs::before,#lua-docs::before{
transform: skewX(11deg);
}
.common-docs:hover{
transform: skewX(-11deg) scale(1.05);
}
.inner-docs{
transform: skewX(11deg);
}
.inner-docs img{
height: 30%;
width: auto;
}
}
@media (max-width: 80em) {
.common-docs{
transform: skewX(-9deg);
}
#cs-docs::before,#lua-docs::before{
transform: skewX(9deg);
}
.common-docs:hover{
transform: skewX(-9deg) scale(1.05);
}
.inner-docs{
transform: skewX(9deg);
}
.inner-docs img{
height: 30%;
width: auto;
}
}
@media (max-width: 70em) {
.common-docs{
transform: skewX(0deg);
}
#cs-docs::before,#lua-docs::before{
transform: skewX(0deg);
}
.common-docs:hover{
transform: skewX(0deg) scale(1.05);
}
.inner-docs{
transform: skewX(0deg);
}
.inner-docs img{
height: auto;
width: 50%;
}
}

View File

@@ -1,5 +0,0 @@
xcopy css html /Y
xcopy js html /Y
cd ..
lua B:\programming\lua\LDoc\ldoc.lua .
cd docs

View File

@@ -1,539 +0,0 @@
:root {
--content-width: 100%;
--sidebar-width: 25%;
--padding-big: 48px;
--padding-normal: 24px;
--padding-small: 16px;
--padding-tiny: 10px;
--font-massive: 32px;
--font-huge: 24px;
--font-big: 18px;
--font-normal: 16px;
--font-tiny: 12px;
--font-style-normal: Segoe UI, Helvetica, Arial, sans-serif;
--font-style-code: Consolas, monospace;
--color-accent: rgb(47, 100, 74);
--color-accent-dark: rgb(33, 33, 33);
--color-white: rgb(255, 255, 255);
--color-offwhite: rgb(200, 200, 200);
--color-white-accent: rgb(203, 190, 209);
--color-black: rgb(0, 0, 0);
--color-lightgrey: rgb(160, 160, 160);
--color-background-light: rgb(245, 245, 245);
--color-background-dark: rgb(33, 33, 33);
--color-background-dark-ish: rgb(44, 44, 44);
--color-outline: rgb(149, 34, 160);
--color-good: #5190ff;
}
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
background-color: var(--color-background-dark);
font-family: var(--font-style-normal);
display: flex;
flex-direction: column;
}
a {
color: inherit;
text-decoration: inherit;
}
h1, h2, h3, h4 {
font-weight: 400;
}
ul li {
margin-left: var(--padding-small);
}
/* landing */
.landing {
background-color: var(--color-accent);
color: var(--color-white);
padding: 128px 0 128px 0;
}
.landing h1 {
margin: 0;
padding: 0;
border: none;
font-weight: 100;
font-size: var(--font-massive);
text-align: center;
}
.wrapper {
padding: var(--padding-small);
}
details {
user-select: none;
}
details summary {
outline: none;
}
code {
font-family: "Source Code Pro", monospace;
font-size: 85%;
white-space: pre;
tab-size: 4;
-moz-tab-size: 4;
padding: 1px 4px;
background-color: #282a36;
outline-style: solid;
outline-color: black;
outline-width: 2px;
}
pre {
background-color: rgb(0, 0, 0, 1);
margin-top: var(--padding-small);
padding: 2px;
overflow: auto;
}
pre code {
background-color: transparent;
}
span.realm {
width: 14px;
height: 14px;
border-radius: 3px;
display: inline-block;
margin-right: 5px;
}
span.realm.shared {
background: linear-gradient(45deg, #f80 0%, #f80 50%, #08f 51%, #08f 100%);
}
span.realm.client {
background-color: #f80;
}
span.realm.server {
background-color: #08f;
}
.colorful-label {
color: rgb(31, 141, 155);
}
/* wrapper element for sidebar/content */
main {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
width: var(--content-width);
margin: auto;
}
/* sidebar */
nav {
color: var(--color-offwhite);
background-color: var(--color-background-dark);
position: fixed;
display: flex;
flex-direction: column;
width: var(--sidebar-width);
height: 100%;
}
/* sidebar header */
nav header {
color: var(--color-white);
background-color: var(--color-accent);
padding: var(--padding-small);
}
nav header h1 {
font-size: var(--font-huge);
font-weight: 100;
text-align: center;
margin-bottom: var(--padding-small);
}
#search {
background-color: var(--color-accent-dark);
color: var(--color-white);
border: none;
font-size: var(--font-normal);
outline: none;
width: 100%;
padding: 6px;
}
#search::placeholder {
color: var(--color-white-accent);
}
#search::-webkit-search-cancel-button {
display: none;
}
/* sidebar contents */
nav section {
padding: var(--padding-small);
overflow: auto;
}
nav section ul {
list-style-type: none;
}
nav section::-webkit-scrollbar,
pre::-webkit-scrollbar {
width: 8px;
height: 8px;
}
nav section::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
background: transparent;
}
nav section::-webkit-scrollbar-thumb {
background-color: var(--color-lightgrey);
}
pre::-webkit-scrollbar-thumb {
background-color: var(--color-lightgrey);
}
/* sidebar contents category */
nav section details.category {
padding-top: var(--padding-tiny);
}
nav section details.category > ul > li {
margin: 0;
line-height: 1.5;
}
nav section details.category > ul > li a {
display: inline-block;
width: 90%;
}
nav section details.category:first-of-type {
padding-top: calc(var(--padding-tiny) * -1);
}
nav section details.category summary::-webkit-details-marker {
opacity: 0.5;
cursor: pointer;
}
nav section details.category summary h2 {
color: var(--color-accent);
font-size: var(--font-big);
letter-spacing: 2px;
text-transform: uppercase;
cursor: pointer;
padding-bottom: var(--padding-tiny);
}
/* content */
article {
background-color: var(--color-background-dark-ish);
color: white;
width: calc(100% - var(--sidebar-width));
min-height: 100vh;
margin-left: var(--sidebar-width);
}
article .wrapper > *:first-child {
margin-top: 0;
}
/* header */
article header {
color: rgb(255, 255, 255);
background-color: var(--color-accent);
padding: var(--padding-tiny);
}
article header h1 {
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
padding-bottom: 8px;
font-family: var(--font-style-code);
margin: 0;
}
article header h2 {
padding-top: var(--padding-tiny);
margin: 0;
font-size: var(--font-normal);
font-weight: normal;
}
article header.module a {
color: white !important;
text-decoration: underline;
}
details.category > summary {
list-style: none;
}
details.category > summary::-webkit-details-marker {
display: none;
}
article h1 {
font-size: 28px;
font-weight: 600;
border-bottom: 1px solid rgba(0, 0, 0, 0.25);
margin-top: 24px;
margin-bottom: 16px;
padding-bottom: 8px;
}
article h2 {
font-size: 20px;
font-weight: 600;
margin-top: 12px;
}
article h3 {
color: var(--color-good);
margin-top: var(--padding-tiny);
text-transform: uppercase;
}
article p {
margin-top: var(--padding-small);
}
article p a,
article ul li a,
article h1 a,
article h2 a {
color: var(--color-good);
font-weight: 600;
}
article h1.title {
color: rgb(255, 255, 255);
background-color: var(--color-accent);
margin-top: var(--padding-small);
margin-bottom: 0;
padding: var(--padding-tiny);
font-size: var(--font-big);
font-weight: 100;
letter-spacing: 2px;
text-transform: uppercase;
}
a.reference {
color: var(--color-good);
float: right;
margin-top: 8px;
padding-left: 8px;
font-size: 14px;
font-weight: 600;
}
.notice {
--color-notice-background: var(--color-accent);
--color-notice-text: var(--color-notice-background);
margin-top: var(--padding-tiny);
border: 2px solid var(--color-notice-background);
}
.notice.error {
--color-notice-background: rgb(194, 52, 130);
}
.notice.warning {
--color-notice-background: rgb(224, 169, 112);
--color-notice-text: rgb(167, 104, 37);
}
.notice .title {
color: var(--color-white);
background-color: var(--color-notice-background);
padding: var(--padding-tiny);
font-size: var(--font-normal);
text-transform: uppercase;
letter-spacing: 2px;
}
.notice p {
color: var(--color-notice-text);
margin: 0 !important;
padding: var(--padding-tiny);
}
/* function/table */
.method {
display: flex;
flex-flow: column;
padding: var(--padding-tiny);
margin-top: var(--padding-small);
}
.method header {
color: white;
background-color: inherit;
padding: 0;
order: -1;
}
.method header .anchor {
color: inherit;
text-decoration: inherit;
}
.method:target {
background-color: var(--color-background-dark);
outline: solid;
outline-width: 1px;
outline-color: var(--color-accent);
}
.method header:target {
background-color: var(--color-accent);
}
.method header h1 {
font-family: "Source Code Pro", monospace;
padding-bottom: var(--padding-tiny);
border-bottom: 1px solid var(--color-accent);
font-size: 20px;
}
.method header p:first-of-type {
margin-top: var(--padding-tiny);
}
.method h3 {
color: var(--color-good);
font-size: var(--font-normal);
letter-spacing: 2px;
text-transform: uppercase;
}
.method pre {
margin-top: var(--padding-tiny);
}
@media only screen and (max-width: 1100px) {
main nav {
position: inherit;
}
main article {
margin-left: 0;
}
}
.method ul {
margin-top: var(--padding-tiny);
background-color: inherit;
}
.method ul li {
list-style: none;
margin: 4px 0 0 var(--padding-normal);
}
.method ul li:first-of-type {
margin-top: 0;
}
.method ul li p {
margin: 4px 0 0 var(--padding-normal);
}
.method ul li pre {
margin: 4px 0 0 var(--padding-normal);
}
.method ul li a {
color: rgb(115, 53, 142);
font-weight: 600;
}
/* we have to manually specify these instead of making a shared class since you cannot customize the parameter class in ldoc */
.parameter, .type, .default {
display: inline-block;
color: rgb(255, 255, 255) !important;
padding: 4px;
font-size: 14px;
font-family: "Source Code Pro", monospace;
}
.parameter {
background-color: rgb(115, 53, 142);
}
.type {
background-color: rgb(31, 141, 155);
}
a.type {
font-weight: 300 !important;
text-decoration: underline;
}
.default {
background-color: rgb(193, 114, 11);
}
.type a {
padding: 0;
}
.or {
color: rgba(115, 53, 142, 0.5);
background-color: inherit;
width: calc(100% - 32px);
height: 8px;
margin: 0 0 8px 32px;
text-align: center;
font-weight: 600;
border-bottom: 1px solid rgba(115, 53, 142, 0.5);
}
.or span {
background-color: inherit;
padding: 0 8px 0 8px;
}

View File

@@ -1 +0,0 @@
py -m http.server -d html

View File

@@ -1,168 +0,0 @@
const skippedCategories = ["manual"];
class Node
{
constructor(name, element, expandable, noAutoCollapse, children = [])
{
this.name = name;
this.element = element;
this.expandable = expandable;
this.noAutoCollapse = noAutoCollapse;
this.children = children;
}
AddChild(name, element, expandable, noAutoCollapse, children)
{
let newNode = new Node(name, element, expandable, noAutoCollapse, children);
this.children.push(newNode);
return newNode;
}
}
class SearchManager
{
constructor(input, contents)
{
this.input = input;
this.input.addEventListener("input", event =>
{
this.OnInputUpdated(this.input.value.toLowerCase().replace(/:/g, "."));
});
// setup search tree
this.tree = new Node("", document.createElement("null"), true, true);
this.entries = {};
const categoryElements = contents.querySelectorAll(".category");
// iterate each kind (hooks/libraries/classes/etc)
for (const category of categoryElements)
{
const nameElement = category.querySelector(":scope > summary > h2");
if (!nameElement)
{
continue;
}
const categoryName = nameElement.textContent.trim().toLowerCase();
if (skippedCategories.includes(categoryName))
{
continue;
}
let categoryNode = this.tree.AddChild(categoryName, category, true, true);
const sectionElements = category.querySelectorAll(":scope > ul > li");
for (const section of sectionElements)
{
const entryElements = section.querySelectorAll(":scope > details > ul > li > a");
const sectionName = section.querySelector(":scope > details > summary > a")
.textContent
.trim()
.toLowerCase();
let sectionNode = categoryNode.AddChild(sectionName, section.querySelector(":scope > details"), true);
for (let i = 0; i < entryElements.length; i++)
{
const entryElement = entryElements[i];
const entryName = entryElement.textContent.trim().toLowerCase();
sectionNode.AddChild(sectionName + "." + entryName, entryElement.parentElement);
}
}
}
}
ResetVisibility(current)
{
current.element.style.display = "";
if (current.noAutoCollapse)
{
current.element.open = true;
}
else if (current.expandable)
{
current.element.open = false;
}
for (let node of current.children)
{
this.ResetVisibility(node);
}
}
Search(input, current)
{
let matched = false;
if (current.name.indexOf(input) != -1)
{
matched = true;
}
for (let node of current.children)
{
let childMatched = this.Search(input, node);
matched = matched || childMatched;
}
if (matched)
{
current.element.style.display = "";
if (current.expandable)
{
current.element.open = true;
}
}
else
{
current.element.style.display = "none";
if (current.expandable)
{
current.element.open = false;
}
}
return matched;
}
OnInputUpdated(input)
{
if (input.length <= 1)
{
this.ResetVisibility(this.tree);
return;
}
this.Search(input, this.tree);
}
}
window.onload = function()
{
const openDetails = document.querySelector(".category > ul > li > details[open]");
if (openDetails)
{
openDetails.scrollIntoView();
}
}
document.addEventListener("DOMContentLoaded", function()
{
const searchInput = document.getElementById("search");
const contents = document.querySelector("body > main > nav > section");
if (searchInput && contents)
{
new SearchManager(searchInput, contents);
}
});

View File

@@ -1,262 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.Affliction
]]
-- @code Affliction
-- @pragma nostrip
local Affliction = {}
--- Serialize
-- @realm shared
-- @tparam XElement element
function Serialize(element) end
--- Deserialize
-- @realm shared
-- @tparam XElement element
function Deserialize(element) end
--- CreateMultiplied
-- @realm shared
-- @tparam number multiplier
-- @treturn Affliction
function CreateMultiplied(multiplier) end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- GetActiveEffect
-- @realm shared
-- @treturn Effect
function GetActiveEffect() end
--- GetVitalityDecrease
-- @realm shared
-- @tparam CharacterHealth characterHealth
-- @treturn number
function GetVitalityDecrease(characterHealth) end
--- GetVitalityDecrease
-- @realm shared
-- @tparam CharacterHealth characterHealth
-- @tparam number strength
-- @treturn number
function GetVitalityDecrease(characterHealth, strength) end
--- GetScreenGrainStrength
-- @realm shared
-- @treturn number
function GetScreenGrainStrength() end
--- GetScreenDistortStrength
-- @realm shared
-- @treturn number
function GetScreenDistortStrength() end
--- GetRadialDistortStrength
-- @realm shared
-- @treturn number
function GetRadialDistortStrength() end
--- GetChromaticAberrationStrength
-- @realm shared
-- @treturn number
function GetChromaticAberrationStrength() end
--- GetAfflictionOverlayMultiplier
-- @realm shared
-- @treturn number
function GetAfflictionOverlayMultiplier() end
--- GetFaceTint
-- @realm shared
-- @treturn Color
function GetFaceTint() end
--- GetBodyTint
-- @realm shared
-- @treturn Color
function GetBodyTint() end
--- GetScreenBlurStrength
-- @realm shared
-- @treturn number
function GetScreenBlurStrength() end
--- GetSkillMultiplier
-- @realm shared
-- @treturn number
function GetSkillMultiplier() end
--- CalculateDamagePerSecond
-- @realm shared
-- @tparam number currentVitalityDecrease
function CalculateDamagePerSecond(currentVitalityDecrease) end
--- GetResistance
-- @realm shared
-- @tparam Identifier afflictionId
-- @treturn number
function GetResistance(afflictionId) end
--- GetSpeedMultiplier
-- @realm shared
-- @treturn number
function GetSpeedMultiplier() end
--- GetStatValue
-- @realm shared
-- @tparam StatTypes statType
-- @treturn number
function GetStatValue(statType) end
--- HasFlag
-- @realm shared
-- @tparam AbilityFlags flagType
-- @treturn bool
function HasFlag(flagType) end
--- Update
-- @realm shared
-- @tparam CharacterHealth characterHealth
-- @tparam Limb targetLimb
-- @tparam number deltaTime
function Update(characterHealth, targetLimb, deltaTime) end
--- ApplyStatusEffects
-- @realm shared
-- @tparam function type
-- @tparam number deltaTime
-- @tparam CharacterHealth characterHealth
-- @tparam Limb targetLimb
function ApplyStatusEffects(type, deltaTime, characterHealth, targetLimb) end
--- ApplyStatusEffect
-- @realm shared
-- @tparam function type
-- @tparam StatusEffect statusEffect
-- @tparam number deltaTime
-- @tparam CharacterHealth characterHealth
-- @tparam Limb targetLimb
function ApplyStatusEffect(type, statusEffect, deltaTime, characterHealth, targetLimb) end
--- SetStrength
-- @realm shared
-- @tparam number strength
function SetStrength(strength) end
--- ShouldShowIcon
-- @realm shared
-- @tparam Character afflictedCharacter
-- @treturn bool
function ShouldShowIcon(afflictedCharacter) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Name, Field of type string
-- @realm shared
-- @string Name
---
-- SerializableProperties, Field of type table
-- @realm shared
-- @table SerializableProperties
---
-- PendingAdditionStrength, Field of type number
-- @realm shared
-- @number PendingAdditionStrength
---
-- AdditionStrength, Field of type number
-- @realm shared
-- @number AdditionStrength
---
-- Strength, Field of type number
-- @realm shared
-- @number Strength
---
-- NonClampedStrength, Field of type number
-- @realm shared
-- @number NonClampedStrength
---
-- Identifier, Field of type Identifier
-- @realm shared
-- @Identifier Identifier
---
-- Probability, Field of type number
-- @realm shared
-- @number Probability
---
-- Prefab, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab Prefab
---
-- DamagePerSecond, Field of type number
-- @realm shared
-- @number DamagePerSecond
---
-- DamagePerSecondTimer, Field of type number
-- @realm shared
-- @number DamagePerSecondTimer
---
-- PreviousVitalityDecrease, Field of type number
-- @realm shared
-- @number PreviousVitalityDecrease
---
-- StrengthDiminishMultiplier, Field of type number
-- @realm shared
-- @number StrengthDiminishMultiplier
---
-- MultiplierSource, Field of type Affliction
-- @realm shared
-- @Affliction MultiplierSource
---
-- PeriodicEffectTimers, Field of type table
-- @realm shared
-- @table PeriodicEffectTimers
---
-- AppliedAsSuccessfulTreatmentTime, Field of type number
-- @realm shared
-- @number AppliedAsSuccessfulTreatmentTime
---
-- AppliedAsFailedTreatmentTime, Field of type number
-- @realm shared
-- @number AppliedAsFailedTreatmentTime
---
-- Source, Field of type Character
-- @realm shared
-- @Character Source

View File

@@ -1,299 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.AfflictionPrefab
]]
-- @code AfflictionPrefab
-- @pragma nostrip
local AfflictionPrefab = {}
--- Dispose
-- @realm shared
function Dispose() end
--- LoadAllEffects
-- @realm shared
function AfflictionPrefab.LoadAllEffects() end
--- ClearAllEffects
-- @realm shared
function AfflictionPrefab.ClearAllEffects() end
--- LoadEffects
-- @realm shared
function LoadEffects() end
--- ClearEffects
-- @realm shared
function ClearEffects() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Instantiate
-- @realm shared
-- @tparam number strength
-- @tparam Character source
-- @treturn Affliction
function Instantiate(strength, source) end
--- GetActiveEffect
-- @realm shared
-- @tparam number currentStrength
-- @treturn Effect
function GetActiveEffect(currentStrength) end
--- GetTreatmentSuitability
-- @realm shared
-- @tparam Item item
-- @treturn number
function GetTreatmentSuitability(item) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- AfflictionPrefab.InternalDamage, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.InternalDamage
---
-- AfflictionPrefab.ImpactDamage, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.ImpactDamage
---
-- AfflictionPrefab.Bleeding, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.Bleeding
---
-- AfflictionPrefab.Burn, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.Burn
---
-- AfflictionPrefab.OxygenLow, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.OxygenLow
---
-- AfflictionPrefab.Bloodloss, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.Bloodloss
---
-- AfflictionPrefab.Pressure, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.Pressure
---
-- AfflictionPrefab.Stun, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.Stun
---
-- AfflictionPrefab.RadiationSickness, Field of type AfflictionPrefab
-- @realm shared
-- @AfflictionPrefab AfflictionPrefab.RadiationSickness
---
-- AfflictionPrefab.List, Field of type Enumerable
-- @realm shared
-- @Enumerable AfflictionPrefab.List
---
-- Effects, Field of type Enumerable
-- @realm shared
-- @Enumerable Effects
---
-- PeriodicEffects, Field of type IList`1
-- @realm shared
-- @IList`1 PeriodicEffects
---
-- TreatmentSuitability, Field of type Enumerable
-- @realm shared
-- @Enumerable TreatmentSuitability
---
-- UintIdentifier, Field of type number
-- @realm shared
-- @number UintIdentifier
---
-- ContentPackage, Field of type ContentPackage
-- @realm shared
-- @ContentPackage ContentPackage
---
-- FilePath, Field of type ContentPath
-- @realm shared
-- @ContentPath FilePath
---
-- AfflictionType, Field of type Identifier
-- @realm shared
-- @Identifier AfflictionType
---
-- LimbSpecific, Field of type bool
-- @realm shared
-- @bool LimbSpecific
---
-- IndicatorLimb, Field of type LimbType
-- @realm shared
-- @LimbType IndicatorLimb
---
-- Name, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Name
---
-- Description, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Description
---
-- TranslationIdentifier, Field of type Identifier
-- @realm shared
-- @Identifier TranslationIdentifier
---
-- IsBuff, Field of type bool
-- @realm shared
-- @bool IsBuff
---
-- HealableInMedicalClinic, Field of type bool
-- @realm shared
-- @bool HealableInMedicalClinic
---
-- HealCostMultiplier, Field of type number
-- @realm shared
-- @number HealCostMultiplier
---
-- BaseHealCost, Field of type number
-- @realm shared
-- @number BaseHealCost
---
-- CauseOfDeathDescription, Field of type LocalizedString
-- @realm shared
-- @LocalizedString CauseOfDeathDescription
---
-- SelfCauseOfDeathDescription, Field of type LocalizedString
-- @realm shared
-- @LocalizedString SelfCauseOfDeathDescription
---
-- ActivationThreshold, Field of type number
-- @realm shared
-- @number ActivationThreshold
---
-- ShowIconThreshold, Field of type number
-- @realm shared
-- @number ShowIconThreshold
---
-- ShowIconToOthersThreshold, Field of type number
-- @realm shared
-- @number ShowIconToOthersThreshold
---
-- MaxStrength, Field of type number
-- @realm shared
-- @number MaxStrength
---
-- GrainBurst, Field of type number
-- @realm shared
-- @number GrainBurst
---
-- ShowInHealthScannerThreshold, Field of type number
-- @realm shared
-- @number ShowInHealthScannerThreshold
---
-- TreatmentThreshold, Field of type number
-- @realm shared
-- @number TreatmentThreshold
---
-- KarmaChangeOnApplied, Field of type number
-- @realm shared
-- @number KarmaChangeOnApplied
---
-- BurnOverlayAlpha, Field of type number
-- @realm shared
-- @number BurnOverlayAlpha
---
-- DamageOverlayAlpha, Field of type number
-- @realm shared
-- @number DamageOverlayAlpha
---
-- AchievementOnRemoved, Field of type Identifier
-- @realm shared
-- @Identifier AchievementOnRemoved
---
-- Icon, Field of type Sprite
-- @realm shared
-- @Sprite Icon
---
-- IconColors, Field of type Color[]
-- @realm shared
-- @Color[] IconColors
---
-- AfflictionOverlay, Field of type Sprite
-- @realm shared
-- @Sprite AfflictionOverlay
---
-- AfflictionOverlayAlphaIsLinear, Field of type bool
-- @realm shared
-- @bool AfflictionOverlayAlphaIsLinear
---
-- AfflictionPrefab.Prefabs, Field of type PrefabCollection`1
-- @realm shared
-- @PrefabCollection`1 AfflictionPrefab.Prefabs
---
-- Identifier, Field of type Identifier
-- @realm shared
-- @Identifier Identifier
---
-- ContentFile, Field of type ContentFile
-- @realm shared
-- @ContentFile ContentFile

View File

@@ -1,591 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.AnimController
]]
-- @code AnimController
-- @pragma nostrip
local AnimController = {}
--- UpdateAnim
-- @realm shared
-- @tparam number deltaTime
function UpdateAnim(deltaTime) end
--- DragCharacter
-- @realm shared
-- @tparam Character target
-- @tparam number deltaTime
function DragCharacter(target, deltaTime) end
--- GetSpeed
-- @realm shared
-- @tparam AnimationType type
-- @treturn number
function GetSpeed(type) end
--- GetCurrentSpeed
-- @realm shared
-- @tparam bool useMaxSpeed
-- @treturn number
function GetCurrentSpeed(useMaxSpeed) end
--- GetAnimationParamsFromType
-- @realm shared
-- @tparam AnimationType type
-- @treturn AnimationParams
function GetAnimationParamsFromType(type) end
--- GetHeightFromFloor
-- @realm shared
-- @treturn number
function GetHeightFromFloor() end
--- UpdateUseItem
-- @realm shared
-- @tparam bool allowMovement
-- @tparam Vector2 handWorldPos
function UpdateUseItem(allowMovement, handWorldPos) end
--- Grab
-- @realm shared
-- @tparam Vector2 rightHandPos
-- @tparam Vector2 leftHandPos
function Grab(rightHandPos, leftHandPos) end
--- HoldItem
-- @realm shared
-- @tparam number deltaTime
-- @tparam Item item
-- @tparam Vector2[] handlePos
-- @tparam Vector2 holdPos
-- @tparam Vector2 aimPos
-- @tparam bool aim
-- @tparam number holdAngle
-- @tparam number itemAngleRelativeToHoldAngle
-- @tparam bool aimMelee
function HoldItem(deltaTime, item, handlePos, holdPos, aimPos, aim, holdAngle, itemAngleRelativeToHoldAngle, aimMelee) end
--- HandIK
-- @realm shared
-- @tparam Limb hand
-- @tparam Vector2 pos
-- @tparam number armTorque
-- @tparam number handTorque
-- @tparam number maxAngularVelocity
function HandIK(hand, pos, armTorque, handTorque, maxAngularVelocity) end
--- ApplyPose
-- @realm shared
-- @tparam Vector2 leftHandPos
-- @tparam Vector2 rightHandPos
-- @tparam Vector2 leftFootPos
-- @tparam Vector2 rightFootPos
-- @tparam number footMoveForce
function ApplyPose(leftHandPos, rightHandPos, leftFootPos, rightFootPos, footMoveForce) end
--- ApplyTestPose
-- @realm shared
function ApplyTestPose() end
--- Recreate
-- @realm shared
-- @tparam RagdollParams ragdollParams
function Recreate(ragdollParams) end
--- GetLimb
-- @realm shared
-- @tparam LimbType limbType
-- @tparam bool excludeSevered
-- @treturn Limb
function GetLimb(limbType, excludeSevered) end
--- GetMouthPosition
-- @realm shared
-- @treturn Nullable`1
function GetMouthPosition() end
--- GetColliderBottom
-- @realm shared
-- @treturn Vector2
function GetColliderBottom() end
--- FindLowestLimb
-- @realm shared
-- @treturn Limb
function FindLowestLimb() end
--- ReleaseStuckLimbs
-- @realm shared
function ReleaseStuckLimbs() end
--- HideAndDisable
-- @realm shared
-- @tparam LimbType limbType
-- @tparam number duration
-- @tparam bool ignoreCollisions
function HideAndDisable(limbType, duration, ignoreCollisions) end
--- RestoreTemporarilyDisabled
-- @realm shared
function RestoreTemporarilyDisabled() end
--- Remove
-- @realm shared
function Remove() end
--- SubtractMass
-- @realm shared
-- @tparam Limb limb
function SubtractMass(limb) end
--- SaveRagdoll
-- @realm shared
-- @tparam string fileNameWithoutExtension
function SaveRagdoll(fileNameWithoutExtension) end
--- ResetRagdoll
-- @realm shared
-- @tparam bool forceReload
function ResetRagdoll(forceReload) end
--- ResetJoints
-- @realm shared
function ResetJoints() end
--- ResetLimbs
-- @realm shared
function ResetLimbs() end
--- AddJoint
-- @realm shared
-- @tparam JointParams jointParams
function AddJoint(jointParams) end
--- AddLimb
-- @realm shared
-- @tparam Limb limb
function AddLimb(limb) end
--- RemoveLimb
-- @realm shared
-- @tparam Limb limb
function RemoveLimb(limb) end
--- OnLimbCollision
-- @realm shared
-- @tparam Fixture f1
-- @tparam Fixture f2
-- @tparam Contact contact
-- @treturn bool
function OnLimbCollision(f1, f2, contact) end
--- SeverLimbJoint
-- @realm shared
-- @tparam LimbJoint limbJoint
-- @treturn bool
function SeverLimbJoint(limbJoint) end
--- Flip
-- @realm shared
function Flip() end
--- GetCenterOfMass
-- @realm shared
-- @treturn Vector2
function GetCenterOfMass() end
--- MoveLimb
-- @realm shared
-- @tparam Limb limb
-- @tparam Vector2 pos
-- @tparam number amount
-- @tparam bool pullFromCenter
function MoveLimb(limb, pos, amount, pullFromCenter) end
--- ResetPullJoints
-- @realm shared
function ResetPullJoints() end
--- FindHull
-- @realm shared
-- @tparam Nullable`1 worldPosition
-- @tparam bool setSubmarine
function FindHull(worldPosition, setSubmarine) end
--- Teleport
-- @realm shared
-- @tparam Vector2 moveAmount
-- @tparam Vector2 velocityChange
-- @tparam bool detachProjectiles
function Teleport(moveAmount, velocityChange, detachProjectiles) end
--- Update
-- @realm shared
-- @tparam number deltaTime
-- @tparam Camera cam
function Update(deltaTime, cam) end
--- ForceRefreshFloorY
-- @realm shared
function ForceRefreshFloorY() end
--- GetSurfaceY
-- @realm shared
-- @treturn number
function GetSurfaceY() end
--- SetPosition
-- @realm shared
-- @tparam Vector2 simPosition
-- @tparam bool lerp
-- @tparam bool ignorePlatforms
-- @tparam bool forceMainLimbToCollider
-- @tparam bool detachProjectiles
function SetPosition(simPosition, lerp, ignorePlatforms, forceMainLimbToCollider, detachProjectiles) end
--- Hang
-- @realm shared
function Hang() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- RightHandIKPos, Field of type Vector2
-- @realm shared
-- @Vector2 RightHandIKPos
---
-- LeftHandIKPos, Field of type Vector2
-- @realm shared
-- @Vector2 LeftHandIKPos
---
-- IsAiming, Field of type bool
-- @realm shared
-- @bool IsAiming
---
-- IsAimingMelee, Field of type bool
-- @realm shared
-- @bool IsAimingMelee
---
-- ArmLength, Field of type number
-- @realm shared
-- @number ArmLength
---
-- WalkParams, Field of type GroundedMovementParams
-- @realm shared
-- @GroundedMovementParams WalkParams
---
-- RunParams, Field of type GroundedMovementParams
-- @realm shared
-- @GroundedMovementParams RunParams
---
-- SwimSlowParams, Field of type SwimParams
-- @realm shared
-- @SwimParams SwimSlowParams
---
-- SwimFastParams, Field of type SwimParams
-- @realm shared
-- @SwimParams SwimFastParams
---
-- CurrentAnimationParams, Field of type AnimationParams
-- @realm shared
-- @AnimationParams CurrentAnimationParams
---
-- ForceSelectAnimationType, Field of type AnimationType
-- @realm shared
-- @AnimationType ForceSelectAnimationType
---
-- CurrentGroundedParams, Field of type GroundedMovementParams
-- @realm shared
-- @GroundedMovementParams CurrentGroundedParams
---
-- CurrentSwimParams, Field of type SwimParams
-- @realm shared
-- @SwimParams CurrentSwimParams
---
-- CanWalk, Field of type bool
-- @realm shared
-- @bool CanWalk
---
-- IsMovingBackwards, Field of type bool
-- @realm shared
-- @bool IsMovingBackwards
---
-- IsMovingFast, Field of type bool
-- @realm shared
-- @bool IsMovingFast
---
-- AllAnimParams, Field of type table
-- @realm shared
-- @table AllAnimParams
---
-- AimSourceWorldPos, Field of type Vector2
-- @realm shared
-- @Vector2 AimSourceWorldPos
---
-- AimSourcePos, Field of type Vector2
-- @realm shared
-- @Vector2 AimSourcePos
---
-- AimSourceSimPos, Field of type Vector2
-- @realm shared
-- @Vector2 AimSourceSimPos
---
-- HeadPosition, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 HeadPosition
---
-- TorsoPosition, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 TorsoPosition
---
-- HeadAngle, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 HeadAngle
---
-- TorsoAngle, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 TorsoAngle
---
-- StepSize, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 StepSize
---
-- AnimationTestPose, Field of type bool
-- @realm shared
-- @bool AnimationTestPose
---
-- WalkPos, Field of type number
-- @realm shared
-- @number WalkPos
---
-- IsAboveFloor, Field of type bool
-- @realm shared
-- @bool IsAboveFloor
---
-- RagdollParams, Field of type RagdollParams
-- @realm shared
-- @RagdollParams RagdollParams
---
-- Limbs, Field of type Limb[]
-- @realm shared
-- @Limb[] Limbs
---
-- HasMultipleLimbsOfSameType, Field of type bool
-- @realm shared
-- @bool HasMultipleLimbsOfSameType
---
-- Frozen, Field of type bool
-- @realm shared
-- @bool Frozen
---
-- Character, Field of type Character
-- @realm shared
-- @Character Character
---
-- OnGround, Field of type bool
-- @realm shared
-- @bool OnGround
---
-- ColliderHeightFromFloor, Field of type number
-- @realm shared
-- @number ColliderHeightFromFloor
---
-- IsStuck, Field of type bool
-- @realm shared
-- @bool IsStuck
---
-- Collider, Field of type PhysicsBody
-- @realm shared
-- @PhysicsBody Collider
---
-- ColliderIndex, Field of type number
-- @realm shared
-- @number ColliderIndex
---
-- FloorY, Field of type number
-- @realm shared
-- @number FloorY
---
-- Mass, Field of type number
-- @realm shared
-- @number Mass
---
-- MainLimb, Field of type Limb
-- @realm shared
-- @Limb MainLimb
---
-- WorldPosition, Field of type Vector2
-- @realm shared
-- @Vector2 WorldPosition
---
-- SimplePhysicsEnabled, Field of type bool
-- @realm shared
-- @bool SimplePhysicsEnabled
---
-- TargetMovement, Field of type Vector2
-- @realm shared
-- @Vector2 TargetMovement
---
-- ImpactTolerance, Field of type number
-- @realm shared
-- @number ImpactTolerance
---
-- Draggable, Field of type bool
-- @realm shared
-- @bool Draggable
---
-- CanEnterSubmarine, Field of type bool
-- @realm shared
-- @bool CanEnterSubmarine
---
-- Dir, Field of type number
-- @realm shared
-- @number Dir
---
-- Direction, Field of type Direction
-- @realm shared
-- @Direction Direction
---
-- InWater, Field of type bool
-- @realm shared
-- @bool InWater
---
-- HeadInWater, Field of type bool
-- @realm shared
-- @bool HeadInWater
---
-- CurrentHull, Field of type Hull
-- @realm shared
-- @Hull CurrentHull
---
-- IgnorePlatforms, Field of type bool
-- @realm shared
-- @bool IgnorePlatforms
---
-- IsFlipped, Field of type bool
-- @realm shared
-- @bool IsFlipped
---
-- BodyInRest, Field of type bool
-- @realm shared
-- @bool BodyInRest
---
-- Invalid, Field of type bool
-- @realm shared
-- @bool Invalid
---
-- IsHanging, Field of type bool
-- @realm shared
-- @bool IsHanging
---
-- Anim, Field of type Animation
-- @realm shared
-- @Animation Anim
---
-- LimbJoints, Field of type LimbJoint[]
-- @realm shared
-- @LimbJoint[] LimbJoints
---
-- movement, Field of type Vector2
-- @realm shared
-- @Vector2 movement
---
-- Stairs, Field of type Structure
-- @realm shared
-- @Structure Stairs
---
-- TargetDir, Field of type Direction
-- @realm shared
-- @Direction TargetDir
---
-- forceStanding, Field of type bool
-- @realm shared
-- @bool forceStanding
---
-- forceNotStanding, Field of type bool
-- @realm shared
-- @bool forceNotStanding

File diff suppressed because it is too large Load Diff

View File

@@ -1,367 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.CharacterHealth
]]
-- @code CharacterHealth
-- @pragma nostrip
local CharacterHealth = {}
--- GetAllAfflictions
-- @realm shared
-- @treturn IReadOnlyCollection`1
function GetAllAfflictions() end
--- GetAllAfflictions
-- @realm shared
-- @tparam function limbHealthFilter
-- @treturn Enumerable
function GetAllAfflictions(limbHealthFilter) end
--- GetAffliction
-- @realm shared
-- @tparam string identifier
-- @tparam bool allowLimbAfflictions
-- @treturn Affliction
function GetAffliction(identifier, allowLimbAfflictions) end
--- GetAffliction
-- @realm shared
-- @tparam Identifier identifier
-- @tparam bool allowLimbAfflictions
-- @treturn Affliction
function GetAffliction(identifier, allowLimbAfflictions) end
--- GetAfflictionOfType
-- @realm shared
-- @tparam Identifier afflictionType
-- @tparam bool allowLimbAfflictions
-- @treturn Affliction
function GetAfflictionOfType(afflictionType, allowLimbAfflictions) end
--- GetAffliction
-- @realm shared
-- @tparam string identifier
-- @tparam bool allowLimbAfflictions
-- @treturn T
function GetAffliction(identifier, allowLimbAfflictions) end
--- GetAffliction
-- @realm shared
-- @tparam string identifier
-- @tparam Limb limb
-- @treturn Affliction
function GetAffliction(identifier, limb) end
--- GetAfflictionLimb
-- @realm shared
-- @tparam Affliction affliction
-- @treturn Limb
function GetAfflictionLimb(affliction) end
--- GetAfflictionStrength
-- @realm shared
-- @tparam string afflictionType
-- @tparam Limb limb
-- @tparam bool requireLimbSpecific
-- @treturn number
function GetAfflictionStrength(afflictionType, limb, requireLimbSpecific) end
--- GetAfflictionStrength
-- @realm shared
-- @tparam string afflictionType
-- @tparam bool allowLimbAfflictions
-- @treturn number
function GetAfflictionStrength(afflictionType, allowLimbAfflictions) end
--- ApplyAffliction
-- @realm shared
-- @tparam Limb targetLimb
-- @tparam Affliction affliction
-- @tparam bool allowStacking
function ApplyAffliction(targetLimb, affliction, allowStacking) end
--- GetResistance
-- @realm shared
-- @tparam AfflictionPrefab afflictionPrefab
-- @treturn number
function GetResistance(afflictionPrefab) end
--- GetStatValue
-- @realm shared
-- @tparam StatTypes statType
-- @treturn number
function GetStatValue(statType) end
--- HasFlag
-- @realm shared
-- @tparam AbilityFlags flagType
-- @treturn bool
function HasFlag(flagType) end
--- ReduceAllAfflictionsOnAllLimbs
-- @realm shared
-- @tparam number amount
-- @tparam Nullable`1 treatmentAction
function ReduceAllAfflictionsOnAllLimbs(amount, treatmentAction) end
--- ReduceAfflictionOnAllLimbs
-- @realm shared
-- @tparam Identifier affliction
-- @tparam number amount
-- @tparam Nullable`1 treatmentAction
function ReduceAfflictionOnAllLimbs(affliction, amount, treatmentAction) end
--- ReduceAllAfflictionsOnLimb
-- @realm shared
-- @tparam Limb targetLimb
-- @tparam number amount
-- @tparam Nullable`1 treatmentAction
function ReduceAllAfflictionsOnLimb(targetLimb, amount, treatmentAction) end
--- ReduceAfflictionOnLimb
-- @realm shared
-- @tparam Limb targetLimb
-- @tparam Identifier affliction
-- @tparam number amount
-- @tparam Nullable`1 treatmentAction
function ReduceAfflictionOnLimb(targetLimb, affliction, amount, treatmentAction) end
--- ApplyDamage
-- @realm shared
-- @tparam Limb hitLimb
-- @tparam AttackResult attackResult
-- @tparam bool allowStacking
function ApplyDamage(hitLimb, attackResult, allowStacking) end
--- SetAllDamage
-- @realm shared
-- @tparam number damageAmount
-- @tparam number bleedingDamageAmount
-- @tparam number burnDamageAmount
function SetAllDamage(damageAmount, bleedingDamageAmount, burnDamageAmount) end
--- GetLimbDamage
-- @realm shared
-- @tparam Limb limb
-- @tparam string afflictionType
-- @treturn number
function GetLimbDamage(limb, afflictionType) end
--- RemoveAllAfflictions
-- @realm shared
function RemoveAllAfflictions() end
--- RemoveNegativeAfflictions
-- @realm shared
function RemoveNegativeAfflictions() end
--- Update
-- @realm shared
-- @tparam number deltaTime
function Update(deltaTime) end
--- SetVitality
-- @realm shared
-- @tparam number newVitality
function SetVitality(newVitality) end
--- CalculateVitality
-- @realm shared
function CalculateVitality() end
--- ApplyAfflictionStatusEffects
-- @realm shared
-- @tparam function type
function ApplyAfflictionStatusEffects(type) end
--- GetCauseOfDeath
-- @realm shared
-- @treturn ValueTuple`2
function GetCauseOfDeath() end
--- GetSuitableTreatments
-- @realm shared
-- @tparam table treatmentSuitability
-- @tparam bool normalize
-- @tparam Limb limb
-- @tparam bool ignoreHiddenAfflictions
-- @tparam number predictFutureDuration
function GetSuitableTreatments(treatmentSuitability, normalize, limb, ignoreHiddenAfflictions, predictFutureDuration) end
--- GetActiveAfflictionTags
-- @realm shared
-- @treturn Enumerable
function GetActiveAfflictionTags() end
--- GetActiveAfflictionTags
-- @realm shared
-- @tparam Enumerable afflictions
-- @treturn Enumerable
function GetActiveAfflictionTags(afflictions) end
--- GetPredictedStrength
-- @realm shared
-- @tparam Affliction affliction
-- @tparam number predictFutureDuration
-- @tparam Limb limb
-- @treturn number
function GetPredictedStrength(affliction, predictFutureDuration, limb) end
--- ServerWrite
-- @realm shared
-- @tparam IWriteMessage msg
function ServerWrite(msg) end
--- Remove
-- @realm shared
function Remove() end
--- SortAfflictionsBySeverity
-- @realm shared
-- @tparam Enumerable afflictions
-- @tparam bool excludeBuffs
-- @treturn Enumerable
function CharacterHealth.SortAfflictionsBySeverity(afflictions, excludeBuffs) end
--- Save
-- @realm shared
-- @tparam XElement healthElement
function Save(healthElement) end
--- Load
-- @realm shared
-- @tparam XElement element
function Load(element) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- DoesBleed, Field of type bool
-- @realm shared
-- @bool DoesBleed
---
-- UseHealthWindow, Field of type bool
-- @realm shared
-- @bool UseHealthWindow
---
-- CrushDepth, Field of type number
-- @realm shared
-- @number CrushDepth
---
-- BloodlossAffliction, Field of type Affliction
-- @realm shared
-- @Affliction BloodlossAffliction
---
-- IsUnconscious, Field of type bool
-- @realm shared
-- @bool IsUnconscious
---
-- PressureKillDelay, Field of type number
-- @realm shared
-- @number PressureKillDelay
---
-- Vitality, Field of type number
-- @realm shared
-- @number Vitality
---
-- HealthPercentage, Field of type number
-- @realm shared
-- @number HealthPercentage
---
-- MaxVitality, Field of type number
-- @realm shared
-- @number MaxVitality
---
-- MinVitality, Field of type number
-- @realm shared
-- @number MinVitality
---
-- FaceTint, Field of type Color
-- @realm shared
-- @Color FaceTint
---
-- BodyTint, Field of type Color
-- @realm shared
-- @Color BodyTint
---
-- OxygenAmount, Field of type number
-- @realm shared
-- @number OxygenAmount
---
-- BloodlossAmount, Field of type number
-- @realm shared
-- @number BloodlossAmount
---
-- Stun, Field of type number
-- @realm shared
-- @number Stun
---
-- StunTimer, Field of type number
-- @realm shared
-- @number StunTimer
---
-- PressureAffliction, Field of type Affliction
-- @realm shared
-- @Affliction PressureAffliction
---
-- Unkillable, Field of type bool
-- @realm shared
-- @bool Unkillable
---
-- DefaultFaceTint, Field of type Color
-- @realm shared
-- @Color DefaultFaceTint
---
-- Character, Field of type Character
-- @realm shared
-- @Character Character
---
-- CharacterHealth.InsufficientOxygenThreshold, Field of type number
-- @realm shared
-- @number CharacterHealth.InsufficientOxygenThreshold
---
-- CharacterHealth.LowOxygenThreshold, Field of type number
-- @realm shared
-- @number CharacterHealth.LowOxygenThreshold

View File

@@ -1,564 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma CharacterInfo class with some additional functions and fields
Barotrauma source code: [CharacterInfo.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Characters/CharacterInfo.cs)
]]
-- @code CharacterInfo
-- @pragma nostrip
local CharacterInfo = {}
--- Rename
-- @realm shared
-- @tparam string newName
function Rename(newName) end
--- ResetName
-- @realm shared
function ResetName() end
--- Save
-- @realm shared
-- @tparam XElement parentElement
-- @treturn XElement
function Save(parentElement) end
--- SaveOrders
-- @realm shared
-- @tparam XElement parentElement
-- @tparam Order[] orders
function CharacterInfo.SaveOrders(parentElement, orders) end
--- SaveOrderData
-- @realm shared
-- @tparam CharacterInfo characterInfo
-- @tparam XElement parentElement
function CharacterInfo.SaveOrderData(characterInfo, parentElement) end
--- SaveOrderData
-- @realm shared
function SaveOrderData() end
--- ApplyOrderData
-- @realm shared
-- @tparam Character character
-- @tparam XElement orderData
function CharacterInfo.ApplyOrderData(character, orderData) end
--- ApplyOrderData
-- @realm shared
function ApplyOrderData() end
--- LoadOrders
-- @realm shared
-- @tparam XElement ordersElement
-- @treturn table
function CharacterInfo.LoadOrders(ordersElement) end
--- ApplyHealthData
-- @realm shared
-- @tparam Character character
-- @tparam XElement healthData
function CharacterInfo.ApplyHealthData(character, healthData) end
--- ReloadHeadAttachments
-- @realm shared
function ReloadHeadAttachments() end
--- ClearCurrentOrders
-- @realm shared
function ClearCurrentOrders() end
--- Remove
-- @realm shared
function Remove() end
--- ClearSavedStatValues
-- @realm shared
function ClearSavedStatValues() end
--- ClearSavedStatValues
-- @realm shared
-- @tparam StatTypes statType
function ClearSavedStatValues(statType) end
--- RemoveSavedStatValuesOnDeath
-- @realm shared
function RemoveSavedStatValuesOnDeath() end
--- ResetSavedStatValue
-- @realm shared
-- @tparam string statIdentifier
function ResetSavedStatValue(statIdentifier) end
--- GetSavedStatValue
-- @realm shared
-- @tparam StatTypes statType
-- @treturn number
function GetSavedStatValue(statType) end
--- GetSavedStatValue
-- @realm shared
-- @tparam StatTypes statType
-- @tparam Identifier statIdentifier
-- @treturn number
function GetSavedStatValue(statType, statIdentifier) end
--- ChangeSavedStatValue
-- @realm shared
-- @tparam StatTypes statType
-- @tparam number value
-- @tparam string statIdentifier
-- @tparam bool removeOnDeath
-- @tparam number maxValue
-- @tparam bool setValue
function ChangeSavedStatValue(statType, value, statIdentifier, removeOnDeath, maxValue, setValue) end
--- ServerWrite
-- @realm shared
-- @tparam IWriteMessage msg
function ServerWrite(msg) end
--- GetUnlockedTalentsInTree
-- @realm shared
-- @treturn Enumerable
function GetUnlockedTalentsInTree() end
--- GetEndocrineTalents
-- @realm shared
-- @treturn Enumerable
function GetEndocrineTalents() end
--- CheckDisguiseStatus
-- @realm shared
-- @tparam bool handleBuff
-- @tparam IdCard idCard
function CheckDisguiseStatus(handleBuff, idCard) end
--- GetManualOrderPriority
-- @realm shared
-- @tparam Order order
-- @treturn number
function GetManualOrderPriority(order) end
--- GetValidAttachmentElements
-- @realm shared
-- @tparam Enumerable elements
-- @tparam HeadPreset headPreset
-- @tparam Nullable`1 wearableType
-- @treturn Enumerable
function GetValidAttachmentElements(elements, headPreset, wearableType) end
--- CountValidAttachmentsOfType
-- @realm shared
-- @tparam WearableType wearableType
-- @treturn number
function CountValidAttachmentsOfType(wearableType) end
--- GetRandomName
-- @realm shared
-- @tparam RandSync randSync
-- @treturn string
function GetRandomName(randSync) end
--- SelectRandomColor
-- @realm shared
-- @tparam ImmutableArray`1& array
-- @tparam RandSync randSync
-- @treturn Color
function CharacterInfo.SelectRandomColor(array, randSync) end
--- GetIdentifier
-- @realm shared
-- @treturn number
function GetIdentifier() end
--- GetIdentifierUsingOriginalName
-- @realm shared
-- @treturn number
function GetIdentifierUsingOriginalName() end
--- FilterElements
-- @realm shared
-- @tparam Enumerable elements
-- @tparam ImmutableHashSet`1 tags
-- @tparam Nullable`1 targetType
-- @treturn Enumerable
function FilterElements(elements, tags, targetType) end
--- RecreateHead
-- @realm shared
-- @tparam ImmutableHashSet`1 tags
-- @tparam number hairIndex
-- @tparam number beardIndex
-- @tparam number moustacheIndex
-- @tparam number faceAttachmentIndex
function RecreateHead(tags, hairIndex, beardIndex, moustacheIndex, faceAttachmentIndex) end
--- ReplaceVars
-- @realm shared
-- @tparam string str
-- @treturn string
function ReplaceVars(str) end
--- RecreateHead
-- @realm shared
-- @tparam HeadInfo headInfo
function RecreateHead(headInfo) end
--- RefreshHead
-- @realm shared
function RefreshHead() end
--- LoadHeadAttachments
-- @realm shared
function LoadHeadAttachments() end
--- AddEmpty
-- @realm shared
-- @tparam Enumerable elements
-- @tparam WearableType type
-- @tparam number commonness
-- @treturn table
function CharacterInfo.AddEmpty(elements, type, commonness) end
--- GetRandomElement
-- @realm shared
-- @tparam Enumerable elements
-- @treturn ContentXElement
function GetRandomElement(elements) end
--- IsValidIndex
-- @realm shared
-- @tparam number index
-- @tparam table list
-- @treturn bool
function CharacterInfo.IsValidIndex(index, list) end
--- IncreaseSkillLevel
-- @realm shared
-- @tparam Identifier skillIdentifier
-- @tparam number increase
-- @tparam bool gainedFromAbility
function IncreaseSkillLevel(skillIdentifier, increase, gainedFromAbility) end
--- SetSkillLevel
-- @realm shared
-- @tparam Identifier skillIdentifier
-- @tparam number level
function SetSkillLevel(skillIdentifier, level) end
--- GiveExperience
-- @realm shared
-- @tparam number amount
-- @tparam bool isMissionExperience
function GiveExperience(amount, isMissionExperience) end
--- SetExperience
-- @realm shared
-- @tparam number newExperience
function SetExperience(newExperience) end
--- GetTotalTalentPoints
-- @realm shared
-- @treturn number
function GetTotalTalentPoints() end
--- GetAvailableTalentPoints
-- @realm shared
-- @treturn number
function GetAvailableTalentPoints() end
--- GetProgressTowardsNextLevel
-- @realm shared
-- @treturn number
function GetProgressTowardsNextLevel() end
--- GetExperienceRequiredForCurrentLevel
-- @realm shared
-- @treturn number
function GetExperienceRequiredForCurrentLevel() end
--- GetExperienceRequiredToLevelUp
-- @realm shared
-- @treturn number
function GetExperienceRequiredToLevelUp() end
--- GetCurrentLevel
-- @realm shared
-- @treturn number
function GetCurrentLevel() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Head, Field of type HeadInfo
-- @realm shared
-- @HeadInfo Head
---
-- IsMale, Field of type bool
-- @realm shared
-- @bool IsMale
---
-- IsFemale, Field of type bool
-- @realm shared
-- @bool IsFemale
---
-- Prefab, Field of type CharacterInfoPrefab
-- @realm shared
-- @CharacterInfoPrefab Prefab
---
-- HasNickname, Field of type bool
-- @realm shared
-- @bool HasNickname
---
-- OriginalName, Field of type string
-- @realm shared
-- @string OriginalName
---
-- DisplayName, Field of type string
-- @realm shared
-- @string DisplayName
---
-- SpeciesName, Field of type Identifier
-- @realm shared
-- @Identifier SpeciesName
---
-- ExperiencePoints, Field of type number
-- @realm shared
-- @number ExperiencePoints
---
-- UnlockedTalents, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 UnlockedTalents
---
-- AdditionalTalentPoints, Field of type number
-- @realm shared
-- @number AdditionalTalentPoints
---
-- HeadSprite, Field of type Sprite
-- @realm shared
-- @Sprite HeadSprite
---
-- Portrait, Field of type Sprite
-- @realm shared
-- @Sprite Portrait
---
-- AttachmentSprites, Field of type table
-- @realm shared
-- @table AttachmentSprites
---
-- CharacterConfigElement, Field of type ContentXElement
-- @realm shared
-- @ContentXElement CharacterConfigElement
---
-- PersonalityTrait, Field of type NPCPersonalityTrait
-- @realm shared
-- @NPCPersonalityTrait PersonalityTrait
---
-- CharacterInfo.HighestManualOrderPriority, Field of type number
-- @realm shared
-- @number CharacterInfo.HighestManualOrderPriority
---
-- CurrentOrders, Field of type table
-- @realm shared
-- @table CurrentOrders
---
-- SpriteTags, Field of type table
-- @realm shared
-- @table SpriteTags
---
-- Ragdoll, Field of type RagdollParams
-- @realm shared
-- @RagdollParams Ragdoll
---
-- IsAttachmentsLoaded, Field of type bool
-- @realm shared
-- @bool IsAttachmentsLoaded
---
-- Hairs, Field of type IReadOnlyList`1
-- @realm shared
-- @IReadOnlyList`1 Hairs
---
-- Beards, Field of type IReadOnlyList`1
-- @realm shared
-- @IReadOnlyList`1 Beards
---
-- Moustaches, Field of type IReadOnlyList`1
-- @realm shared
-- @IReadOnlyList`1 Moustaches
---
-- FaceAttachments, Field of type IReadOnlyList`1
-- @realm shared
-- @IReadOnlyList`1 FaceAttachments
---
-- Wearables, Field of type Enumerable
-- @realm shared
-- @Enumerable Wearables
---
-- InventoryData, Field of type XElement
-- @realm shared
-- @XElement InventoryData
---
-- HealthData, Field of type XElement
-- @realm shared
-- @XElement HealthData
---
-- OrderData, Field of type XElement
-- @realm shared
-- @XElement OrderData
---
-- Name, Field of type string
-- @realm shared
-- @string Name
---
-- Character, Field of type Character
-- @realm shared
-- @Character Character
---
-- Job, Field of type Job
-- @realm shared
-- @Job Job
---
-- Salary, Field of type number
-- @realm shared
-- @number Salary
---
-- OmitJobInPortraitClothing, Field of type bool
-- @realm shared
-- @bool OmitJobInPortraitClothing
---
-- IsDisguised, Field of type bool
-- @realm shared
-- @bool IsDisguised
---
-- IsDisguisedAsAnother, Field of type bool
-- @realm shared
-- @bool IsDisguisedAsAnother
---
-- ragdollFileName, Field of type string
-- @realm shared
-- @string ragdollFileName
---
-- StartItemsGiven, Field of type bool
-- @realm shared
-- @bool StartItemsGiven
---
-- IsNewHire, Field of type bool
-- @realm shared
-- @bool IsNewHire
---
-- CauseOfDeath, Field of type CauseOfDeath
-- @realm shared
-- @CauseOfDeath CauseOfDeath
---
-- TeamID, Field of type CharacterTeamType
-- @realm shared
-- @CharacterTeamType TeamID
---
-- ID, Field of type number
-- @realm shared
-- @number ID
---
-- HasSpecifierTags, Field of type bool
-- @realm shared
-- @bool HasSpecifierTags
---
-- HairColors, Field of type ImmutableArray`1
-- @realm shared
-- @ImmutableArray`1 HairColors
---
-- FacialHairColors, Field of type ImmutableArray`1
-- @realm shared
-- @ImmutableArray`1 FacialHairColors
---
-- SkinColors, Field of type ImmutableArray`1
-- @realm shared
-- @ImmutableArray`1 SkinColors
---
-- MissionsCompletedSinceDeath, Field of type number
-- @realm shared
-- @number MissionsCompletedSinceDeath
---
-- SavedStatValues, Field of type table
-- @realm shared
-- @table SavedStatValues
---
-- CharacterInfo.MaxAdditionalTalentPoints, Field of type number
-- @realm shared
-- @number CharacterInfo.MaxAdditionalTalentPoints
---
-- CharacterInfo.MaxCurrentOrders, Field of type number
-- @realm shared
-- @number CharacterInfo.MaxCurrentOrders

View File

@@ -1,338 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.CharacterInventory
]]
-- @code CharacterInventory
-- @pragma nostrip
local CharacterInventory = {}
--- FindLimbSlot
-- @realm shared
-- @tparam InvSlotType limbSlot
-- @treturn number
function FindLimbSlot(limbSlot) end
--- GetItemInLimbSlot
-- @realm shared
-- @tparam InvSlotType limbSlot
-- @treturn Item
function GetItemInLimbSlot(limbSlot) end
--- IsInLimbSlot
-- @realm shared
-- @tparam Item item
-- @tparam InvSlotType limbSlot
-- @treturn bool
function IsInLimbSlot(item, limbSlot) end
--- CanBePutInSlot
-- @realm shared
-- @tparam Item item
-- @tparam number i
-- @tparam bool ignoreCondition
-- @treturn bool
function CanBePutInSlot(item, i, ignoreCondition) end
--- CanBePutInSlot
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam number i
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @treturn bool
function CanBePutInSlot(itemPrefab, i, condition, quality) end
--- CanBeAutoMovedToCorrectSlots
-- @realm shared
-- @tparam Item item
-- @treturn bool
function CanBeAutoMovedToCorrectSlots(item) end
--- RemoveItem
-- @realm shared
-- @tparam Item item
function RemoveItem(item) end
--- RemoveItem
-- @realm shared
-- @tparam Item item
-- @tparam bool tryEquipFromSameStack
function RemoveItem(item, tryEquipFromSameStack) end
--- TryPutItemWithAutoEquipCheck
-- @realm shared
-- @tparam Item item
-- @tparam Character user
-- @tparam Enumerable allowedSlots
-- @tparam bool createNetworkEvent
-- @treturn bool
function TryPutItemWithAutoEquipCheck(item, user, allowedSlots, createNetworkEvent) end
--- TryPutItem
-- @realm shared
-- @tparam Item item
-- @tparam Character user
-- @tparam Enumerable allowedSlots
-- @tparam bool createNetworkEvent
-- @tparam bool ignoreCondition
-- @treturn bool
function TryPutItem(item, user, allowedSlots, createNetworkEvent, ignoreCondition) end
--- CheckIfAnySlotAvailable
-- @realm shared
-- @tparam Item item
-- @tparam bool inWrongSlot
-- @treturn number
function CheckIfAnySlotAvailable(item, inWrongSlot) end
--- TryPutItem
-- @realm shared
-- @tparam Item item
-- @tparam number index
-- @tparam bool allowSwapping
-- @tparam bool allowCombine
-- @tparam Character user
-- @tparam bool createNetworkEvent
-- @tparam bool ignoreCondition
-- @treturn bool
function TryPutItem(item, index, allowSwapping, allowCombine, user, createNetworkEvent, ignoreCondition) end
--- ServerEventRead
-- @realm shared
-- @tparam IReadMessage msg
-- @tparam Client c
function ServerEventRead(msg, c) end
--- ServerEventWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam Client c
-- @tparam IData extraData
function ServerEventWrite(msg, c, extraData) end
--- Contains
-- @realm shared
-- @tparam Item item
-- @treturn bool
function Contains(item) end
--- FirstOrDefault
-- @realm shared
-- @treturn Item
function FirstOrDefault() end
--- LastOrDefault
-- @realm shared
-- @treturn Item
function LastOrDefault() end
--- GetItemAt
-- @realm shared
-- @tparam number index
-- @treturn Item
function GetItemAt(index) end
--- GetItemsAt
-- @realm shared
-- @tparam number index
-- @treturn Enumerable
function GetItemsAt(index) end
--- FindIndex
-- @realm shared
-- @tparam Item item
-- @treturn number
function FindIndex(item) end
--- FindIndices
-- @realm shared
-- @tparam Item item
-- @treturn table
function FindIndices(item) end
--- ItemOwnsSelf
-- @realm shared
-- @tparam Item item
-- @treturn bool
function ItemOwnsSelf(item) end
--- FindAllowedSlot
-- @realm shared
-- @tparam Item item
-- @tparam bool ignoreCondition
-- @treturn number
function FindAllowedSlot(item, ignoreCondition) end
--- CanBePut
-- @realm shared
-- @tparam Item item
-- @treturn bool
function CanBePut(item) end
--- CanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @treturn bool
function CanBePut(itemPrefab, condition, quality) end
--- HowManyCanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Nullable`1 condition
-- @treturn number
function HowManyCanBePut(itemPrefab, condition) end
--- HowManyCanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam number i
-- @tparam Nullable`1 condition
-- @treturn number
function HowManyCanBePut(itemPrefab, i, condition) end
--- IsEmpty
-- @realm shared
-- @treturn bool
function IsEmpty() end
--- IsFull
-- @realm shared
-- @tparam bool takeStacksIntoAccount
-- @treturn bool
function IsFull(takeStacksIntoAccount) end
--- CreateNetworkEvent
-- @realm shared
function CreateNetworkEvent() end
--- FindItem
-- @realm shared
-- @tparam function predicate
-- @tparam bool recursive
-- @treturn Item
function FindItem(predicate, recursive) end
--- FindAllItems
-- @realm shared
-- @tparam function predicate
-- @tparam bool recursive
-- @tparam table list
-- @treturn table
function FindAllItems(predicate, recursive, list) end
--- FindItemByTag
-- @realm shared
-- @tparam Identifier tag
-- @tparam bool recursive
-- @treturn Item
function FindItemByTag(tag, recursive) end
--- FindItemByIdentifier
-- @realm shared
-- @tparam Identifier identifier
-- @tparam bool recursive
-- @treturn Item
function FindItemByIdentifier(identifier, recursive) end
--- ForceToSlot
-- @realm shared
-- @tparam Item item
-- @tparam number index
function ForceToSlot(item, index) end
--- ForceRemoveFromSlot
-- @realm shared
-- @tparam Item item
-- @tparam number index
function ForceRemoveFromSlot(item, index) end
--- SharedRead
-- @realm shared
-- @tparam IReadMessage msg
-- @tparam List`1[]& newItemIds
function SharedRead(msg, newItemIds) end
--- SharedWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam IData extraData
function SharedWrite(msg, extraData) end
--- DeleteAllItems
-- @realm shared
function DeleteAllItems() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- SlotTypes, Field of type InvSlotType[]
-- @realm shared
-- @InvSlotType[] SlotTypes
---
-- AccessibleWhenAlive, Field of type bool
-- @realm shared
-- @bool AccessibleWhenAlive
---
-- AccessibleByOwner, Field of type bool
-- @realm shared
-- @bool AccessibleByOwner
---
-- AllItems, Field of type Enumerable
-- @realm shared
-- @Enumerable AllItems
---
-- AllItemsMod, Field of type Enumerable
-- @realm shared
-- @Enumerable AllItemsMod
---
-- Capacity, Field of type number
-- @realm shared
-- @number Capacity
---
-- CharacterInventory.anySlot, Field of type table
-- @realm shared
-- @table CharacterInventory.anySlot
---
-- Owner, Field of type Entity
-- @realm shared
-- @Entity Owner
---
-- Locked, Field of type bool
-- @realm shared
-- @bool Locked
---
-- AllowSwappingContainedItems, Field of type bool
-- @realm shared
-- @bool AllowSwappingContainedItems

View File

@@ -1,487 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma Client class with some additional functions and fields
Barotrauma source code: [Client.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Networking/Client.cs)
]]
-- @code Client
-- @pragma nostrip
local Client = {}
-- @remove function SetClientCharacter(character) end
-- @remove function Kick(reason) end
-- @remove function Ban(reason, range, seconds) end
-- @remove function Client.Unban(player, endpoint) end
-- @remove function CheckPermission(permissions) end
--- Sets the client character.
-- @realm server
function SetClientCharacter(character) end
--- Kick a client.
-- @realm server
function Kick(reason) end
--- Ban a client.
-- @realm server
function Ban(reason, range, seconds) end
--- Checks permissions, Client.Permissions.
-- @realm server
function CheckPermission(permissions) end
--- Unban a client.
-- @realm server
function Client.Unban(player, endpoint) end
--- Ban
-- @realm shared
-- @tparam string player
-- @tparam string reason
-- @tparam bool range
-- @tparam number seconds
function Client.Ban(player, reason, range, seconds) end
--- InitClientSync
-- @realm shared
function InitClientSync() end
--- IsValidName
-- @realm shared
-- @tparam string name
-- @tparam ServerSettings serverSettings
-- @treturn bool
function Client.IsValidName(name, serverSettings) end
--- EndpointMatches
-- @realm shared
-- @tparam string endPoint
-- @treturn bool
function EndpointMatches(endPoint) end
--- SetPermissions
-- @realm shared
-- @tparam ClientPermissions permissions
-- @tparam Enumerable permittedConsoleCommands
function SetPermissions(permissions, permittedConsoleCommands) end
--- GivePermission
-- @realm shared
-- @tparam ClientPermissions permission
function GivePermission(permission) end
--- RemovePermission
-- @realm shared
-- @tparam ClientPermissions permission
function RemovePermission(permission) end
--- HasPermission
-- @realm shared
-- @tparam ClientPermissions permission
-- @treturn bool
function HasPermission(permission) end
--- GetVote
-- @realm shared
-- @tparam VoteType voteType
-- @treturn T
function GetVote(voteType) end
--- SetVote
-- @realm shared
-- @tparam VoteType voteType
-- @tparam Object value
function SetVote(voteType, value) end
--- ResetVotes
-- @realm shared
function ResetVotes() end
--- AddKickVote
-- @realm shared
-- @tparam Client voter
function AddKickVote(voter) end
--- RemoveKickVote
-- @realm shared
-- @tparam Client voter
function RemoveKickVote(voter) end
--- HasKickVoteFrom
-- @realm shared
-- @tparam Client voter
-- @treturn bool
function HasKickVoteFrom(voter) end
--- HasKickVoteFromID
-- @realm shared
-- @tparam number id
-- @treturn bool
function HasKickVoteFromID(id) end
--- UpdateKickVotes
-- @realm shared
-- @tparam table connectedClients
function Client.UpdateKickVotes(connectedClients) end
--- WritePermissions
-- @realm shared
-- @tparam IWriteMessage msg
function WritePermissions(msg) end
--- ReadPermissions
-- @realm shared
-- @tparam IReadMessage inc
-- @tparam ClientPermissions& permissions
-- @tparam List`1& permittedCommands
function Client.ReadPermissions(inc, permissions, permittedCommands) end
--- ReadPermissions
-- @realm shared
-- @tparam IReadMessage inc
function ReadPermissions(inc) end
--- SanitizeName
-- @realm shared
-- @tparam string name
-- @treturn string
function Client.SanitizeName(name) end
--- Dispose
-- @realm shared
function Dispose() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- CharacterInfo, Field of type CharacterInfo
-- @realm shared
-- @CharacterInfo CharacterInfo
---
-- Connection, Field of type NetworkConnection
-- @realm shared
-- @NetworkConnection Connection
---
-- Karma, Field of type number
-- @realm shared
-- @number Karma
---
-- Client.ClientList, Field of type table
-- @realm shared
-- @table Client.ClientList
---
-- Character, Field of type Character
-- @realm shared
-- @Character Character
---
-- SpectatePos, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 SpectatePos
---
-- Spectating, Field of type bool
-- @realm shared
-- @bool Spectating
---
-- Muted, Field of type bool
-- @realm shared
-- @bool Muted
---
-- HasPermissions, Field of type bool
-- @realm shared
-- @bool HasPermissions
---
-- VoipQueue, Field of type VoipQueue
-- @realm shared
-- @VoipQueue VoipQueue
---
-- InGame, Field of type bool
-- @realm shared
-- @bool InGame
---
-- KickVoteCount, Field of type number
-- @realm shared
-- @number KickVoteCount
---
-- VoiceEnabled, Field of type bool
-- @realm shared
-- @bool VoiceEnabled
---
-- LastRecvClientListUpdate, Field of type number
-- @realm shared
-- @number LastRecvClientListUpdate
---
-- LastSentServerSettingsUpdate, Field of type number
-- @realm shared
-- @number LastSentServerSettingsUpdate
---
-- LastRecvServerSettingsUpdate, Field of type number
-- @realm shared
-- @number LastRecvServerSettingsUpdate
---
-- LastRecvLobbyUpdate, Field of type number
-- @realm shared
-- @number LastRecvLobbyUpdate
---
-- LastSentChatMsgID, Field of type number
-- @realm shared
-- @number LastSentChatMsgID
---
-- LastRecvChatMsgID, Field of type number
-- @realm shared
-- @number LastRecvChatMsgID
---
-- LastSentEntityEventID, Field of type number
-- @realm shared
-- @number LastSentEntityEventID
---
-- LastRecvEntityEventID, Field of type number
-- @realm shared
-- @number LastRecvEntityEventID
---
-- LastRecvCampaignUpdate, Field of type number
-- @realm shared
-- @number LastRecvCampaignUpdate
---
-- LastRecvCampaignSave, Field of type number
-- @realm shared
-- @number LastRecvCampaignSave
---
-- LastCampaignSaveSendTime, Field of type Pair`2
-- @realm shared
-- @Pair`2 LastCampaignSaveSendTime
---
-- ChatMsgQueue, Field of type table
-- @realm shared
-- @table ChatMsgQueue
---
-- LastChatMsgQueueID, Field of type number
-- @realm shared
-- @number LastChatMsgQueueID
---
-- LastSentChatMessages, Field of type table
-- @realm shared
-- @table LastSentChatMessages
---
-- ChatSpamSpeed, Field of type number
-- @realm shared
-- @number ChatSpamSpeed
---
-- ChatSpamTimer, Field of type number
-- @realm shared
-- @number ChatSpamTimer
---
-- ChatSpamCount, Field of type number
-- @realm shared
-- @number ChatSpamCount
---
-- RoundsSincePlayedAsTraitor, Field of type number
-- @realm shared
-- @number RoundsSincePlayedAsTraitor
---
-- KickAFKTimer, Field of type number
-- @realm shared
-- @number KickAFKTimer
---
-- MidRoundSyncTimeOut, Field of type number
-- @realm shared
-- @number MidRoundSyncTimeOut
---
-- NeedsMidRoundSync, Field of type bool
-- @realm shared
-- @bool NeedsMidRoundSync
---
-- UnreceivedEntityEventCount, Field of type number
-- @realm shared
-- @number UnreceivedEntityEventCount
---
-- FirstNewEventID, Field of type number
-- @realm shared
-- @number FirstNewEventID
---
-- EntityEventLastSent, Field of type table
-- @realm shared
-- @table EntityEventLastSent
---
-- PositionUpdateLastSent, Field of type table
-- @realm shared
-- @table PositionUpdateLastSent
---
-- PendingPositionUpdates, Field of type Queue`1
-- @realm shared
-- @Queue`1 PendingPositionUpdates
---
-- ReadyToStart, Field of type bool
-- @realm shared
-- @bool ReadyToStart
---
-- JobPreferences, Field of type table
-- @realm shared
-- @table JobPreferences
---
-- AssignedJob, Field of type JobVariant
-- @realm shared
-- @JobVariant AssignedJob
---
-- DeleteDisconnectedTimer, Field of type number
-- @realm shared
-- @number DeleteDisconnectedTimer
---
-- SpectateOnly, Field of type bool
-- @realm shared
-- @bool SpectateOnly
---
-- WaitForNextRoundRespawn, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 WaitForNextRoundRespawn
---
-- KarmaKickCount, Field of type number
-- @realm shared
-- @number KarmaKickCount
---
-- Name, Field of type string
-- @realm shared
-- @string Name
---
-- NameID, Field of type number
-- @realm shared
-- @number NameID
---
-- ID, Field of type Byte
-- @realm shared
-- @Byte ID
---
-- SteamID, Field of type number
-- @realm shared
-- @number SteamID
---
-- OwnerSteamID, Field of type number
-- @realm shared
-- @number OwnerSteamID
---
-- Language, Field of type LanguageIdentifier
-- @realm shared
-- @LanguageIdentifier Language
---
-- Ping, Field of type number
-- @realm shared
-- @number Ping
---
-- PreferredJob, Field of type Identifier
-- @realm shared
-- @Identifier PreferredJob
---
-- TeamID, Field of type CharacterTeamType
-- @realm shared
-- @CharacterTeamType TeamID
---
-- PreferredTeam, Field of type CharacterTeamType
-- @realm shared
-- @CharacterTeamType PreferredTeam
---
-- CharacterID, Field of type number
-- @realm shared
-- @number CharacterID
---
-- HasSpawned, Field of type bool
-- @realm shared
-- @bool HasSpawned
---
-- GivenAchievements, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 GivenAchievements
---
-- Permissions, Field of type ClientPermissions
-- @realm shared
-- @ClientPermissions Permissions
---
-- PermittedConsoleCommands, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 PermittedConsoleCommands
---
-- Client.MaxNameLength, Field of type number
-- @realm shared
-- @number Client.MaxNameLength

View File

@@ -1,213 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma EntitySpawner class with some additional functions and fields
Barotrauma source code: [EntitySpawner.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Networking/EntitySpawner.cs)
]]
-- @code Entity.Spawner
-- @pragma nostrip
--- CreateNetworkEvent
-- @realm shared
-- @tparam SpawnOrRemove spawnOrRemove
function CreateNetworkEvent(spawnOrRemove) end
--- ServerEventWrite
-- @realm shared
-- @tparam IWriteMessage message
-- @tparam Client client
-- @tparam IData extraData
function ServerEventWrite(message, client, extraData) end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- AddItemToSpawnQueue
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Vector2 worldPosition
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @tparam function onSpawned
function AddItemToSpawnQueue(itemPrefab, worldPosition, condition, quality, onSpawned) end
--- AddItemToSpawnQueue
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Vector2 position
-- @tparam Submarine sub
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @tparam function onSpawned
function AddItemToSpawnQueue(itemPrefab, position, sub, condition, quality, onSpawned) end
--- AddItemToSpawnQueue
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Inventory inventory
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @tparam function onSpawned
-- @tparam bool spawnIfInventoryFull
-- @tparam bool ignoreLimbSlots
-- @tparam InvSlotType slot
function AddItemToSpawnQueue(itemPrefab, inventory, condition, quality, onSpawned, spawnIfInventoryFull, ignoreLimbSlots, slot) end
--- AddCharacterToSpawnQueue
-- @realm shared
-- @tparam Identifier speciesName
-- @tparam Vector2 worldPosition
-- @tparam function onSpawn
function AddCharacterToSpawnQueue(speciesName, worldPosition, onSpawn) end
--- AddCharacterToSpawnQueue
-- @realm shared
-- @tparam Identifier speciesName
-- @tparam Vector2 position
-- @tparam Submarine sub
-- @tparam function onSpawn
function AddCharacterToSpawnQueue(speciesName, position, sub, onSpawn) end
--- AddCharacterToSpawnQueue
-- @realm shared
-- @tparam Identifier speciesName
-- @tparam Vector2 worldPosition
-- @tparam CharacterInfo characterInfo
-- @tparam function onSpawn
function AddCharacterToSpawnQueue(speciesName, worldPosition, characterInfo, onSpawn) end
--- AddEntityToRemoveQueue
-- @realm shared
-- @tparam Entity entity
function AddEntityToRemoveQueue(entity) end
--- AddItemToRemoveQueue
-- @realm shared
-- @tparam Item item
function AddItemToRemoveQueue(item) end
--- IsInSpawnQueue
-- @realm shared
-- @tparam Predicate`1 predicate
-- @treturn bool
function IsInSpawnQueue(predicate) end
--- CountSpawnQueue
-- @realm shared
-- @tparam Predicate`1 predicate
-- @treturn number
function CountSpawnQueue(predicate) end
--- IsInRemoveQueue
-- @realm shared
-- @tparam Entity entity
-- @treturn bool
function IsInRemoveQueue(entity) end
--- Update
-- @realm shared
-- @tparam bool createNetworkEvents
function Update(createNetworkEvents) end
--- Reset
-- @realm shared
function Reset() end
--- FreeID
-- @realm shared
function FreeID() end
--- Remove
-- @realm shared
function Remove() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Removed, Field of type bool
-- @realm shared
-- @bool Removed
---
-- IdFreed, Field of type bool
-- @realm shared
-- @bool IdFreed
---
-- SimPosition, Field of type Vector2
-- @realm shared
-- @Vector2 SimPosition
---
-- Position, Field of type Vector2
-- @realm shared
-- @Vector2 Position
---
-- WorldPosition, Field of type Vector2
-- @realm shared
-- @Vector2 WorldPosition
---
-- DrawPosition, Field of type Vector2
-- @realm shared
-- @Vector2 DrawPosition
---
-- Submarine, Field of type Submarine
-- @realm shared
-- @Submarine Submarine
---
-- AiTarget, Field of type AITarget
-- @realm shared
-- @AITarget AiTarget
---
-- InDetectable, Field of type bool
-- @realm shared
-- @bool InDetectable
---
-- SpawnTime, Field of type number
-- @realm shared
-- @number SpawnTime
---
-- ErrorLine, Field of type string
-- @realm shared
-- @string ErrorLine
---
-- ID, Field of type number
-- @realm shared
-- @number ID
---
-- CreationStackTrace, Field of type string
-- @realm shared
-- @string CreationStackTrace
---
-- CreationIndex, Field of type number
-- @realm shared
-- @number CreationIndex

View File

@@ -1,176 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma Entity class with some additional functions and fields
Barotrauma source code: [Entity.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Map/Entity.cs)
]]
-- @code Entity
-- @pragma nostrip
--- Remove
-- @realm shared
function Remove() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- GetEntities
-- @realm shared
-- @treturn IReadOnlyCollection`1
function Entity.GetEntities() end
--- FindFreeIdBlock
-- @realm shared
-- @tparam number minBlockSize
-- @treturn number
function Entity.FindFreeIdBlock(minBlockSize) end
--- FindEntityByID
-- @realm shared
-- @tparam number ID
-- @treturn Entity
function Entity.FindEntityByID(ID) end
--- RemoveAll
-- @realm shared
function Entity.RemoveAll() end
--- FreeID
-- @realm shared
function FreeID() end
--- DumpIds
-- @realm shared
-- @tparam number count
-- @tparam string filename
function Entity.DumpIds(count, filename) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Entity.EntityCount, Field of type number
-- @realm shared
-- @number Entity.EntityCount
---
-- Removed, Field of type bool
-- @realm shared
-- @bool Removed
---
-- IdFreed, Field of type bool
-- @realm shared
-- @bool IdFreed
---
-- SimPosition, Field of type Vector2
-- @realm shared
-- @Vector2 SimPosition
---
-- Position, Field of type Vector2
-- @realm shared
-- @Vector2 Position
---
-- WorldPosition, Field of type Vector2
-- @realm shared
-- @Vector2 WorldPosition
---
-- DrawPosition, Field of type Vector2
-- @realm shared
-- @Vector2 DrawPosition
---
-- Submarine, Field of type Submarine
-- @realm shared
-- @Submarine Submarine
---
-- AiTarget, Field of type AITarget
-- @realm shared
-- @AITarget AiTarget
---
-- InDetectable, Field of type bool
-- @realm shared
-- @bool InDetectable
---
-- SpawnTime, Field of type number
-- @realm shared
-- @number SpawnTime
---
-- ErrorLine, Field of type string
-- @realm shared
-- @string ErrorLine
---
-- ID, Field of type number
-- @realm shared
-- @number ID
---
-- CreationStackTrace, Field of type string
-- @realm shared
-- @string CreationStackTrace
---
-- CreationIndex, Field of type number
-- @realm shared
-- @number CreationIndex
---
-- Entity.Spawner, Field of type EntitySpawner
-- @realm shared
-- @EntitySpawner Entity.Spawner
---
-- Entity.NullEntityID, Field of type number
-- @realm shared
-- @number Entity.NullEntityID
---
-- Entity.EntitySpawnerID, Field of type number
-- @realm shared
-- @number Entity.EntitySpawnerID
---
-- Entity.RespawnManagerID, Field of type number
-- @realm shared
-- @number Entity.RespawnManagerID
---
-- Entity.DummyID, Field of type number
-- @realm shared
-- @number Entity.DummyID
---
-- Entity.ReservedIDStart, Field of type number
-- @realm shared
-- @number Entity.ReservedIDStart
---
-- Entity.MaxEntityCount, Field of type number
-- @realm shared
-- @number Entity.MaxEntityCount

View File

@@ -1,58 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.GameScreen
]]
-- @code Game.GameScreen
-- @pragma nostrip
local GameScreen = {}
--- Select
-- @realm shared
function Select() end
--- Deselect
-- @realm shared
function Deselect() end
--- Update
-- @realm shared
-- @tparam number deltaTime
function Update(deltaTime) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Cam, Field of type Camera
-- @realm shared
-- @Camera Cam
---
-- GameTime, Field of type number
-- @realm shared
-- @number GameTime
---
-- IsEditor, Field of type bool
-- @realm shared
-- @bool IsEditor

View File

@@ -1,256 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.GameSession
]]
-- @code Game.GameSession
-- @pragma nostrip
local GameSession = {}
--- LoadPreviousSave
-- @realm shared
function LoadPreviousSave() end
--- SwitchSubmarine
-- @realm shared
-- @tparam SubmarineInfo newSubmarine
-- @tparam number cost
-- @tparam Client client
-- @treturn SubmarineInfo
function SwitchSubmarine(newSubmarine, cost, client) end
--- PurchaseSubmarine
-- @realm shared
-- @tparam SubmarineInfo newSubmarine
-- @tparam Client client
function PurchaseSubmarine(newSubmarine, client) end
--- IsSubmarineOwned
-- @realm shared
-- @tparam SubmarineInfo query
-- @treturn bool
function IsSubmarineOwned(query) end
--- IsCurrentLocationRadiated
-- @realm shared
-- @treturn bool
function IsCurrentLocationRadiated() end
--- StartRound
-- @realm shared
-- @tparam string levelSeed
-- @tparam Nullable`1 difficulty
-- @tparam LevelGenerationParams levelGenerationParams
function StartRound(levelSeed, difficulty, levelGenerationParams) end
--- StartRound
-- @realm shared
-- @tparam LevelData levelData
-- @tparam bool mirrorLevel
-- @tparam SubmarineInfo startOutpost
-- @tparam SubmarineInfo endOutpost
function StartRound(levelData, mirrorLevel, startOutpost, endOutpost) end
--- PlaceSubAtStart
-- @realm shared
-- @tparam Level level
function PlaceSubAtStart(level) end
--- Update
-- @realm shared
-- @tparam number deltaTime
function Update(deltaTime) end
--- GetMission
-- @realm shared
-- @tparam number index
-- @treturn Mission
function GetMission(index) end
--- GetMissionIndex
-- @realm shared
-- @tparam Mission mission
-- @treturn number
function GetMissionIndex(mission) end
--- EnforceMissionOrder
-- @realm shared
-- @tparam table missionIdentifiers
function EnforceMissionOrder(missionIdentifiers) end
--- GetSessionCrewCharacters
-- @realm shared
-- @tparam CharacterType type
-- @treturn ImmutableHashSet`1
function GameSession.GetSessionCrewCharacters(type) end
--- EndRound
-- @realm shared
-- @tparam string endMessage
-- @tparam table traitorResults
-- @tparam TransitionType transitionType
function EndRound(endMessage, traitorResults, transitionType) end
--- LogEndRoundStats
-- @realm shared
-- @tparam string eventId
function LogEndRoundStats(eventId) end
--- KillCharacter
-- @realm shared
-- @tparam Character character
function KillCharacter(character) end
--- ReviveCharacter
-- @realm shared
-- @tparam Character character
function ReviveCharacter(character) end
--- IsCompatibleWithEnabledContentPackages
-- @realm shared
-- @tparam IList`1 contentPackageNames
-- @tparam LocalizedString& errorMsg
-- @treturn bool
function GameSession.IsCompatibleWithEnabledContentPackages(contentPackageNames, errorMsg) end
--- Save
-- @realm shared
-- @tparam string filePath
function Save(filePath) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Missions, Field of type Enumerable
-- @realm shared
-- @Enumerable Missions
---
-- Casualties, Field of type Enumerable
-- @realm shared
-- @Enumerable Casualties
---
-- IsRunning, Field of type bool
-- @realm shared
-- @bool IsRunning
---
-- RoundEnding, Field of type bool
-- @realm shared
-- @bool RoundEnding
---
-- Level, Field of type Level
-- @realm shared
-- @Level Level
---
-- LevelData, Field of type LevelData
-- @realm shared
-- @LevelData LevelData
---
-- MirrorLevel, Field of type bool
-- @realm shared
-- @bool MirrorLevel
---
-- Map, Field of type Map
-- @realm shared
-- @Map Map
---
-- Campaign, Field of type CampaignMode
-- @realm shared
-- @CampaignMode Campaign
---
-- StartLocation, Field of type Location
-- @realm shared
-- @Location StartLocation
---
-- EndLocation, Field of type Location
-- @realm shared
-- @Location EndLocation
---
-- SubmarineInfo, Field of type SubmarineInfo
-- @realm shared
-- @SubmarineInfo SubmarineInfo
---
-- Submarine, Field of type Submarine
-- @realm shared
-- @Submarine Submarine
---
-- SavePath, Field of type string
-- @realm shared
-- @string SavePath
---
-- EventManager, Field of type EventManager
-- @realm shared
-- @EventManager EventManager
---
-- GameMode, Field of type GameMode
-- @realm shared
-- @GameMode GameMode
---
-- CrewManager, Field of type CrewManager
-- @realm shared
-- @CrewManager CrewManager
---
-- RoundStartTime, Field of type number
-- @realm shared
-- @number RoundStartTime
---
-- TimeSpentCleaning, Field of type number
-- @realm shared
-- @number TimeSpentCleaning
---
-- TimeSpentPainting, Field of type number
-- @realm shared
-- @number TimeSpentPainting
---
-- WinningTeam, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 WinningTeam
---
-- OwnedSubmarines, Field of type table
-- @realm shared
-- @table OwnedSubmarines
---
-- GameSession.MinimumLoadingTime, Field of type number
-- @realm shared
-- @number GameSession.MinimumLoadingTime

View File

@@ -1,53 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.GameSettings
]]
-- @code Game.Settings
-- @pragma nostrip
local GameSettings = {}
--- Init
-- @realm shared
function GameSettings.Init() end
--- SetCurrentConfig
-- @realm shared
-- @tparam Config& newConfig
function GameSettings.SetCurrentConfig(newConfig) end
--- SaveCurrentConfig
-- @realm shared
function GameSettings.SaveCurrentConfig() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- GameSettings.CurrentConfig, Field of type Config&
-- @realm shared
-- @Config& GameSettings.CurrentConfig
---
-- GameSettings.PlayerConfigPath, Field of type string
-- @realm shared
-- @string GameSettings.PlayerConfigPath

View File

@@ -1,817 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.Hull
]]
-- @code Hull
-- @pragma nostrip
local Hull = {}
--- IncreaseSectionColorOrStrength
-- @realm shared
-- @tparam BackgroundSection section
-- @tparam Nullable`1 color
-- @tparam Nullable`1 strength
-- @tparam bool requiresUpdate
-- @tparam bool isCleaning
function IncreaseSectionColorOrStrength(section, color, strength, requiresUpdate, isCleaning) end
--- SetSectionColorOrStrength
-- @realm shared
-- @tparam BackgroundSection section
-- @tparam Nullable`1 color
-- @tparam Nullable`1 strength
function SetSectionColorOrStrength(section, color, strength) end
--- CleanSection
-- @realm shared
-- @tparam BackgroundSection section
-- @tparam number cleanVal
-- @tparam bool updateRequired
function CleanSection(section, cleanVal, updateRequired) end
--- Load
-- @realm shared
-- @tparam ContentXElement element
-- @tparam Submarine submarine
-- @tparam IdRemap idRemap
-- @treturn Hull
function Hull.Load(element, submarine, idRemap) end
--- Save
-- @realm shared
-- @tparam XElement parentElement
-- @treturn XElement
function Save(parentElement) end
--- IsMouseOn
-- @realm shared
-- @tparam Vector2 position
-- @treturn bool
function IsMouseOn(position) end
--- ServerEventWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam Client c
-- @tparam IData extraData
function ServerEventWrite(msg, c, extraData) end
--- ServerEventRead
-- @realm shared
-- @tparam IReadMessage msg
-- @tparam Client c
function ServerEventRead(msg, c) end
--- GetBorders
-- @realm shared
-- @treturn Rectangle
function Hull.GetBorders() end
--- Clone
-- @realm shared
-- @treturn MapEntity
function Clone() end
--- GenerateEntityGrid
-- @realm shared
-- @tparam Rectangle worldRect
-- @treturn EntityGrid
function Hull.GenerateEntityGrid(worldRect) end
--- GenerateEntityGrid
-- @realm shared
-- @tparam Submarine submarine
-- @treturn EntityGrid
function Hull.GenerateEntityGrid(submarine) end
--- SetModuleTags
-- @realm shared
-- @tparam Enumerable tags
function SetModuleTags(tags) end
--- OnMapLoaded
-- @realm shared
function OnMapLoaded() end
--- AddToGrid
-- @realm shared
-- @tparam Submarine submarine
function AddToGrid(submarine) end
--- GetWaveIndex
-- @realm shared
-- @tparam Vector2 position
-- @treturn number
function GetWaveIndex(position) end
--- GetWaveIndex
-- @realm shared
-- @tparam number xPos
-- @treturn number
function GetWaveIndex(xPos) end
--- Move
-- @realm shared
-- @tparam Vector2 amount
function Move(amount) end
--- ShallowRemove
-- @realm shared
function ShallowRemove() end
--- Remove
-- @realm shared
function Remove() end
--- AddFireSource
-- @realm shared
-- @tparam FireSource fireSource
function AddFireSource(fireSource) end
--- AddDecal
-- @realm shared
-- @tparam number decalId
-- @tparam Vector2 worldPosition
-- @tparam number scale
-- @tparam bool isNetworkEvent
-- @tparam Nullable`1 spriteIndex
-- @treturn Decal
function AddDecal(decalId, worldPosition, scale, isNetworkEvent, spriteIndex) end
--- AddDecal
-- @realm shared
-- @tparam string decalName
-- @tparam Vector2 worldPosition
-- @tparam number scale
-- @tparam bool isNetworkEvent
-- @tparam Nullable`1 spriteIndex
-- @treturn Decal
function AddDecal(decalName, worldPosition, scale, isNetworkEvent, spriteIndex) end
--- Update
-- @realm shared
-- @tparam number deltaTime
-- @tparam Camera cam
function Update(deltaTime, cam) end
--- ApplyFlowForces
-- @realm shared
-- @tparam number deltaTime
-- @tparam Item item
function ApplyFlowForces(deltaTime, item) end
--- Extinguish
-- @realm shared
-- @tparam number deltaTime
-- @tparam number amount
-- @tparam Vector2 position
-- @tparam bool extinguishRealFires
-- @tparam bool extinguishFakeFires
function Extinguish(deltaTime, amount, position, extinguishRealFires, extinguishFakeFires) end
--- RemoveFire
-- @realm shared
-- @tparam FireSource fire
function RemoveFire(fire) end
--- GetConnectedHulls
-- @realm shared
-- @tparam bool includingThis
-- @tparam Nullable`1 searchDepth
-- @tparam bool ignoreClosedGaps
-- @treturn Enumerable
function GetConnectedHulls(includingThis, searchDepth, ignoreClosedGaps) end
--- GetApproximateDistance
-- @realm shared
-- @tparam Vector2 startPos
-- @tparam Vector2 endPos
-- @tparam Hull targetHull
-- @tparam number maxDistance
-- @tparam number distanceMultiplierPerClosedDoor
-- @treturn number
function GetApproximateDistance(startPos, endPos, targetHull, maxDistance, distanceMultiplierPerClosedDoor) end
--- FindHull
-- @realm shared
-- @tparam Vector2 position
-- @tparam Hull guess
-- @tparam bool useWorldCoordinates
-- @tparam bool inclusive
-- @treturn Hull
function Hull.FindHull(position, guess, useWorldCoordinates, inclusive) end
--- FindHullUnoptimized
-- @realm shared
-- @tparam Vector2 position
-- @tparam Hull guess
-- @tparam bool useWorldCoordinates
-- @tparam bool inclusive
-- @treturn Hull
function Hull.FindHullUnoptimized(position, guess, useWorldCoordinates, inclusive) end
--- DetectItemVisibility
-- @realm shared
-- @tparam Character c
function Hull.DetectItemVisibility(c) end
--- CreateRoomName
-- @realm shared
-- @treturn string
function CreateRoomName() end
--- IsTaggedAirlock
-- @realm shared
-- @treturn bool
function IsTaggedAirlock() end
--- LeadsOutside
-- @realm shared
-- @tparam Character character
-- @treturn bool
function LeadsOutside(character) end
--- GetCleanTarget
-- @realm shared
-- @tparam Vector2 worldPosition
-- @treturn Hull
function Hull.GetCleanTarget(worldPosition) end
--- GetBackgroundSection
-- @realm shared
-- @tparam Vector2 worldPosition
-- @treturn BackgroundSection
function GetBackgroundSection(worldPosition) end
--- GetBackgroundSectionsViaContaining
-- @realm shared
-- @tparam Rectangle rectArea
-- @treturn Enumerable
function GetBackgroundSectionsViaContaining(rectArea) end
--- DoesSectionMatch
-- @realm shared
-- @tparam number index
-- @tparam number row
-- @treturn bool
function DoesSectionMatch(index, row) end
--- AddLinked
-- @realm shared
-- @tparam MapEntity entity
function AddLinked(entity) end
--- ResolveLinks
-- @realm shared
-- @tparam IdRemap childRemap
function ResolveLinks(childRemap) end
--- HasUpgrade
-- @realm shared
-- @tparam Identifier identifier
-- @treturn bool
function HasUpgrade(identifier) end
--- GetUpgrade
-- @realm shared
-- @tparam Identifier identifier
-- @treturn Upgrade
function GetUpgrade(identifier) end
--- GetUpgrades
-- @realm shared
-- @treturn table
function GetUpgrades() end
--- SetUpgrade
-- @realm shared
-- @tparam Upgrade upgrade
-- @tparam bool createNetworkEvent
function SetUpgrade(upgrade, createNetworkEvent) end
--- AddUpgrade
-- @realm shared
-- @tparam Upgrade upgrade
-- @tparam bool createNetworkEvent
-- @treturn bool
function AddUpgrade(upgrade, createNetworkEvent) end
--- FlipX
-- @realm shared
-- @tparam bool relativeToSub
function FlipX(relativeToSub) end
--- FlipY
-- @realm shared
-- @tparam bool relativeToSub
function FlipY(relativeToSub) end
--- RemoveLinked
-- @realm shared
-- @tparam MapEntity e
function RemoveLinked(e) end
--- GetLinkedEntities
-- @realm shared
-- @tparam HashSet`1 list
-- @tparam Nullable`1 maxDepth
-- @tparam function filter
-- @treturn HashSet`1
function GetLinkedEntities(list, maxDepth, filter) end
--- FreeID
-- @realm shared
function FreeID() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- SerializableProperties, Field of type table
-- @realm shared
-- @table SerializableProperties
---
-- Name, Field of type string
-- @realm shared
-- @string Name
---
-- DisplayName, Field of type LocalizedString
-- @realm shared
-- @LocalizedString DisplayName
---
-- OutpostModuleTags, Field of type Enumerable
-- @realm shared
-- @Enumerable OutpostModuleTags
---
-- RoomName, Field of type string
-- @realm shared
-- @string RoomName
---
-- AmbientLight, Field of type Color
-- @realm shared
-- @Color AmbientLight
---
-- Rect, Field of type Rectangle
-- @realm shared
-- @Rectangle Rect
---
-- Linkable, Field of type bool
-- @realm shared
-- @bool Linkable
---
-- LethalPressure, Field of type number
-- @realm shared
-- @number LethalPressure
---
-- Size, Field of type Vector2
-- @realm shared
-- @Vector2 Size
---
-- CeilingHeight, Field of type number
-- @realm shared
-- @number CeilingHeight
---
-- Surface, Field of type number
-- @realm shared
-- @number Surface
---
-- WorldSurface, Field of type number
-- @realm shared
-- @number WorldSurface
---
-- WaterVolume, Field of type number
-- @realm shared
-- @number WaterVolume
---
-- Oxygen, Field of type number
-- @realm shared
-- @number Oxygen
---
-- IsWetRoom, Field of type bool
-- @realm shared
-- @bool IsWetRoom
---
-- AvoidStaying, Field of type bool
-- @realm shared
-- @bool AvoidStaying
---
-- WaterPercentage, Field of type number
-- @realm shared
-- @number WaterPercentage
---
-- OxygenPercentage, Field of type number
-- @realm shared
-- @number OxygenPercentage
---
-- Volume, Field of type number
-- @realm shared
-- @number Volume
---
-- Pressure, Field of type number
-- @realm shared
-- @number Pressure
---
-- WaveY, Field of type Single[]
-- @realm shared
-- @Single[] WaveY
---
-- WaveVel, Field of type Single[]
-- @realm shared
-- @Single[] WaveVel
---
-- BackgroundSections, Field of type table
-- @realm shared
-- @table BackgroundSections
---
-- SupportsPaintedColors, Field of type bool
-- @realm shared
-- @bool SupportsPaintedColors
---
-- FireSources, Field of type table
-- @realm shared
-- @table FireSources
---
-- FakeFireSources, Field of type table
-- @realm shared
-- @table FakeFireSources
---
-- BallastFlora, Field of type BallastFloraBehavior
-- @realm shared
-- @BallastFloraBehavior BallastFlora
---
-- DisallowedUpgrades, Field of type string
-- @realm shared
-- @string DisallowedUpgrades
---
-- FlippedX, Field of type bool
-- @realm shared
-- @bool FlippedX
---
-- FlippedY, Field of type bool
-- @realm shared
-- @bool FlippedY
---
-- IsHighlighted, Field of type bool
-- @realm shared
-- @bool IsHighlighted
---
-- WorldRect, Field of type Rectangle
-- @realm shared
-- @Rectangle WorldRect
---
-- Sprite, Field of type Sprite
-- @realm shared
-- @Sprite Sprite
---
-- DrawBelowWater, Field of type bool
-- @realm shared
-- @bool DrawBelowWater
---
-- DrawOverWater, Field of type bool
-- @realm shared
-- @bool DrawOverWater
---
-- AllowedLinks, Field of type Enumerable
-- @realm shared
-- @Enumerable AllowedLinks
---
-- ResizeHorizontal, Field of type bool
-- @realm shared
-- @bool ResizeHorizontal
---
-- ResizeVertical, Field of type bool
-- @realm shared
-- @bool ResizeVertical
---
-- RectWidth, Field of type number
-- @realm shared
-- @number RectWidth
---
-- RectHeight, Field of type number
-- @realm shared
-- @number RectHeight
---
-- SpriteDepthOverrideIsSet, Field of type bool
-- @realm shared
-- @bool SpriteDepthOverrideIsSet
---
-- SpriteOverrideDepth, Field of type number
-- @realm shared
-- @number SpriteOverrideDepth
---
-- SpriteDepth, Field of type number
-- @realm shared
-- @number SpriteDepth
---
-- Scale, Field of type number
-- @realm shared
-- @number Scale
---
-- HiddenInGame, Field of type bool
-- @realm shared
-- @bool HiddenInGame
---
-- Position, Field of type Vector2
-- @realm shared
-- @Vector2 Position
---
-- SimPosition, Field of type Vector2
-- @realm shared
-- @Vector2 SimPosition
---
-- SoundRange, Field of type number
-- @realm shared
-- @number SoundRange
---
-- SightRange, Field of type number
-- @realm shared
-- @number SightRange
---
-- RemoveIfLinkedOutpostDoorInUse, Field of type bool
-- @realm shared
-- @bool RemoveIfLinkedOutpostDoorInUse
---
-- Layer, Field of type string
-- @realm shared
-- @string Layer
---
-- Removed, Field of type bool
-- @realm shared
-- @bool Removed
---
-- IdFreed, Field of type bool
-- @realm shared
-- @bool IdFreed
---
-- WorldPosition, Field of type Vector2
-- @realm shared
-- @Vector2 WorldPosition
---
-- DrawPosition, Field of type Vector2
-- @realm shared
-- @Vector2 DrawPosition
---
-- Submarine, Field of type Submarine
-- @realm shared
-- @Submarine Submarine
---
-- AiTarget, Field of type AITarget
-- @realm shared
-- @AITarget AiTarget
---
-- InDetectable, Field of type bool
-- @realm shared
-- @bool InDetectable
---
-- SpawnTime, Field of type number
-- @realm shared
-- @number SpawnTime
---
-- ErrorLine, Field of type string
-- @realm shared
-- @string ErrorLine
---
-- properties, Field of type table
-- @realm shared
-- @table properties
---
-- Visible, Field of type bool
-- @realm shared
-- @bool Visible
---
-- ConnectedGaps, Field of type table
-- @realm shared
-- @table ConnectedGaps
---
-- OriginalAmbientLight, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 OriginalAmbientLight
---
-- xBackgroundMax, Field of type number
-- @realm shared
-- @number xBackgroundMax
---
-- yBackgroundMax, Field of type number
-- @realm shared
-- @number yBackgroundMax
---
-- Hull.HullList, Field of type table
-- @realm shared
-- @table Hull.HullList
---
-- Hull.EntityGrids, Field of type table
-- @realm shared
-- @table Hull.EntityGrids
---
-- Hull.ShowHulls, Field of type bool
-- @realm shared
-- @bool Hull.ShowHulls
---
-- Hull.EditWater, Field of type bool
-- @realm shared
-- @bool Hull.EditWater
---
-- Hull.EditFire, Field of type bool
-- @realm shared
-- @bool Hull.EditFire
---
-- Hull.WaveStiffness, Field of type number
-- @realm shared
-- @number Hull.WaveStiffness
---
-- Hull.WaveSpread, Field of type number
-- @realm shared
-- @number Hull.WaveSpread
---
-- Hull.WaveDampening, Field of type number
-- @realm shared
-- @number Hull.WaveDampening
---
-- Hull.OxygenDistributionSpeed, Field of type number
-- @realm shared
-- @number Hull.OxygenDistributionSpeed
---
-- Hull.OxygenDeteriorationSpeed, Field of type number
-- @realm shared
-- @number Hull.OxygenDeteriorationSpeed
---
-- Hull.OxygenConsumptionSpeed, Field of type number
-- @realm shared
-- @number Hull.OxygenConsumptionSpeed
---
-- Hull.WaveWidth, Field of type number
-- @realm shared
-- @number Hull.WaveWidth
---
-- Hull.MaxCompress, Field of type number
-- @realm shared
-- @number Hull.MaxCompress
---
-- Hull.BackgroundSectionSize, Field of type number
-- @realm shared
-- @number Hull.BackgroundSectionSize
---
-- Hull.BackgroundSectionsPerNetworkEvent, Field of type number
-- @realm shared
-- @number Hull.BackgroundSectionsPerNetworkEvent
---
-- Hull.MaxDecalsPerHull, Field of type number
-- @realm shared
-- @number Hull.MaxDecalsPerHull
---
-- Prefab, Field of type MapEntityPrefab
-- @realm shared
-- @MapEntityPrefab Prefab
---
-- unresolvedLinkedToID, Field of type table
-- @realm shared
-- @table unresolvedLinkedToID
---
-- DisallowedUpgradeSet, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 DisallowedUpgradeSet
---
-- linkedTo, Field of type table
-- @realm shared
-- @table linkedTo
---
-- ShouldBeSaved, Field of type bool
-- @realm shared
-- @bool ShouldBeSaved
---
-- ExternalHighlight, Field of type bool
-- @realm shared
-- @bool ExternalHighlight
---
-- OriginalModuleIndex, Field of type number
-- @realm shared
-- @number OriginalModuleIndex
---
-- OriginalContainerIndex, Field of type number
-- @realm shared
-- @number OriginalContainerIndex
---
-- ID, Field of type number
-- @realm shared
-- @number ID
---
-- CreationStackTrace, Field of type string
-- @realm shared
-- @string CreationStackTrace
---
-- CreationIndex, Field of type number
-- @realm shared
-- @number CreationIndex

View File

@@ -1,276 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.Inventory
]]
-- @code Inventory
-- @pragma nostrip
local Inventory = {}
--- ServerEventRead
-- @realm shared
-- @tparam IReadMessage msg
-- @tparam Client c
function ServerEventRead(msg, c) end
--- ServerEventWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam Client c
-- @tparam IData extraData
function ServerEventWrite(msg, c, extraData) end
--- Contains
-- @realm shared
-- @tparam Item item
-- @treturn bool
function Contains(item) end
--- FirstOrDefault
-- @realm shared
-- @treturn Item
function FirstOrDefault() end
--- LastOrDefault
-- @realm shared
-- @treturn Item
function LastOrDefault() end
--- GetItemAt
-- @realm shared
-- @tparam number index
-- @treturn Item
function GetItemAt(index) end
--- GetItemsAt
-- @realm shared
-- @tparam number index
-- @treturn Enumerable
function GetItemsAt(index) end
--- FindIndex
-- @realm shared
-- @tparam Item item
-- @treturn number
function FindIndex(item) end
--- FindIndices
-- @realm shared
-- @tparam Item item
-- @treturn table
function FindIndices(item) end
--- ItemOwnsSelf
-- @realm shared
-- @tparam Item item
-- @treturn bool
function ItemOwnsSelf(item) end
--- FindAllowedSlot
-- @realm shared
-- @tparam Item item
-- @tparam bool ignoreCondition
-- @treturn number
function FindAllowedSlot(item, ignoreCondition) end
--- CanBePut
-- @realm shared
-- @tparam Item item
-- @treturn bool
function CanBePut(item) end
--- CanBePutInSlot
-- @realm shared
-- @tparam Item item
-- @tparam number i
-- @tparam bool ignoreCondition
-- @treturn bool
function CanBePutInSlot(item, i, ignoreCondition) end
--- CanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @treturn bool
function CanBePut(itemPrefab, condition, quality) end
--- CanBePutInSlot
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam number i
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @treturn bool
function CanBePutInSlot(itemPrefab, i, condition, quality) end
--- HowManyCanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Nullable`1 condition
-- @treturn number
function HowManyCanBePut(itemPrefab, condition) end
--- HowManyCanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam number i
-- @tparam Nullable`1 condition
-- @treturn number
function HowManyCanBePut(itemPrefab, i, condition) end
--- TryPutItem
-- @realm shared
-- @tparam Item item
-- @tparam Character user
-- @tparam Enumerable allowedSlots
-- @tparam bool createNetworkEvent
-- @tparam bool ignoreCondition
-- @treturn bool
function TryPutItem(item, user, allowedSlots, createNetworkEvent, ignoreCondition) end
--- TryPutItem
-- @realm shared
-- @tparam Item item
-- @tparam number i
-- @tparam bool allowSwapping
-- @tparam bool allowCombine
-- @tparam Character user
-- @tparam bool createNetworkEvent
-- @tparam bool ignoreCondition
-- @treturn bool
function TryPutItem(item, i, allowSwapping, allowCombine, user, createNetworkEvent, ignoreCondition) end
--- IsEmpty
-- @realm shared
-- @treturn bool
function IsEmpty() end
--- IsFull
-- @realm shared
-- @tparam bool takeStacksIntoAccount
-- @treturn bool
function IsFull(takeStacksIntoAccount) end
--- CreateNetworkEvent
-- @realm shared
function CreateNetworkEvent() end
--- FindItem
-- @realm shared
-- @tparam function predicate
-- @tparam bool recursive
-- @treturn Item
function FindItem(predicate, recursive) end
--- FindAllItems
-- @realm shared
-- @tparam function predicate
-- @tparam bool recursive
-- @tparam table list
-- @treturn table
function FindAllItems(predicate, recursive, list) end
--- FindItemByTag
-- @realm shared
-- @tparam Identifier tag
-- @tparam bool recursive
-- @treturn Item
function FindItemByTag(tag, recursive) end
--- FindItemByIdentifier
-- @realm shared
-- @tparam Identifier identifier
-- @tparam bool recursive
-- @treturn Item
function FindItemByIdentifier(identifier, recursive) end
--- RemoveItem
-- @realm shared
-- @tparam Item item
function RemoveItem(item) end
--- ForceToSlot
-- @realm shared
-- @tparam Item item
-- @tparam number index
function ForceToSlot(item, index) end
--- ForceRemoveFromSlot
-- @realm shared
-- @tparam Item item
-- @tparam number index
function ForceRemoveFromSlot(item, index) end
--- SharedRead
-- @realm shared
-- @tparam IReadMessage msg
-- @tparam List`1[]& newItemIds
function SharedRead(msg, newItemIds) end
--- SharedWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam IData extraData
function SharedWrite(msg, extraData) end
--- DeleteAllItems
-- @realm shared
function DeleteAllItems() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- AllItems, Field of type Enumerable
-- @realm shared
-- @Enumerable AllItems
---
-- AllItemsMod, Field of type Enumerable
-- @realm shared
-- @Enumerable AllItemsMod
---
-- Capacity, Field of type number
-- @realm shared
-- @number Capacity
---
-- Owner, Field of type Entity
-- @realm shared
-- @Entity Owner
---
-- Locked, Field of type bool
-- @realm shared
-- @bool Locked
---
-- AllowSwappingContainedItems, Field of type bool
-- @realm shared
-- @bool AllowSwappingContainedItems
---
-- Inventory.MaxStackSize, Field of type number
-- @realm shared
-- @number Inventory.MaxStackSize

File diff suppressed because it is too large Load Diff

View File

@@ -1,276 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.ItemInventory
]]
-- @code ItemInventory
-- @pragma nostrip
local ItemInventory = {}
--- FindAllowedSlot
-- @realm shared
-- @tparam Item item
-- @tparam bool ignoreCondition
-- @treturn number
function FindAllowedSlot(item, ignoreCondition) end
--- CanBePutInSlot
-- @realm shared
-- @tparam Item item
-- @tparam number i
-- @tparam bool ignoreCondition
-- @treturn bool
function CanBePutInSlot(item, i, ignoreCondition) end
--- CanBePutInSlot
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam number i
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @treturn bool
function CanBePutInSlot(itemPrefab, i, condition, quality) end
--- HowManyCanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam number i
-- @tparam Nullable`1 condition
-- @treturn number
function HowManyCanBePut(itemPrefab, i, condition) end
--- IsFull
-- @realm shared
-- @tparam bool takeStacksIntoAccount
-- @treturn bool
function IsFull(takeStacksIntoAccount) end
--- TryPutItem
-- @realm shared
-- @tparam Item item
-- @tparam Character user
-- @tparam Enumerable allowedSlots
-- @tparam bool createNetworkEvent
-- @tparam bool ignoreCondition
-- @treturn bool
function TryPutItem(item, user, allowedSlots, createNetworkEvent, ignoreCondition) end
--- TryPutItem
-- @realm shared
-- @tparam Item item
-- @tparam number i
-- @tparam bool allowSwapping
-- @tparam bool allowCombine
-- @tparam Character user
-- @tparam bool createNetworkEvent
-- @tparam bool ignoreCondition
-- @treturn bool
function TryPutItem(item, i, allowSwapping, allowCombine, user, createNetworkEvent, ignoreCondition) end
--- CreateNetworkEvent
-- @realm shared
function CreateNetworkEvent() end
--- RemoveItem
-- @realm shared
-- @tparam Item item
function RemoveItem(item) end
--- ServerEventRead
-- @realm shared
-- @tparam IReadMessage msg
-- @tparam Client c
function ServerEventRead(msg, c) end
--- ServerEventWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam Client c
-- @tparam IData extraData
function ServerEventWrite(msg, c, extraData) end
--- Contains
-- @realm shared
-- @tparam Item item
-- @treturn bool
function Contains(item) end
--- FirstOrDefault
-- @realm shared
-- @treturn Item
function FirstOrDefault() end
--- LastOrDefault
-- @realm shared
-- @treturn Item
function LastOrDefault() end
--- GetItemAt
-- @realm shared
-- @tparam number index
-- @treturn Item
function GetItemAt(index) end
--- GetItemsAt
-- @realm shared
-- @tparam number index
-- @treturn Enumerable
function GetItemsAt(index) end
--- FindIndex
-- @realm shared
-- @tparam Item item
-- @treturn number
function FindIndex(item) end
--- FindIndices
-- @realm shared
-- @tparam Item item
-- @treturn table
function FindIndices(item) end
--- ItemOwnsSelf
-- @realm shared
-- @tparam Item item
-- @treturn bool
function ItemOwnsSelf(item) end
--- CanBePut
-- @realm shared
-- @tparam Item item
-- @treturn bool
function CanBePut(item) end
--- CanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Nullable`1 condition
-- @tparam Nullable`1 quality
-- @treturn bool
function CanBePut(itemPrefab, condition, quality) end
--- HowManyCanBePut
-- @realm shared
-- @tparam ItemPrefab itemPrefab
-- @tparam Nullable`1 condition
-- @treturn number
function HowManyCanBePut(itemPrefab, condition) end
--- IsEmpty
-- @realm shared
-- @treturn bool
function IsEmpty() end
--- FindItem
-- @realm shared
-- @tparam function predicate
-- @tparam bool recursive
-- @treturn Item
function FindItem(predicate, recursive) end
--- FindAllItems
-- @realm shared
-- @tparam function predicate
-- @tparam bool recursive
-- @tparam table list
-- @treturn table
function FindAllItems(predicate, recursive, list) end
--- FindItemByTag
-- @realm shared
-- @tparam Identifier tag
-- @tparam bool recursive
-- @treturn Item
function FindItemByTag(tag, recursive) end
--- FindItemByIdentifier
-- @realm shared
-- @tparam Identifier identifier
-- @tparam bool recursive
-- @treturn Item
function FindItemByIdentifier(identifier, recursive) end
--- ForceToSlot
-- @realm shared
-- @tparam Item item
-- @tparam number index
function ForceToSlot(item, index) end
--- ForceRemoveFromSlot
-- @realm shared
-- @tparam Item item
-- @tparam number index
function ForceRemoveFromSlot(item, index) end
--- SharedRead
-- @realm shared
-- @tparam IReadMessage msg
-- @tparam List`1[]& newItemIds
function SharedRead(msg, newItemIds) end
--- SharedWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam IData extraData
function SharedWrite(msg, extraData) end
--- DeleteAllItems
-- @realm shared
function DeleteAllItems() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Container, Field of type ItemContainer
-- @realm shared
-- @ItemContainer Container
---
-- AllItems, Field of type Enumerable
-- @realm shared
-- @Enumerable AllItems
---
-- AllItemsMod, Field of type Enumerable
-- @realm shared
-- @Enumerable AllItemsMod
---
-- Capacity, Field of type number
-- @realm shared
-- @number Capacity
---
-- Owner, Field of type Entity
-- @realm shared
-- @Entity Owner
---
-- Locked, Field of type bool
-- @realm shared
-- @bool Locked
---
-- AllowSwappingContainedItems, Field of type bool
-- @realm shared
-- @bool AllowSwappingContainedItems

View File

@@ -1,628 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma ItemPrefab class with some additional functions and fields
Barotrauma source code: [ItemPrefab.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Items/ItemPrefab.cs)
]]
-- @code ItemPrefab
-- @pragma nostrip
local ItemPrefab = {}
--- Add ItemPrefab to spawn queue and spawns it at the specified position
-- @tparam ItemPrefab itemPrefab
-- @tparam Vector2 position
-- @tparam function spawned
-- @realm server
function ItemPrefab.AddToSpawnQueue(itemPrefab, position, spawned) end
--- Add ItemPrefab to spawn queue and spawns it inside the specified inventory
-- @tparam ItemPrefab itemPrefab
-- @tparam Inventory inventory
-- @tparam function spawned
-- @realm server
function ItemPrefab.AddToSpawnQueue(itemPrefab, inventory, spawned) end
--- Get a item prefab via name or id
-- @tparam string itemNameOrId
-- @treturn ItemPrefab
-- @realm shared
function ItemPrefab.GetItemPrefab(itemNameOrId) end
---
-- Identifier, the identifier of the prefab.
-- @realm shared
-- @string Identifier
--- GenerateLegacyIdentifier
-- @realm shared
-- @tparam string name
-- @treturn Identifier
function ItemPrefab.GenerateLegacyIdentifier(name) end
--- GetTreatmentSuitability
-- @realm shared
-- @tparam Identifier treatmentIdentifier
-- @treturn number
function GetTreatmentSuitability(treatmentIdentifier) end
--- GetPriceInfo
-- @realm shared
-- @tparam StoreInfo store
-- @treturn PriceInfo
function GetPriceInfo(store) end
--- CanBeBoughtFrom
-- @realm shared
-- @tparam StoreInfo store
-- @tparam PriceInfo& priceInfo
-- @treturn bool
function CanBeBoughtFrom(store, priceInfo) end
--- CanBeBoughtFrom
-- @realm shared
-- @tparam Location location
-- @treturn bool
function CanBeBoughtFrom(location) end
--- GetMinPrice
-- @realm shared
-- @treturn Nullable`1
function GetMinPrice() end
--- GetBuyPricesUnder
-- @realm shared
-- @tparam number maxCost
-- @treturn ImmutableDictionary`2
function GetBuyPricesUnder(maxCost) end
--- GetSellPricesOver
-- @realm shared
-- @tparam number minCost
-- @tparam bool sellingImportant
-- @treturn ImmutableDictionary`2
function GetSellPricesOver(minCost, sellingImportant) end
--- Find
-- @realm shared
-- @tparam string name
-- @tparam Identifier identifier
-- @treturn ItemPrefab
function ItemPrefab.Find(name, identifier) end
--- IsContainerPreferred
-- @realm shared
-- @tparam Item item
-- @tparam ItemContainer targetContainer
-- @tparam Boolean& isPreferencesDefined
-- @tparam Boolean& isSecondary
-- @tparam bool requireConditionRequirement
-- @treturn bool
function IsContainerPreferred(item, targetContainer, isPreferencesDefined, isSecondary, requireConditionRequirement) end
--- IsContainerPreferred
-- @realm shared
-- @tparam Item item
-- @tparam Identifier[] identifiersOrTags
-- @tparam Boolean& isPreferencesDefined
-- @tparam Boolean& isSecondary
-- @treturn bool
function IsContainerPreferred(item, identifiersOrTags, isPreferencesDefined, isSecondary) end
--- IsContainerPreferred
-- @realm shared
-- @tparam Enumerable preferences
-- @tparam ItemContainer c
-- @treturn bool
function ItemPrefab.IsContainerPreferred(preferences, c) end
--- IsContainerPreferred
-- @realm shared
-- @tparam Enumerable preferences
-- @tparam Enumerable ids
-- @treturn bool
function ItemPrefab.IsContainerPreferred(preferences, ids) end
--- Dispose
-- @realm shared
function Dispose() end
--- InheritFrom
-- @realm shared
-- @tparam ItemPrefab parent
function InheritFrom(parent) end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- GetItemPrefab
-- @realm shared
-- @tparam string itemNameOrId
-- @treturn ItemPrefab
function ItemPrefab.GetItemPrefab(itemNameOrId) end
--- GetItemNameTextId
-- @realm shared
-- @treturn string
function GetItemNameTextId() end
--- GetHullNameTextId
-- @realm shared
-- @treturn string
function GetHullNameTextId() end
--- GetAllowedUpgrades
-- @realm shared
-- @treturn Enumerable
function GetAllowedUpgrades() end
--- HasSubCategory
-- @realm shared
-- @tparam string subcategory
-- @treturn bool
function HasSubCategory(subcategory) end
--- DebugCreateInstance
-- @realm shared
function DebugCreateInstance() end
--- NameMatches
-- @realm shared
-- @tparam string name
-- @tparam StringComparison comparisonType
-- @treturn bool
function NameMatches(name, comparisonType) end
--- NameMatches
-- @realm shared
-- @tparam Enumerable allowedNames
-- @tparam StringComparison comparisonType
-- @treturn bool
function NameMatches(allowedNames, comparisonType) end
--- IsLinkAllowed
-- @realm shared
-- @tparam MapEntityPrefab target
-- @treturn bool
function IsLinkAllowed(target) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Size, Field of type Vector2
-- @realm shared
-- @Vector2 Size
---
-- DefaultPrice, Field of type PriceInfo
-- @realm shared
-- @PriceInfo DefaultPrice
---
-- CanBeBought, Field of type bool
-- @realm shared
-- @bool CanBeBought
---
-- CanBeSold, Field of type bool
-- @realm shared
-- @bool CanBeSold
---
-- Triggers, Field of type ImmutableArray`1
-- @realm shared
-- @ImmutableArray`1 Triggers
---
-- IsOverride, Field of type bool
-- @realm shared
-- @bool IsOverride
---
-- ConfigElement, Field of type ContentXElement
-- @realm shared
-- @ContentXElement ConfigElement
---
-- DeconstructItems, Field of type ImmutableArray`1
-- @realm shared
-- @ImmutableArray`1 DeconstructItems
---
-- FabricationRecipes, Field of type ImmutableDictionary`2
-- @realm shared
-- @ImmutableDictionary`2 FabricationRecipes
---
-- DeconstructTime, Field of type number
-- @realm shared
-- @number DeconstructTime
---
-- AllowDeconstruct, Field of type bool
-- @realm shared
-- @bool AllowDeconstruct
---
-- PreferredContainers, Field of type ImmutableArray`1
-- @realm shared
-- @ImmutableArray`1 PreferredContainers
---
-- SwappableItem, Field of type SwappableItem
-- @realm shared
-- @SwappableItem SwappableItem
---
-- LevelCommonness, Field of type ImmutableDictionary`2
-- @realm shared
-- @ImmutableDictionary`2 LevelCommonness
---
-- LevelQuantity, Field of type ImmutableDictionary`2
-- @realm shared
-- @ImmutableDictionary`2 LevelQuantity
---
-- CanSpriteFlipX, Field of type bool
-- @realm shared
-- @bool CanSpriteFlipX
---
-- CanSpriteFlipY, Field of type bool
-- @realm shared
-- @bool CanSpriteFlipY
---
-- AllowAsExtraCargo, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 AllowAsExtraCargo
---
-- RandomDeconstructionOutput, Field of type bool
-- @realm shared
-- @bool RandomDeconstructionOutput
---
-- RandomDeconstructionOutputAmount, Field of type number
-- @realm shared
-- @number RandomDeconstructionOutputAmount
---
-- Sprite, Field of type Sprite
-- @realm shared
-- @Sprite Sprite
---
-- OriginalName, Field of type string
-- @realm shared
-- @string OriginalName
---
-- Name, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Name
---
-- Tags, Field of type ImmutableHashSet`1
-- @realm shared
-- @ImmutableHashSet`1 Tags
---
-- AllowedLinks, Field of type ImmutableHashSet`1
-- @realm shared
-- @ImmutableHashSet`1 AllowedLinks
---
-- Category, Field of type MapEntityCategory
-- @realm shared
-- @MapEntityCategory Category
---
-- Aliases, Field of type ImmutableHashSet`1
-- @realm shared
-- @ImmutableHashSet`1 Aliases
---
-- InteractDistance, Field of type number
-- @realm shared
-- @number InteractDistance
---
-- InteractPriority, Field of type number
-- @realm shared
-- @number InteractPriority
---
-- InteractThroughWalls, Field of type bool
-- @realm shared
-- @bool InteractThroughWalls
---
-- HideConditionBar, Field of type bool
-- @realm shared
-- @bool HideConditionBar
---
-- HideConditionInTooltip, Field of type bool
-- @realm shared
-- @bool HideConditionInTooltip
---
-- RequireBodyInsideTrigger, Field of type bool
-- @realm shared
-- @bool RequireBodyInsideTrigger
---
-- RequireCursorInsideTrigger, Field of type bool
-- @realm shared
-- @bool RequireCursorInsideTrigger
---
-- RequireCampaignInteract, Field of type bool
-- @realm shared
-- @bool RequireCampaignInteract
---
-- FocusOnSelected, Field of type bool
-- @realm shared
-- @bool FocusOnSelected
---
-- OffsetOnSelected, Field of type number
-- @realm shared
-- @number OffsetOnSelected
---
-- Health, Field of type number
-- @realm shared
-- @number Health
---
-- AllowSellingWhenBroken, Field of type bool
-- @realm shared
-- @bool AllowSellingWhenBroken
---
-- Indestructible, Field of type bool
-- @realm shared
-- @bool Indestructible
---
-- DamagedByExplosions, Field of type bool
-- @realm shared
-- @bool DamagedByExplosions
---
-- ExplosionDamageMultiplier, Field of type number
-- @realm shared
-- @number ExplosionDamageMultiplier
---
-- DamagedByProjectiles, Field of type bool
-- @realm shared
-- @bool DamagedByProjectiles
---
-- DamagedByMeleeWeapons, Field of type bool
-- @realm shared
-- @bool DamagedByMeleeWeapons
---
-- DamagedByRepairTools, Field of type bool
-- @realm shared
-- @bool DamagedByRepairTools
---
-- DamagedByMonsters, Field of type bool
-- @realm shared
-- @bool DamagedByMonsters
---
-- FireProof, Field of type bool
-- @realm shared
-- @bool FireProof
---
-- WaterProof, Field of type bool
-- @realm shared
-- @bool WaterProof
---
-- ImpactTolerance, Field of type number
-- @realm shared
-- @number ImpactTolerance
---
-- OnDamagedThreshold, Field of type number
-- @realm shared
-- @number OnDamagedThreshold
---
-- SonarSize, Field of type number
-- @realm shared
-- @number SonarSize
---
-- UseInHealthInterface, Field of type bool
-- @realm shared
-- @bool UseInHealthInterface
---
-- DisableItemUsageWhenSelected, Field of type bool
-- @realm shared
-- @bool DisableItemUsageWhenSelected
---
-- CargoContainerIdentifier, Field of type string
-- @realm shared
-- @string CargoContainerIdentifier
---
-- UseContainedSpriteColor, Field of type bool
-- @realm shared
-- @bool UseContainedSpriteColor
---
-- UseContainedInventoryIconColor, Field of type bool
-- @realm shared
-- @bool UseContainedInventoryIconColor
---
-- AddedRepairSpeedMultiplier, Field of type number
-- @realm shared
-- @number AddedRepairSpeedMultiplier
---
-- AddedPickingSpeedMultiplier, Field of type number
-- @realm shared
-- @number AddedPickingSpeedMultiplier
---
-- CannotRepairFail, Field of type bool
-- @realm shared
-- @bool CannotRepairFail
---
-- EquipConfirmationText, Field of type string
-- @realm shared
-- @string EquipConfirmationText
---
-- AllowRotatingInEditor, Field of type bool
-- @realm shared
-- @bool AllowRotatingInEditor
---
-- ShowContentsInTooltip, Field of type bool
-- @realm shared
-- @bool ShowContentsInTooltip
---
-- CanFlipX, Field of type bool
-- @realm shared
-- @bool CanFlipX
---
-- CanFlipY, Field of type bool
-- @realm shared
-- @bool CanFlipY
---
-- IsDangerous, Field of type bool
-- @realm shared
-- @bool IsDangerous
---
-- MaxStackSize, Field of type number
-- @realm shared
-- @number MaxStackSize
---
-- AllowDroppingOnSwap, Field of type bool
-- @realm shared
-- @bool AllowDroppingOnSwap
---
-- AllowDroppingOnSwapWith, Field of type ImmutableHashSet`1
-- @realm shared
-- @ImmutableHashSet`1 AllowDroppingOnSwapWith
---
-- VariantOf, Field of type Identifier
-- @realm shared
-- @Identifier VariantOf
---
-- ResizeHorizontal, Field of type bool
-- @realm shared
-- @bool ResizeHorizontal
---
-- ResizeVertical, Field of type bool
-- @realm shared
-- @bool ResizeVertical
---
-- Description, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Description
---
-- AllowedUpgrades, Field of type string
-- @realm shared
-- @string AllowedUpgrades
---
-- HideInMenus, Field of type bool
-- @realm shared
-- @bool HideInMenus
---
-- Subcategory, Field of type string
-- @realm shared
-- @string Subcategory
---
-- Linkable, Field of type bool
-- @realm shared
-- @bool Linkable
---
-- SpriteColor, Field of type Color
-- @realm shared
-- @Color SpriteColor
---
-- Scale, Field of type number
-- @realm shared
-- @number Scale
---
-- UintIdentifier, Field of type number
-- @realm shared
-- @number UintIdentifier
---
-- ContentPackage, Field of type ContentPackage
-- @realm shared
-- @ContentPackage ContentPackage
---
-- FilePath, Field of type ContentPath
-- @realm shared
-- @ContentPath FilePath
---
-- ItemPrefab.Prefabs, Field of type PrefabCollection`1
-- @realm shared
-- @PrefabCollection`1 ItemPrefab.Prefabs
---
-- Identifier, Field of type Identifier
-- @realm shared
-- @Identifier Identifier
---
-- ContentFile, Field of type ContentFile
-- @realm shared
-- @ContentFile ContentFile

View File

@@ -1,106 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma Job class with some additional functions and fields
Barotrauma source code: [Job.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Characters/Jobs/Job.cs)
]]
-- @code Job
-- @pragma nostrip
local Job = {}
--- Random
-- @realm shared
-- @tparam RandSync randSync
-- @treturn Job
function Job.Random(randSync) end
--- GetSkills
-- @realm shared
-- @treturn Enumerable
function GetSkills() end
--- GetSkillLevel
-- @realm shared
-- @tparam Identifier skillIdentifier
-- @treturn number
function GetSkillLevel(skillIdentifier) end
--- GetSkill
-- @realm shared
-- @tparam Identifier skillIdentifier
-- @treturn Skill
function GetSkill(skillIdentifier) end
--- OverrideSkills
-- @realm shared
-- @tparam table newSkills
function OverrideSkills(newSkills) end
--- IncreaseSkillLevel
-- @realm shared
-- @tparam Identifier skillIdentifier
-- @tparam number increase
-- @tparam bool increasePastMax
function IncreaseSkillLevel(skillIdentifier, increase, increasePastMax) end
--- GiveJobItems
-- @realm shared
-- @tparam Character character
-- @tparam WayPoint spawnPoint
function GiveJobItems(character, spawnPoint) end
--- Save
-- @realm shared
-- @tparam XElement parentElement
-- @treturn XElement
function Save(parentElement) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Name, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Name
---
-- Description, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Description
---
-- Prefab, Field of type JobPrefab
-- @realm shared
-- @JobPrefab Prefab
---
-- PrimarySkill, Field of type Skill
-- @realm shared
-- @Skill PrimarySkill
---
-- Variant, Field of type number
-- @realm shared
-- @number Variant

View File

@@ -1,214 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma JobPrefab class with some additional functions and fields
Barotrauma source code: [JobPrefab.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Characters/Jobs/JobPrefab.cs)
]]
-- @code JobPrefab
-- @pragma nostrip
local JobPrefab = {}
--- Dispose
-- @realm shared
function Dispose() end
--- Get
-- @realm shared
-- @tparam string identifier
-- @treturn JobPrefab
function JobPrefab.Get(identifier) end
--- Random
-- @realm shared
-- @tparam RandSync sync
-- @treturn JobPrefab
function JobPrefab.Random(sync) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- JobPrefab.ItemRepairPriorities, Field of type IReadOnlyDictionary`2
-- @realm shared
-- @IReadOnlyDictionary`2 JobPrefab.ItemRepairPriorities
---
-- UIColor, Field of type Color
-- @realm shared
-- @Color UIColor
---
-- IdleBehavior, Field of type BehaviorType
-- @realm shared
-- @BehaviorType IdleBehavior
---
-- OnlyJobSpecificDialog, Field of type bool
-- @realm shared
-- @bool OnlyJobSpecificDialog
---
-- InitialCount, Field of type number
-- @realm shared
-- @number InitialCount
---
-- AllowAlways, Field of type bool
-- @realm shared
-- @bool AllowAlways
---
-- MaxNumber, Field of type number
-- @realm shared
-- @number MaxNumber
---
-- MinNumber, Field of type number
-- @realm shared
-- @number MinNumber
---
-- MinKarma, Field of type number
-- @realm shared
-- @number MinKarma
---
-- PriceMultiplier, Field of type number
-- @realm shared
-- @number PriceMultiplier
---
-- Commonness, Field of type number
-- @realm shared
-- @number Commonness
---
-- VitalityModifier, Field of type number
-- @realm shared
-- @number VitalityModifier
---
-- HiddenJob, Field of type bool
-- @realm shared
-- @bool HiddenJob
---
-- PrimarySkill, Field of type SkillPrefab
-- @realm shared
-- @SkillPrefab PrimarySkill
---
-- Element, Field of type ContentXElement
-- @realm shared
-- @ContentXElement Element
---
-- ClothingElement, Field of type ContentXElement
-- @realm shared
-- @ContentXElement ClothingElement
---
-- Variants, Field of type number
-- @realm shared
-- @number Variants
---
-- UintIdentifier, Field of type number
-- @realm shared
-- @number UintIdentifier
---
-- ContentPackage, Field of type ContentPackage
-- @realm shared
-- @ContentPackage ContentPackage
---
-- FilePath, Field of type ContentPath
-- @realm shared
-- @ContentPath FilePath
---
-- ItemSets, Field of type table
-- @realm shared
-- @table ItemSets
---
-- PreviewItems, Field of type ImmutableDictionary`2
-- @realm shared
-- @ImmutableDictionary`2 PreviewItems
---
-- Skills, Field of type table
-- @realm shared
-- @table Skills
---
-- AutonomousObjectives, Field of type table
-- @realm shared
-- @table AutonomousObjectives
---
-- AppropriateOrders, Field of type table
-- @realm shared
-- @table AppropriateOrders
---
-- Name, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Name
---
-- Description, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Description
---
-- Icon, Field of type Sprite
-- @realm shared
-- @Sprite Icon
---
-- IconSmall, Field of type Sprite
-- @realm shared
-- @Sprite IconSmall
---
-- JobPrefab.Prefabs, Field of type PrefabCollection`1
-- @realm shared
-- @PrefabCollection`1 JobPrefab.Prefabs
---
-- JobPrefab.NoJobElement, Field of type ContentXElement
-- @realm shared
-- @ContentXElement JobPrefab.NoJobElement
---
-- Identifier, Field of type Identifier
-- @realm shared
-- @Identifier Identifier
---
-- ContentFile, Field of type ContentFile
-- @realm shared
-- @ContentFile ContentFile

View File

@@ -1,559 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.Level
]]
-- @code Level
-- @pragma nostrip
local Level = {}
--- GenerateMissionResources
-- @realm shared
-- @tparam ItemPrefab prefab
-- @tparam number requiredAmount
-- @tparam Single& rotation
-- @treturn table
function GenerateMissionResources(prefab, requiredAmount, rotation) end
--- GetRandomItemPos
-- @realm shared
-- @tparam PositionType spawnPosType
-- @tparam number randomSpread
-- @tparam number minDistFromSubs
-- @tparam number offsetFromWall
-- @tparam function filter
-- @treturn Vector2
function GetRandomItemPos(spawnPosType, randomSpread, minDistFromSubs, offsetFromWall, filter) end
--- TryGetInterestingPositionAwayFromPoint
-- @realm shared
-- @tparam bool useSyncedRand
-- @tparam PositionType positionType
-- @tparam number minDistFromSubs
-- @tparam Vector2& position
-- @tparam Vector2 awayPoint
-- @tparam number minDistFromPoint
-- @tparam function filter
-- @treturn bool
function TryGetInterestingPositionAwayFromPoint(useSyncedRand, positionType, minDistFromSubs, position, awayPoint, minDistFromPoint, filter) end
--- TryGetInterestingPosition
-- @realm shared
-- @tparam bool useSyncedRand
-- @tparam PositionType positionType
-- @tparam number minDistFromSubs
-- @tparam Vector2& position
-- @tparam function filter
-- @treturn bool
function TryGetInterestingPosition(useSyncedRand, positionType, minDistFromSubs, position, filter) end
--- TryGetInterestingPosition
-- @realm shared
-- @tparam bool useSyncedRand
-- @tparam PositionType positionType
-- @tparam number minDistFromSubs
-- @tparam Point& position
-- @tparam Vector2 awayPoint
-- @tparam number minDistFromPoint
-- @tparam function filter
-- @treturn bool
function TryGetInterestingPosition(useSyncedRand, positionType, minDistFromSubs, position, awayPoint, minDistFromPoint, filter) end
--- Update
-- @realm shared
-- @tparam number deltaTime
-- @tparam Camera cam
function Update(deltaTime, cam) end
--- GetBottomPosition
-- @realm shared
-- @tparam number xPosition
-- @treturn Vector2
function GetBottomPosition(xPosition) end
--- GetAllCells
-- @realm shared
-- @treturn table
function GetAllCells() end
--- GetCells
-- @realm shared
-- @tparam Vector2 worldPos
-- @tparam number searchDepth
-- @treturn table
function GetCells(worldPos, searchDepth) end
--- GetClosestCell
-- @realm shared
-- @tparam Vector2 worldPos
-- @treturn VoronoiCell
function GetClosestCell(worldPos) end
--- IsCloseToStart
-- @realm shared
-- @tparam Vector2 position
-- @tparam number minDist
-- @treturn bool
function IsCloseToStart(position, minDist) end
--- IsCloseToEnd
-- @realm shared
-- @tparam Vector2 position
-- @tparam number minDist
-- @treturn bool
function IsCloseToEnd(position, minDist) end
--- IsCloseToStart
-- @realm shared
-- @tparam Point position
-- @tparam number minDist
-- @treturn bool
function IsCloseToStart(position, minDist) end
--- IsCloseToEnd
-- @realm shared
-- @tparam Point position
-- @tparam number minDist
-- @treturn bool
function IsCloseToEnd(position, minDist) end
--- PrepareBeaconStation
-- @realm shared
function PrepareBeaconStation() end
--- CheckBeaconActive
-- @realm shared
-- @treturn bool
function CheckBeaconActive() end
--- SpawnCorpses
-- @realm shared
function SpawnCorpses() end
--- SpawnNPCs
-- @realm shared
function SpawnNPCs() end
--- GetRealWorldDepth
-- @realm shared
-- @tparam number worldPositionY
-- @treturn number
function GetRealWorldDepth(worldPositionY) end
--- DebugSetStartLocation
-- @realm shared
-- @tparam Location newStartLocation
function DebugSetStartLocation(newStartLocation) end
--- DebugSetEndLocation
-- @realm shared
-- @tparam Location newEndLocation
function DebugSetEndLocation(newEndLocation) end
--- Remove
-- @realm shared
function Remove() end
--- ServerEventWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam Client c
-- @tparam IData extraData
function ServerEventWrite(msg, c, extraData) end
--- Generate
-- @realm shared
-- @tparam LevelData levelData
-- @tparam bool mirror
-- @tparam SubmarineInfo startOutpost
-- @tparam SubmarineInfo endOutpost
-- @treturn Level
function Level.Generate(levelData, mirror, startOutpost, endOutpost) end
--- GetTooCloseCells
-- @realm shared
-- @tparam Vector2 position
-- @tparam number minDistance
-- @treturn table
function GetTooCloseCells(position, minDistance) end
--- FreeID
-- @realm shared
function FreeID() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Level.Loaded, Field of type Level
-- @realm shared
-- @Level Level.Loaded
---
-- AbyssArea, Field of type Rectangle
-- @realm shared
-- @Rectangle AbyssArea
---
-- AbyssStart, Field of type number
-- @realm shared
-- @number AbyssStart
---
-- AbyssEnd, Field of type number
-- @realm shared
-- @number AbyssEnd
---
-- StartPosition, Field of type Vector2
-- @realm shared
-- @Vector2 StartPosition
---
-- StartExitPosition, Field of type Vector2
-- @realm shared
-- @Vector2 StartExitPosition
---
-- Size, Field of type Point
-- @realm shared
-- @Point Size
---
-- EndPosition, Field of type Vector2
-- @realm shared
-- @Vector2 EndPosition
---
-- EndExitPosition, Field of type Vector2
-- @realm shared
-- @Vector2 EndExitPosition
---
-- BottomPos, Field of type number
-- @realm shared
-- @number BottomPos
---
-- SeaFloorTopPos, Field of type number
-- @realm shared
-- @number SeaFloorTopPos
---
-- CrushDepth, Field of type number
-- @realm shared
-- @number CrushDepth
---
-- RealWorldCrushDepth, Field of type number
-- @realm shared
-- @number RealWorldCrushDepth
---
-- SeaFloor, Field of type LevelWall
-- @realm shared
-- @LevelWall SeaFloor
---
-- Ruins, Field of type table
-- @realm shared
-- @table Ruins
---
-- Wrecks, Field of type table
-- @realm shared
-- @table Wrecks
---
-- BeaconStation, Field of type Submarine
-- @realm shared
-- @Submarine BeaconStation
---
-- ExtraWalls, Field of type table
-- @realm shared
-- @table ExtraWalls
---
-- UnsyncedExtraWalls, Field of type table
-- @realm shared
-- @table UnsyncedExtraWalls
---
-- Tunnels, Field of type table
-- @realm shared
-- @table Tunnels
---
-- Caves, Field of type table
-- @realm shared
-- @table Caves
---
-- PositionsOfInterest, Field of type table
-- @realm shared
-- @table PositionsOfInterest
---
-- StartOutpost, Field of type Submarine
-- @realm shared
-- @Submarine StartOutpost
---
-- EndOutpost, Field of type Submarine
-- @realm shared
-- @Submarine EndOutpost
---
-- EqualityCheckValues, Field of type table
-- @realm shared
-- @table EqualityCheckValues
---
-- EntitiesBeforeGenerate, Field of type table
-- @realm shared
-- @table EntitiesBeforeGenerate
---
-- EntityCountBeforeGenerate, Field of type number
-- @realm shared
-- @number EntityCountBeforeGenerate
---
-- EntityCountAfterGenerate, Field of type number
-- @realm shared
-- @number EntityCountAfterGenerate
---
-- TopBarrier, Field of type Body
-- @realm shared
-- @Body TopBarrier
---
-- BottomBarrier, Field of type Body
-- @realm shared
-- @Body BottomBarrier
---
-- LevelObjectManager, Field of type LevelObjectManager
-- @realm shared
-- @LevelObjectManager LevelObjectManager
---
-- Generating, Field of type bool
-- @realm shared
-- @bool Generating
---
-- StartLocation, Field of type Location
-- @realm shared
-- @Location StartLocation
---
-- EndLocation, Field of type Location
-- @realm shared
-- @Location EndLocation
---
-- Mirrored, Field of type bool
-- @realm shared
-- @bool Mirrored
---
-- Seed, Field of type string
-- @realm shared
-- @string Seed
---
-- Difficulty, Field of type number
-- @realm shared
-- @number Difficulty
---
-- Type, Field of type LevelType
-- @realm shared
-- @LevelType Type
---
-- Level.IsLoadedOutpost, Field of type bool
-- @realm shared
-- @bool Level.IsLoadedOutpost
---
-- GenerationParams, Field of type LevelGenerationParams
-- @realm shared
-- @LevelGenerationParams GenerationParams
---
-- BackgroundTextureColor, Field of type Color
-- @realm shared
-- @Color BackgroundTextureColor
---
-- BackgroundColor, Field of type Color
-- @realm shared
-- @Color BackgroundColor
---
-- WallColor, Field of type Color
-- @realm shared
-- @Color WallColor
---
-- PathPoints, Field of type table
-- @realm shared
-- @table PathPoints
---
-- AbyssResources, Field of type table
-- @realm shared
-- @table AbyssResources
---
-- Removed, Field of type bool
-- @realm shared
-- @bool Removed
---
-- IdFreed, Field of type bool
-- @realm shared
-- @bool IdFreed
---
-- SimPosition, Field of type Vector2
-- @realm shared
-- @Vector2 SimPosition
---
-- Position, Field of type Vector2
-- @realm shared
-- @Vector2 Position
---
-- WorldPosition, Field of type Vector2
-- @realm shared
-- @Vector2 WorldPosition
---
-- DrawPosition, Field of type Vector2
-- @realm shared
-- @Vector2 DrawPosition
---
-- Submarine, Field of type Submarine
-- @realm shared
-- @Submarine Submarine
---
-- AiTarget, Field of type AITarget
-- @realm shared
-- @AITarget AiTarget
---
-- InDetectable, Field of type bool
-- @realm shared
-- @bool InDetectable
---
-- SpawnTime, Field of type number
-- @realm shared
-- @number SpawnTime
---
-- ErrorLine, Field of type string
-- @realm shared
-- @string ErrorLine
---
-- AbyssIslands, Field of type table
-- @realm shared
-- @table AbyssIslands
---
-- siteCoordsX, Field of type table
-- @realm shared
-- @table siteCoordsX
---
-- siteCoordsY, Field of type table
-- @realm shared
-- @table siteCoordsY
---
-- distanceField, Field of type table
-- @realm shared
-- @table distanceField
---
-- LevelData, Field of type LevelData
-- @realm shared
-- @LevelData LevelData
---
-- Level.ForcedDifficulty, Field of type Nullable`1
-- @realm shared
-- @Nullable`1 Level.ForcedDifficulty
---
-- Level.MaxEntityDepth, Field of type number
-- @realm shared
-- @number Level.MaxEntityDepth
---
-- Level.ShaftHeight, Field of type number
-- @realm shared
-- @number Level.ShaftHeight
---
-- Level.MaxSubmarineWidth, Field of type number
-- @realm shared
-- @number Level.MaxSubmarineWidth
---
-- Level.ExitDistance, Field of type number
-- @realm shared
-- @number Level.ExitDistance
---
-- Level.GridCellSize, Field of type number
-- @realm shared
-- @number Level.GridCellSize
---
-- Level.DefaultRealWorldCrushDepth, Field of type number
-- @realm shared
-- @number Level.DefaultRealWorldCrushDepth
---
-- ID, Field of type number
-- @realm shared
-- @number ID
---
-- CreationStackTrace, Field of type string
-- @realm shared
-- @string CreationStackTrace
---
-- CreationIndex, Field of type number
-- @realm shared
-- @number CreationIndex

View File

@@ -1,167 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.NetLobbyScreen
]]
-- @code Game.NetLobbyScreen
-- @pragma nostrip
local NetLobbyScreen = {}
--- ChangeServerName
-- @realm shared
-- @tparam string n
function ChangeServerName(n) end
--- ChangeServerMessage
-- @realm shared
-- @tparam string m
function ChangeServerMessage(m) end
--- GetSubList
-- @realm shared
-- @treturn IReadOnlyList`1
function GetSubList() end
--- AddSub
-- @realm shared
-- @tparam SubmarineInfo sub
function AddSub(sub) end
--- ToggleCampaignMode
-- @realm shared
-- @tparam bool enabled
function ToggleCampaignMode(enabled) end
--- Select
-- @realm shared
function Select() end
--- RandomizeSettings
-- @realm shared
function RandomizeSettings() end
--- SetLevelDifficulty
-- @realm shared
-- @tparam number difficulty
function SetLevelDifficulty(difficulty) end
--- ToggleTraitorsEnabled
-- @realm shared
-- @tparam number dir
function ToggleTraitorsEnabled(dir) end
--- SetBotCount
-- @realm shared
-- @tparam number botCount
function SetBotCount(botCount) end
--- SetBotSpawnMode
-- @realm shared
-- @tparam BotSpawnMode botSpawnMode
function SetBotSpawnMode(botSpawnMode) end
--- SetTraitorsEnabled
-- @realm shared
-- @tparam YesNoMaybe enabled
function SetTraitorsEnabled(enabled) end
--- Deselect
-- @realm shared
function Deselect() end
--- Update
-- @realm shared
-- @tparam number deltaTime
function Update(deltaTime) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- SelectedSub, Field of type SubmarineInfo
-- @realm shared
-- @SubmarineInfo SelectedSub
---
-- SelectedShuttle, Field of type SubmarineInfo
-- @realm shared
-- @SubmarineInfo SelectedShuttle
---
-- GameModes, Field of type GameModePreset[]
-- @realm shared
-- @GameModePreset[] GameModes
---
-- SelectedModeIndex, Field of type number
-- @realm shared
-- @number SelectedModeIndex
---
-- SelectedModeIdentifier, Field of type Identifier
-- @realm shared
-- @Identifier SelectedModeIdentifier
---
-- SelectedMode, Field of type GameModePreset
-- @realm shared
-- @GameModePreset SelectedMode
---
-- MissionType, Field of type MissionType
-- @realm shared
-- @MissionType MissionType
---
-- MissionTypeName, Field of type string
-- @realm shared
-- @string MissionTypeName
---
-- JobPreferences, Field of type table
-- @realm shared
-- @table JobPreferences
---
-- LevelSeed, Field of type string
-- @realm shared
-- @string LevelSeed
---
-- LastUpdateID, Field of type number
-- @realm shared
-- @number LastUpdateID
---
-- Cam, Field of type Camera
-- @realm shared
-- @Camera Cam
---
-- IsEditor, Field of type bool
-- @realm shared
-- @bool IsEditor
---
-- RadiationEnabled, Field of type bool
-- @realm shared
-- @bool RadiationEnabled

View File

@@ -1,588 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.Networking.ServerSettings
]]
-- @code Game.ServerSettings
-- @pragma nostrip
local ServerSettings = {}
--- ReadMonsterEnabled
-- @realm shared
-- @tparam IReadMessage inc
function ReadMonsterEnabled(inc) end
--- WriteMonsterEnabled
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam table monsterEnabled
function WriteMonsterEnabled(msg, monsterEnabled) end
--- ReadExtraCargo
-- @realm shared
-- @tparam IReadMessage msg
-- @treturn bool
function ReadExtraCargo(msg) end
--- WriteExtraCargo
-- @realm shared
-- @tparam IWriteMessage msg
function WriteExtraCargo(msg) end
--- ReadHiddenSubs
-- @realm shared
-- @tparam IReadMessage msg
function ReadHiddenSubs(msg) end
--- WriteHiddenSubs
-- @realm shared
-- @tparam IWriteMessage msg
function WriteHiddenSubs(msg) end
--- SetPassword
-- @realm shared
-- @tparam string password
function SetPassword(password) end
--- SaltPassword
-- @realm shared
-- @tparam Byte[] password
-- @tparam number salt
-- @treturn Byte[]
function ServerSettings.SaltPassword(password, salt) end
--- IsPasswordCorrect
-- @realm shared
-- @tparam Byte[] input
-- @tparam number salt
-- @treturn bool
function IsPasswordCorrect(input, salt) end
--- UpdateFlag
-- @realm shared
-- @tparam NetFlags flag
function UpdateFlag(flag) end
--- GetRequiredFlags
-- @realm shared
-- @tparam Client c
-- @treturn NetFlags
function GetRequiredFlags(c) end
--- ServerAdminWrite
-- @realm shared
-- @tparam IWriteMessage outMsg
-- @tparam Client c
function ServerAdminWrite(outMsg, c) end
--- ServerWrite
-- @realm shared
-- @tparam IWriteMessage outMsg
-- @tparam Client c
function ServerWrite(outMsg, c) end
--- ServerRead
-- @realm shared
-- @tparam IReadMessage incMsg
-- @tparam Client c
function ServerRead(incMsg, c) end
--- SaveSettings
-- @realm shared
function SaveSettings() end
--- SelectNonHiddenSubmarine
-- @realm shared
-- @tparam string current
-- @treturn string
function SelectNonHiddenSubmarine(current) end
--- LoadClientPermissions
-- @realm shared
function LoadClientPermissions() end
--- SaveClientPermissions
-- @realm shared
function SaveClientPermissions() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- LastPropertyUpdateId, Field of type number
-- @realm shared
-- @number LastPropertyUpdateId
---
-- Name, Field of type string
-- @realm shared
-- @string Name
---
-- SerializableProperties, Field of type table
-- @realm shared
-- @table SerializableProperties
---
-- ServerName, Field of type string
-- @realm shared
-- @string ServerName
---
-- ServerMessageText, Field of type string
-- @realm shared
-- @string ServerMessageText
---
-- MonsterEnabled, Field of type table
-- @realm shared
-- @table MonsterEnabled
---
-- ExtraCargo, Field of type table
-- @realm shared
-- @table ExtraCargo
---
-- HiddenSubs, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 HiddenSubs
---
-- ClientPermissions, Field of type table
-- @realm shared
-- @table ClientPermissions
---
-- Whitelist, Field of type WhiteList
-- @realm shared
-- @WhiteList Whitelist
---
-- TickRate, Field of type number
-- @realm shared
-- @number TickRate
---
-- RandomizeSeed, Field of type bool
-- @realm shared
-- @bool RandomizeSeed
---
-- UseRespawnShuttle, Field of type bool
-- @realm shared
-- @bool UseRespawnShuttle
---
-- RespawnInterval, Field of type number
-- @realm shared
-- @number RespawnInterval
---
-- MaxTransportTime, Field of type number
-- @realm shared
-- @number MaxTransportTime
---
-- MinRespawnRatio, Field of type number
-- @realm shared
-- @number MinRespawnRatio
---
-- AutoRestartInterval, Field of type number
-- @realm shared
-- @number AutoRestartInterval
---
-- StartWhenClientsReady, Field of type bool
-- @realm shared
-- @bool StartWhenClientsReady
---
-- StartWhenClientsReadyRatio, Field of type number
-- @realm shared
-- @number StartWhenClientsReadyRatio
---
-- AllowSpectating, Field of type bool
-- @realm shared
-- @bool AllowSpectating
---
-- SaveServerLogs, Field of type bool
-- @realm shared
-- @bool SaveServerLogs
---
-- AllowModDownloads, Field of type bool
-- @realm shared
-- @bool AllowModDownloads
---
-- AllowRagdollButton, Field of type bool
-- @realm shared
-- @bool AllowRagdollButton
---
-- AllowFileTransfers, Field of type bool
-- @realm shared
-- @bool AllowFileTransfers
---
-- VoiceChatEnabled, Field of type bool
-- @realm shared
-- @bool VoiceChatEnabled
---
-- PlayStyle, Field of type PlayStyle
-- @realm shared
-- @PlayStyle PlayStyle
---
-- LosMode, Field of type LosMode
-- @realm shared
-- @LosMode LosMode
---
-- LinesPerLogFile, Field of type number
-- @realm shared
-- @number LinesPerLogFile
---
-- AutoRestart, Field of type bool
-- @realm shared
-- @bool AutoRestart
---
-- HasPassword, Field of type bool
-- @realm shared
-- @bool HasPassword
---
-- AllowVoteKick, Field of type bool
-- @realm shared
-- @bool AllowVoteKick
---
-- AllowEndVoting, Field of type bool
-- @realm shared
-- @bool AllowEndVoting
---
-- AllowRespawn, Field of type bool
-- @realm shared
-- @bool AllowRespawn
---
-- BotCount, Field of type number
-- @realm shared
-- @number BotCount
---
-- MaxBotCount, Field of type number
-- @realm shared
-- @number MaxBotCount
---
-- BotSpawnMode, Field of type BotSpawnMode
-- @realm shared
-- @BotSpawnMode BotSpawnMode
---
-- DisableBotConversations, Field of type bool
-- @realm shared
-- @bool DisableBotConversations
---
-- SelectedLevelDifficulty, Field of type number
-- @realm shared
-- @number SelectedLevelDifficulty
---
-- AllowDisguises, Field of type bool
-- @realm shared
-- @bool AllowDisguises
---
-- AllowRewiring, Field of type bool
-- @realm shared
-- @bool AllowRewiring
---
-- LockAllDefaultWires, Field of type bool
-- @realm shared
-- @bool LockAllDefaultWires
---
-- AllowLinkingWifiToChat, Field of type bool
-- @realm shared
-- @bool AllowLinkingWifiToChat
---
-- AllowFriendlyFire, Field of type bool
-- @realm shared
-- @bool AllowFriendlyFire
---
-- DestructibleOutposts, Field of type bool
-- @realm shared
-- @bool DestructibleOutposts
---
-- KillableNPCs, Field of type bool
-- @realm shared
-- @bool KillableNPCs
---
-- BanAfterWrongPassword, Field of type bool
-- @realm shared
-- @bool BanAfterWrongPassword
---
-- MaxPasswordRetriesBeforeBan, Field of type number
-- @realm shared
-- @number MaxPasswordRetriesBeforeBan
---
-- SelectedSubmarine, Field of type string
-- @realm shared
-- @string SelectedSubmarine
---
-- SelectedShuttle, Field of type string
-- @realm shared
-- @string SelectedShuttle
---
-- TraitorsEnabled, Field of type YesNoMaybe
-- @realm shared
-- @YesNoMaybe TraitorsEnabled
---
-- TraitorsMinPlayerCount, Field of type number
-- @realm shared
-- @number TraitorsMinPlayerCount
---
-- TraitorsMinStartDelay, Field of type number
-- @realm shared
-- @number TraitorsMinStartDelay
---
-- TraitorsMaxStartDelay, Field of type number
-- @realm shared
-- @number TraitorsMaxStartDelay
---
-- TraitorsMinRestartDelay, Field of type number
-- @realm shared
-- @number TraitorsMinRestartDelay
---
-- TraitorsMaxRestartDelay, Field of type number
-- @realm shared
-- @number TraitorsMaxRestartDelay
---
-- SubSelectionMode, Field of type SelectionMode
-- @realm shared
-- @SelectionMode SubSelectionMode
---
-- ModeSelectionMode, Field of type SelectionMode
-- @realm shared
-- @SelectionMode ModeSelectionMode
---
-- BanList, Field of type BanList
-- @realm shared
-- @BanList BanList
---
-- EndVoteRequiredRatio, Field of type number
-- @realm shared
-- @number EndVoteRequiredRatio
---
-- VoteRequiredRatio, Field of type number
-- @realm shared
-- @number VoteRequiredRatio
---
-- VoteTimeout, Field of type number
-- @realm shared
-- @number VoteTimeout
---
-- KickVoteRequiredRatio, Field of type number
-- @realm shared
-- @number KickVoteRequiredRatio
---
-- KillDisconnectedTime, Field of type number
-- @realm shared
-- @number KillDisconnectedTime
---
-- KickAFKTime, Field of type number
-- @realm shared
-- @number KickAFKTime
---
-- KarmaEnabled, Field of type bool
-- @realm shared
-- @bool KarmaEnabled
---
-- KarmaPreset, Field of type string
-- @realm shared
-- @string KarmaPreset
---
-- GameModeIdentifier, Field of type Identifier
-- @realm shared
-- @Identifier GameModeIdentifier
---
-- MissionType, Field of type string
-- @realm shared
-- @string MissionType
---
-- MaxPlayers, Field of type number
-- @realm shared
-- @number MaxPlayers
---
-- AllowedRandomMissionTypes, Field of type table
-- @realm shared
-- @table AllowedRandomMissionTypes
---
-- AutoBanTime, Field of type number
-- @realm shared
-- @number AutoBanTime
---
-- MaxAutoBanTime, Field of type number
-- @realm shared
-- @number MaxAutoBanTime
---
-- RadiationEnabled, Field of type bool
-- @realm shared
-- @bool RadiationEnabled
---
-- MaxMissionCount, Field of type number
-- @realm shared
-- @number MaxMissionCount
---
-- AllowSubVoting, Field of type bool
-- @realm shared
-- @bool AllowSubVoting
---
-- AllowModeVoting, Field of type bool
-- @realm shared
-- @bool AllowModeVoting
---
-- AllowedClientNameChars, Field of type table
-- @realm shared
-- @table AllowedClientNameChars
---
-- LastUpdateIdForFlag, Field of type table
-- @realm shared
-- @table LastUpdateIdForFlag
---
-- ServerDetailsChanged, Field of type bool
-- @realm shared
-- @bool ServerDetailsChanged
---
-- Port, Field of type number
-- @realm shared
-- @number Port
---
-- QueryPort, Field of type number
-- @realm shared
-- @number QueryPort
---
-- ListenIPAddress, Field of type IPAddress
-- @realm shared
-- @IPAddress ListenIPAddress
---
-- EnableUPnP, Field of type bool
-- @realm shared
-- @bool EnableUPnP
---
-- ServerLog, Field of type ServerLog
-- @realm shared
-- @ServerLog ServerLog
---
-- AutoRestartTimer, Field of type number
-- @realm shared
-- @number AutoRestartTimer
---
-- IsPublic, Field of type bool
-- @realm shared
-- @bool IsPublic
---
-- ServerSettings.ClientPermissionsFile, Field of type string
-- @realm shared
-- @string ServerSettings.ClientPermissionsFile
---
-- ServerSettings.SubmarineSeparatorChar, Field of type Char
-- @realm shared
-- @Char ServerSettings.SubmarineSeparatorChar
---
-- ServerSettings.PermissionPresetFile, Field of type string
-- @realm shared
-- @string ServerSettings.PermissionPresetFile
---
-- ServerSettings.SettingsFile, Field of type string
-- @realm shared
-- @string ServerSettings.SettingsFile
---
-- ServerSettings.MaxExtraCargoItemsOfType, Field of type number
-- @realm shared
-- @number ServerSettings.MaxExtraCargoItemsOfType
---
-- ServerSettings.MaxExtraCargoItemTypes, Field of type number
-- @realm shared
-- @number ServerSettings.MaxExtraCargoItemTypes

View File

@@ -1,623 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma Submarine class with some additional functions and fields
Barotrauma source code: [Submarine.cs](https://github.com/evilfactory/Barotrauma-lua-attempt/blob/master/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs)
Not all fields and methods will work, this doc was autogenerated.
]]
-- @code Submarine
-- @pragma nostrip
local Submarine = {}
--- FindContaining
-- @realm shared
-- @tparam Vector2 position
-- @treturn Submarine
function Submarine.FindContaining(position) end
--- GetBorders
-- @realm shared
-- @tparam XElement submarineElement
-- @treturn Rectangle
function Submarine.GetBorders(submarineElement) end
--- Load
-- @realm shared
-- @tparam SubmarineInfo info
-- @tparam bool unloadPrevious
-- @tparam IdRemap linkedRemap
-- @treturn Submarine
function Submarine.Load(info, unloadPrevious, linkedRemap) end
--- RepositionEntities
-- @realm shared
-- @tparam Vector2 moveAmount
-- @tparam Enumerable entities
function Submarine.RepositionEntities(moveAmount, entities) end
--- SaveToXElement
-- @realm shared
-- @tparam XElement element
function SaveToXElement(element) end
--- TrySaveAs
-- @realm shared
-- @tparam string filePath
-- @tparam MemoryStream previewImage
-- @treturn bool
function TrySaveAs(filePath, previewImage) end
--- Unload
-- @realm shared
function Submarine.Unload() end
--- Remove
-- @realm shared
function Remove() end
--- Dispose
-- @realm shared
function Dispose() end
--- DisableObstructedWayPoints
-- @realm shared
function DisableObstructedWayPoints() end
--- DisableObstructedWayPoints
-- @realm shared
-- @tparam Submarine otherSub
function DisableObstructedWayPoints(otherSub) end
--- EnableObstructedWaypoints
-- @realm shared
-- @tparam Submarine otherSub
function EnableObstructedWaypoints(otherSub) end
--- RefreshOutdoorNodes
-- @realm shared
function RefreshOutdoorNodes() end
--- ServerWritePosition
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam Client c
function ServerWritePosition(msg, c) end
--- ServerEventWrite
-- @realm shared
-- @tparam IWriteMessage msg
-- @tparam Client c
-- @tparam IData extraData
function ServerEventWrite(msg, c, extraData) end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- CalculateBasePrice
-- @realm shared
-- @treturn number
function CalculateBasePrice() end
--- AttemptBallastFloraInfection
-- @realm shared
-- @tparam Identifier identifier
-- @tparam number deltaTime
-- @tparam number probability
function AttemptBallastFloraInfection(identifier, deltaTime, probability) end
--- MakeWreck
-- @realm shared
function MakeWreck() end
--- CreateWreckAI
-- @realm shared
-- @treturn bool
function CreateWreckAI() end
--- DisableWreckAI
-- @realm shared
function DisableWreckAI() end
--- GetDockedBorders
-- @realm shared
-- @tparam table checkd
-- @treturn Rectangle
function GetDockedBorders(checkd) end
--- GetConnectedSubs
-- @realm shared
-- @treturn table
function GetConnectedSubs() end
--- FindSpawnPos
-- @realm shared
-- @tparam Vector2 spawnPos
-- @tparam Nullable`1 submarineSize
-- @tparam number subDockingPortOffset
-- @tparam number verticalMoveDir
-- @treturn Vector2
function FindSpawnPos(spawnPos, submarineSize, subDockingPortOffset, verticalMoveDir) end
--- UpdateTransform
-- @realm shared
-- @tparam bool interpolate
function UpdateTransform(interpolate) end
--- VectorToWorldGrid
-- @realm shared
-- @tparam Vector2 position
-- @treturn Vector2
function Submarine.VectorToWorldGrid(position) end
--- CalculateDimensions
-- @realm shared
-- @tparam bool onlyHulls
-- @treturn Rectangle
function CalculateDimensions(onlyHulls) end
--- AbsRect
-- @realm shared
-- @tparam Vector2 pos
-- @tparam Vector2 size
-- @treturn Rectangle
function Submarine.AbsRect(pos, size) end
--- RectContains
-- @realm shared
-- @tparam Rectangle rect
-- @tparam Vector2 pos
-- @tparam bool inclusive
-- @treturn bool
function Submarine.RectContains(rect, pos, inclusive) end
--- RectsOverlap
-- @realm shared
-- @tparam Rectangle rect1
-- @tparam Rectangle rect2
-- @tparam bool inclusive
-- @treturn bool
function Submarine.RectsOverlap(rect1, rect2, inclusive) end
--- PickBody
-- @realm shared
-- @tparam Vector2 rayStart
-- @tparam Vector2 rayEnd
-- @tparam Enumerable ignoredBodies
-- @tparam Nullable`1 collisionCategory
-- @tparam bool ignoreSensors
-- @tparam Predicate`1 customPredicate
-- @tparam bool allowInsideFixture
-- @treturn Body
function Submarine.PickBody(rayStart, rayEnd, ignoredBodies, collisionCategory, ignoreSensors, customPredicate, allowInsideFixture) end
--- LastPickedBodyDist
-- @realm shared
-- @tparam Body body
-- @treturn number
function Submarine.LastPickedBodyDist(body) end
--- PickBodies
-- @realm shared
-- @tparam Vector2 rayStart
-- @tparam Vector2 rayEnd
-- @tparam Enumerable ignoredBodies
-- @tparam Nullable`1 collisionCategory
-- @tparam bool ignoreSensors
-- @tparam Predicate`1 customPredicate
-- @tparam bool allowInsideFixture
-- @treturn Enumerable
function Submarine.PickBodies(rayStart, rayEnd, ignoredBodies, collisionCategory, ignoreSensors, customPredicate, allowInsideFixture) end
--- CheckVisibility
-- @realm shared
-- @tparam Vector2 rayStart
-- @tparam Vector2 rayEnd
-- @tparam bool ignoreLevel
-- @tparam bool ignoreSubs
-- @tparam bool ignoreSensors
-- @tparam bool ignoreDisabledWalls
-- @tparam bool ignoreBranches
-- @treturn Body
function Submarine.CheckVisibility(rayStart, rayEnd, ignoreLevel, ignoreSubs, ignoreSensors, ignoreDisabledWalls, ignoreBranches) end
--- FlipX
-- @realm shared
-- @tparam table parents
function FlipX(parents) end
--- Update
-- @realm shared
-- @tparam number deltaTime
function Update(deltaTime) end
--- ApplyForce
-- @realm shared
-- @tparam Vector2 force
function ApplyForce(force) end
--- EnableMaintainPosition
-- @realm shared
function EnableMaintainPosition() end
--- NeutralizeBallast
-- @realm shared
function NeutralizeBallast() end
--- SetPrevTransform
-- @realm shared
-- @tparam Vector2 position
function SetPrevTransform(position) end
--- SetPosition
-- @realm shared
-- @tparam Vector2 position
-- @tparam table checkd
-- @tparam bool forceUndockFromStaticSubmarines
function SetPosition(position, checkd, forceUndockFromStaticSubmarines) end
--- CalculateDockOffset
-- @realm shared
-- @tparam Submarine sub
-- @tparam Submarine dockedSub
-- @treturn Nullable`1
function Submarine.CalculateDockOffset(sub, dockedSub) end
--- Translate
-- @realm shared
-- @tparam Vector2 amount
function Translate(amount) end
--- FindClosest
-- @realm shared
-- @tparam Vector2 worldPosition
-- @tparam bool ignoreOutposts
-- @tparam bool ignoreOutsideLevel
-- @tparam bool ignoreRespawnShuttle
-- @tparam Nullable`1 teamType
-- @treturn Submarine
function Submarine.FindClosest(worldPosition, ignoreOutposts, ignoreOutsideLevel, ignoreRespawnShuttle, teamType) end
--- IsConnectedTo
-- @realm shared
-- @tparam Submarine otherSub
-- @treturn bool
function IsConnectedTo(otherSub) end
--- GetHulls
-- @realm shared
-- @tparam bool alsoFromConnectedSubs
-- @treturn table
function GetHulls(alsoFromConnectedSubs) end
--- GetGaps
-- @realm shared
-- @tparam bool alsoFromConnectedSubs
-- @treturn table
function GetGaps(alsoFromConnectedSubs) end
--- GetItems
-- @realm shared
-- @tparam bool alsoFromConnectedSubs
-- @treturn table
function GetItems(alsoFromConnectedSubs) end
--- GetWaypoints
-- @realm shared
-- @tparam bool alsoFromConnectedSubs
-- @treturn table
function GetWaypoints(alsoFromConnectedSubs) end
--- GetWalls
-- @realm shared
-- @tparam bool alsoFromConnectedSubs
-- @treturn table
function GetWalls(alsoFromConnectedSubs) end
--- GetEntities
-- @realm shared
-- @tparam bool includingConnectedSubs
-- @tparam table list
-- @treturn table
function GetEntities(includingConnectedSubs, list) end
--- GetCargoContainers
-- @realm shared
-- @treturn table
function GetCargoContainers() end
--- GetEntities
-- @realm shared
-- @tparam bool includingConnectedSubs
-- @tparam Enumerable list
-- @treturn Enumerable
function GetEntities(includingConnectedSubs, list) end
--- IsEntityFoundOnThisSub
-- @realm shared
-- @tparam MapEntity entity
-- @tparam bool includingConnectedSubs
-- @tparam bool allowDifferentTeam
-- @tparam bool allowDifferentType
-- @treturn bool
function IsEntityFoundOnThisSub(entity, includingConnectedSubs, allowDifferentTeam, allowDifferentType) end
--- FreeID
-- @realm shared
function FreeID() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Info, Field of type SubmarineInfo
-- @realm shared
-- @SubmarineInfo Info
---
-- HiddenSubPosition, Field of type Vector2
-- @realm shared
-- @Vector2 HiddenSubPosition
---
-- IdOffset, Field of type number
-- @realm shared
-- @number IdOffset
---
-- Submarine.MainSub, Field of type Submarine
-- @realm shared
-- @Submarine Submarine.MainSub
---
-- Submarine.VisibleEntities, Field of type Enumerable
-- @realm shared
-- @Enumerable Submarine.VisibleEntities
---
-- DockedTo, Field of type Enumerable
-- @realm shared
-- @Enumerable DockedTo
---
-- Submarine.LastPickedPosition, Field of type Vector2
-- @realm shared
-- @Vector2 Submarine.LastPickedPosition
---
-- Submarine.LastPickedFraction, Field of type number
-- @realm shared
-- @number Submarine.LastPickedFraction
---
-- Submarine.LastPickedFixture, Field of type Fixture
-- @realm shared
-- @Fixture Submarine.LastPickedFixture
---
-- Submarine.LastPickedNormal, Field of type Vector2
-- @realm shared
-- @Vector2 Submarine.LastPickedNormal
---
-- Loading, Field of type bool
-- @realm shared
-- @bool Loading
---
-- GodMode, Field of type bool
-- @realm shared
-- @bool GodMode
---
-- Submarine.Loaded, Field of type table
-- @realm shared
-- @table Submarine.Loaded
---
-- SubBody, Field of type SubmarineBody
-- @realm shared
-- @SubmarineBody SubBody
---
-- PhysicsBody, Field of type PhysicsBody
-- @realm shared
-- @PhysicsBody PhysicsBody
---
-- Borders, Field of type Rectangle
-- @realm shared
-- @Rectangle Borders
---
-- VisibleBorders, Field of type Rectangle
-- @realm shared
-- @Rectangle VisibleBorders
---
-- Position, Field of type Vector2
-- @realm shared
-- @Vector2 Position
---
-- WorldPosition, Field of type Vector2
-- @realm shared
-- @Vector2 WorldPosition
---
-- RealWorldCrushDepth, Field of type number
-- @realm shared
-- @number RealWorldCrushDepth
---
-- RealWorldDepth, Field of type number
-- @realm shared
-- @number RealWorldDepth
---
-- AtEndExit, Field of type bool
-- @realm shared
-- @bool AtEndExit
---
-- AtStartExit, Field of type bool
-- @realm shared
-- @bool AtStartExit
---
-- DrawPosition, Field of type Vector2
-- @realm shared
-- @Vector2 DrawPosition
---
-- SimPosition, Field of type Vector2
-- @realm shared
-- @Vector2 SimPosition
---
-- Velocity, Field of type Vector2
-- @realm shared
-- @Vector2 Velocity
---
-- HullVertices, Field of type table
-- @realm shared
-- @table HullVertices
---
-- SubmarineSpecificIDTag, Field of type number
-- @realm shared
-- @number SubmarineSpecificIDTag
---
-- AtDamageDepth, Field of type bool
-- @realm shared
-- @bool AtDamageDepth
---
-- ImmuneToBallastFlora, Field of type bool
-- @realm shared
-- @bool ImmuneToBallastFlora
---
-- WreckAI, Field of type WreckAI
-- @realm shared
-- @WreckAI WreckAI
---
-- FlippedX, Field of type bool
-- @realm shared
-- @bool FlippedX
---
-- Submarine.Unloading, Field of type bool
-- @realm shared
-- @bool Submarine.Unloading
---
-- Removed, Field of type bool
-- @realm shared
-- @bool Removed
---
-- IdFreed, Field of type bool
-- @realm shared
-- @bool IdFreed
---
-- Submarine, Field of type Submarine
-- @realm shared
-- @Submarine Submarine
---
-- AiTarget, Field of type AITarget
-- @realm shared
-- @AITarget AiTarget
---
-- InDetectable, Field of type bool
-- @realm shared
-- @bool InDetectable
---
-- SpawnTime, Field of type number
-- @realm shared
-- @number SpawnTime
---
-- ErrorLine, Field of type string
-- @realm shared
-- @string ErrorLine
---
-- TeamID, Field of type CharacterTeamType
-- @realm shared
-- @CharacterTeamType TeamID
---
-- ConnectedDockingPorts, Field of type table
-- @realm shared
-- @table ConnectedDockingPorts
---
-- ShowSonarMarker, Field of type bool
-- @realm shared
-- @bool ShowSonarMarker
---
-- Submarine.HiddenSubStartPosition, Field of type Vector2
-- @realm shared
-- @Vector2 Submarine.HiddenSubStartPosition
---
-- Submarine.LockX, Field of type bool
-- @realm shared
-- @bool Submarine.LockX
---
-- Submarine.LockY, Field of type bool
-- @realm shared
-- @bool Submarine.LockY
---
-- Submarine.GridSize, Field of type Vector2
-- @realm shared
-- @Vector2 Submarine.GridSize
---
-- Submarine.MainSubs, Field of type Submarine[]
-- @realm shared
-- @Submarine[] Submarine.MainSubs
---
-- ID, Field of type number
-- @realm shared
-- @number ID
---
-- CreationStackTrace, Field of type string
-- @realm shared
-- @string CreationStackTrace
---
-- CreationIndex, Field of type number
-- @realm shared
-- @number CreationIndex

View File

@@ -1,307 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.SubmarineInfo
]]
-- @code SubmarineInfo
-- @pragma nostrip
local SubmarineInfo = {}
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Reload
-- @realm shared
function Reload() end
--- Dispose
-- @realm shared
function Dispose() end
--- IsVanillaSubmarine
-- @realm shared
-- @treturn bool
function IsVanillaSubmarine() end
--- StartHashDocTask
-- @realm shared
-- @tparam XDocument doc
function StartHashDocTask(doc) end
--- HasTag
-- @realm shared
-- @tparam SubmarineTag tag
-- @treturn bool
function HasTag(tag) end
--- AddTag
-- @realm shared
-- @tparam SubmarineTag tag
function AddTag(tag) end
--- RemoveTag
-- @realm shared
-- @tparam SubmarineTag tag
function RemoveTag(tag) end
--- CheckSubsLeftBehind
-- @realm shared
-- @tparam XElement element
function CheckSubsLeftBehind(element) end
--- GetRealWorldCrushDepth
-- @realm shared
-- @treturn number
function GetRealWorldCrushDepth() end
--- GetRealWorldCrushDepthMultiplier
-- @realm shared
-- @treturn number
function GetRealWorldCrushDepthMultiplier() end
--- SaveAs
-- @realm shared
-- @tparam string filePath
-- @tparam MemoryStream previewImage
function SaveAs(filePath, previewImage) end
--- AddToSavedSubs
-- @realm shared
-- @tparam SubmarineInfo subInfo
function SubmarineInfo.AddToSavedSubs(subInfo) end
--- RemoveSavedSub
-- @realm shared
-- @tparam string filePath
function SubmarineInfo.RemoveSavedSub(filePath) end
--- RefreshSavedSub
-- @realm shared
-- @tparam string filePath
function SubmarineInfo.RefreshSavedSub(filePath) end
--- RefreshSavedSubs
-- @realm shared
function SubmarineInfo.RefreshSavedSubs() end
--- OpenFile
-- @realm shared
-- @tparam string file
-- @treturn XDocument
function SubmarineInfo.OpenFile(file) end
--- OpenFile
-- @realm shared
-- @tparam string file
-- @tparam Exception& exception
-- @treturn XDocument
function SubmarineInfo.OpenFile(file, exception) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- SubmarineInfo.SavedSubmarines, Field of type Enumerable
-- @realm shared
-- @Enumerable SubmarineInfo.SavedSubmarines
---
-- Tags, Field of type SubmarineTag
-- @realm shared
-- @SubmarineTag Tags
---
-- EqualityCheckVal, Field of type number
-- @realm shared
-- @number EqualityCheckVal
---
-- Name, Field of type string
-- @realm shared
-- @string Name
---
-- DisplayName, Field of type LocalizedString
-- @realm shared
-- @LocalizedString DisplayName
---
-- Description, Field of type LocalizedString
-- @realm shared
-- @LocalizedString Description
---
-- Price, Field of type number
-- @realm shared
-- @number Price
---
-- InitialSuppliesSpawned, Field of type bool
-- @realm shared
-- @bool InitialSuppliesSpawned
---
-- GameVersion, Field of type Version
-- @realm shared
-- @Version GameVersion
---
-- Type, Field of type SubmarineType
-- @realm shared
-- @SubmarineType Type
---
-- OutpostModuleInfo, Field of type OutpostModuleInfo
-- @realm shared
-- @OutpostModuleInfo OutpostModuleInfo
---
-- IsOutpost, Field of type bool
-- @realm shared
-- @bool IsOutpost
---
-- IsWreck, Field of type bool
-- @realm shared
-- @bool IsWreck
---
-- IsBeacon, Field of type bool
-- @realm shared
-- @bool IsBeacon
---
-- IsPlayer, Field of type bool
-- @realm shared
-- @bool IsPlayer
---
-- IsRuin, Field of type bool
-- @realm shared
-- @bool IsRuin
---
-- IsCampaignCompatible, Field of type bool
-- @realm shared
-- @bool IsCampaignCompatible
---
-- IsCampaignCompatibleIgnoreClass, Field of type bool
-- @realm shared
-- @bool IsCampaignCompatibleIgnoreClass
---
-- MD5Hash, Field of type Md5Hash
-- @realm shared
-- @Md5Hash MD5Hash
---
-- CalculatingHash, Field of type bool
-- @realm shared
-- @bool CalculatingHash
---
-- Dimensions, Field of type Vector2
-- @realm shared
-- @Vector2 Dimensions
---
-- CargoCapacity, Field of type number
-- @realm shared
-- @number CargoCapacity
---
-- FilePath, Field of type string
-- @realm shared
-- @string FilePath
---
-- SubmarineElement, Field of type XElement
-- @realm shared
-- @XElement SubmarineElement
---
-- IsFileCorrupted, Field of type bool
-- @realm shared
-- @bool IsFileCorrupted
---
-- RequiredContentPackagesInstalled, Field of type bool
-- @realm shared
-- @bool RequiredContentPackagesInstalled
---
-- SubsLeftBehind, Field of type bool
-- @realm shared
-- @bool SubsLeftBehind
---
-- LeftBehindSubDockingPortOccupied, Field of type bool
-- @realm shared
-- @bool LeftBehindSubDockingPortOccupied
---
-- LastModifiedTime, Field of type DateTime
-- @realm shared
-- @DateTime LastModifiedTime
---
-- RecommendedCrewSizeMin, Field of type number
-- @realm shared
-- @number RecommendedCrewSizeMin
---
-- RecommendedCrewSizeMax, Field of type number
-- @realm shared
-- @number RecommendedCrewSizeMax
---
-- RecommendedCrewExperience, Field of type string
-- @realm shared
-- @string RecommendedCrewExperience
---
-- RequiredContentPackages, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 RequiredContentPackages
---
-- SubmarineClass, Field of type SubmarineClass
-- @realm shared
-- @SubmarineClass SubmarineClass
---
-- LeftBehindDockingPortIDs, Field of type table
-- @realm shared
-- @table LeftBehindDockingPortIDs
---
-- BlockedDockingPortIDs, Field of type table
-- @realm shared
-- @table BlockedDockingPortIDs
---
-- OutpostGenerationParams, Field of type OutpostGenerationParams
-- @realm shared
-- @OutpostGenerationParams OutpostGenerationParams
---
-- OutpostNPCs, Field of type table
-- @realm shared
-- @table OutpostNPCs

View File

@@ -1,507 +0,0 @@
-- luacheck: ignore 111
--[[--
Barotrauma.WayPoint
]]
-- @code WayPoint
-- @pragma nostrip
local WayPoint = {}
--- Clone
-- @realm shared
-- @treturn MapEntity
function Clone() end
--- GenerateSubWaypoints
-- @realm shared
-- @tparam Submarine submarine
-- @treturn bool
function WayPoint.GenerateSubWaypoints(submarine) end
--- ConnectTo
-- @realm shared
-- @tparam WayPoint wayPoint2
function ConnectTo(wayPoint2) end
--- GetRandom
-- @realm shared
-- @tparam SpawnType spawnType
-- @tparam JobPrefab assignedJob
-- @tparam Submarine sub
-- @tparam bool useSyncedRand
-- @tparam string spawnPointTag
-- @tparam bool ignoreSubmarine
-- @treturn WayPoint
function WayPoint.GetRandom(spawnType, assignedJob, sub, useSyncedRand, spawnPointTag, ignoreSubmarine) end
--- SelectCrewSpawnPoints
-- @realm shared
-- @tparam table crew
-- @tparam Submarine submarine
-- @treturn WayPoint[]
function WayPoint.SelectCrewSpawnPoints(crew, submarine) end
--- FindHull
-- @realm shared
function FindHull() end
--- OnMapLoaded
-- @realm shared
function OnMapLoaded() end
--- InitializeLinks
-- @realm shared
function InitializeLinks() end
--- Load
-- @realm shared
-- @tparam ContentXElement element
-- @tparam Submarine submarine
-- @tparam IdRemap idRemap
-- @treturn WayPoint
function WayPoint.Load(element, submarine, idRemap) end
--- Save
-- @realm shared
-- @tparam XElement parentElement
-- @treturn XElement
function Save(parentElement) end
--- ShallowRemove
-- @realm shared
function ShallowRemove() end
--- Remove
-- @realm shared
function Remove() end
--- AddLinked
-- @realm shared
-- @tparam MapEntity entity
function AddLinked(entity) end
--- ResolveLinks
-- @realm shared
-- @tparam IdRemap childRemap
function ResolveLinks(childRemap) end
--- Move
-- @realm shared
-- @tparam Vector2 amount
function Move(amount) end
--- IsMouseOn
-- @realm shared
-- @tparam Vector2 position
-- @treturn bool
function IsMouseOn(position) end
--- HasUpgrade
-- @realm shared
-- @tparam Identifier identifier
-- @treturn bool
function HasUpgrade(identifier) end
--- GetUpgrade
-- @realm shared
-- @tparam Identifier identifier
-- @treturn Upgrade
function GetUpgrade(identifier) end
--- GetUpgrades
-- @realm shared
-- @treturn table
function GetUpgrades() end
--- SetUpgrade
-- @realm shared
-- @tparam Upgrade upgrade
-- @tparam bool createNetworkEvent
function SetUpgrade(upgrade, createNetworkEvent) end
--- AddUpgrade
-- @realm shared
-- @tparam Upgrade upgrade
-- @tparam bool createNetworkEvent
-- @treturn bool
function AddUpgrade(upgrade, createNetworkEvent) end
--- Update
-- @realm shared
-- @tparam number deltaTime
-- @tparam Camera cam
function Update(deltaTime, cam) end
--- FlipX
-- @realm shared
-- @tparam bool relativeToSub
function FlipX(relativeToSub) end
--- FlipY
-- @realm shared
-- @tparam bool relativeToSub
function FlipY(relativeToSub) end
--- RemoveLinked
-- @realm shared
-- @tparam MapEntity e
function RemoveLinked(e) end
--- GetLinkedEntities
-- @realm shared
-- @tparam HashSet`1 list
-- @tparam Nullable`1 maxDepth
-- @tparam function filter
-- @treturn HashSet`1
function GetLinkedEntities(list, maxDepth, filter) end
--- FreeID
-- @realm shared
function FreeID() end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- ConnectedGap, Field of type Gap
-- @realm shared
-- @Gap ConnectedGap
---
-- ConnectedDoor, Field of type Door
-- @realm shared
-- @Door ConnectedDoor
---
-- CurrentHull, Field of type Hull
-- @realm shared
-- @Hull CurrentHull
---
-- SpawnType, Field of type SpawnType
-- @realm shared
-- @SpawnType SpawnType
---
-- OnLinksChanged, Field of type function
-- @realm shared
-- @function OnLinksChanged
---
-- Name, Field of type string
-- @realm shared
-- @string Name
---
-- IdCardDesc, Field of type string
-- @realm shared
-- @string IdCardDesc
---
-- IdCardTags, Field of type String[]
-- @realm shared
-- @String[] IdCardTags
---
-- Tags, Field of type Enumerable
-- @realm shared
-- @Enumerable Tags
---
-- AssignedJob, Field of type JobPrefab
-- @realm shared
-- @JobPrefab AssignedJob
---
-- DisallowedUpgrades, Field of type string
-- @realm shared
-- @string DisallowedUpgrades
---
-- FlippedX, Field of type bool
-- @realm shared
-- @bool FlippedX
---
-- FlippedY, Field of type bool
-- @realm shared
-- @bool FlippedY
---
-- IsHighlighted, Field of type bool
-- @realm shared
-- @bool IsHighlighted
---
-- Rect, Field of type Rectangle
-- @realm shared
-- @Rectangle Rect
---
-- WorldRect, Field of type Rectangle
-- @realm shared
-- @Rectangle WorldRect
---
-- Sprite, Field of type Sprite
-- @realm shared
-- @Sprite Sprite
---
-- DrawBelowWater, Field of type bool
-- @realm shared
-- @bool DrawBelowWater
---
-- DrawOverWater, Field of type bool
-- @realm shared
-- @bool DrawOverWater
---
-- Linkable, Field of type bool
-- @realm shared
-- @bool Linkable
---
-- AllowedLinks, Field of type Enumerable
-- @realm shared
-- @Enumerable AllowedLinks
---
-- ResizeHorizontal, Field of type bool
-- @realm shared
-- @bool ResizeHorizontal
---
-- ResizeVertical, Field of type bool
-- @realm shared
-- @bool ResizeVertical
---
-- RectWidth, Field of type number
-- @realm shared
-- @number RectWidth
---
-- RectHeight, Field of type number
-- @realm shared
-- @number RectHeight
---
-- SpriteDepthOverrideIsSet, Field of type bool
-- @realm shared
-- @bool SpriteDepthOverrideIsSet
---
-- SpriteOverrideDepth, Field of type number
-- @realm shared
-- @number SpriteOverrideDepth
---
-- SpriteDepth, Field of type number
-- @realm shared
-- @number SpriteDepth
---
-- Scale, Field of type number
-- @realm shared
-- @number Scale
---
-- HiddenInGame, Field of type bool
-- @realm shared
-- @bool HiddenInGame
---
-- Position, Field of type Vector2
-- @realm shared
-- @Vector2 Position
---
-- SimPosition, Field of type Vector2
-- @realm shared
-- @Vector2 SimPosition
---
-- SoundRange, Field of type number
-- @realm shared
-- @number SoundRange
---
-- SightRange, Field of type number
-- @realm shared
-- @number SightRange
---
-- RemoveIfLinkedOutpostDoorInUse, Field of type bool
-- @realm shared
-- @bool RemoveIfLinkedOutpostDoorInUse
---
-- Layer, Field of type string
-- @realm shared
-- @string Layer
---
-- Removed, Field of type bool
-- @realm shared
-- @bool Removed
---
-- IdFreed, Field of type bool
-- @realm shared
-- @bool IdFreed
---
-- WorldPosition, Field of type Vector2
-- @realm shared
-- @Vector2 WorldPosition
---
-- DrawPosition, Field of type Vector2
-- @realm shared
-- @Vector2 DrawPosition
---
-- Submarine, Field of type Submarine
-- @realm shared
-- @Submarine Submarine
---
-- AiTarget, Field of type AITarget
-- @realm shared
-- @AITarget AiTarget
---
-- InDetectable, Field of type bool
-- @realm shared
-- @bool InDetectable
---
-- SpawnTime, Field of type number
-- @realm shared
-- @number SpawnTime
---
-- ErrorLine, Field of type string
-- @realm shared
-- @string ErrorLine
---
-- Ladders, Field of type Ladder
-- @realm shared
-- @Ladder Ladders
---
-- Stairs, Field of type Structure
-- @realm shared
-- @Structure Stairs
---
-- isObstructed, Field of type bool
-- @realm shared
-- @bool isObstructed
---
-- Tunnel, Field of type Tunnel
-- @realm shared
-- @Tunnel Tunnel
---
-- Ruin, Field of type Ruin
-- @realm shared
-- @Ruin Ruin
---
-- WayPoint.WayPointList, Field of type table
-- @realm shared
-- @table WayPoint.WayPointList
---
-- WayPoint.ShowWayPoints, Field of type bool
-- @realm shared
-- @bool WayPoint.ShowWayPoints
---
-- WayPoint.ShowSpawnPoints, Field of type bool
-- @realm shared
-- @bool WayPoint.ShowSpawnPoints
---
-- WayPoint.LadderWaypointInterval, Field of type number
-- @realm shared
-- @number WayPoint.LadderWaypointInterval
---
-- Prefab, Field of type MapEntityPrefab
-- @realm shared
-- @MapEntityPrefab Prefab
---
-- unresolvedLinkedToID, Field of type table
-- @realm shared
-- @table unresolvedLinkedToID
---
-- DisallowedUpgradeSet, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 DisallowedUpgradeSet
---
-- linkedTo, Field of type table
-- @realm shared
-- @table linkedTo
---
-- ShouldBeSaved, Field of type bool
-- @realm shared
-- @bool ShouldBeSaved
---
-- ExternalHighlight, Field of type bool
-- @realm shared
-- @bool ExternalHighlight
---
-- OriginalModuleIndex, Field of type number
-- @realm shared
-- @number OriginalModuleIndex
---
-- OriginalContainerIndex, Field of type number
-- @realm shared
-- @number OriginalContainerIndex
---
-- ID, Field of type number
-- @realm shared
-- @number ID
---
-- CreationStackTrace, Field of type string
-- @realm shared
-- @string CreationStackTrace
---
-- CreationIndex, Field of type number
-- @realm shared
-- @number CreationIndex

View File

@@ -1,478 +0,0 @@
-- luacheck: ignore 111
--[[--
FarseerPhysics.Dynamics.World
]]
-- @code Game.World
-- @pragma nostrip
local World = {}
--- Add
-- @realm shared
-- @tparam Body body
function Add(body) end
--- Remove
-- @realm shared
-- @tparam Body body
function Remove(body) end
--- Add
-- @realm shared
-- @tparam Joint joint
function Add(joint) end
--- Remove
-- @realm shared
-- @tparam Joint joint
function Remove(joint) end
--- AddAsync
-- @realm shared
-- @tparam Body body
function AddAsync(body) end
--- RemoveAsync
-- @realm shared
-- @tparam Body body
function RemoveAsync(body) end
--- AddAsync
-- @realm shared
-- @tparam Joint joint
function AddAsync(joint) end
--- RemoveAsync
-- @realm shared
-- @tparam Joint joint
function RemoveAsync(joint) end
--- ProcessChanges
-- @realm shared
function ProcessChanges() end
--- Step
-- @realm shared
-- @tparam TimeSpan dt
function Step(dt) end
--- Step
-- @realm shared
-- @tparam TimeSpan dt
-- @tparam SolverIterations& iterations
function Step(dt, iterations) end
--- Step
-- @realm shared
-- @tparam number dt
function Step(dt) end
--- Step
-- @realm shared
-- @tparam number dt
-- @tparam SolverIterations& iterations
function Step(dt, iterations) end
--- ClearForces
-- @realm shared
function ClearForces() end
--- QueryAABB
-- @realm shared
-- @tparam function callback
-- @tparam AABB& aabb
function QueryAABB(callback, aabb) end
--- QueryAABB
-- @realm shared
-- @tparam AABB& aabb
-- @treturn table
function QueryAABB(aabb) end
--- RayCast
-- @realm shared
-- @tparam function callback
-- @tparam Vector2 point1
-- @tparam Vector2 point2
-- @tparam Category collisionCategory
function RayCast(callback, point1, point2, collisionCategory) end
--- RayCast
-- @realm shared
-- @tparam Vector2 point1
-- @tparam Vector2 point2
-- @treturn table
function RayCast(point1, point2) end
--- Add
-- @realm shared
-- @tparam Controller controller
function Add(controller) end
--- Remove
-- @realm shared
-- @tparam Controller controller
function Remove(controller) end
--- TestPoint
-- @realm shared
-- @tparam Vector2 point
-- @treturn Fixture
function TestPoint(point) end
--- TestPointAll
-- @realm shared
-- @tparam Vector2 point
-- @treturn table
function TestPointAll(point) end
--- ShiftOrigin
-- @realm shared
-- @tparam Vector2 newOrigin
function ShiftOrigin(newOrigin) end
--- Clear
-- @realm shared
function Clear() end
--- CreateBody
-- @realm shared
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateBody(position, rotation, bodyType) end
--- CreateEdge
-- @realm shared
-- @tparam Vector2 start
-- @tparam Vector2 endparam
-- @treturn Body
function CreateEdge(start, endparam) end
--- CreateChainShape
-- @realm shared
-- @tparam Vertices vertices
-- @tparam Vector2 position
-- @treturn Body
function CreateChainShape(vertices, position) end
--- CreateLoopShape
-- @realm shared
-- @tparam Vertices vertices
-- @tparam Vector2 position
-- @treturn Body
function CreateLoopShape(vertices, position) end
--- CreateRectangle
-- @realm shared
-- @tparam number width
-- @tparam number height
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateRectangle(width, height, density, position, rotation, bodyType) end
--- CreateCircle
-- @realm shared
-- @tparam number radius
-- @tparam number density
-- @tparam Vector2 position
-- @tparam BodyType bodyType
-- @treturn Body
function CreateCircle(radius, density, position, bodyType) end
--- CreateEllipse
-- @realm shared
-- @tparam number xRadius
-- @tparam number yRadius
-- @tparam number edges
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateEllipse(xRadius, yRadius, edges, density, position, rotation, bodyType) end
--- CreatePolygon
-- @realm shared
-- @tparam Vertices vertices
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreatePolygon(vertices, density, position, rotation, bodyType) end
--- CreateCompoundPolygon
-- @realm shared
-- @tparam table list
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateCompoundPolygon(list, density, position, rotation, bodyType) end
--- CreateGear
-- @realm shared
-- @tparam number radius
-- @tparam number numberOfTeeth
-- @tparam number tipPercentage
-- @tparam number toothHeight
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateGear(radius, numberOfTeeth, tipPercentage, toothHeight, density, position, rotation, bodyType) end
--- CreateCapsule
-- @realm shared
-- @tparam number height
-- @tparam number topRadius
-- @tparam number topEdges
-- @tparam number bottomRadius
-- @tparam number bottomEdges
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateCapsule(height, topRadius, topEdges, bottomRadius, bottomEdges, density, position, rotation, bodyType) end
--- CreateCapsuleHorizontal
-- @realm shared
-- @tparam number width
-- @tparam number endRadius
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateCapsuleHorizontal(width, endRadius, density, position, rotation, bodyType) end
--- CreateCapsule
-- @realm shared
-- @tparam number height
-- @tparam number endRadius
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateCapsule(height, endRadius, density, position, rotation, bodyType) end
--- CreateRoundedRectangle
-- @realm shared
-- @tparam number width
-- @tparam number height
-- @tparam number xRadius
-- @tparam number yRadius
-- @tparam number segments
-- @tparam number density
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateRoundedRectangle(width, height, xRadius, yRadius, segments, density, position, rotation, bodyType) end
--- CreateLineArc
-- @realm shared
-- @tparam number radians
-- @tparam number sides
-- @tparam number radius
-- @tparam bool closed
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateLineArc(radians, sides, radius, closed, position, rotation, bodyType) end
--- CreateSolidArc
-- @realm shared
-- @tparam number density
-- @tparam number radians
-- @tparam number sides
-- @tparam number radius
-- @tparam Vector2 position
-- @tparam number rotation
-- @tparam BodyType bodyType
-- @treturn Body
function CreateSolidArc(density, radians, sides, radius, position, rotation, bodyType) end
--- CreateChain
-- @realm shared
-- @tparam Vector2 start
-- @tparam Vector2 endparam
-- @tparam number linkWidth
-- @tparam number linkHeight
-- @tparam number numberOfLinks
-- @tparam number linkDensity
-- @tparam bool attachRopeJoint
-- @treturn Path
function CreateChain(start, endparam, linkWidth, linkHeight, numberOfLinks, linkDensity, attachRopeJoint) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- Fluid, Field of type FluidSystem2
-- @realm shared
-- @FluidSystem2 Fluid
---
-- UpdateTime, Field of type TimeSpan
-- @realm shared
-- @TimeSpan UpdateTime
---
-- ContinuousPhysicsTime, Field of type TimeSpan
-- @realm shared
-- @TimeSpan ContinuousPhysicsTime
---
-- ControllersUpdateTime, Field of type TimeSpan
-- @realm shared
-- @TimeSpan ControllersUpdateTime
---
-- AddRemoveTime, Field of type TimeSpan
-- @realm shared
-- @TimeSpan AddRemoveTime
---
-- NewContactsTime, Field of type TimeSpan
-- @realm shared
-- @TimeSpan NewContactsTime
---
-- ContactsUpdateTime, Field of type TimeSpan
-- @realm shared
-- @TimeSpan ContactsUpdateTime
---
-- SolveUpdateTime, Field of type TimeSpan
-- @realm shared
-- @TimeSpan SolveUpdateTime
---
-- ProxyCount, Field of type number
-- @realm shared
-- @number ProxyCount
---
-- ContactCount, Field of type number
-- @realm shared
-- @number ContactCount
---
-- IsLocked, Field of type bool
-- @realm shared
-- @bool IsLocked
---
-- ContactList, Field of type ContactListHead
-- @realm shared
-- @ContactListHead ContactList
---
-- Enabled, Field of type bool
-- @realm shared
-- @bool Enabled
---
-- Island, Field of type Island
-- @realm shared
-- @Island Island
---
-- Tag, Field of type Object
-- @realm shared
-- @Object Tag
---
-- BodyAdded, Field of type BodyDelegate
-- @realm shared
-- @BodyDelegate BodyAdded
---
-- BodyRemoved, Field of type BodyDelegate
-- @realm shared
-- @BodyDelegate BodyRemoved
---
-- FixtureAdded, Field of type FixtureDelegate
-- @realm shared
-- @FixtureDelegate FixtureAdded
---
-- FixtureRemoved, Field of type FixtureDelegate
-- @realm shared
-- @FixtureDelegate FixtureRemoved
---
-- JointAdded, Field of type JointDelegate
-- @realm shared
-- @JointDelegate JointAdded
---
-- JointRemoved, Field of type JointDelegate
-- @realm shared
-- @JointDelegate JointRemoved
---
-- ControllerAdded, Field of type ControllerDelegate
-- @realm shared
-- @ControllerDelegate ControllerAdded
---
-- ControllerRemoved, Field of type ControllerDelegate
-- @realm shared
-- @ControllerDelegate ControllerRemoved
---
-- ControllerList, Field of type table
-- @realm shared
-- @table ControllerList
---
-- Gravity, Field of type Vector2
-- @realm shared
-- @Vector2 Gravity
---
-- ContactManager, Field of type ContactManager
-- @realm shared
-- @ContactManager ContactManager
---
-- BodyList, Field of type table
-- @realm shared
-- @table BodyList
---
-- JointList, Field of type table
-- @realm shared
-- @table JointList

View File

@@ -1,51 +0,0 @@
# How to use hooks
Hooks are basically functions that get called when events happen in-game, like chat messages. They can be triggered either by Lua itself or the game code.
## Adding hooks
Hooks can be added like this:
```
Hook.Add("chatMessage", "test", function(message, client)
print(client.Name .. " has sent " .. message)
end)
```
The event name (first argument), is case-insensitive, so you can call it chatMessage, cHaTmEsSaGe, chatmessage, etc.
## Calling hooks
You can also call hooks with the following code:
```
Hook.Call("myCustomEvent", {"some", "arguments", 123})
```
## XML Status Effect Hooks
With Lua, a new XML tags is added, it can be used to call Lua hooks inside status effects:
```
<StatusEffect type="OnUse">
<LuaHook name="doSomething" />
</StatusEffect>
```
```
Hook.Add("doSomething", "something", function (effect, deltaTime, item, targets, worldPosition)
print(effect, ' ', item)
end)
```
## Patching
Patching allows you to hook into existing methods in the game code, notice that it can be a little unstable depending on the method that you are patching, so be aware.
```
Hook.HookMethod("Barotrauma.CharacterInfo", "IncreaseSkillLevel", function (instance, ptable)
print(string.format("%s gained % xp", instance.Character.Name, ptable.increase))
end, Hook.HookMethodType.After)
```
If you return anything other than nil, it will stop the execution of the method, if the method has a return type, it will also return what you returned in the Lua function. (Only in Hook.HookMethodType.After)

View File

@@ -1,24 +0,0 @@
<div class="landing">
<h1>Lua For Barotrauma Documentation</h1>
</div>
<div class="wrapper">
<p style="text-align: center;"></p>
<h2>Welcome to the Lua For Barotrauma documentation!</h2>
<p>This is a work in progress documentation, not everything is documented here, but because Barotrauma classes are exposed to Lua, you can check the Barotrauma source code for functions and fields that you can access.</p>
<h2>Installing Lua For Barotrauma</h2>
<p>Downloading and using the Core Content Package from <a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2559634234" target="_blank">Workshop</a> should be enough to have it installed, but if you want to install it manually, you can check out <a href="{* ldoc.url('manual/installing-lua-for-barotrauma-manually') *}">this guide.</a>
</p>
<h2>Getting Started</h2>
<p>If you want to get started with Lua For Barotrauma modding, check out <a href="{* ldoc.url('manual/getting-started') *}">this guide.</a>
</p>
<h2>Links</h2>
<p>
<a href="https://github.com/evilfactory/Barotrauma-lua-attempt" target="_blank">Github</a><br>
<a href="https://discord.gg/f9zvNNuxu9" target="_blank">Discord Server</a>
</p>
</div>

View File

@@ -1,90 +0,0 @@
{%
local baseUrl = ldoc.css:gsub("ldoc.css", "")
local repo = "https://github.com/evilfactory/Barotrauma-lua-attempt/"
local pageTitle = mod and (ldoc.display_name(mod) .. " - " .. ldoc.title) or ldoc.title
local oldmarkup = ldoc.markup
function ldoc.markup(text, item)
return oldmarkup(text, item, ldoc.plain)
end
function ldoc.url(path)
return baseUrl .. path
end
function ldoc.realm_icon(realm)
return "<span class=\"realm " .. (realm or "") .. "\"></span>";
end
function ldoc.is_kind_classmethod(kind)
return kind ~= "libraries"
end
function ldoc.repo_reference(item)
return repo .. "tree/master" .. item.file.filename:gsub(item.file.base, "/gamemode") .. "#L" .. item.lineno
end
local function moduleDescription(mod)
if (mod.type == "topic") then
return mod.body:gsub(mod.display_name, ""):gsub("#", ""):sub(1, 256) .. "..."
end
return mod.summary
end
%}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{pageTitle}}</title>
<meta property="og:type" content="website" />
<meta property="og:title" content="{{pageTitle}}" />
<meta property="og:site_name" content="Lua For Barotrauma Documentation" />
{% if (mod) then %}
<meta property="og:description" content="{{moduleDescription(mod)}}" />
{% else %}
<meta property="og:description" content="A Barotrauma modification that adds Lua modding support." />
{% end %}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro" />
<link rel="stylesheet" href="{* ldoc.css *}" />
<link rel="stylesheet" href="{* ldoc.url('highlight.css') *}" />
</head>
<body>
<main>
{(docs/templates/sidebar.ltp)}
<article>
{% if (ldoc.root) then -- we're rendering the landing page (index.html) %}
{(docs/templates/landing.ltp)}
{% elseif (ldoc.body) then -- we're rendering non-code elements %}
<div class="wrapper">
{* ldoc.body *}
</div>
{% elseif (module) then -- we're rendering libary contents %}
<div class="wrapper">
{(docs/templates/module.ltp)}
</div>
{% end %}
</article>
</main>
<script type="text/javascript" src="{* ldoc.url('app.js') *}"></script>
<script type="text/javascript" src="{* ldoc.url('highlight.min.js') *}"></script>
<script type="text/javascript">
var elements = document.querySelectorAll("pre code")
hljs.configure({
languages: ["lua", ""]
});
for (var i = 0; i < elements.length; i++)
{
hljs.highlightBlock(elements[i]);
}
</script>
</body>
</html>

View File

@@ -1,147 +0,0 @@
<header class="module">
<h1>{{mod.name}}</h1>
<h2>{* ldoc.markup(mod.summary) *}</h2>
</header>
<p>{* ldoc.markup(mod.description) *}</p>
{%
local kinds = {}
local kindsIpairs = {}
for kind, items in mod.kinds() do
local name = kind
if kind == "Tables" then
name = "Fields"
end
for item in items() do
if kinds[name] == nil then
kinds[name] = {}
local value = {}
value.kind = name
value.items = kinds[name]
table.insert(kindsIpairs, value)
end
kinds[name][item] = true
end
end
%}
{% for i, value in ipairs(kindsIpairs) do
local kind = value.kind
local items = value.items
%}
<h1 class="title">{{kind}}</h1>
{% for item, _ in pairs(items) do %}
<section class="method" id="{{item.name}}">
<header>
<a class="anchor">
<h1>{* ldoc.realm_icon(item.tags.realm[1]) *}</span>{{ldoc.display_name(item)}}</h1>
</a>
{% if (item.tags.internal) then %}
<div class="notice error">
<div class="title">Internal</div>
<p>This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.</p>
</div>
{% end %}
{% if (ldoc.descript(item):len() == 0) then %}
<div class="notice warning">
<div class="title">Incomplete</div>
<p>Documentation for this section is incomplete and needs expanding.</p>
</div>
{% else %}
<p>{* ldoc.markup(ldoc.descript(item)) *}</p>
{% end %}
</header>
{# function arguments #}
{% if (item.params and #item.params > 0) then %}
{% local subnames = mod.kinds:type_of(item).subnames %}
{% if (subnames) then %}
<h3>{{subnames}}</h3>
{% end %}
{% for argument in ldoc.modules.iter(item.params) do %}
{% local argument, sublist = item:subparam(argument) %}
<ul>
{% for argumentName in ldoc.modules.iter(argument) do %}
{% local displayName = item:display_name_of(argumentName) %}
{% local type = ldoc.typename(item:type_of_param(argumentName)) %}
{% local default = item:default_of_param(argumentName) %}
<li>
<span class="tag parameter">{{displayName}}</span>
{% if (type ~= "") then %}
<span class="tag">{* type *}</span>
{% end %}
{% if (default and default ~= true) then %}
<span class="tag default">default: {{default}}</span>
{% elseif (default) then %}
<span class="tag default">optional</span>
{% end %}
<p>{* ldoc.markup(item.params.map[argumentName]) *}</p>
</li>
{% end %}
</ul>
{% end %}
{% end %}
{# function returns #}
{% if ((not ldoc.no_return_or_parms) and item.retgroups) then %}
{% local groups = item.retgroups %}
<h3>Returns</h3>
<ul>
{% for i, group in ldoc.ipairs(groups) do %}
{% for returnValue in group:iter() do %}
{% local type, ctypes = item:return_type(returnValue) %}
{% type = ldoc.typename(type) %}
<li>
{% if (type ~= "") then %}
{* type *}
{% else -- we'll assume that it will return a variable type if none is set %}
<span class="tag type">any</span>
{% end %}
<p>{* ldoc.markup(returnValue.text) *}</p>
</li>
{% end %}
{% if (i ~= #groups) then %}
<div class="or"><span>OR</span></div>
{% end %}
{% end %}
</ul>
{% end %}
{% if (item.usage) then -- function usage %}
<h3>Example Usage</h3>
{% for usage in ldoc.modules.iter(item.usage) do %}
<pre><code>{* usage *}</code></pre>
{% end %}
{% end %}
{% if (item.see) then %}
<h3>See Also</h3>
<ul>
{% for see in ldoc.modules.iter(item.see) do %}
<li><a href="{* ldoc.href(see) *}">{{see.label}}</a></li>
{% end %}
</ul>
{% end %}
</section>
{% end %}
{% end %}

View File

@@ -1,116 +0,0 @@
{%
local function isKindExpandable(kind)
return kind ~= "Manual"
end
%}
<nav>
<header>
{% if (not ldoc.root) then %}
<h1><a href="{* ldoc.url('') *}">Lua For Barotrauma Documentation</a></h1>
{% end %}
<input id="search" type="search" autocomplete="off" placeholder="Search..." />
</header>
<section>
{% for kind, mods, type in ldoc.kinds() do %}
{% if (ldoc.allowed_in_contents(type, mod)) then %}
<details class="category" open>
<summary>
<h2>{{kind}}</h2>
</summary>
<ul>
{% for currentMod in mods() do %}
{% local name = ldoc.display_name(currentMod) %}
<li>
{% if (isKindExpandable(kind)) then %}
<details {{currentMod.name == (mod or {}).name and "open" or ""}}>
<summary><a href="{* ldoc.ref_to_module(currentMod) *}">{{name}}</a></summary>
<ul>
{% else %}
<a href="{* ldoc.ref_to_module(currentMod) *}">{{name}}</a>
{% end %}
{% if (isKindExpandable(kind)) then
currentMod.items:sort(function(a, b)
return a.name < b.name
end)
end %}
{%
local isThereFunctions = false
for k, v in pairs(currentMod.items) do
if (v.kind == "functions") then
isThereFunctions = true
break
end
end
%}
{% if isThereFunctions then %}
<li>
<label class="colorful-label">FUNCTIONS</label>
</li>
{% end %}
{% for k, v in pairs(currentMod.items) do %}
{% if (v.kind == "functions") then %}
<li>
{* ldoc.realm_icon(v.tags.realm[1]) *}
<a href="{* ldoc.ref_to_module(currentMod) *}#{{v.name}}">
{% if (ldoc.is_kind_classmethod(currentMod.kind)) then
echo((v.name:gsub(".+:", "")))
else
echo((v.name:gsub(currentMod.name .. ".", "")))
end %}
</a>
</li>
{% end %}
{% end %}
{%
local isThereFields = false
for k, v in pairs(currentMod.items) do
if (v.kind == "fields" or v.kind == "tables") then
isThereFields = true
break
end
end
%}
{% if isThereFields then %}
<li>
<label class="colorful-label">FIELDS</label>
</li>
{% end %}
{% for k, v in pairs(currentMod.items) do %}
{% if (v.kind == "fields" or v.kind == "tables") then %}
<li>
{* ldoc.realm_icon(v.tags.realm[1]) *}
<a href="{* ldoc.ref_to_module(currentMod) *}#{{v.name}}">
{% if (ldoc.is_kind_classmethod(currentMod.kind)) then
echo((v.name:gsub(".+:", "")))
else
echo((v.name:gsub(currentMod.name .. ".", "")))
end %}
</a>
</li>
{% end %}
{% end %}
{% if (isKindExpandable(kind)) then %}
</ul>
</details>
{% end %}
</li>
{% end %}
</ul>
</details>
{% end %}
{% end %}
</section>
</nav>

View File

@@ -1,8 +0,0 @@
<doxygenlayout version="1.0">
<navindex>
<tab type="user" url="./index.html" title="Documentation introduction"/>
<tab type="user" url="../baro-server/html/index.html" title="Server class documentation"/>
<tab type="user" url="../baro-client/html/index.html" title="Client class documentation"/>
<tab type="mainpage" visible="yes" title=""/>
</navindex>
</doxygenlayout>

View File

@@ -1,244 +0,0 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.9.4 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="user" url="../../html/index.html" title="Documentation introduction"/>
<tab type="user" url="../../baro-server/html/index.html" title="Server class documentation"/>
<tab type="user" url="./index.html" title="Client class documentation"/>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="concepts" visible="yes" title="">
</tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="structs" visible="yes" title="">
<tab type="structlist" visible="yes" title="" intro=""/>
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
</tab>
<tab type="exceptions" visible="yes" title="">
<tab type="exceptionlist" visible="yes" title="" intro=""/>
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<concepts visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a concept page -->
<concept>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<definition visible="yes" title=""/>
<detaileddescription title=""/>
<authorsection visible="yes"/>
</concept>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@@ -1,244 +0,0 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.9.4 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="user" url="../../html/index.html" title="Documentation introduction"/>
<tab type="user" url="./index.html" title="Server class documentation"/>
<tab type="user" url="../../baro-client/html/index.html" title="Client class documentation"/>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="concepts" visible="yes" title="">
</tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="structs" visible="yes" title="">
<tab type="structlist" visible="yes" title="" intro=""/>
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
</tab>
<tab type="exceptions" visible="yes" title="">
<tab type="exceptionlist" visible="yes" title="" intro=""/>
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<concepts visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a concept page -->
<concept>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<definition visible="yes" title=""/>
<detaileddescription title=""/>
<authorsection visible="yes"/>
</concept>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@@ -1,16 +0,0 @@
@echo off
if not exist ".\build" mkdir ".\build"
if not exist ".\build\baro-server" mkdir ".\build\baro-server"
if not exist ".\build\baro-client" mkdir ".\build\baro-client"
cd .\baro-server
echo Building server documentation
doxygen Doxyfile
cd ..\baro-client
echo Building client documentation
doxygen Doxyfile
cd ..
echo Building shared documentation
doxygen Doxyfile

View File

@@ -1,5 +0,0 @@
@echo off
if not exist ".\build" mkdir ".\build"
echo Building shared documentation
doxygen Doxyfile

16
luacs-docs/.editorconfig Normal file
View File

@@ -0,0 +1,16 @@
[*]
end_of_line = lf
[*.cs]
indent_style = space
indent_size = 2
csharp_prefer_braces = when_multiline:warning
csharp_indent_case_contents_when_block = false
# One True Brace style
csharp_new_line_before_open_brace = none
csharp_new_line_before_else = false
csharp_new_line_before_catch = false
csharp_new_line_before_finally = false
csharp_new_line_before_members_in_object_initializers = false
csharp_new_line_before_members_in_anonymous_types = false
csharp_new_line_between_query_expression_clauses = false

2
luacs-docs/.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# prevent git from converting our line endings to CRLF
* text=auto eol=lf

4
luacs-docs/cs/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
html
*/html
*/*.tag
build

View File

@@ -0,0 +1,8 @@
<doxygenlayout version="1.0">
<navindex>
<tab type="user" url="./index.html" title="Documentation introduction"/>
<tab type="user" url="../baro-server/html/index.html" title="Server class documentation"/>
<tab type="user" url="../baro-client/html/index.html" title="Client class documentation"/>
<tab type="mainpage" visible="yes" title=""/>
</navindex>
</doxygenlayout>

View File

@@ -906,8 +906,8 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = ../../Barotrauma/BarotraumaShared/SharedSource \
../../Barotrauma/BarotraumaClient/ClientSource
INPUT = ../../../Barotrauma/BarotraumaShared/SharedSource \
../../../Barotrauma/BarotraumaClient/ClientSource
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

View File

@@ -0,0 +1,243 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.9.4 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="user" url="../../html/index.html" title="Documentation introduction"/>
<tab type="user" url="../../baro-server/html/index.html" title="Server class documentation"/>
<tab type="user" url="./index.html" title="Client class documentation"/>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="concepts" visible="yes" title="">
</tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="structs" visible="yes" title="">
<tab type="structlist" visible="yes" title="" intro=""/>
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
</tab>
<tab type="exceptions" visible="yes" title="">
<tab type="exceptionlist" visible="yes" title="" intro=""/>
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<concepts visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a concept page -->
<concept>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<definition visible="yes" title=""/>
<detaileddescription title=""/>
<authorsection visible="yes"/>
</concept>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@@ -906,8 +906,8 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = ../../Barotrauma/BarotraumaShared/SharedSource \
../../Barotrauma/BarotraumaServer/ServerSource
INPUT = ../../../Barotrauma/BarotraumaShared/SharedSource \
../../../Barotrauma/BarotraumaServer/ServerSource
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

View File

@@ -0,0 +1,243 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.9.4 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="user" url="../../html/index.html" title="Documentation introduction"/>
<tab type="user" url="./index.html" title="Server class documentation"/>
<tab type="user" url="../../baro-client/html/index.html" title="Client class documentation"/>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="concepts" visible="yes" title="">
</tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="structs" visible="yes" title="">
<tab type="structlist" visible="yes" title="" intro=""/>
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
</tab>
<tab type="exceptions" visible="yes" title="">
<tab type="exceptionlist" visible="yes" title="" intro=""/>
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<concepts visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a concept page -->
<concept>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<definition visible="yes" title=""/>
<detaileddescription title=""/>
<authorsection visible="yes"/>
</concept>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

Some files were not shown because too many files have changed in this diff Show More