mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Compare commits
400 Commits
feature/st
...
v0.65.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a898adaa2 | ||
|
|
031dceeb48 | ||
|
|
bf6928703f | ||
|
|
75288ba5e7 | ||
|
|
96938ca85a | ||
|
|
a60011d612 | ||
|
|
60e0c0b804 | ||
|
|
a0c23c7fee | ||
|
|
46183aa41a | ||
|
|
3f175a8d2a | ||
|
|
fac1b2c469 | ||
|
|
bb137d69a2 | ||
|
|
1723be3d5b | ||
|
|
a35632d89e | ||
|
|
f956ad2008 | ||
|
|
1646297039 | ||
|
|
c26c8fb81e | ||
|
|
38f2808816 | ||
|
|
7994935b23 | ||
|
|
7120000ef5 | ||
|
|
7c3fd3eaa9 | ||
|
|
8bd47cd7f8 | ||
|
|
1068458beb | ||
|
|
54db524e53 | ||
|
|
9265af75bf | ||
|
|
037bff9099 | ||
|
|
6de1b41d9c | ||
|
|
0ab9f34046 | ||
|
|
2746dccfc6 | ||
|
|
eae54d0327 | ||
|
|
c1195d1f1d | ||
|
|
5a02c5c03f | ||
|
|
d9c59164f2 | ||
|
|
72a952fbdd | ||
|
|
45e58c1ed8 | ||
|
|
127d1d7eaf | ||
|
|
18c9c6bf0a | ||
|
|
89ec06468f | ||
|
|
9920e409ca | ||
|
|
f1681b2128 | ||
|
|
490a4efff8 | ||
|
|
a416eedff0 | ||
|
|
2fe0c94d84 | ||
|
|
2f22de4eff | ||
|
|
2017d943fb | ||
|
|
e34935c9e2 | ||
|
|
db95c6284b | ||
|
|
6255ee6e96 | ||
|
|
d1b16d9a52 | ||
|
|
708b3b2acf | ||
|
|
2e471366b7 | ||
|
|
ca9ce7c7ed | ||
|
|
81cd43f988 | ||
|
|
cf5c72e7ea | ||
|
|
2629fd3efb | ||
|
|
338fcd5fcb | ||
|
|
b5395c0bc0 | ||
|
|
97bdc1edee | ||
|
|
8a0464ed35 | ||
|
|
31d68dcd49 | ||
|
|
3b337bf88d | ||
|
|
f3e0706488 | ||
|
|
3378f1ff98 | ||
|
|
f160508da3 | ||
|
|
1ba5c9120f | ||
|
|
701606c75a | ||
|
|
efa0fa3f1b | ||
|
|
63b9b56006 | ||
|
|
4b082baf37 | ||
|
|
698d65c5af | ||
|
|
c9dd27658e | ||
|
|
266223c3fd | ||
|
|
521e4746c6 | ||
|
|
72efbe543c | ||
|
|
b69ccc2241 | ||
|
|
656992ae5f | ||
|
|
947f04ebb9 | ||
|
|
603b88c77a | ||
|
|
108e270f9e | ||
|
|
d3edd10714 | ||
|
|
125d138e16 | ||
|
|
f5c210b990 | ||
|
|
4521dc37f5 | ||
|
|
adcdb9f736 | ||
|
|
2116230f58 | ||
|
|
dd0d186314 | ||
|
|
329e2b0cdc | ||
|
|
a562675553 | ||
|
|
89a1d32e1d | ||
|
|
05fb110f40 | ||
|
|
c6896e9bd9 | ||
|
|
2678fad629 | ||
|
|
7d0e9f9635 | ||
|
|
7a5df9a718 | ||
|
|
856fbd0480 | ||
|
|
828ac48f7c | ||
|
|
d0e11a755c | ||
|
|
b637967163 | ||
|
|
50dce4d56b | ||
|
|
e9af594448 | ||
|
|
b5662007d5 | ||
|
|
03acded657 | ||
|
|
6b0e2deede | ||
|
|
ffe1689be6 | ||
|
|
2f3f7976f1 | ||
|
|
df7933b890 | ||
|
|
5778ca87e7 | ||
|
|
af8a21df53 | ||
|
|
cd02dddd5d | ||
|
|
e44805cd20 | ||
|
|
635387a23e | ||
|
|
2b594f6356 | ||
|
|
cec14ae861 | ||
|
|
a12a973a26 | ||
|
|
45a315bb69 | ||
|
|
1e843bf3a2 | ||
|
|
26c85725a5 | ||
|
|
467d391ec8 | ||
|
|
601feb7cc0 | ||
|
|
cd1466cdc0 | ||
|
|
94aeb309b2 | ||
|
|
3fba59eb6c | ||
|
|
508754f4bc | ||
|
|
3f4ae0f02a | ||
|
|
b0daf64d94 | ||
|
|
c4223f015d | ||
|
|
33ebb99b9c | ||
|
|
dad176aca1 | ||
|
|
cac1f3e018 | ||
|
|
49dfb2d2f1 | ||
|
|
4e0821c6c1 | ||
|
|
39800d57d1 | ||
|
|
52b9729bb8 | ||
|
|
5a49ce1812 | ||
|
|
c3d27fb338 | ||
|
|
07378f4503 | ||
|
|
ae2f3fe70c | ||
|
|
6edd5d8a63 | ||
|
|
08c6e52806 | ||
|
|
f13a066bdd | ||
|
|
c478ef3a4b | ||
|
|
1d3bf8d072 | ||
|
|
12f40d951d | ||
|
|
c98e409ad8 | ||
|
|
ef6efd3c68 | ||
|
|
c4b0534240 | ||
|
|
ff0dbecbee | ||
|
|
b0d59e5e3f | ||
|
|
e3d29ae28f | ||
|
|
9aebaa3749 | ||
|
|
2bae6abbc0 | ||
|
|
880160e7af | ||
|
|
801b513cde | ||
|
|
bd284cc945 | ||
|
|
c481b50a8b | ||
|
|
c889c2b2aa | ||
|
|
60c150269e | ||
|
|
8dffeef261 | ||
|
|
6943693d3f | ||
|
|
964ab60020 | ||
|
|
8fad4d291f | ||
|
|
d3adcb83db | ||
|
|
3c046b5f6f | ||
|
|
dd567a4cc8 | ||
|
|
fe78883a93 | ||
|
|
1d0c9e9512 | ||
|
|
1a61f1925c | ||
|
|
18567c7051 | ||
|
|
4932487859 | ||
|
|
506f0b0a1e | ||
|
|
ae2e6bca82 | ||
|
|
0b19d04c1c | ||
|
|
8344e8ba10 | ||
|
|
5dd1b58357 | ||
|
|
537e1ab4f9 | ||
|
|
7247171b4b | ||
|
|
155a35ab06 | ||
|
|
3c50db8b5e | ||
|
|
78ba02432e | ||
|
|
32f8b6f4b8 | ||
|
|
97d52393ed | ||
|
|
576abe7adb | ||
|
|
d404494018 | ||
|
|
80e390a74b | ||
|
|
cf912d8c07 | ||
|
|
ae8a7481bc | ||
|
|
dbcb9bde3d | ||
|
|
6dc06e7690 | ||
|
|
f2cbfbf705 | ||
|
|
ca79d1fc13 | ||
|
|
2bcfca3d78 | ||
|
|
74c86bf08c | ||
|
|
b8397a1a27 | ||
|
|
4c2da94a58 | ||
|
|
42c6b9976a | ||
|
|
cd40916df0 | ||
|
|
95525a549a | ||
|
|
07c5c0ca0e | ||
|
|
c8e36eadf7 | ||
|
|
b3df54d2bb | ||
|
|
007bfe4447 | ||
|
|
ea1691c7f5 | ||
|
|
f82e3e8432 | ||
|
|
59d8cb37f0 | ||
|
|
cf52985eaf | ||
|
|
aa412c2b47 | ||
|
|
917280b4d7 | ||
|
|
51c6ff934e | ||
|
|
e534fcd800 | ||
|
|
6105be4b14 | ||
|
|
205147c0f0 | ||
|
|
f6d722f7c3 | ||
|
|
d1c1bffc4f | ||
|
|
54316b7255 | ||
|
|
2d7cd49dbc | ||
|
|
5832cb3866 | ||
|
|
818ea1a629 | ||
|
|
58c0f7796b | ||
|
|
55217c982d | ||
|
|
036951ae62 | ||
|
|
ebaa8d9ac3 | ||
|
|
e222f82059 | ||
|
|
d867661c24 | ||
|
|
ac7c44ab2e | ||
|
|
b861182846 | ||
|
|
1f3e42b013 | ||
|
|
7b0c4dd7fb | ||
|
|
2898e1413b | ||
|
|
ba3525c0c0 | ||
|
|
5ff11980b7 | ||
|
|
29274986f8 | ||
|
|
57d862f9fc | ||
|
|
31da2557d5 | ||
|
|
9752996497 | ||
|
|
7c7c8d23fb | ||
|
|
e1dc83a573 | ||
|
|
520461ff95 | ||
|
|
7c2a010c71 | ||
|
|
c17faedccf | ||
|
|
36495fe81b | ||
|
|
9e3851b847 | ||
|
|
582e705088 | ||
|
|
cf893c3c32 | ||
|
|
3a5cc20a88 | ||
|
|
cb209df0e5 | ||
|
|
eb64f55ce5 | ||
|
|
00ab9c6474 | ||
|
|
26eaa38e89 | ||
|
|
42bc16d4c9 | ||
|
|
498ce86176 | ||
|
|
3104678140 | ||
|
|
c63984eaca | ||
|
|
078b81d495 | ||
|
|
4c341f0289 | ||
|
|
bb4461587e | ||
|
|
fe45af151a | ||
|
|
ae2b0e9d8f | ||
|
|
ddf4828bf9 | ||
|
|
b1d0dbf03c | ||
|
|
a91b134c5d | ||
|
|
660b0b05d3 | ||
|
|
e14493246e | ||
|
|
d93a35b620 | ||
|
|
2e12a712fa | ||
|
|
29a84a6621 | ||
|
|
51f00d4b3b | ||
|
|
a67b22cce8 | ||
|
|
cfbfdbf420 | ||
|
|
a76d053818 | ||
|
|
1587ee3c93 | ||
|
|
662808d0d3 | ||
|
|
9d88857b55 | ||
|
|
3c92794aed | ||
|
|
527879c048 | ||
|
|
d2494bcdc7 | ||
|
|
486aa1423b | ||
|
|
20659789b0 | ||
|
|
d87d6f7f8c | ||
|
|
fa5fdcb5a5 | ||
|
|
e6af084c22 | ||
|
|
de01b9d8cb | ||
|
|
c9aa2c61bd | ||
|
|
8200f1d942 | ||
|
|
1af0ebca6c | ||
|
|
fe5957bb91 | ||
|
|
be08f1787f | ||
|
|
ea35e6c03f | ||
|
|
a6c6b22393 | ||
|
|
5e6e5cb5ea | ||
|
|
64d2a3ca28 | ||
|
|
bee4e499a8 | ||
|
|
55da2dc5e5 | ||
|
|
177eca0f90 | ||
|
|
ae229a03d8 | ||
|
|
2dc8093660 | ||
|
|
071acbc818 | ||
|
|
3f5982cac0 | ||
|
|
6f387402fe | ||
|
|
363e28561c | ||
|
|
4d63b54259 | ||
|
|
7fa05c7db3 | ||
|
|
c466f5f17f | ||
|
|
b6f302b71e | ||
|
|
7d9db6f7b2 | ||
|
|
8bedba2da7 | ||
|
|
837dde78c9 | ||
|
|
a01629969d | ||
|
|
15e13c7f92 | ||
|
|
3dd80b90eb | ||
|
|
cb8e295ad9 | ||
|
|
909163a923 | ||
|
|
6aa2408364 | ||
|
|
afc1eed7ae | ||
|
|
85c8dc05fe | ||
|
|
710371d7d1 | ||
|
|
9f651646d7 | ||
|
|
d2860c80a9 | ||
|
|
e1b9ae22b6 | ||
|
|
5d64f35c96 | ||
|
|
5cfea0cd97 | ||
|
|
a165556bf5 | ||
|
|
dee2881203 | ||
|
|
da0891a5f4 | ||
|
|
1ed9796700 | ||
|
|
578a967a31 | ||
|
|
14c0c58e87 | ||
|
|
766d909a08 | ||
|
|
9c50a217da | ||
|
|
4f9db0cdb7 | ||
|
|
3c19937750 | ||
|
|
c509764014 | ||
|
|
75e06e4060 | ||
|
|
1b909f71a1 | ||
|
|
1a8764f54b | ||
|
|
9152c97de7 | ||
|
|
45cb04f928 | ||
|
|
a700750d9e | ||
|
|
07d327eb8b | ||
|
|
2275ec9573 | ||
|
|
5848b449f6 | ||
|
|
67aa32e694 | ||
|
|
dbd2961b9f | ||
|
|
b77b49c667 | ||
|
|
0eabe62bdb | ||
|
|
31e2ea2770 | ||
|
|
7a636b3b87 | ||
|
|
98ce017b4a | ||
|
|
26b04f0d66 | ||
|
|
f4f2dea688 | ||
|
|
e9a0f9a4c1 | ||
|
|
de438ae94c | ||
|
|
9ec77f20ee | ||
|
|
da01040b52 | ||
|
|
dce2a5ddb2 | ||
|
|
5c99fbabf2 | ||
|
|
9d0846c0e9 | ||
|
|
035ecfb098 | ||
|
|
3693f5aee7 | ||
|
|
b859815b07 | ||
|
|
3701ca83e4 | ||
|
|
1473f1d34c | ||
|
|
889c140fb9 | ||
|
|
c8259915f8 | ||
|
|
a2a25fb296 | ||
|
|
938a9929ea | ||
|
|
7726075b9b | ||
|
|
03b3d1bbe7 | ||
|
|
17ec51b74c | ||
|
|
e92998d1ec | ||
|
|
6691512136 | ||
|
|
a80f4ad76c | ||
|
|
2c6f4cd80c | ||
|
|
51a4c6dcf2 | ||
|
|
1f402e581a | ||
|
|
17ea92bfda | ||
|
|
6a8266af7e | ||
|
|
f6b7606648 | ||
|
|
9cd8adae93 | ||
|
|
c5ba8b75c8 | ||
|
|
3d73cc7289 | ||
|
|
11aa062ee0 | ||
|
|
b4358a9e33 | ||
|
|
0cce4714a1 | ||
|
|
9c4e6a6595 | ||
|
|
1ddd541fe9 | ||
|
|
e45aa3f2fe | ||
|
|
99efdb6061 | ||
|
|
32f0ffdc79 | ||
|
|
cf166483c9 | ||
|
|
49631867f4 | ||
|
|
9f56eaec9a | ||
|
|
04f2b732a5 | ||
|
|
b8cfabc339 | ||
|
|
1cdd39202f | ||
|
|
3290720b4c | ||
|
|
49badb06cb | ||
|
|
2c6941e73b | ||
|
|
5e5883cb88 | ||
|
|
02c504445e | ||
|
|
4d5075a792 |
30
.github/workflows/benchmarks.yml
vendored
30
.github/workflows/benchmarks.yml
vendored
@@ -9,14 +9,6 @@ on:
|
||||
|
||||
concurrency: benchmarks
|
||||
|
||||
env:
|
||||
ROBUST_BENCHMARKS_ENABLE_SQL: 1
|
||||
ROBUST_BENCHMARKS_SQL_ADDRESS: ${{ secrets.BENCHMARKS_WRITE_ADDRESS }}
|
||||
ROBUST_BENCHMARKS_SQL_PORT: ${{ secrets.BENCHMARKS_WRITE_PORT }}
|
||||
ROBUST_BENCHMARKS_SQL_USER: ${{ secrets.BENCHMARKS_WRITE_USER }}
|
||||
ROBUST_BENCHMARKS_SQL_PASSWORD: ${{ secrets.BENCHMARKS_WRITE_PASSWORD }}
|
||||
ROBUST_BENCHMARKS_SQL_DATABASE: benchmarks
|
||||
|
||||
jobs:
|
||||
benchmark:
|
||||
name: Run Benchmarks
|
||||
@@ -28,8 +20,22 @@ jobs:
|
||||
host: centcomm.spacestation14.io
|
||||
username: robust-benchmark-runner
|
||||
key: ${{ secrets.CENTCOMM_ROBUST_BENCHMARK_RUNNER_KEY }}
|
||||
command_timeout: 100000m
|
||||
command_timeout: 100000m
|
||||
script: |
|
||||
wget https://raw.githubusercontent.com/space-wizards/RobustToolbox/${{ github.sha }}/Tools/run_benchmarks.py
|
||||
python3 run_benchmarks.py "${{ secrets.BENCHMARKS_WRITE_ADDRESS }}" "${{ secrets.BENCHMARKS_WRITE_PORT }}" "${{ secrets.BENCHMARKS_WRITE_USER }}" "${{ secrets.BENCHMARKS_WRITE_PASSWORD }}" "${{ github.sha }}"
|
||||
rm run_benchmarks.py
|
||||
mkdir benchmark_run_${{ github.sha }}
|
||||
cd benchmark_run_${{ github.sha }}
|
||||
git clone https://github.com/space-wizards/RobustToolbox.git repo_dir --recursive
|
||||
cd repo_dir
|
||||
git checkout ${{ github.sha }}
|
||||
cd Robust.Benchmarks
|
||||
dotnet restore
|
||||
export ROBUST_BENCHMARKS_ENABLE_SQL=1
|
||||
export ROBUST_BENCHMARKS_SQL_ADDRESS="${{ secrets.BENCHMARKS_WRITE_ADDRESS }}"
|
||||
export ROBUST_BENCHMARKS_SQL_PORT="${{ secrets.BENCHMARKS_WRITE_PORT }}"
|
||||
export ROBUST_BENCHMARKS_SQL_USER="${{ secrets.BENCHMARKS_WRITE_USER }}"
|
||||
export ROBUST_BENCHMARKS_SQL_PASSWORD="${{ secrets.BENCHMARKS_WRITE_PASSWORD }}"
|
||||
export ROBUST_BENCHMARKS_SQL_DATABASE="benchmarks"
|
||||
export GITHUB_SHA="${{ github.sha }}"
|
||||
dotnet run --filter '*' --configuration Release
|
||||
cd ../../..
|
||||
rm -rf benchmark_run_${{ github.sha }}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\MSBuild\Robust.Properties.targets" />
|
||||
</Project>
|
||||
|
||||
Submodule Lidgren.Network/Lidgren.Network updated: 1e7fb3c2b6...13bd6f1ad2
@@ -1,7 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>SpaceWizards.Lidgren.Network</AssemblyName>
|
||||
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<DefaultItemExcludes>Lidgren.Network/**/*</DefaultItemExcludes>
|
||||
@@ -13,6 +15,7 @@
|
||||
<Compile Include="Lidgren.Network\Lidgren.Network\**\*.cs">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
<Compile Remove="Lidgren.Network\Lidgren.Network\obj\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -26,4 +26,7 @@
|
||||
<PropertyGroup Condition="'$(EnableClientScripting)' == 'True'">
|
||||
<DefineConstants>$(DefineConstants);CLIENT_SCRIPTING</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(UseSystemSqlite)' == 'True'">
|
||||
<DefineConstants>$(DefineConstants);USE_SYSTEM_SQLITE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project>
|
||||
<!-- This file automatically reset by Tools/version.py -->
|
||||
<PropertyGroup><Version>0.40.3.0</Version></PropertyGroup>
|
||||
</Project>
|
||||
<Project>
|
||||
|
||||
<!-- This file automatically reset by Tools/version.py -->
|
||||
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
<ActualOS>MacOS</ActualOS>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="$([MSBuild]::IsOSPlatform('FreeBSD'))">
|
||||
<PropertyGroup>
|
||||
<ActualOS>FreeBSD</ActualOS>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<ActualOS>Linux</ActualOS>
|
||||
@@ -30,5 +35,6 @@
|
||||
<EnableClientScripting>True</EnableClientScripting>
|
||||
<!-- Client scripting is disabled on full release builds for security and size reasons. -->
|
||||
<EnableClientScripting Condition="'$(FullRelease)' == 'True'">False</EnableClientScripting>
|
||||
<UseSystemSqlite Condition="'$(TargetOS)' == 'FreeBSD'">True</UseSystemSqlite>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
|
||||
<TargetFramework>$(TargetFramework)</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\MSBuild\Robust.DefineConstants.targets" />
|
||||
|
||||
453
RELEASE-NOTES.md
Normal file
453
RELEASE-NOTES.md
Normal file
@@ -0,0 +1,453 @@
|
||||
# Release notes for RobustToolbox.
|
||||
|
||||
<!--
|
||||
NOTE: automatically updated sometimes by version.py.
|
||||
Don't change the format without looking at the script!
|
||||
-->
|
||||
|
||||
<!--START TEMPLATE
|
||||
## Master
|
||||
|
||||
### Breaking changes
|
||||
|
||||
*None yet*
|
||||
|
||||
### New features
|
||||
|
||||
*None yet*
|
||||
|
||||
### Bugfixes
|
||||
|
||||
*None yet*
|
||||
|
||||
### Other
|
||||
|
||||
*None yet*
|
||||
|
||||
### Internal
|
||||
|
||||
*None yet*
|
||||
|
||||
|
||||
END TEMPLATE-->
|
||||
|
||||
## Master
|
||||
|
||||
### Breaking changes
|
||||
|
||||
*None yet*
|
||||
|
||||
### New features
|
||||
|
||||
*None yet*
|
||||
|
||||
### Bugfixes
|
||||
|
||||
*None yet*
|
||||
|
||||
### Other
|
||||
|
||||
*None yet*
|
||||
|
||||
### Internal
|
||||
|
||||
*None yet*
|
||||
|
||||
|
||||
## 0.65.2.0
|
||||
|
||||
### New features
|
||||
|
||||
* Added ClydeAudio.StopAllAudio()
|
||||
* Expose more tick logic to content.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix bad reference in WebView.
|
||||
|
||||
### Internal
|
||||
|
||||
* Add Robust.Packaging to solution.
|
||||
* Add WebView to solution.
|
||||
* Physics contacts are now parallel and much faster.
|
||||
|
||||
## 0.65.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Implement value prototype id dictionary serializer.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixes lerping clean up issue added in #3472.
|
||||
|
||||
### Internal
|
||||
|
||||
* Add test for (de)serializing data record structs.
|
||||
|
||||
|
||||
## 0.65.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- Fix SetLocalPositionRotation raising 2 moveevents. This should help physics performance significantly.
|
||||
- Fix tpgrid responses and command error.
|
||||
|
||||
|
||||
## 0.65.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Rename transform lerping properties alongside other minor internal changes.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix physics testbeds.
|
||||
* Force grids to always be collidable for now and stop them clipping.
|
||||
|
||||
### Other
|
||||
|
||||
* Slight optimization to `OutputPanel`'s handling of internal `RichTextEntry`s.
|
||||
* Force non-collidable contacts to be destroyed. Previously these hung around until both entities became collidable again.
|
||||
|
||||
### Internal
|
||||
|
||||
* `Tools/version.py` has been updated to automatically update `RELEASE-NOTES.md`.
|
||||
* General cleanup to `Tools/version.py`.
|
||||
|
||||
## 0.64.1.0
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Word-wrapping in `OutputPanel` and `RichTextLabel` has been fixed.
|
||||
|
||||
## 0.64.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* IMapLoader has been refactored into MapLoaderSystem. The API is similar for now but is subject to change in the future.
|
||||
|
||||
## 0.63.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Thanks to new IME support with SDL2, `IClyde.TextInputStart()` and `IClyde.TextInputStop()` must now be appropriately called to start/stop receiving text input when focusing/unfocusing a UI control. This restriction is applied even on the (default) GLFW backend, to enforce consistent usage of these APIs.
|
||||
* `[GUI]TextEventArgs` have been renamed to `[GUI]TextEnteredEventArgs`, turned into records, and made to carry a `string` rather than a single text `Rune`.
|
||||
* IoC and `DependencyCollection` `Register` methods now have a `TInterface : class` constraint.
|
||||
* [ABI] `IoCManager.InitThread` now returns the `IDependencyCollection`.
|
||||
|
||||
### New features
|
||||
|
||||
* Fixes for compiling & running on .NET 7. You'll still have to edit a bunch of project files to enable this though.
|
||||
* `FormattedMessage.EnumerateRunes()`
|
||||
* `OSWindow.Shown()` virtual function for child classes to hook into.
|
||||
* `IUserInterfaceManager.DeferAction(...)` for running UI logic "not right now because that would cause an enumeration exception".
|
||||
* New `TextEdit` control for multi-line editable text, complete with word-wrapping!
|
||||
* `Rope` data structure for representing large editable text, used by the new `TextEdit`.
|
||||
* Robust now has IME support matching SDL2's API. This only works on the SDL2 backend (which is not currently enabled by default) but the API is there:
|
||||
* `IClyde.TextInputStart()`, `IClyde.TextInputStop()`, `IClyde.TextInputSetRect()` APIs to control text input behavior.
|
||||
* `TextEditing` events for reporting in-progress IME compositions.
|
||||
* `LineEdit` and `TextEdit` have functional IME support when the game is running on SDL2. If you provide a font file with the relevant glyphs, CJK text input should now be usable.
|
||||
* `Register<T>` (single type parameter) extension method for `IDependencyCollection`.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixes erroneous literal "\\n" inside the Clyde debug panel.
|
||||
* Fixed Lidgren connection status changes potentially getting mislogged.
|
||||
* Fixed missing components not being correctly saved for maps
|
||||
* Fixed map saving sometimes not including new components.
|
||||
* Fix hot reload unit tests.
|
||||
|
||||
### Other
|
||||
|
||||
* Properly re-use `HttpClient` in `NetManager` meaning we properly pool connections to the auth server, improving performance.
|
||||
* Hub advertisements have extended keep-alive pool timeout, so the connection can be kept active between advertisements.
|
||||
* All HTTP requests from the engine now have appropriate `User-Agent` header.
|
||||
* `bind` command has been made somewhat more clear thanks to a bit of help text and some basic completions.
|
||||
* `BoundKeyEventArgs` and derivatives now have a `[DebuggerDisplay]`.
|
||||
* Text cursors now have a fancy blinking animation.
|
||||
* `SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH` is set on the SDL2 windowing backend, so clicking on the game window to focus it will pass clicks through into the game itself, matching GLFW's behavior.
|
||||
* Windows clipboard history paste now works.
|
||||
* Improved multi-window UI keyboard focusing system: a single focused control is now tracked per UI root (OS window), and is saved/restored when switching between focused window. This means that you (ideally) only ever have a UI control focused on the current OS window.
|
||||
|
||||
### Internal
|
||||
|
||||
* `uitest2` is a new command that's like `uitest` but opens an OS window instead. It can also be passed an argument to open a specific tab immediately.
|
||||
* Word-wrapping logic has been split off from `RichTextEntry`, into a new helper struct `WordWrap`.
|
||||
* Some internal logic in `LineEdit` has been shared with `TextEdit` by moving it to a new `TextEditShared` file.
|
||||
* SDL2 backend now uses `[UnmanagedCallersOnly]` instead of `GetFunctionPointerForDelegate`-style P/Invoke marshalling.
|
||||
* Entity prototype reloading logic has been moved out of `PrototypeManager` and into a new `PrototypeReloadSystem`.
|
||||
* Most usages of `IoCManager.` statically have been removed in favor of dependency injection.
|
||||
|
||||
## 0.62.1.0
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed a PVS issue causing entities to be sent to clients without first sending their parents.
|
||||
* Improved client-side state handling exception tolerance.
|
||||
|
||||
### Other
|
||||
|
||||
* Removed null-space map entities.
|
||||
|
||||
### Internal
|
||||
|
||||
* Added some more anchoring tests.
|
||||
|
||||
## 0.62.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed sprites not animating when directly toggling layer visibility,
|
||||
* Fixed anchored entities not being added to the anchored lookups.
|
||||
|
||||
## 0.62.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Removed some obsolete map event handlers.
|
||||
|
||||
### New features
|
||||
|
||||
* Added entity query struct enumerators
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Improved error tolerance during client state application.
|
||||
* Added better error logs when a client deletes a predicted entity.
|
||||
* Fixes command permissions not getting sent to clients.
|
||||
* Fixes a broad-phase bug were entities were not properly updating their positions.
|
||||
|
||||
### Other
|
||||
|
||||
* Added the LocalizedCommands class, which automatically infer help and description loc strings from the commands name.
|
||||
|
||||
## 0.61.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* IMap and IMapGrid have been removed. Just use the associated components directly.
|
||||
|
||||
### Other
|
||||
|
||||
* AudioSystem has been refactored.
|
||||
|
||||
## 0.60.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* ISerializationHooks.BeforeSerialization() has been removed. Use custom type serializers instead.
|
||||
|
||||
### New features
|
||||
|
||||
* Added function to UserInterfaceSystem that returns list of BUIs that a client has open.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed various container related broadphase bugs which could result in entities getting stuck with a null-broadphase.
|
||||
* Fixed client fixture state handling bug that caused the client to incorrectly disable collision.
|
||||
|
||||
### Other
|
||||
|
||||
* Misc PVS optimisations
|
||||
|
||||
### Internal
|
||||
|
||||
* Removed redundant grid-init physics logic
|
||||
* Modified garbage collection for entity spawning profiling.
|
||||
|
||||
## 0.59.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Various transform related methods have been removed from MapGrids
|
||||
* TransformSystem.SetCoordinates() arguments have changed and now allow an entity to be sent to nullspace
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed an entity lookup bug that sometimes failed to return entities in StaticSundriesTrees
|
||||
|
||||
### Other
|
||||
|
||||
* The EntitySystem.Resolve<> methods have been change to protected
|
||||
|
||||
## 0.58.1.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed some container shutdown errors
|
||||
* Fixed LookupFlags.Static not acting as a full replacement for LookupFlags.Anchored
|
||||
|
||||
## 0.58.1.0
|
||||
|
||||
### Other
|
||||
|
||||
* Physics collision changed and body type changed events no longer get raised before initialisation
|
||||
|
||||
## 0.58.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Some TransformComponent functions have been moved to the system.
|
||||
* Container insert, remove, and shutdown function arguments and functionality has changed.
|
||||
* Physics entities without fixtures now automatically disable collision.
|
||||
|
||||
### New features
|
||||
|
||||
* Added command to profile entity spawning
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* EntityLookup/BroadphaseComponent tracking has been overhauled, which should hopefully fix various broadphase bugs.
|
||||
|
||||
### Other
|
||||
|
||||
* Component.Owner is now marked as obsolete.
|
||||
|
||||
## 0.57.0.4
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Made entity deletion more resilient against exceptions. Should fix several bugs.
|
||||
|
||||
## 0.57.0.2 and 0.57.0.3
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed more entity-lookup bugs.
|
||||
|
||||
## 0.57.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed entity lookup bug that was causing crashes.
|
||||
|
||||
### 0.57.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* EntityLookupComponent has been merged into BroadphaseComponent. The data that was previously stored in this tree is now stored across the 3 trees on BroadphaseComponent.
|
||||
|
||||
### New features
|
||||
|
||||
* EntityLookup has had its flags updated to reflect the merge of EntityLookupComponent and BroadphaseComponent, with the new flags reflecting each tree: Dynamic, Static, and Sundries. Dynamic and Static store physics bodies that are collidable and Sundries stores everything else (apart from grids).
|
||||
|
||||
### Internal
|
||||
|
||||
* EntityLookup and Broadphase have had their data de-duplicated, dropping the AABBs stored on the server by half. This also means MoveEvent updates will be much faster.
|
||||
* PVS mover updates has had their performance improved slightly.
|
||||
* Physics LinkedList nodes for contacts will no longer be re-made for every contact and will just be cleared when re-used.
|
||||
* Sprite / Light dynamictree allocations on the client have been dropped by using static lambdas.
|
||||
* The physics contact buffer for each FixtureProxy is now pooled.
|
||||
|
||||
## 0.56.1.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix PVS sometimes not sending an entity's parents.
|
||||
* Fix velocity preservation on parenting changes.
|
||||
|
||||
## 0.56.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Update pt-BR locale with more localizations
|
||||
* Separated PVS entity budget into an entity creation budget and a pvs-entry budget.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix VV type handler removal.
|
||||
* System errors during component removal should no longer result in undeletable entities.
|
||||
|
||||
### Other
|
||||
|
||||
* The ordering of component removals and shutdowns during entity deltion has changed (see #3355).
|
||||
* Improved Box2Serializer
|
||||
* Removed uses IEnumerables from EntityLookupSystem.
|
||||
* Optimized client entity spawning by 15%.
|
||||
* Modified how the rendering tree handles entity movement.
|
||||
* Improved grid enumeration allocs.
|
||||
* Fixed a bunch of build warnings (see #3329 and #3289 for details)
|
||||
|
||||
## 0.56.0.2
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Rename \_lib.ftl to \_engine_lib.ftl to avoid overwriting
|
||||
|
||||
## 0.56.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix instantiation of data records containing value types
|
||||
|
||||
## 0.56.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `CastShadows` moved to `SharedPointLightComponent` from clientside, now networked
|
||||
|
||||
### New features
|
||||
|
||||
* New type handler helpers added to V^3
|
||||
* Added pt-BR locale
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed audio fallback coords
|
||||
|
||||
### Other
|
||||
|
||||
* Improved PVS performance by using `for` over `forEach`
|
||||
* Improved Vec2 inverse allocations
|
||||
|
||||
## 0.55.5.0
|
||||
|
||||
### New features
|
||||
|
||||
* Added a method to pass in physics transforms for getting nearest point.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Prevent singular sprite matrices.
|
||||
* Fix obsolete warnings in tests.
|
||||
|
||||
### Other
|
||||
|
||||
* Significantly reduce physics contact allocations.
|
||||
|
||||
## 0.55.4.1
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Removed `SI`, `SIoC`, `I`, `IoC`, `SE` and `CE` VV command prefixes.
|
||||
* `SI`, `SIoC`, `I` and `IoC` are replaced by VV paths under `/ioc/` and `/c/ioc/`.
|
||||
* `SE` and `CE` are replaced by VV paths under `/system/` and `/c/system`.
|
||||
|
||||
### New features
|
||||
|
||||
* Added CVars to control Lidgren's <abbr title="Maximum Transmission Unit">MTU</abbr> parameters:
|
||||
* `net.mtu`
|
||||
* `net.mtu_expand`
|
||||
* `net.mtu_expand_frequency`
|
||||
* `net.mtu_expand_fail_attempts`
|
||||
* Added a whole load of features to ViewVariables.
|
||||
* Added VV Paths, which allow you to refer to an object by a path, e.g. `/entity/1234/Transform/WorldPosition`
|
||||
* Added VV Domains, which allow you to add "handlers" for the top-most VV Path segment, e.g. `/entity` is a domain and so is `/player`...
|
||||
* Added VV Type Handlers, which allow you to add "custom paths" under specific types, even dynamically!
|
||||
* Added VV Path networking, which allows you to read/write/invoke paths remotely, both from server to client and from client to server.
|
||||
* Added `vvread`, `vvwrite` and `vvinvoke` commands, which allow you to read, write and invoke VV paths.
|
||||
* Added autocompletion to all VV commands.
|
||||
* Please note that the VV GUI still remains the same. It will be updated to use these new features in the future.
|
||||
|
||||
### Other
|
||||
|
||||
* Changed Lidgren to be compiled against `net6.0`. This unlocks `Half` read/write methods.
|
||||
* Lidgren has been updated to [0.2.2](https://github.com/space-wizards/SpaceWizards.Lidgren.Network/blob/v0.2.2/RELEASE-NOTES.md). Not all the changes since 0.1.0 are new here, since this is the first version where we're properly tracking this in release notes.
|
||||
* Robust.Client now uses our own [NFluidsynth](https://github.com/space-wizards/SpaceWizards.NFluidsynth) [nuget package](https://www.nuget.org/packages/SpaceWizards.NFluidsynth).
|
||||
|
||||
### Internal
|
||||
|
||||
* Renamed Lidgren's assembly to `SpaceWizards.Lidgren.Network`.
|
||||
* Rogue `obj/` folders inside Lidgren no longer break the build.
|
||||
* Renamed NFluidsynth's assembly to `SpaceWizards.NFluidsynth`
|
||||
3
Resources/EnginePrototypes/UserInterface/uiThemes.yml
Normal file
3
Resources/EnginePrototypes/UserInterface/uiThemes.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
- type: uiTheme
|
||||
id: Default
|
||||
path: /textures/interface/Default
|
||||
63
Resources/Locale/en-US/_engine_lib.ftl
Normal file
63
Resources/Locale/en-US/_engine_lib.ftl
Normal file
@@ -0,0 +1,63 @@
|
||||
# Used internally by the THE() function.
|
||||
zzzz-the = { PROPER($ent) ->
|
||||
*[false] the { $ent }
|
||||
[true] { $ent }
|
||||
}
|
||||
|
||||
# Used internally by the SUBJECT() function.
|
||||
zzzz-subject-pronoun = { GENDER($ent) ->
|
||||
[male] he
|
||||
[female] she
|
||||
[epicene] they
|
||||
*[neuter] it
|
||||
}
|
||||
|
||||
# Used internally by the OBJECT() function.
|
||||
zzzz-object-pronoun = { GENDER($ent) ->
|
||||
[male] him
|
||||
[female] her
|
||||
[epicene] them
|
||||
*[neuter] it
|
||||
}
|
||||
|
||||
# Used internally by the POSS-PRONOUN() function.
|
||||
zzzz-possessive-pronoun = { GENDER($ent) ->
|
||||
[male] his
|
||||
[female] hers
|
||||
[epicene] theirs
|
||||
*[neuter] its
|
||||
}
|
||||
|
||||
# Used internally by the POSS-ADJ() function.
|
||||
zzzz-possessive-adjective = { GENDER($ent) ->
|
||||
[male] his
|
||||
[female] her
|
||||
[epicene] their
|
||||
*[neuter] its
|
||||
}
|
||||
|
||||
# Used internally by the REFLEXIVE() function.
|
||||
zzzz-reflexive-pronoun = { GENDER($ent) ->
|
||||
[male] himself
|
||||
[female] herself
|
||||
[epicene] themselves
|
||||
*[neuter] itself
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BE() function.
|
||||
zzzz-conjugate-be = { GENDER($ent) ->
|
||||
[epicene] are
|
||||
*[other] is
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-HAVE() function.
|
||||
zzzz-conjugate-have = { GENDER($ent) ->
|
||||
[epicene] have
|
||||
*[other] has
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BASIC() function.
|
||||
zzzz-conjugate-basic = { GENDER($ent) ->
|
||||
[epicene] { $first }
|
||||
*[other] { $second }
|
||||
}
|
||||
16
Resources/Locale/en-US/client-state-commands.ftl
Normal file
16
Resources/Locale/en-US/client-state-commands.ftl
Normal file
@@ -0,0 +1,16 @@
|
||||
# Loc strings for various entity state & client-side PVS related commands
|
||||
|
||||
cmd-reset-ent-help = Usage: resetent <Entity UID>
|
||||
cmd-reset-ent-desc = Reset an entity to the most recently received server state. This will also reset entities that have been detached to null-space.
|
||||
|
||||
cmd-reset-all-ents-help = Usage: resetallents
|
||||
cmd-reset-all-ents-desc = Resets all entities to the most recently received server state. This only impacts entities that have not been detached to null-space.
|
||||
|
||||
cmd-detach-ent-help = Usage: detachent <Entity UID>
|
||||
cmd-detach-ent-desc = Detach an entity to null-space, as if it had left PVS range.
|
||||
|
||||
cmd-local-delete-help = Usage: localdelete <Entity UID>
|
||||
cmd-local-delete-desc = Deletes an entity. Unlike the normal delete command, this is CLIENT-SIDE. Unless the entity is a client-side entity, this will likely cause errors.
|
||||
|
||||
cmd-full-state-reset-help = Usage: fullstatereset
|
||||
cmd-full-state-reset-desc = Discards any entity state information and requests a full-state from the server.
|
||||
@@ -1,10 +1,15 @@
|
||||
### Localization for engine console commands
|
||||
|
||||
## generic
|
||||
## generic command errors
|
||||
|
||||
cmd-invalid-arg-number-error = Invalid number of arguments.
|
||||
|
||||
cmd-parse-failure-integer = {$arg} is not a valid integer.
|
||||
cmd-parse-failure-float = {$arg} is not a valid float.
|
||||
cmd-parse-failure-bool = {$arg} is not a valid bool.
|
||||
cmd-parse-failure-uid = {$arg} is not a valid entity UID.
|
||||
cmd-parse-failure-mapid = {$arg} is not a valid MapId.
|
||||
cmd-parse-failure-entity-exist = UID {$arg} does not correspond to an existing entity.
|
||||
|
||||
|
||||
## 'help' command
|
||||
@@ -124,6 +129,11 @@ cmd-monitor-minus-all-hint = Hides all monitors
|
||||
cmd-monitor-plus-all-hint = Shows all monitors
|
||||
|
||||
|
||||
## 'setambientlight' command
|
||||
cmd-set-ambient-light-desc = Allows you to set the ambient light for the specified map, in SRGB.
|
||||
cmd-set-ambient-light-help = setambientlight [mapid] [r g b a]
|
||||
cmd-set-ambient-light-parse = Unable to parse args as a byte values for a color.
|
||||
|
||||
## Mapping commands
|
||||
|
||||
cmd-savemap-desc = Serializes a map to disk. Will not save a post-init map unless forced.
|
||||
@@ -147,9 +157,375 @@ cmd-hint-loadmap-y-position = [y-position]
|
||||
cmd-hint-loadmap-rotation = [rotation]
|
||||
cmd-hint-loadmap-uids = [float]
|
||||
|
||||
cmd-hint-savebp-id = <Grid EntityID>
|
||||
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
cmd-flushcookies-desc = Flush CEF cookie storage to disk
|
||||
cmd-flushcookies-help = This ensure cookies are properly saved to disk in the event of unclean shutdowns.
|
||||
Note that the actual operation is asynchronous.
|
||||
|
||||
cmd-ldrsc-desc = Pre-caches a resource.
|
||||
cmd-ldrsc-help = Usage: ldrsc <path> <type>
|
||||
|
||||
cmd-rldrsc-desc = Reloads a resource.
|
||||
cmd-rldrsc-help = Usage: rldrsc <path> <type>
|
||||
|
||||
cmd-gridtc-desc = Gets the tile count of a grid.
|
||||
cmd-gridtc-help = Usage: gridtc <gridId>
|
||||
|
||||
|
||||
# Client-side commands
|
||||
cmd-guidump-desc = Dump GUI tree to /guidump.txt in user data.
|
||||
cmd-guidump-help = Usage: guidump
|
||||
|
||||
cmd-uitest-desc = Open a dummy UI testing window
|
||||
cmd-uitest-help = Usage: uitest
|
||||
|
||||
## 'uitest2' command
|
||||
cmd-uitest2-desc = Opens a UI control testing OS window
|
||||
cmd-uitest2-help = Usage: uitest2 <tab>
|
||||
cmd-uitest2-arg-tab = <tab>
|
||||
cmd-uitest2-error-args = Expected at most one argument
|
||||
cmd-uitest2-error-tab = Invalid tab: '{$value}'
|
||||
cmd-uitest2-title = UITest2
|
||||
|
||||
|
||||
cmd-setclipboard-desc = Sets the system clipboard
|
||||
cmd-setclipboard-help = Usage: setclipboard <text>
|
||||
|
||||
cmd-getclipboard-desc = Gets the system clipboard
|
||||
cmd-getclipboard-help = Usage: Getclipboard
|
||||
|
||||
cmd-togglelight-desc = Toggles light rendering.
|
||||
cmd-togglelight-help = Usage: togglelight
|
||||
|
||||
cmd-togglefov-desc = Toggles fov for client.
|
||||
cmd-togglefov-help = Usage: togglefov
|
||||
|
||||
cmd-togglehardfov-desc = Toggles hard fov for client. (for debugging space-station-14#2353)
|
||||
cmd-togglehardfov-help = Usage: togglehardfov
|
||||
|
||||
cmd-toggleshadows-desc = Toggles shadow rendering.
|
||||
cmd-toggleshadows-help = Usage: toggleshadows
|
||||
|
||||
cmd-togglelightbuf-desc = Toggles lighting rendering. This includes shadows but not FOV.
|
||||
cmd-togglelightbuf-help = Usage: togglelightbuf
|
||||
|
||||
cmd-chunkinfo-desc = Gets info about a chunk under your mouse cursor.
|
||||
cmd-chunkinfo-help = Usage: chunkinfo
|
||||
|
||||
cmd-rldshader-desc = Reloads all shaders.
|
||||
cmd-rldshader-help = Usage: rldshader
|
||||
|
||||
cmd-cldbglyr-desc = Toggle fov and light debug layers.
|
||||
cmd-cldbglyr-help= Usage: cldbglyr <layer>: Toggle <layer>
|
||||
cldbglyr: Turn all Layers off
|
||||
|
||||
cmd-key-info-desc = Keys key info for a key.
|
||||
cmd-key-info-help = Usage: keyinfo <Key>
|
||||
|
||||
## 'bind' command
|
||||
cmd-bind-desc = Binds an input key combination to an input command.
|
||||
cmd-bind-help = Usage: bind { cmd-bind-arg-key } { cmd-bind-arg-mode } { cmd-bind-arg-command }
|
||||
Note that this DOES NOT automatically save bindings.
|
||||
Use the 'svbind' command to save binding configuration.
|
||||
|
||||
cmd-bind-arg-key = <KeyName>
|
||||
cmd-bind-arg-mode = <BindMode>
|
||||
cmd-bind-arg-command = <InputCommand>
|
||||
|
||||
cmd-net-draw-interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net-draw-interp-help = Usage: net_draw_interp
|
||||
|
||||
cmd-net-draw-interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net-draw-interp-help = Usage: net_draw_interp
|
||||
|
||||
cmd-net-watch-ent-desc = Dumps all network updates for an EntityId to the console.
|
||||
cmd-net-watch-ent-help = Usage: net_watchent <0|EntityUid>
|
||||
|
||||
cmd-net-refresh-desc = Requests a full server state.
|
||||
cmd-net-refresh-help = Usage: net_refresh
|
||||
|
||||
cmd-net-entity-report-desc = Toggles the net entity report panel.
|
||||
cmd-net-entity-report-help = Usage: net_entityreport
|
||||
|
||||
cmd-fill-desc = Fill up the console for debugging.
|
||||
cmd-fill-help = Fills the console with some nonsense for debugging.
|
||||
|
||||
cmd-cls-desc = Clears the console.
|
||||
cmd-cls-help = Clears the debug console of all messages.
|
||||
|
||||
cmd-sendgarbage-desc = Sends garbage to the server.
|
||||
cmd-sendgarbage-help = The server will reply with 'no u'
|
||||
|
||||
cmd-loadgrid-desc = Loads a grid from a file into an existing map.
|
||||
cmd-loadgrid-help = loadgrid <MapID> <Path> [x y] [rotation] [storeUids]
|
||||
|
||||
cmd-loc-desc = Prints the absolute location of the player's entity to console.
|
||||
cmd-loc-help = loc
|
||||
|
||||
cmd-tpgrid-desc = Teleports a grid to a new location.
|
||||
cmd-tpgrid-help = tpgrid <gridId> <X> <Y> [<MapId>]
|
||||
|
||||
cmd-rmgrid-desc = Removes a grid from a map. You cannot remove the default grid.
|
||||
cmd-rmgrid-help = rmgrid <gridId>
|
||||
|
||||
cmd-mapinit-desc = Runs map init on a map.
|
||||
cmd-mapinit-help = mapinit <mapID>
|
||||
|
||||
cmd-lsmap-desc = Lists maps.
|
||||
cmd-lsmap-help = lsmap
|
||||
|
||||
cmd-lsgrid-desc = Lists grids.
|
||||
cmd-lsgrid-help = lsgrid
|
||||
|
||||
cmd-addmap-desc = Adds a new empty map to the round. If the mapID already exists, this command does nothing.
|
||||
cmd-addmap-help = addmap <mapID> [initialize]
|
||||
|
||||
cmd-rmmap-desc = Removes a map from the world. You cannot remove nullspace.
|
||||
cmd-rmmap-help = rmmap <mapId>
|
||||
|
||||
cmd-savegrid-desc = Serializes a grid to disk.
|
||||
cmd-savegrid-help = savegrid <gridID> <Path>
|
||||
|
||||
cmd-testbed-desc = Loads a physics testbed on the specified map.
|
||||
cmd-testbed-help = testbed <mapid> <test>
|
||||
|
||||
cmd-saveconfig-desc = Saves the client configuration to the config file.
|
||||
cmd-saveconfig-help = saveconfig
|
||||
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
cmd-flushcookies-desc = Flush CEF cookie storage to disk
|
||||
cmd-flushcookies-help = This ensure cookies are properly saved to disk in the event of unclean shutdowns.
|
||||
Note that the actual operation is asynchronous.
|
||||
|
||||
## 'addcomp' command
|
||||
cmd-addcomp-desc = Adds a component to an entity.
|
||||
cmd-addcomp-help = addcomp <uid> <componentName>
|
||||
cmd-addcompc-desc = Adds a component to an entity on the client.
|
||||
cmd-addcompc-help = addcompc <uid> <componentName>
|
||||
|
||||
## 'rmcomp' command
|
||||
cmd-rmcomp-desc = Removes a component from an entity.
|
||||
cmd-rmcomp-help = rmcomp <uid> <componentName>
|
||||
cmd-rmcompc-desc = Removes a component from an entity on the client.
|
||||
cmd-rmcompc-help = rmcomp <uid> <componentName>
|
||||
|
||||
## 'addview' command
|
||||
cmd-addview-desc = Allows you to subscribe to an entity's view for debugging purposes.
|
||||
cmd-addview-help = addview <entityUid>
|
||||
cmd-addviewc-desc = Allows you to subscribe to an entity's view for debugging purposes.
|
||||
cmd-addviewc-help = addview <entityUid>
|
||||
|
||||
## 'removeview' command
|
||||
cmd-removeview-desc = Allows you to unsubscribe to an entity's view for debugging purposes.
|
||||
cmd-removeview-help = removeview <entityUid>
|
||||
|
||||
## 'loglevel' command
|
||||
cmd-loglevel-desc = Changes the log level for a provided sawmill.
|
||||
cmd-loglevel-help = Usage: loglevel <sawmill> <level>
|
||||
sawmill: A label prefixing log messages. This is the one you're setting the level for.
|
||||
level: The log level. Must match one of the values of the LogLevel enum.
|
||||
|
||||
cmd-testlog-desc = Writes a test log to a sawmill.
|
||||
cmd-testlog-help = Usage: testlog <sawmill> <level> <message>
|
||||
sawmill: A label prefixing the logged message.
|
||||
level: The log level. Must match one of the values of the LogLevel enum.
|
||||
message: The message to be logged. Wrap this in double quotes if you want to use spaces.
|
||||
|
||||
## 'vv' command
|
||||
cmd-vv-desc = Opens View Variables.
|
||||
cmd-vv-help = Usage: vv <entity ID|IoC interface name|SIoC interface name>
|
||||
|
||||
## 'showvelocities' command
|
||||
cmd-showvelocities-desc = Displays your angular and linear velocities.
|
||||
cmd-showvelocities-help = Usage: showvelocities
|
||||
|
||||
## 'setinputcontext' command
|
||||
cmd-setinputcontext-desc = Sets the active input context.
|
||||
cmd-setinputcontext-help = Usage: setinputcontext <context>
|
||||
|
||||
## 'forall' command
|
||||
cmd-forall-desc = Runs a command over all entities with a given component.
|
||||
cmd-forall-help = Usage: forall <bql query> do <command...>
|
||||
|
||||
## 'delete' command
|
||||
cmd-delete-desc = Deletes the entity with the specified ID.
|
||||
cmd-delete-help = delete <entity UID>
|
||||
|
||||
# System commands
|
||||
cmd-showtime-desc = Shows the server time.
|
||||
cmd-showtime-help = showtime
|
||||
|
||||
cmd-restart-desc = Gracefully restarts the server (not just the round).
|
||||
cmd-restart-help = restart
|
||||
|
||||
cmd-shutdown-desc = Gracefully shuts down the server.
|
||||
cmd-shutdown-help = shutdown
|
||||
|
||||
cmd-saveconfig-desc = Saves the server configuration to the config file.
|
||||
cmd-saveconfig-help = saveconfig
|
||||
|
||||
cmd-netaudit-desc = Prints into about NetMsg security.
|
||||
cmd-netaudit-help = netaudit
|
||||
|
||||
# Player commands
|
||||
cmd-tp-desc = Teleports a player to any location in the round.
|
||||
cmd-tp-help = tp <x> <y> [<mapID>]
|
||||
|
||||
cmd-tpto-desc = Teleports the current player or the specified players/entities to the location of last player/entity specified.d.
|
||||
cmd-tpto-help = tpto <username|uid> [username|uid]...
|
||||
|
||||
cmd-listplayers-desc = Lists all players currently connected.
|
||||
cmd-listplayers-help = listplayers
|
||||
|
||||
cmd-kick-desc = Kicks a connected player out of the server, disconnecting them.
|
||||
cmd-kick-help = kick <PlayerIndex> [<Reason>]
|
||||
|
||||
# Spin command
|
||||
cmd-spin-desc = Causes an entity to spin. Default entity is the attached player's parent.
|
||||
cmd-spin-help = spin velocity [drag] [entityUid]
|
||||
|
||||
# Localization command
|
||||
cmd-rldloc-desc = Reloads localization (client & server).
|
||||
cmd-rldloc-help = Usage: rldloc
|
||||
|
||||
# Debug entity controls
|
||||
cmd-spawn-desc = Spawns an entity with specific type.
|
||||
cmd-spawn-help = spawn <prototype> OR spawn <prototype> <relative entity ID> OR spawn <prototype> <x> <y>
|
||||
cmd-cspawn-desc = Spawns a client-side entity with specific type at your feet.
|
||||
cmd-cspawn-help = cspawn <entity type>
|
||||
|
||||
cmd-scale-desc = Increases or decreases an entity's size naively.
|
||||
cmd-scale-help = scale <entityUid> <float>
|
||||
|
||||
cmd-dumpentities-desc = Dump entity list.
|
||||
cmd-dumpentities-help = Dumps entity list of UIDs and prototype.
|
||||
|
||||
cmd-getcomponentregistration-desc = Gets component registration information.
|
||||
cmd-getcomponentregistration-help = Usage: getcomponentregistration <componentName>
|
||||
|
||||
cmd-showrays-desc = Toggles debug drawing of physics rays. An integer for <raylifetime> must be provided.
|
||||
cmd-showrays-help = Usage: showrays <raylifetime>
|
||||
|
||||
cmd-disconnect-desc = Immediately disconnect from the server and go back to the main menu.
|
||||
cmd-disconnect-help = Usage: disconnect
|
||||
|
||||
cmd-entfo-desc = Displays verbose diagnostics for an entity.
|
||||
cmd-entfo-help = Usage: entfo <entityuid>
|
||||
The entity UID can be prefixed with 'c' to convert it to a client entity UID.
|
||||
|
||||
cmd-fuck-desc = Throws an exception
|
||||
cmd-fuck-help = Throws an exception
|
||||
|
||||
cmd-showpos-desc = Enables debug drawing over all entity positions in the game.
|
||||
cmd-showpos-help = Usage: showpos
|
||||
|
||||
cmd-sggcell-desc = Lists entities on a snap grid cell.
|
||||
cmd-sggcell-help = Usage: sggcell <gridID> <vector2i>\nThat vector2i param is in the form x<int>,y<int>.
|
||||
|
||||
cmd-overrideplayername-desc = Changes the name used when attempting to connect to the server.
|
||||
cmd-overrideplayername-help = Usage: overrideplayername <name>
|
||||
|
||||
cmd-showanchored-desc = Shows anchored entities on a particular tile
|
||||
cmd-showanchored-help = Usage: showanchored
|
||||
|
||||
cmd-dmetamem-desc = Dumps a type's members in a format suitable for the sandbox configuration file.
|
||||
cmd-dmetamem-help = Usage: dmetamem <type>
|
||||
|
||||
cmd-dmetamem-desc = Displays chunk bounds for the purposes of rendering.
|
||||
cmd-dmetamem-help = Usage: showchunkbb <type>
|
||||
|
||||
cmd-launchauth-desc = Load authentication tokens from launcher data to aid in testing of live servers.
|
||||
cmd-launchauth-help = Usage: launchauth <account name>
|
||||
|
||||
cmd-lightbb-desc = Toggles whether to show light bounding boxes.
|
||||
cmd-lightbb-help = Usage: lightbb
|
||||
|
||||
cmd-monitorinfo-desc = Monitors info
|
||||
cmd-monitorinfo-help = Usage: monitorinfo <id>
|
||||
|
||||
cmd-setmonitor-desc = Set monitor
|
||||
cmd-setmonitor-help = Usage: setmonitor <id>
|
||||
|
||||
cmd-physics-desc = Shows a debug physics overlay. The arg supplied specifies the overlay.
|
||||
cmd-physics-help = Usage: physics <aabbs / com / contactnormals / contactpoints / distance / joints / shapeinfo / shapes>
|
||||
|
||||
cmd-hardquit-desc = Kills the game client instantly.
|
||||
cmd-hardquit-help = Kills the game client instantly, leaving no traces. No telling the server goodbye.
|
||||
|
||||
cmd-quit-desc = Shuts down the game client gracefully.
|
||||
cmd-quit-help = Properly shuts down the game client, notifying the connected server and such.
|
||||
|
||||
cmd-csi-desc = Opens a C# interactive console.
|
||||
cmd-csi-help = Usage: csi
|
||||
|
||||
cmd-scsi-desc = Opens a C# interactive console on the server.
|
||||
cmd-scsi-help = Usage: scsi
|
||||
|
||||
cmd-watch-desc = Opens a variable watch window.
|
||||
cmd-watch-help = Usage: watch
|
||||
|
||||
cmd-showspritebb-desc = Toggle whether sprite bounds are shown
|
||||
cmd-showspritebb-help = Usage: showspritebb
|
||||
|
||||
cmd-togglelookup-desc = Shows / hides entitylookup bounds via an overlay.
|
||||
cmd-togglelookup-help = Usage: togglelookup
|
||||
|
||||
cmd-net_entityreport-desc = Toggles the net entity report panel.
|
||||
cmd-net_entityreport-help = Usage: net_entityreport
|
||||
|
||||
cmd-net_refresh-desc = Requests a full server state.
|
||||
cmd-net_refresh-help = Usage: net_refresh
|
||||
|
||||
cmd-net_graph-desc = Toggles the net statistics pannel.
|
||||
cmd-net_graph-help = Usage: net_graph
|
||||
|
||||
cmd-net_watchent-desc = Dumps all network updates for an EntityId to the console.
|
||||
cmd-net_watchent-help = Usage: net_watchent <0|EntityUid>
|
||||
|
||||
cmd-net_draw_interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net_draw_interp-help = Usage: net_draw_interp <0|EntityUid>
|
||||
|
||||
cmd-vram-desc = Displays video memory usage statics by the game.
|
||||
cmd-vram-help = Usage: vram
|
||||
|
||||
cmd-showislands-desc = Shows the current physics bodies involved in each physics island.
|
||||
cmd-showislands-help = Usage: showislands
|
||||
|
||||
cmd-showgridnodes-desc = Shows the nodes for grid split purposes.
|
||||
cmd-showgridnodes-help = Usage: showgridnodes
|
||||
|
||||
cmd-profsnap-desc = Make a profiling snapshot.
|
||||
cmd-profsnap-help = Usage: profsnap
|
||||
|
||||
cmd-devwindow-desc = Dev Window
|
||||
cmd-devwindow-help = Usage: devwindow
|
||||
|
||||
cmd-devwindow-desc = Open file
|
||||
cmd-devwindow-help = Usage: testopenfile
|
||||
|
||||
cmd-scene-desc = Immediately changes the UI scene/state.
|
||||
cmd-scene-help = Usage: scene <className>
|
||||
|
||||
cmd-szr_stats-desc = Report serializer statistics.
|
||||
cmd-szr_stats-help = Usage: szr_stats
|
||||
|
||||
cmd-hwid-desc = Returns the current HWID (HardWare ID).
|
||||
cmd-hwid-help = Usage: hwid
|
||||
|
||||
cmd-vvread-desc = Retrieve a path's value using VV (View Variables).
|
||||
cmd-vvread-desc = Usage: vvread <path>
|
||||
|
||||
cmd-vvwrite-desc = Modify a path's value using VV (View Variables).
|
||||
cmd-vvwrite-desc = Usage: vvwrite <path>
|
||||
|
||||
cmd-vv-desc = Opens View Variables (VV).
|
||||
cmd-vv-desc = Usage: vv <path|entity ID|guihover>
|
||||
|
||||
cmd-vvinvoke-desc = Invoke/Call a path with arguments using VV.
|
||||
cmd-vvinvoke-desc = Usage: vvinvoke <path> [arguments...]
|
||||
|
||||
@@ -1 +1 @@
|
||||
midi-panic-command-description = Turns off every note for every active MIDI renderer.
|
||||
cmd-midipanic-desc = Turns off every note for every active MIDI renderer.
|
||||
|
||||
63
Resources/Locale/pt-BR/_engine_lib.ftl
Normal file
63
Resources/Locale/pt-BR/_engine_lib.ftl
Normal file
@@ -0,0 +1,63 @@
|
||||
# Used internally by the THE() function.
|
||||
zzzz-the = { PROPER($ent) ->
|
||||
*[false] a { $ent }
|
||||
[true] { $ent }
|
||||
}
|
||||
|
||||
# Used internally by the SUBJECT() function.
|
||||
zzzz-subject-pronoun = { GENDER($ent) ->
|
||||
[male] ele
|
||||
[female] ela
|
||||
[epicene] eles
|
||||
*[neuter] ele
|
||||
}
|
||||
|
||||
# Used internally by the OBJECT() function.
|
||||
zzzz-object-pronoun = { GENDER($ent) ->
|
||||
[male] ele
|
||||
[female] ela
|
||||
[epicene] eles
|
||||
*[neuter] isso
|
||||
}
|
||||
|
||||
# Used internally by the POSS-PRONOUN() function.
|
||||
zzzz-possessive-pronoun = { GENDER($ent) ->
|
||||
[male] dele
|
||||
[female] dela
|
||||
[epicene] deles
|
||||
*[neuter] dele
|
||||
}
|
||||
|
||||
# Used internally by the POSS-ADJ() function.
|
||||
zzzz-possessive-adjective = { GENDER($ent) ->
|
||||
[male] dele
|
||||
[female] dela
|
||||
[epicene] deles
|
||||
*[neuter] dele
|
||||
}
|
||||
|
||||
# Used internally by the REFLEXIVE() function.
|
||||
zzzz-reflexive-pronoun = { GENDER($ent) ->
|
||||
[male] ele mesmo
|
||||
[female] ela mesmo
|
||||
[epicene] eles mesmos
|
||||
*[neuter] ele mesmo
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BE() function.
|
||||
zzzz-conjugate-be = { GENDER($ent) ->
|
||||
[epicene] é
|
||||
*[other] é
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-HAVE() function.
|
||||
zzzz-conjugate-have = { GENDER($ent) ->
|
||||
[epicene] tenho
|
||||
*[other] tem
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BASIC() function.
|
||||
zzzz-conjugate-basic = { GENDER($ent) ->
|
||||
[epicene] { $first }
|
||||
*[other] { $second }
|
||||
}
|
||||
16
Resources/Locale/pt-BR/client-state-commands.ftl
Normal file
16
Resources/Locale/pt-BR/client-state-commands.ftl
Normal file
@@ -0,0 +1,16 @@
|
||||
# Strings Loc para vários comandos relacionados ao estado da entidade e ao PVS do lado do cliente
|
||||
|
||||
cmd-reset-ent-help = Uso: resetent <Entity UID>
|
||||
cmd-reset-ent-desc = Redefina uma entidade para o estado do servidor recebido mais recentemente. Isso também redefinirá as entidades que foram desanexadas para espaço nulo.
|
||||
|
||||
cmd-reset-all-ents-help = Uso: resetallents
|
||||
cmd-reset-all-ents-desc = Redefine todas as entidades para o estado do servidor recebido mais recentemente. Isso afeta apenas as entidades que não foram desanexadas ao espaço nulo.
|
||||
|
||||
cmd-detach-ent-help = Uso: detachent <Entity UID>
|
||||
cmd-detach-ent-desc = Desanexar uma entidade para espaço nulo, como se tivesse saído do intervalo PVS.
|
||||
|
||||
cmd-local-delete-help = Uso: localdelete <Entity UID>
|
||||
cmd-local-delete-desc = Exclui uma entidade. Ao contrário do comando delete normal, este é CLIENT-SIDE. A menos que a entidade seja uma entidade do lado do cliente, isso provavelmente causará erros.
|
||||
|
||||
cmd-full-state-reset-help = Uso: fullstatereset
|
||||
cmd-full-state-reset-desc = Descarta qualquer informação de estado da entidade e solicita um estado completo do servidor.
|
||||
161
Resources/Locale/pt-BR/commands.ftl
Normal file
161
Resources/Locale/pt-BR/commands.ftl
Normal file
@@ -0,0 +1,161 @@
|
||||
### Localization for engine console commands
|
||||
|
||||
## generic
|
||||
|
||||
cmd-invalid-arg-number-error = Número inválido de argumentos.
|
||||
|
||||
cmd-parse-failure-integer = {$arg} não é um inteiro válido.
|
||||
cmd-parse-failure-float = {$arg} não é um float válido.
|
||||
cmd-parse-failure-bool = {$arg} não é um booleano válido.
|
||||
cmd-parse-failure-uid = {$arg} não é um UID de entidade válido.
|
||||
cmd-parse-failure-entity-exist = UID {$arg} não corresponde a uma entidade existente.
|
||||
|
||||
|
||||
## 'help' command
|
||||
cmd-help-desc = Exibir ajuda geral ou texto de ajuda para um comando específico
|
||||
cmd-help-help = Uso: help [command name]
|
||||
Quando nenhum nome de comando é fornecido, exibe o texto de ajuda geral. Se um nome de comando for fornecido, exibe o texto de ajuda para esse comando.
|
||||
|
||||
cmd-help-no-args = Para exibir a ajuda de um comando específico, escreva 'help <command>'. Para listar todos os comandos disponíveis, escreva 'list'. Para procurar comandos, use 'list <filter>'.
|
||||
cmd-help-unknown = Comando desconhecido: { $command }
|
||||
cmd-help-top = { $command } - { $description }
|
||||
cmd-help-invalid-args = Quantidade de argumentos inválida.
|
||||
cmd-help-arg-cmdname = [command name]
|
||||
|
||||
## 'cvar' command
|
||||
cmd-cvar-desc = Obtém ou define um CVar.
|
||||
cmd-cvar-help = Uso: cvar <name | ?> [value]
|
||||
Se um valor for passado, o valor será analisado e armazenado como o novo valor do CVar.
|
||||
Caso contrário, o valor atual do CVar é exibido.
|
||||
Use 'cvar ?' para obter uma lista de todos os CVars registrados.
|
||||
|
||||
cmd-cvar-invalid-args = Deve fornecer exatamente um ou dois argumentos.
|
||||
cmd-cvar-not-registered = CVar '{ $cvar }' não está registrado. Use 'cvar ?' para obter uma lista de todos os CVars registrados.
|
||||
cmd-cvar-parse-error = O valor de entrada está no formato incorreto para o tipo { $type }
|
||||
cmd-cvar-compl-list = Listar CVars disponíveis
|
||||
cmd-cvar-arg-name = <name | ?>
|
||||
cmd-cvar-value-hidden = <value hidden>
|
||||
|
||||
## 'list' command
|
||||
cmd-list-desc = Lista os comandos disponíveis, com filtro de pesquisa opcional
|
||||
cmd-list-help = Uso: list [filter]
|
||||
Lista todos os comandos disponíveis. Se um argumento for fornecido, ele será usado para filtrar comandos por nome.
|
||||
|
||||
cmd-list-heading = NOME DESC{"\u000A"}-------------------------{"\u000A"}
|
||||
|
||||
cmd-list-arg-filter = [filter]
|
||||
|
||||
## '>' command, aka remote exec
|
||||
cmd-remoteexec-desc = Executa comandos do lado do servidor
|
||||
cmd-remoteexec-help = Uso: > <command> [arg] [arg] [arg...]
|
||||
Executa um comando no servidor. Isso é necessário se um comando com o mesmo nome existir no cliente, pois a simples execução do comando executaria o comando do cliente primeiro.
|
||||
|
||||
## 'gc' command
|
||||
cmd-gc-desc = Execute o GC (coletor de lixo)
|
||||
cmd-gc-help = Uso: gc [generation]
|
||||
Usa GC.Collect() para executar o Garbage Collector.
|
||||
Se um argumento for fornecido, ele será analisado como um número de geração do GC e GC.Collect(int) será usado.
|
||||
Use o comando 'gfc' para fazer um GC completo compactando LOH.
|
||||
cmd-gc-failed-parse = Falha ao analisar o argumento.
|
||||
cmd-gc-arg-generation = [generation]
|
||||
|
||||
## 'gcf' command
|
||||
cmd-gcf-desc = Execute o GC, totalmente, compactando LOH e tudo.
|
||||
cmd-gcf-help = Uso: gcf
|
||||
Faz um GC.Collect(2, GCCollectionMode.Forced, true, true) completo enquanto também compacta LOH.
|
||||
Isso provavelmente será bloqueado por centenas de milissegundos, esteja avisado.
|
||||
|
||||
## 'gc_mode' command
|
||||
cmd-gc_mode-desc = Alterar/ler o modo de latência do GC
|
||||
cmd-gc_mode-help = Uso: gc_mode [type]
|
||||
Se nenhum argumento for fornecido, retornará o modo de latência do GC atual.
|
||||
Se um argumento for passado, ele será analisado como GCLatencyMode e definido como o modo de latência do GC.
|
||||
|
||||
cmd-gc_mode-current = modo de latência atual do gc: { $prevMode }
|
||||
cmd-gc_mode-possible = modos possíveis:
|
||||
cmd-gc_mode-option = - { $mode }
|
||||
cmd-gc_mode-unknown = modo de latência gc desconhecido: { $arg }
|
||||
cmd-gc_mode-attempt = tentando alterar o modo de latência do gc: { $prevMode } -> { $mode }
|
||||
cmd-gc_mode-result = modo de latência gc resultante: { $mode }
|
||||
cmd-gc_mode-arg-type = [type]
|
||||
|
||||
## 'mem' command
|
||||
cmd-mem-desc = Imprime informações de memória gerenciada
|
||||
cmd-mem-help = Uso: mem
|
||||
|
||||
cmd-mem-report = Tamanho da pilha: { TOSTRING($heapSize, "N0") }
|
||||
Total alocado: { TOSTRING($totalAllocated, "N0") }
|
||||
|
||||
## 'physics' command
|
||||
cmd-physics-overlay = {$overlay} não é uma sobreposição reconhecida
|
||||
|
||||
## 'lsasm' command
|
||||
cmd-lsasm-desc = Lista assemblies carregados por contexto de carregamento
|
||||
cmd-lsasm-help = Uso: lsasm
|
||||
|
||||
## 'exec' command
|
||||
cmd-exec-desc = Executa um arquivo de script dos dados de usuário graváveis do jogo
|
||||
cmd-exec-help = Uso: exec <fileName>
|
||||
Cada linha no arquivo é executada como um único comando, a menos que comece com um #
|
||||
|
||||
cmd-exec-arg-filename = <fileName>
|
||||
|
||||
## 'dump_net_comps' command
|
||||
cmd-dump_net_comps-desc = Imprime a tabela de componentes em rede.
|
||||
cmd-dump_net_comps-help = Uso: dump_net-comps
|
||||
|
||||
cmd-dump_net_comps-error-writeable = Registro ainda gravável, IDs de rede não foram gerados.
|
||||
cmd-dump_net_comps-header = Registros de componentes em rede:
|
||||
|
||||
## 'dump_event_tables' command
|
||||
cmd-dump_event_tables-desc = Imprime tabelas de eventos direcionados para uma entidade.
|
||||
cmd-dump_event_tables-help = Uso: dump_event_tables <entityUid>
|
||||
|
||||
cmd-dump_event_tables-missing-arg-entity = Argumento de entidade ausente
|
||||
cmd-dump_event_tables-error-entity = Entidade inválida
|
||||
cmd-dump_event_tables-arg-entity = <entityUid>
|
||||
|
||||
## 'monitor' command
|
||||
cmd-monitor-desc = Alterna um monitor de depuração no menu F3.
|
||||
cmd-monitor-help = Uso: monitor <name>
|
||||
Os monitores possíveis são: { $monitors }
|
||||
Você também pode usar os valores especiais "-all" e "+all" para ocultar ou mostrar todos os monitores, respectivamente.
|
||||
|
||||
cmd-monitor-arg-monitor = <monitor>
|
||||
cmd-monitor-invalid-name = Nome do monitor inválido
|
||||
cmd-monitor-arg-count = Argumento do monitor ausente
|
||||
cmd-monitor-minus-all-hint = Esconde todos os monitores
|
||||
cmd-monitor-plus-all-hint = Mostra todos os monitores
|
||||
|
||||
|
||||
## Mapping commands
|
||||
|
||||
cmd-savemap-desc = Serializa um mapa para o disco. Não salvará um mapa pós-inicialização a menos que seja forçado.
|
||||
cmd-savemap-help = savemap <MapID> <Path> [force]
|
||||
cmd-savemap-not-exist = O mapa de destino não existe.
|
||||
cmd-savemap-init-warning = Tentativa de salvar um mapa pós-inicialização sem forçar o salvamento.
|
||||
cmd-savemap-attempt = Tentando salvar o mapa {$mapId} em {$path}.
|
||||
cmd-savemap-success = Mapa salvo com sucesso.
|
||||
cmd-hint-savemap-id = <MapID>
|
||||
cmd-hint-savemap-path = <Path>
|
||||
cmd-hint-savemap-force = [bool]
|
||||
|
||||
cmd-loadmap-desc = Carrega um mapa do disco para o jogo.
|
||||
cmd-loadmap-help = loadmap <MapID> <Path> [x] [y] [rotation] [consistentUids]
|
||||
cmd-loadmap-nullspace = Você não pode carregar no mapa 0.
|
||||
cmd-loadmap-exists = Mapa {$mapId} já existe.
|
||||
cmd-loadmap-success = Mapa {$mapId} foi carregado em {$path}.
|
||||
cmd-loadmap-error = Ocorreu um erro ao carregar o mapa de {$path}.
|
||||
cmd-hint-loadmap-x-position = [x-position]
|
||||
cmd-hint-loadmap-y-position = [y-position]
|
||||
cmd-hint-loadmap-rotation = [rotation]
|
||||
cmd-hint-loadmap-uids = [float]
|
||||
|
||||
cmd-hint-savebp-id = <Grid EntityID>
|
||||
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
cmd-flushcookies-desc = Liberar o armazenamento de cookies CEF para o disco
|
||||
cmd-flushcookies-help = Isso garante que os cookies sejam salvos corretamente no disco no caso de desligamentos impróprios.
|
||||
Observe que a operação real é assíncrona.
|
||||
10
Resources/Locale/pt-BR/controls.ftl
Normal file
10
Resources/Locale/pt-BR/controls.ftl
Normal file
@@ -0,0 +1,10 @@
|
||||
color-selector-sliders-red = R
|
||||
color-selector-sliders-green = G
|
||||
color-selector-sliders-blue = B
|
||||
color-selector-sliders-hue = H
|
||||
color-selector-sliders-saturation = S
|
||||
color-selector-sliders-value = V
|
||||
color-selector-sliders-alpha = A
|
||||
|
||||
color-selector-sliders-rgb = RGB
|
||||
color-selector-sliders-hsv = HSV
|
||||
11
Resources/Locale/pt-BR/custom-controls.ftl
Normal file
11
Resources/Locale/pt-BR/custom-controls.ftl
Normal file
@@ -0,0 +1,11 @@
|
||||
## EntitySpawnWindow
|
||||
|
||||
entity-spawn-window-title = Painel de Criação de Entidade
|
||||
entity-spawn-window-search-bar-placeholder = pesquisar
|
||||
entity-spawn-window-clear-button = Limpar
|
||||
entity-spawn-window-erase-button-text = Modo Apagar
|
||||
entity-spawn-window-override-menu-tooltip = Substituir posicionamento
|
||||
|
||||
## Console
|
||||
|
||||
console-line-edit-placeholder = Comando aqui
|
||||
1
Resources/Locale/pt-BR/defaultwindow.ftl
Normal file
1
Resources/Locale/pt-BR/defaultwindow.ftl
Normal file
@@ -0,0 +1 @@
|
||||
defaultwindow-placeholder-title = Exemplo de título de janela aqui
|
||||
54
Resources/Locale/pt-BR/input.ftl
Normal file
54
Resources/Locale/pt-BR/input.ftl
Normal file
@@ -0,0 +1,54 @@
|
||||
input-key-Escape = Escape
|
||||
input-key-Control = Control
|
||||
input-key-Shift = Shift
|
||||
input-key-Alt = Alt
|
||||
input-key-Menu = Menu
|
||||
input-key-F1 = F1
|
||||
input-key-F2 = F2
|
||||
input-key-F3 = F3
|
||||
input-key-F4 = F4
|
||||
input-key-F5 = F5
|
||||
input-key-F6 = F6
|
||||
input-key-F7 = F7
|
||||
input-key-F8 = F8
|
||||
input-key-F9 = F9
|
||||
input-key-F10 = F10
|
||||
input-key-F11 = F11
|
||||
input-key-F12 = F12
|
||||
input-key-F13 = F13
|
||||
input-key-F14 = F14
|
||||
input-key-F15 = F15
|
||||
input-key-Pause = Pause
|
||||
input-key-Left = Left
|
||||
input-key-Up = Up
|
||||
input-key-Down = Down
|
||||
input-key-Right = Right
|
||||
input-key-Space = Space
|
||||
input-key-Return = Return
|
||||
input-key-NumpadEnter = Num Enter
|
||||
input-key-BackSpace = Backspace
|
||||
input-key-Tab = Tab
|
||||
input-key-PageUp = Page Up
|
||||
input-key-PageDown = Page Down
|
||||
input-key-End = End
|
||||
input-key-Home = Home
|
||||
input-key-Insert = Insert
|
||||
input-key-Delete = Delete
|
||||
input-key-MouseLeft = Mouse Left
|
||||
input-key-MouseRight = Mouse Right
|
||||
input-key-MouseMiddle = Mouse Middle
|
||||
input-key-MouseButton4 = Mouse 4
|
||||
input-key-MouseButton5 = Mouse 5
|
||||
input-key-MouseButton6 = Mouse 6
|
||||
input-key-MouseButton7 = Mouse 7
|
||||
input-key-MouseButton8 = Mouse 8
|
||||
input-key-MouseButton9 = Mouse 9
|
||||
|
||||
input-key-LSystem-win = Left Win
|
||||
input-key-RSystem-win = Right Win
|
||||
input-key-LSystem-mac = Left Cmd
|
||||
input-key-RSystem-mac = Right Cmd
|
||||
input-key-LSystem-linux = Left Meta
|
||||
input-key-RSystem-linux = Right Meta
|
||||
|
||||
input-key-unknown = <unknown key>
|
||||
1
Resources/Locale/pt-BR/midi-commands.ftl
Normal file
1
Resources/Locale/pt-BR/midi-commands.ftl
Normal file
@@ -0,0 +1 @@
|
||||
cmd-midipanic-desc = Desliga cada nota para cada renderizador MIDI ativo.
|
||||
1
Resources/Locale/pt-BR/tab-container.ftl
Normal file
1
Resources/Locale/pt-BR/tab-container.ftl
Normal file
@@ -0,0 +1 @@
|
||||
tab-container-not-tab-title-provided = Sem título
|
||||
11
Resources/Locale/pt-BR/view-variables.ftl
Normal file
11
Resources/Locale/pt-BR/view-variables.ftl
Normal file
@@ -0,0 +1,11 @@
|
||||
## ViewVariablesInstanceEntity
|
||||
|
||||
view-variable-instance-entity-server-components-add-component-button-placeholder = Adicionar Componente
|
||||
view-variable-instance-entity-client-variables-tab-title = Variávies do Cliente
|
||||
view-variable-instance-entity-client-components-tab-title = Componentes do Cliente
|
||||
view-variable-instance-entity-server-variables-tab-title = Variávies do Servidor
|
||||
view-variable-instance-entity-server-components-tab-title = Componentes do Servidor
|
||||
view-variable-instance-entity-client-components-search-bar-placeholder = Pesquisar
|
||||
view-variable-instance-entity-server-components-search-bar-placeholder = Pesquisar
|
||||
view-variable-instance-entity-add-window-server-components = Adicionar Componente [S]
|
||||
view-variable-instance-entity-add-window-client-components = Adicionar Componente [C]
|
||||
@@ -3,11 +3,13 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using BenchmarkDotNet.Exporters;
|
||||
using BenchmarkDotNet.Loggers;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using BenchmarkDotNet.Parameters;
|
||||
using BenchmarkDotNet.Reports;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
@@ -20,6 +22,11 @@ namespace Robust.Benchmarks.Exporters;
|
||||
|
||||
public sealed class SQLExporter : IExporter
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonSerializerOptions = new JsonSerializerOptions
|
||||
{
|
||||
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals
|
||||
};
|
||||
|
||||
public static readonly IExporter Default = new SQLExporter();
|
||||
|
||||
private SQLExporter(){}
|
||||
@@ -74,13 +81,13 @@ public sealed class SQLExporter : IExporter
|
||||
{
|
||||
ctx.Database.OpenConnection();
|
||||
var con = (NpgsqlConnection) ctx.Database.GetDbConnection();
|
||||
con.TypeMapper.AddTypeResolverFactory(new JsonOverrideTypeHandlerResolverFactory(new JsonSerializerOptions
|
||||
{
|
||||
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals
|
||||
}));
|
||||
con.TypeMapper.AddTypeResolverFactory(new JsonOverrideTypeHandlerResolverFactory(JsonSerializerOptions));
|
||||
|
||||
ctx.Database.Migrate();
|
||||
ctx.BenchmarkRuns.Add(BenchmarkRun.FromSummary(summary, gitHash));
|
||||
foreach (var run in BenchmarkRun.FromSummary(summary, gitHash))
|
||||
{
|
||||
ctx.BenchmarkRuns.Add(run);
|
||||
}
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
finally
|
||||
@@ -131,6 +138,7 @@ class JsonOverrideTypeHandlerResolverFactory : TypeHandlerResolverFactory
|
||||
=> null; // Let the built-in resolver do this
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DesignTimeContextFactoryPostgres : IDesignTimeDbContextFactory<BenchmarkContext>
|
||||
{
|
||||
public BenchmarkContext CreateDbContext(string[] args)
|
||||
@@ -154,42 +162,66 @@ public class BenchmarkRun
|
||||
public int Id { get; set; }
|
||||
public string GitHash { get; set; } = string.Empty;
|
||||
|
||||
[Column(TypeName = "timestamptz")]
|
||||
public DateTime RunDate { get; set; }
|
||||
[Column(TypeName = "timestamptz")] public DateTime RunDate { get; set; }
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[Column(TypeName = "jsonb")]
|
||||
public BenchmarkRunReport[] Reports { get; set; } = Array.Empty<BenchmarkRunReport>();
|
||||
public string? ParameterMapping { get; set; }
|
||||
|
||||
public static BenchmarkRun FromSummary(Summary summary, string gitHash)
|
||||
[Column(TypeName = "jsonb")]
|
||||
public BenchmarkRunParameter[]? ParameterMappingJson { get; set; }
|
||||
|
||||
[Column(TypeName = "jsonb")]
|
||||
public Statistics Statistics { get; set; } = default!;
|
||||
|
||||
public static IEnumerable<BenchmarkRun> FromSummary(Summary summary, string gitHash)
|
||||
{
|
||||
return new BenchmarkRun
|
||||
var runDate = DateTime.UtcNow;
|
||||
|
||||
foreach (var benchmarkReport in summary.Reports)
|
||||
{
|
||||
Reports = summary.Reports.Select(r => new BenchmarkRunReport
|
||||
var paramString = new StringBuilder();
|
||||
var parametersItems = benchmarkReport.BenchmarkCase.Parameters.Items;
|
||||
var runParameters = new BenchmarkRunParameter[parametersItems.Count];
|
||||
for (var i = 0; i < parametersItems.Count; i++)
|
||||
{
|
||||
Parameters = r.BenchmarkCase.Parameters.Items.Select(p => new BenchmarkRunParameter
|
||||
{
|
||||
Name = p.Name,
|
||||
Value = p.Value
|
||||
}).ToArray(),
|
||||
Statistics = r.ResultStatistics
|
||||
}).ToArray(),
|
||||
Name = summary.BenchmarksCases.First().FolderInfo,
|
||||
RunDate = DateTime.UtcNow,
|
||||
GitHash = gitHash
|
||||
};
|
||||
runParameters[i] = new BenchmarkRunParameter(parametersItems[i]);
|
||||
paramString.Append(runParameters[i].ToString());
|
||||
if (i < parametersItems.Count - 1) paramString.Append(',');
|
||||
}
|
||||
|
||||
if (benchmarkReport.ResultStatistics == null)
|
||||
{
|
||||
Console.WriteLine($"err: No statistics available for {benchmarkReport.BenchmarkCase.Descriptor.DisplayInfo}!");
|
||||
continue;
|
||||
}
|
||||
|
||||
yield return new BenchmarkRun
|
||||
{
|
||||
Name = benchmarkReport.BenchmarkCase.Descriptor.DisplayInfo,
|
||||
RunDate = runDate,
|
||||
GitHash = gitHash,
|
||||
ParameterMapping = runParameters.Length > 0 ? paramString.ToString() : null,
|
||||
ParameterMappingJson = runParameters.Length > 0 ? runParameters : null,
|
||||
Statistics = benchmarkReport.ResultStatistics
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BenchmarkRunReport
|
||||
{
|
||||
public BenchmarkRunParameter[] Parameters { get; set; } = Array.Empty<BenchmarkRunParameter>();
|
||||
public Statistics Statistics { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class BenchmarkRunParameter
|
||||
public struct BenchmarkRunParameter
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public object Value { get; set; } = default!;
|
||||
|
||||
public BenchmarkRunParameter(ParameterInstance instance)
|
||||
{
|
||||
Name = instance.Name;
|
||||
Value = instance.Value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Name}={Value}";
|
||||
}
|
||||
}
|
||||
|
||||
62
Robust.Benchmarks/Migrations/20221009235705_db.Designer.cs
generated
Normal file
62
Robust.Benchmarks/Migrations/20221009235705_db.Designer.cs
generated
Normal file
@@ -0,0 +1,62 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
[DbContext(typeof(BenchmarkContext))]
|
||||
[Migration("20221009235705_db")]
|
||||
partial class db
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Robust.Benchmarks.Exporters.BenchmarkRun", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("GitHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ParameterMapping")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RunDate")
|
||||
.HasColumnType("timestamptz");
|
||||
|
||||
b.Property<Statistics>("Statistics")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BenchmarkRuns");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Robust.Benchmarks/Migrations/20221009235705_db.cs
Normal file
36
Robust.Benchmarks/Migrations/20221009235705_db.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
public partial class db : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Reports",
|
||||
table: "BenchmarkRuns",
|
||||
newName: "Statistics");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Statistics",
|
||||
table: "BenchmarkRuns",
|
||||
newName: "Reports");
|
||||
}
|
||||
}
|
||||
}
|
||||
64
Robust.Benchmarks/Migrations/20221010144620_param_work.Designer.cs
generated
Normal file
64
Robust.Benchmarks/Migrations/20221010144620_param_work.Designer.cs
generated
Normal file
@@ -0,0 +1,64 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
[DbContext(typeof(BenchmarkContext))]
|
||||
[Migration("20221010144620_param_work")]
|
||||
partial class param_work
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Robust.Benchmarks.Exporters.BenchmarkRun", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("GitHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ParameterMapping")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<BenchmarkRunParameter[]>("ParameterMappingJson")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<DateTime>("RunDate")
|
||||
.HasColumnType("timestamptz");
|
||||
|
||||
b.Property<Statistics>("Statistics")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BenchmarkRuns");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Robust.Benchmarks/Migrations/20221010144620_param_work.cs
Normal file
44
Robust.Benchmarks/Migrations/20221010144620_param_work.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
public partial class param_work : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns",
|
||||
type: "text",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text");
|
||||
|
||||
migrationBuilder.AddColumn<BenchmarkRunParameter[]>(
|
||||
name: "ParameterMappingJson",
|
||||
table: "BenchmarkRuns",
|
||||
type: "jsonb",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ParameterMappingJson",
|
||||
table: "BenchmarkRuns");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
@@ -17,7 +18,7 @@ namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.0")
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
@@ -38,13 +39,19 @@ namespace Robust.Benchmarks.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<BenchmarkRunReport[]>("Reports")
|
||||
.IsRequired()
|
||||
b.Property<string>("ParameterMapping")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<BenchmarkRunParameter[]>("ParameterMappingJson")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<DateTime>("RunDate")
|
||||
.HasColumnType("timestamptz");
|
||||
|
||||
b.Property<Statistics>("Statistics")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BenchmarkRuns");
|
||||
|
||||
11
Robust.Benchmarks/Migrations/TypeIApparentlyHaveToKeep.cs
Normal file
11
Robust.Benchmarks/Migrations/TypeIApparentlyHaveToKeep.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
namespace Robust.Benchmarks.Migrations;
|
||||
|
||||
public class BenchmarkRunReport
|
||||
{
|
||||
public BenchmarkRunParameter[] Parameters { get; set; } = Array.Empty<BenchmarkRunParameter>();
|
||||
public Statistics Statistics { get; set; } = default!;
|
||||
}
|
||||
@@ -24,7 +24,8 @@ namespace Robust.Benchmarks.Serialization
|
||||
return int.Parse(node.Value, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public DataNode Write(ISerializationManager serializationManager, int value, bool alwaysWrite = false,
|
||||
public DataNode Write(ISerializationManager serializationManager, int value, IDependencyCollection dependencies,
|
||||
bool alwaysWrite = false,
|
||||
ISerializationContext? context = null)
|
||||
{
|
||||
return new ValueDataNode(value.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Robust.Benchmarks.Serialization
|
||||
{
|
||||
public SerializationBenchmark()
|
||||
{
|
||||
IoCManager.InitThread();
|
||||
ServerIoC.RegisterIoC();
|
||||
IoCManager.BuildGraph();
|
||||
var deps = IoCManager.InitThread();
|
||||
ServerIoC.RegisterIoC(deps);
|
||||
deps.BuildGraph();
|
||||
|
||||
var assemblies = new[]
|
||||
{
|
||||
@@ -25,12 +25,12 @@ namespace Robust.Benchmarks.Serialization
|
||||
|
||||
foreach (var assembly in assemblies)
|
||||
{
|
||||
IoCManager.Resolve<IConfigurationManagerInternal>().LoadCVarsFromAssembly(assembly);
|
||||
deps.Resolve<IConfigurationManagerInternal>().LoadCVarsFromAssembly(assembly);
|
||||
}
|
||||
|
||||
IoCManager.Resolve<IReflectionManager>().LoadAssemblies(assemblies);
|
||||
deps.Resolve<IReflectionManager>().LoadAssemblies(assemblies);
|
||||
|
||||
SerializationManager = IoCManager.Resolve<ISerializationManager>();
|
||||
SerializationManager = deps.Resolve<ISerializationManager>();
|
||||
}
|
||||
|
||||
protected ISerializationManager SerializationManager { get; }
|
||||
|
||||
@@ -143,6 +143,8 @@ namespace Robust.Client.WebView.Cef
|
||||
|
||||
private const int ScrollSpeed = 50;
|
||||
|
||||
private bool _textInputActive;
|
||||
|
||||
private readonly RobustRequestHandler _requestHandler = new(Logger.GetSawmill("root"));
|
||||
private LiveData? _data;
|
||||
private string _startUrl = "about:blank";
|
||||
@@ -360,24 +362,21 @@ namespace Robust.Client.WebView.Cef
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public void TextEntered(GUITextEventArgs args)
|
||||
public void TextEntered(GUITextEnteredEventArgs args)
|
||||
{
|
||||
if (_data == null)
|
||||
return;
|
||||
|
||||
var host = _data.Browser.GetHost();
|
||||
|
||||
Span<char> buf = stackalloc char[2];
|
||||
var written = args.AsRune.EncodeToUtf16(buf);
|
||||
|
||||
for (var i = 0; i < written; i++)
|
||||
foreach (var chr in args.Text)
|
||||
{
|
||||
host.SendKeyEvent(new CefKeyEvent
|
||||
{
|
||||
EventType = CefKeyEventType.Char,
|
||||
WindowsKeyCode = buf[i],
|
||||
Character = buf[i],
|
||||
UnmodifiedCharacter = buf[i]
|
||||
WindowsKeyCode = chr,
|
||||
Character = chr,
|
||||
UnmodifiedCharacter = chr
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -481,6 +480,32 @@ namespace Robust.Client.WebView.Cef
|
||||
_requestHandler.RemoveBeforeBrowseHandler(handler);
|
||||
}
|
||||
|
||||
public void FocusEntered()
|
||||
{
|
||||
if (_textInputActive)
|
||||
_clyde.TextInputStart();
|
||||
}
|
||||
|
||||
public void FocusExited()
|
||||
{
|
||||
if (_textInputActive)
|
||||
_clyde.TextInputStop();
|
||||
}
|
||||
|
||||
public void TextInputStart()
|
||||
{
|
||||
_textInputActive = true;
|
||||
if (Owner.HasKeyboardFocus())
|
||||
_clyde.TextInputStart();
|
||||
}
|
||||
|
||||
public void TextInputStop()
|
||||
{
|
||||
_textInputActive = false;
|
||||
if (Owner.HasKeyboardFocus())
|
||||
_clyde.TextInputStop();
|
||||
}
|
||||
|
||||
private sealed class LiveData
|
||||
{
|
||||
public OwnedTexture Texture;
|
||||
@@ -579,6 +604,22 @@ namespace Robust.Client.WebView.Cef
|
||||
if (_control.Owner.Disposed)
|
||||
return;
|
||||
}
|
||||
|
||||
protected override void OnVirtualKeyboardRequested(CefBrowser browser, CefTextInputMode inputMode)
|
||||
{
|
||||
base.OnVirtualKeyboardRequested(browser, inputMode);
|
||||
|
||||
// Treat virtual keyboard requests as a guide for whether we should accept text input.
|
||||
|
||||
if (inputMode == CefTextInputMode.None)
|
||||
{
|
||||
_control.TextInputStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
_control.TextInputStart();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Robust.Client.WebView.Headless
|
||||
return false;
|
||||
}
|
||||
|
||||
public void TextEntered(GUITextEventArgs args)
|
||||
public void TextEntered(GUITextEnteredEventArgs args)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -125,6 +125,14 @@ namespace Robust.Client.WebView.Headless
|
||||
public void RemoveBeforeBrowseHandler(Action<IBeforeBrowseContext> handler)
|
||||
{
|
||||
}
|
||||
|
||||
public void FocusEntered()
|
||||
{
|
||||
}
|
||||
|
||||
public void FocusExited()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class WebViewWindowDummy : DummyBase, IWebViewWindow
|
||||
|
||||
@@ -15,10 +15,12 @@ namespace Robust.Client.WebView
|
||||
void MouseExited();
|
||||
void MouseWheel(GUIMouseWheelEventArgs args);
|
||||
bool RawKeyEvent(in GuiRawKeyEvent guiRawEvent);
|
||||
void TextEntered(GUITextEventArgs args);
|
||||
void TextEntered(GUITextEnteredEventArgs args);
|
||||
void Resized();
|
||||
void Draw(DrawingHandleScreen handle);
|
||||
void AddBeforeBrowseHandler(Action<IBeforeBrowseContext> handler);
|
||||
void RemoveBeforeBrowseHandler(Action<IBeforeBrowseContext> handler);
|
||||
void FocusEntered();
|
||||
void FocusExited();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.WebView.Cef;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -76,13 +75,27 @@ namespace Robust.Client.WebView
|
||||
return _controlImpl.RawKeyEvent(guiRawEvent);
|
||||
}
|
||||
|
||||
protected internal override void TextEntered(GUITextEventArgs args)
|
||||
protected internal override void TextEntered(GUITextEnteredEventArgs args)
|
||||
{
|
||||
base.TextEntered(args);
|
||||
|
||||
_controlImpl.TextEntered(args);
|
||||
}
|
||||
|
||||
protected internal override void KeyboardFocusEntered()
|
||||
{
|
||||
base.KeyboardFocusEntered();
|
||||
|
||||
_controlImpl.FocusEntered();
|
||||
}
|
||||
|
||||
protected internal override void KeyboardFocusExited()
|
||||
{
|
||||
base.KeyboardFocusExited();
|
||||
|
||||
_controlImpl.FocusExited();
|
||||
}
|
||||
|
||||
protected override void Resized()
|
||||
{
|
||||
base.Resized();
|
||||
|
||||
@@ -3,6 +3,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Shared.Animations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
|
||||
namespace Robust.Client.Animations
|
||||
{
|
||||
@@ -20,7 +21,14 @@ namespace Robust.Client.Animations
|
||||
}
|
||||
|
||||
var entity = (EntityUid) context;
|
||||
var component = IoCManager.Resolve<IEntityManager>().GetComponent(entity, ComponentType);
|
||||
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!entManager.TryGetComponent(entity, ComponentType, out var component))
|
||||
{
|
||||
// This gets checked when the animation is first played, but the component may also be removed while the animation plays
|
||||
Logger.Error($"Couldn't find component {ComponentType} on {entManager.ToPrettyString(entity)} for animation playback!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (component is IAnimationProperties properties)
|
||||
{
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
using System;
|
||||
using Robust.Client.Graphics;
|
||||
|
||||
namespace Robust.Client.Audio
|
||||
{
|
||||
public sealed class AudioStream
|
||||
{
|
||||
public TimeSpan Length { get; }
|
||||
internal ClydeHandle? ClydeHandle { get; }
|
||||
public string? Name { get; }
|
||||
public int ChannelCount { get; }
|
||||
namespace Robust.Client.Audio;
|
||||
|
||||
internal AudioStream(ClydeHandle handle, TimeSpan length, int channelCount, string? name = null)
|
||||
{
|
||||
ClydeHandle = handle;
|
||||
Length = length;
|
||||
ChannelCount = channelCount;
|
||||
Name = name;
|
||||
}
|
||||
public sealed class AudioStream
|
||||
{
|
||||
public TimeSpan Length { get; }
|
||||
internal ClydeHandle? ClydeHandle { get; }
|
||||
public string? Name { get; }
|
||||
public int ChannelCount { get; }
|
||||
|
||||
internal AudioStream(ClydeHandle handle, TimeSpan length, int channelCount, string? name = null)
|
||||
{
|
||||
ClydeHandle = handle;
|
||||
Length = length;
|
||||
ChannelCount = channelCount;
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,13 @@ using Robust.Shared.Localization;
|
||||
|
||||
namespace Robust.Client.Audio.Midi.Commands;
|
||||
|
||||
public sealed class MidiPanicCommand : IConsoleCommand
|
||||
public sealed class MidiPanicCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IMidiManager _midiManager = default!;
|
||||
|
||||
public string Command => "midipanic";
|
||||
public string Description => Loc.GetString("midi-panic-command-description");
|
||||
public string Help => $"{Command}";
|
||||
public override string Command => "midipanic";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
foreach (var renderer in _midiManager.Renderers)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ internal sealed partial class MidiManager
|
||||
break;
|
||||
|
||||
default:
|
||||
_midiSawmill.Error($"Unsupported Sequencer Event: {tick:D8}: {SequencerEventToString(midiEvent)}");
|
||||
_midiSawmill.Warning($"Unsupported Sequencer Event: {tick:D8}: {SequencerEventToString(midiEvent)}");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace Robust.Client.Audio.Midi;
|
||||
internal sealed partial class MidiManager : IMidiManager
|
||||
{
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IResourceManagerInternal _resourceManager = default!;
|
||||
[Dependency] private readonly IResourceCacheInternal _resourceManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfgMan = default!;
|
||||
[Dependency] private readonly IClydeAudio _clydeAudio = default!;
|
||||
@@ -100,11 +101,13 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
|
||||
private const string FallbackSoundfont = "/Midi/fallback.sf2";
|
||||
|
||||
private const string ContentCustomSoundfontDirectory = "/Audio/MidiCustom/";
|
||||
|
||||
private const float MaxDistanceForOcclusion = 1000;
|
||||
|
||||
private static ResourcePath CustomSoundfontDirectory = new ResourcePath("/soundfonts/");
|
||||
|
||||
private readonly ResourceLoaderCallbacks _soundfontLoaderCallbacks = new();
|
||||
private readonly ResourceLoaderCallbacks _soundfontLoaderCallbacks;
|
||||
|
||||
private bool FluidsynthInitialized;
|
||||
private bool _failedInitialize;
|
||||
@@ -115,6 +118,11 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int OcclusionCollisionMask { get; set; }
|
||||
|
||||
public MidiManager()
|
||||
{
|
||||
_soundfontLoaderCallbacks = new ResourceLoaderCallbacks(this);
|
||||
}
|
||||
|
||||
private void InitializeFluidsynth()
|
||||
{
|
||||
if (FluidsynthInitialized || _failedInitialize) return;
|
||||
@@ -127,7 +135,11 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
}, true);
|
||||
|
||||
_midiSawmill = _logger.GetSawmill("midi");
|
||||
_midiSawmill.Level = LogLevel.Info;
|
||||
#if DEBUG
|
||||
_midiSawmill.Level = LogLevel.Debug;
|
||||
#else
|
||||
_midiSawmill.Level = LogLevel.Error;
|
||||
#endif
|
||||
_sawmill = _logger.GetSawmill("midi.fluidsynth");
|
||||
_loggerDelegate = LoggerDelegate;
|
||||
|
||||
@@ -166,8 +178,7 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_midiSawmill.Warning(
|
||||
"Failed to initialize fluidsynth due to exception, disabling MIDI support:\n{0}", e);
|
||||
_midiSawmill.Error("Failed to initialize fluidsynth due to exception, disabling MIDI support:\n{0}", e);
|
||||
_failedInitialize = true;
|
||||
return;
|
||||
}
|
||||
@@ -175,13 +186,14 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
_midiThread = new Thread(ThreadUpdate);
|
||||
_midiThread.Start();
|
||||
|
||||
_broadPhaseSystem = EntitySystem.Get<SharedPhysicsSystem>();
|
||||
_broadPhaseSystem = _entityManager.EntitySysManager.GetEntitySystem<SharedPhysicsSystem>();
|
||||
FluidsynthInitialized = true;
|
||||
}
|
||||
|
||||
private void LoggerDelegate(NFluidsynth.Logger.LogLevel level, string message, IntPtr data)
|
||||
{
|
||||
var rLevel = level switch {
|
||||
var rLevel = level switch
|
||||
{
|
||||
NFluidsynth.Logger.LogLevel.Panic => LogLevel.Error,
|
||||
NFluidsynth.Logger.LogLevel.Error => LogLevel.Error,
|
||||
NFluidsynth.Logger.LogLevel.Warning => LogLevel.Warning,
|
||||
@@ -216,6 +228,7 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
|
||||
var renderer = new MidiRenderer(_settings!, soundfontLoader, mono, this, _clydeAudio, _taskManager, _midiSawmill);
|
||||
|
||||
_midiSawmill.Debug($"Loading soundfont {FallbackSoundfont}");
|
||||
// Since the last loaded soundfont takes priority, we load the fallback soundfont before the soundfont.
|
||||
renderer.LoadSoundfont(FallbackSoundfont);
|
||||
|
||||
@@ -223,11 +236,13 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
{
|
||||
foreach (var filepath in LinuxSoundfonts)
|
||||
{
|
||||
if (!File.Exists(filepath) || !SoundFont.IsSoundFont(filepath)) continue;
|
||||
if (!File.Exists(filepath) || !SoundFont.IsSoundFont(filepath))
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
renderer.LoadSoundfont(filepath, true);
|
||||
renderer.LoadSoundfont(filepath);
|
||||
_midiSawmill.Debug($"Loaded Linux soundfont {filepath}");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -240,29 +255,37 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
else if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
if (File.Exists(OsxSoundfont) && SoundFont.IsSoundFont(OsxSoundfont))
|
||||
renderer.LoadSoundfont(OsxSoundfont, true);
|
||||
{
|
||||
_midiSawmill.Debug($"Loading soundfont {OsxSoundfont}");
|
||||
renderer.LoadSoundfont(OsxSoundfont);
|
||||
}
|
||||
}
|
||||
else if (OperatingSystem.IsWindows())
|
||||
{
|
||||
if (File.Exists(WindowsSoundfont) && SoundFont.IsSoundFont(WindowsSoundfont))
|
||||
renderer.LoadSoundfont(WindowsSoundfont, true);
|
||||
{
|
||||
_midiSawmill.Debug($"Loading soundfont {WindowsSoundfont}");
|
||||
renderer.LoadSoundfont(WindowsSoundfont);
|
||||
}
|
||||
}
|
||||
|
||||
// Load content-specific custom soundfonts, which could override the system/fallback soundfont.
|
||||
foreach (var file in _resourceManager.ContentFindFiles(("/Audio/MidiCustom/")))
|
||||
_midiSawmill.Debug($"Loading soundfonts from {ContentCustomSoundfontDirectory}");
|
||||
foreach (var file in _resourceManager.ContentFindFiles(ContentCustomSoundfontDirectory))
|
||||
{
|
||||
if (file.Extension != "sf2" && file.Extension != "dls") continue;
|
||||
_midiSawmill.Debug($"Loading soundfont {file}");
|
||||
renderer.LoadSoundfont(file.ToString());
|
||||
}
|
||||
|
||||
// Load every soundfont from the user data directory last, since those may override any other soundfont.
|
||||
_midiSawmill.Debug($"loading soundfonts from {CustomSoundfontDirectory.ToRelativePath().ToString()}/*");
|
||||
var enumerator = _resourceManager.UserData.Find($"{CustomSoundfontDirectory.ToRelativePath().ToString()}/*").Item1;
|
||||
foreach (var soundfont in enumerator)
|
||||
_midiSawmill.Debug($"Loading soundfonts from {{USERDATA}} {CustomSoundfontDirectory}");
|
||||
var enumerator = _resourceManager.UserData.Find($"{CustomSoundfontDirectory.ToRelativePath()}/*").Item1;
|
||||
foreach (var file in enumerator)
|
||||
{
|
||||
if (soundfont.Extension != "sf2" && soundfont.Extension != "dls") continue;
|
||||
_midiSawmill.Debug($"loading soundfont {soundfont}");
|
||||
renderer.LoadSoundfont(soundfont.ToString());
|
||||
if (file.Extension != "sf2" && file.Extension != "dls") continue;
|
||||
_midiSawmill.Debug($"Loading soundfont {{USERDATA}} {file}");
|
||||
renderer.LoadSoundfont(file.ToString());
|
||||
}
|
||||
|
||||
renderer.Source.SetVolume(Volume);
|
||||
@@ -426,9 +449,15 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
/// </summary>
|
||||
private sealed class ResourceLoaderCallbacks : SoundFontLoaderCallbacks
|
||||
{
|
||||
private readonly MidiManager _parent;
|
||||
private readonly Dictionary<int, Stream> _openStreams = new();
|
||||
private int _nextStreamId = 1;
|
||||
|
||||
public ResourceLoaderCallbacks(MidiManager parent)
|
||||
{
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
public override IntPtr Open(string filename)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filename))
|
||||
@@ -437,7 +466,7 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
}
|
||||
|
||||
Stream? stream;
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
var resourceCache = _parent._resourceManager;
|
||||
var resourcePath = new ResourcePath(filename);
|
||||
|
||||
if (resourcePath.IsRooted)
|
||||
|
||||
@@ -354,7 +354,7 @@ internal sealed class MidiRenderer : IMidiRenderer
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadSoundfont(string filename, bool resetPresets = false)
|
||||
public void LoadSoundfont(string filename, bool resetPresets = true)
|
||||
{
|
||||
lock (_playerStateLock)
|
||||
{
|
||||
@@ -521,7 +521,10 @@ internal sealed class MidiRenderer : IMidiRenderer
|
||||
return;
|
||||
|
||||
_rendererState.Controllers.AsSpan[midiEvent.Channel].AsSpan[midiEvent.Control] = midiEvent.Value;
|
||||
_synth.CC(midiEvent.Channel, midiEvent.Control, midiEvent.Value);
|
||||
if(midiEvent.Control != 0x0)
|
||||
_synth.CC(midiEvent.Channel, midiEvent.Control, midiEvent.Value);
|
||||
else // Fluidsynth doesn't seem to respect CC0 as bank selection, so we have to do it manually.
|
||||
_synth.BankSelect(midiEvent.Channel, midiEvent.Value);
|
||||
break;
|
||||
|
||||
case RobustMidiCommand.ProgramChange:
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace Robust.Client
|
||||
|
||||
private void GameStoppedReset()
|
||||
{
|
||||
IoCManager.Resolve<INetConfigurationManager>().FlushMessages();
|
||||
_configManager.FlushMessages();
|
||||
_gameStates.Reset();
|
||||
_playMan.Shutdown();
|
||||
_entityManager.Shutdown();
|
||||
|
||||
@@ -18,6 +18,7 @@ using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.State;
|
||||
using Robust.Client.Timing;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Themes;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Client.ViewVariables;
|
||||
using Robust.Shared;
|
||||
@@ -32,90 +33,92 @@ using Robust.Shared.Players;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Reflection;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Robust.Client
|
||||
{
|
||||
internal static class ClientIoC
|
||||
{
|
||||
public static void RegisterIoC(GameController.DisplayMode mode)
|
||||
public static void RegisterIoC(GameController.DisplayMode mode, IDependencyCollection deps)
|
||||
{
|
||||
SharedIoC.RegisterIoC();
|
||||
SharedIoC.RegisterIoC(deps);
|
||||
|
||||
IoCManager.Register<IGameTiming, ClientGameTiming>();
|
||||
IoCManager.Register<IClientGameTiming, ClientGameTiming>();
|
||||
IoCManager.Register<IPrototypeManager, ClientPrototypeManager>();
|
||||
IoCManager.Register<IMapManager, NetworkedMapManager>();
|
||||
IoCManager.Register<IMapManagerInternal, NetworkedMapManager>();
|
||||
IoCManager.Register<INetworkedMapManager, NetworkedMapManager>();
|
||||
IoCManager.Register<IEntityManager, ClientEntityManager>();
|
||||
IoCManager.Register<IReflectionManager, ClientReflectionManager>();
|
||||
IoCManager.Register<IConsoleHost, ClientConsoleHost>();
|
||||
IoCManager.Register<IClientConsoleHost, ClientConsoleHost>();
|
||||
IoCManager.Register<IComponentFactory, ClientComponentFactory>();
|
||||
IoCManager.Register<ITileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
IoCManager.Register<IClydeTileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
IoCManager.Register<GameController, GameController>();
|
||||
IoCManager.Register<IGameController, GameController>();
|
||||
IoCManager.Register<IGameControllerInternal, GameController>();
|
||||
IoCManager.Register<IResourceManager, ResourceCache>();
|
||||
IoCManager.Register<IResourceManagerInternal, ResourceCache>();
|
||||
IoCManager.Register<IResourceCache, ResourceCache>();
|
||||
IoCManager.Register<IResourceCacheInternal, ResourceCache>();
|
||||
IoCManager.Register<IClientNetManager, NetManager>();
|
||||
IoCManager.Register<EntityManager, ClientEntityManager>();
|
||||
IoCManager.Register<ClientEntityManager>();
|
||||
IoCManager.Register<IClientEntityManager, ClientEntityManager>();
|
||||
IoCManager.Register<IClientEntityManagerInternal, ClientEntityManager>();
|
||||
IoCManager.Register<IEntityNetworkManager, ClientEntityManager>();
|
||||
IoCManager.Register<IClientGameStateManager, ClientGameStateManager>();
|
||||
IoCManager.Register<IBaseClient, BaseClient>();
|
||||
IoCManager.Register<IPlayerManager, PlayerManager>();
|
||||
IoCManager.Register<ISharedPlayerManager, PlayerManager>();
|
||||
IoCManager.Register<IStateManager, StateManager>();
|
||||
IoCManager.Register<IUserInterfaceManager, UserInterfaceManager>();
|
||||
IoCManager.Register<IUserInterfaceManagerInternal, UserInterfaceManager>();
|
||||
IoCManager.Register<ILightManager, LightManager>();
|
||||
IoCManager.Register<IDiscordRichPresence, DiscordRichPresence>();
|
||||
IoCManager.Register<IMidiManager, MidiManager>();
|
||||
IoCManager.Register<IAuthManager, AuthManager>();
|
||||
IoCManager.Register<ProfViewManager>();
|
||||
IoCManager.Register<IPhysicsManager, PhysicsManager>();
|
||||
deps.Register<IGameTiming, ClientGameTiming>();
|
||||
deps.Register<IClientGameTiming, ClientGameTiming>();
|
||||
deps.Register<IPrototypeManager, ClientPrototypeManager>();
|
||||
deps.Register<IMapManager, NetworkedMapManager>();
|
||||
deps.Register<IMapManagerInternal, NetworkedMapManager>();
|
||||
deps.Register<INetworkedMapManager, NetworkedMapManager>();
|
||||
deps.Register<IEntityManager, ClientEntityManager>();
|
||||
deps.Register<IReflectionManager, ClientReflectionManager>();
|
||||
deps.Register<IConsoleHost, ClientConsoleHost>();
|
||||
deps.Register<IClientConsoleHost, ClientConsoleHost>();
|
||||
deps.Register<IComponentFactory, ClientComponentFactory>();
|
||||
deps.Register<ITileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
deps.Register<IClydeTileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
deps.Register<GameController, GameController>();
|
||||
deps.Register<IGameController, GameController>();
|
||||
deps.Register<IGameControllerInternal, GameController>();
|
||||
deps.Register<IResourceManager, ResourceCache>();
|
||||
deps.Register<IResourceManagerInternal, ResourceCache>();
|
||||
deps.Register<IResourceCache, ResourceCache>();
|
||||
deps.Register<IResourceCacheInternal, ResourceCache>();
|
||||
deps.Register<IClientNetManager, NetManager>();
|
||||
deps.Register<EntityManager, ClientEntityManager>();
|
||||
deps.Register<ClientEntityManager>();
|
||||
deps.Register<IClientEntityManager, ClientEntityManager>();
|
||||
deps.Register<IClientEntityManagerInternal, ClientEntityManager>();
|
||||
deps.Register<IEntityNetworkManager, ClientEntityManager>();
|
||||
deps.Register<IClientGameStateManager, ClientGameStateManager>();
|
||||
deps.Register<IBaseClient, BaseClient>();
|
||||
deps.Register<IPlayerManager, PlayerManager>();
|
||||
deps.Register<ISharedPlayerManager, PlayerManager>();
|
||||
deps.Register<IStateManager, StateManager>();
|
||||
deps.Register<IUserInterfaceManager, UserInterfaceManager>();
|
||||
deps.Register<IUserInterfaceManagerInternal, UserInterfaceManager>();
|
||||
deps.Register<ILightManager, LightManager>();
|
||||
deps.Register<IDiscordRichPresence, DiscordRichPresence>();
|
||||
deps.Register<IMidiManager, MidiManager>();
|
||||
deps.Register<IAuthManager, AuthManager>();
|
||||
deps.Register<ProfViewManager>();
|
||||
deps.Register<IPhysicsManager, PhysicsManager>();
|
||||
switch (mode)
|
||||
{
|
||||
case GameController.DisplayMode.Headless:
|
||||
IoCManager.Register<IClyde, ClydeHeadless>();
|
||||
IoCManager.Register<IClipboardManager, ClydeHeadless>();
|
||||
IoCManager.Register<IClydeInternal, ClydeHeadless>();
|
||||
IoCManager.Register<IClydeAudio, ClydeAudioHeadless>();
|
||||
IoCManager.Register<IClydeAudioInternal, ClydeAudioHeadless>();
|
||||
IoCManager.Register<IInputManager, InputManager>();
|
||||
IoCManager.Register<IFileDialogManager, DummyFileDialogManager>();
|
||||
IoCManager.Register<IUriOpener, UriOpenerDummy>();
|
||||
deps.Register<IClyde, ClydeHeadless>();
|
||||
deps.Register<IClipboardManager, ClydeHeadless>();
|
||||
deps.Register<IClydeInternal, ClydeHeadless>();
|
||||
deps.Register<IClydeAudio, ClydeAudioHeadless>();
|
||||
deps.Register<IClydeAudioInternal, ClydeAudioHeadless>();
|
||||
deps.Register<IInputManager, InputManager>();
|
||||
deps.Register<IFileDialogManager, DummyFileDialogManager>();
|
||||
deps.Register<IUriOpener, UriOpenerDummy>();
|
||||
break;
|
||||
case GameController.DisplayMode.Clyde:
|
||||
IoCManager.Register<IClyde, Clyde>();
|
||||
IoCManager.Register<IClipboardManager, Clyde>();
|
||||
IoCManager.Register<IClydeInternal, Clyde>();
|
||||
IoCManager.Register<IClydeAudio, FallbackProxyClydeAudio>();
|
||||
IoCManager.Register<IClydeAudioInternal, FallbackProxyClydeAudio>();
|
||||
IoCManager.Register<IInputManager, ClydeInputManager>();
|
||||
IoCManager.Register<IFileDialogManager, FileDialogManager>();
|
||||
IoCManager.Register<IUriOpener, UriOpener>();
|
||||
deps.Register<IClyde, Clyde>();
|
||||
deps.Register<IClipboardManager, Clyde>();
|
||||
deps.Register<IClydeInternal, Clyde>();
|
||||
deps.Register<IClydeAudio, FallbackProxyClydeAudio>();
|
||||
deps.Register<IClydeAudioInternal, FallbackProxyClydeAudio>();
|
||||
deps.Register<IInputManager, ClydeInputManager>();
|
||||
deps.Register<IFileDialogManager, FileDialogManager>();
|
||||
deps.Register<IUriOpener, UriOpener>();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
IoCManager.Register<IFontManager, FontManager>();
|
||||
IoCManager.Register<IFontManagerInternal, FontManager>();
|
||||
IoCManager.Register<IEyeManager, EyeManager>();
|
||||
IoCManager.Register<IPlacementManager, PlacementManager>();
|
||||
IoCManager.Register<IOverlayManager, OverlayManager>();
|
||||
IoCManager.Register<IOverlayManagerInternal, OverlayManager>();
|
||||
IoCManager.Register<IViewVariablesManager, ViewVariablesManager>();
|
||||
IoCManager.Register<IViewVariablesManagerInternal, ViewVariablesManager>();
|
||||
IoCManager.Register<IClientConGroupController, ClientConGroupController>();
|
||||
IoCManager.Register<IScriptClient, ScriptClient>();
|
||||
deps.Register<IFontManager, FontManager>();
|
||||
deps.Register<IFontManagerInternal, FontManager>();
|
||||
deps.Register<IEyeManager, EyeManager>();
|
||||
deps.Register<IPlacementManager, PlacementManager>();
|
||||
deps.Register<IOverlayManager, OverlayManager>();
|
||||
deps.Register<IOverlayManagerInternal, OverlayManager>();
|
||||
deps.Register<IViewVariablesManager, ClientViewVariablesManager>();
|
||||
deps.Register<IClientViewVariablesManager, ClientViewVariablesManager>();
|
||||
deps.Register<IClientViewVariablesManagerInternal, ClientViewVariablesManager>();
|
||||
deps.Register<IClientConGroupController, ClientConGroupController>();
|
||||
deps.Register<IScriptClient, ScriptClient>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,18 +266,18 @@ namespace Robust.Client.Console
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class RemoteExecCommand : IConsoleCommand
|
||||
private sealed class RemoteExecCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => ">";
|
||||
public string Description => Loc.GetString("cmd-remoteexec-desc");
|
||||
public string Help => Loc.GetString("cmd-remoteexec-help");
|
||||
public override string Command => ">";
|
||||
public override string Description => LocalizationManager.GetString("cmd-remoteexec-desc");
|
||||
public override string Help => LocalizationManager.GetString("cmd-remoteexec-help");
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
shell.RemoteExecuteCommand(argStr["> ".Length..]);
|
||||
}
|
||||
|
||||
public async ValueTask<CompletionResult> GetCompletionAsync(
|
||||
public override async ValueTask<CompletionResult> GetCompletionAsync(
|
||||
IConsoleShell shell,
|
||||
string[] args,
|
||||
CancellationToken cancel)
|
||||
|
||||
@@ -6,13 +6,14 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class AddCompCommand : IConsoleCommand
|
||||
internal sealed class AddCompCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "addcompc";
|
||||
public string Description => "Adds a component to an entity on the client";
|
||||
public string Help => "addcompc <uid> <componentName>";
|
||||
[Dependency] private readonly IComponentFactory _componentFactory = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "addcompc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
|
||||
if (args.Length != 2)
|
||||
@@ -24,25 +25,23 @@ namespace Robust.Client.Console.Commands
|
||||
var entity = EntityUid.Parse(args[0]);
|
||||
var componentName = args[1];
|
||||
|
||||
var compFactory = IoCManager.Resolve<IComponentFactory>();
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
var component = (Component) compFactory.GetComponent(componentName);
|
||||
var component = (Component) _componentFactory.GetComponent(componentName);
|
||||
|
||||
component.Owner = entity;
|
||||
|
||||
entityManager.AddComponent(entity, component);
|
||||
_entityManager.AddComponent(entity, component);
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
internal sealed class RemoveCompCommand : IConsoleCommand
|
||||
internal sealed class RemoveCompCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "rmcompc";
|
||||
public string Description => "Removes a component from an entity.";
|
||||
public string Help => "rmcompc <uid> <componentName>";
|
||||
[Dependency] private readonly IComponentFactory _componentFactory = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "rmcompc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 2)
|
||||
{
|
||||
@@ -53,12 +52,9 @@ namespace Robust.Client.Console.Commands
|
||||
var entityUid = EntityUid.Parse(args[0]);
|
||||
var componentName = args[1];
|
||||
|
||||
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||
var compFactory = IoCManager.Resolve<IComponentFactory>();
|
||||
var registration = _componentFactory.GetRegistration(componentName);
|
||||
|
||||
var registration = compFactory.GetRegistration(componentName);
|
||||
|
||||
entManager.RemoveComponent(entityUid, registration.Type);
|
||||
_entityManager.RemoveComponent(entityUid, registration.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,22 +7,23 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class ClientSpawnCommand : IConsoleCommand
|
||||
internal sealed class ClientSpawnCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "cspawn";
|
||||
public string Description => "Spawns a client-side entity with specific type at your feet.";
|
||||
public string Help => "cspawn <entity type>";
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "cspawn";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var controlled = IoCManager.Resolve<IPlayerManager>().LocalPlayer?.ControlledEntity ?? EntityUid.Invalid;
|
||||
var controlled = _playerManager.LocalPlayer?.ControlledEntity ?? EntityUid.Invalid;
|
||||
if (controlled == EntityUid.Invalid)
|
||||
{
|
||||
shell.WriteLine("You don't have an attached entity.");
|
||||
return;
|
||||
}
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var entityManager = _entityManager;
|
||||
entityManager.SpawnEntity(args[0], entityManager.GetComponent<TransformComponent>(controlled).Coordinates);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,16 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class SaveConfig : IConsoleCommand
|
||||
public sealed class SaveConfig : LocalizedCommands
|
||||
{
|
||||
public string Command => "saveconfig";
|
||||
public string Description => "Saves the client configuration to the config file";
|
||||
public string Help => "saveconfig";
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
|
||||
public override string Command => "saveconfig";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<IConfigurationManager>().SaveToFile();
|
||||
_cfg.SaveToFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,25 +6,21 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
sealed class ClearCommand : IConsoleCommand
|
||||
sealed class ClearCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "cls";
|
||||
public string Help => "Clears the debug console of all messages.";
|
||||
public string Description => "Clears the console.";
|
||||
public override string Command => "cls";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
shell.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
sealed class FillCommand : IConsoleCommand
|
||||
sealed class FillCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "fill";
|
||||
public string Help => "Fills the console with some nonsense for debugging.";
|
||||
public string Description => "Fill up the console for debugging.";
|
||||
public override string Command => "fill";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
for (int x = 0; x < 50; x++)
|
||||
{
|
||||
|
||||
@@ -31,30 +31,31 @@ using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class DumpEntitiesCommand : IConsoleCommand
|
||||
internal sealed class DumpEntitiesCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "dumpentities";
|
||||
public string Help => "Dump entity list";
|
||||
public string Description => "Dumps entity list of UIDs and prototype.";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "dumpentities";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
foreach (var e in entityManager.GetEntities().OrderBy(e => e))
|
||||
foreach (var e in _entityManager.GetEntities().OrderBy(e => e))
|
||||
{
|
||||
shell.WriteLine($"entity {e}, {entityManager.GetComponent<MetaDataComponent>(e).EntityPrototype?.ID}, {entityManager.GetComponent<TransformComponent>(e).Coordinates}.");
|
||||
shell.WriteLine(
|
||||
$"entity {e}, {_entityManager.GetComponent<MetaDataComponent>(e).EntityPrototype?.ID}, {_entityManager.GetComponent<TransformComponent>(e).Coordinates}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GetComponentRegistrationCommand : IConsoleCommand
|
||||
internal sealed class GetComponentRegistrationCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "getcomponentregistration";
|
||||
public string Help => "Usage: getcomponentregistration <componentName>";
|
||||
public string Description => "Gets component registration information";
|
||||
[Dependency] private readonly IComponentFactory _componentFactory = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
|
||||
public override string Command => "getcomponentregistration";
|
||||
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 1)
|
||||
{
|
||||
@@ -62,11 +63,9 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var componentFactory = IoCManager.Resolve<IComponentFactory>();
|
||||
|
||||
try
|
||||
{
|
||||
var registration = componentFactory.GetRegistration(args[0]);
|
||||
var registration = _componentFactory.GetRegistration(args[0]);
|
||||
|
||||
var message = new StringBuilder($"'{registration.Name}': (type: {registration.Type}, ");
|
||||
if (registration.NetID == null)
|
||||
@@ -94,13 +93,14 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleMonitorCommand : IConsoleCommand
|
||||
internal sealed class ToggleMonitorCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "monitor";
|
||||
[Dependency] private readonly IUserInterfaceManager _uiMgr = default!;
|
||||
|
||||
public string Description => Loc.GetString("cmd-monitor-desc");
|
||||
|
||||
public string Help
|
||||
public override string Command => "monitor";
|
||||
|
||||
public override string Help
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -109,9 +109,9 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var monitors = IoCManager.Resolve<IUserInterfaceManager>().DebugMonitors;
|
||||
var monitors = _uiMgr.DebugMonitors;
|
||||
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -149,7 +149,7 @@ namespace Robust.Client.Console.Commands
|
||||
monitors.ToggleMonitor(parsedMonitor);
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
if (args.Length == 1)
|
||||
{
|
||||
@@ -167,38 +167,36 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ExceptionCommand : IConsoleCommand
|
||||
internal sealed class ExceptionCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "fuck";
|
||||
public string Help => "Throws an exception";
|
||||
public string Description => "Throws an exception";
|
||||
public override string Command => "fuck";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
throw new InvalidOperationException("Fuck");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ShowPositionsCommand : IConsoleCommand
|
||||
internal sealed class ShowPositionsCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showpos";
|
||||
public string Help => "";
|
||||
public string Description => "Enables debug drawing over all entity positions in the game.";
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showpos";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = EntitySystem.Get<DebugDrawingSystem>();
|
||||
var mgr = _entitySystems.GetEntitySystem<DebugDrawingSystem>();
|
||||
mgr.DebugPositions = !mgr.DebugPositions;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ShowRayCommand : IConsoleCommand
|
||||
internal sealed class ShowRayCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showrays";
|
||||
public string Help => "Usage: showrays <raylifetime>";
|
||||
public string Description => "Toggles debug drawing of physics rays. An integer for <raylifetime> must be provided";
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showrays";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -212,35 +210,32 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var mgr = EntitySystem.Get<DebugRayDrawingSystem>();
|
||||
var mgr = _entitySystems.GetEntitySystem<DebugRayDrawingSystem>();
|
||||
mgr.DebugDrawRays = !mgr.DebugDrawRays;
|
||||
shell.WriteError("Toggled showing rays to:" + mgr.DebugDrawRays);
|
||||
mgr.DebugRayLifetime = TimeSpan.FromSeconds(duration);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class DisconnectCommand : IConsoleCommand
|
||||
internal sealed class DisconnectCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "disconnect";
|
||||
public string Help => "";
|
||||
public string Description => "Immediately disconnect from the server and go back to the main menu.";
|
||||
[Dependency] private readonly IClientNetManager _netManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "disconnect";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<IClientNetManager>().ClientDisconnect("Disconnect command used.");
|
||||
_netManager.ClientDisconnect("Disconnect command used.");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class EntityInfoCommand : IConsoleCommand
|
||||
internal sealed class EntityInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "entfo";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public string Help =>
|
||||
"entfo <entityuid>\nThe entity UID can be prefixed with 'c' to convert it to a client entity UID.";
|
||||
public override string Command => "entfo";
|
||||
|
||||
public string Description => "Displays verbose diagnostics for an entity.";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -255,15 +250,17 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
|
||||
var uid = EntityUid.Parse(args[0]);
|
||||
var entmgr = IoCManager.Resolve<IEntityManager>();
|
||||
var entmgr = _entityManager;
|
||||
if (!entmgr.EntityExists(uid))
|
||||
{
|
||||
shell.WriteError("That entity does not exist. Sorry lad.");
|
||||
return;
|
||||
}
|
||||
|
||||
var meta = entmgr.GetComponent<MetaDataComponent>(uid);
|
||||
shell.WriteLine($"{uid}: {meta.EntityPrototype?.ID}/{meta.EntityName}");
|
||||
shell.WriteLine($"init/del/lmt: {meta.EntityInitialized}/{meta.EntityDeleted}/{meta.EntityLastModifiedTick}");
|
||||
shell.WriteLine(
|
||||
$"init/del/lmt: {meta.EntityInitialized}/{meta.EntityDeleted}/{meta.EntityLastModifiedTick}");
|
||||
foreach (var component in entmgr.GetComponents(uid))
|
||||
{
|
||||
shell.WriteLine(component.ToString() ?? "");
|
||||
@@ -283,13 +280,13 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SnapGridGetCell : IConsoleCommand
|
||||
internal sealed class SnapGridGetCell : LocalizedCommands
|
||||
{
|
||||
public string Command => "sggcell";
|
||||
public string Help => "sggcell <gridID> <vector2i>\nThat vector2i param is in the form x<int>,y<int>.";
|
||||
public string Description => "Lists entities on a snap grid cell.";
|
||||
[Dependency] private readonly IMapManager _map = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "sggcell";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 2)
|
||||
{
|
||||
@@ -297,12 +294,11 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
string gridId = args[0];
|
||||
string indices = args[1];
|
||||
|
||||
if (!int.TryParse(args[0], out var id))
|
||||
if (!EntityUid.TryParse(args[0], out var gridUid))
|
||||
{
|
||||
shell.WriteError($"{args[0]} is not a valid integer.");
|
||||
shell.WriteError($"{args[0]} is not a valid entity UID.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,15 +308,11 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var mapMan = IoCManager.Resolve<IMapManager>();
|
||||
|
||||
if (mapMan.GridExists(new GridId(int.Parse(gridId, CultureInfo.InvariantCulture))))
|
||||
if (_map.TryGetGrid(gridUid, out var grid))
|
||||
{
|
||||
foreach (var entity in
|
||||
mapMan.GetGrid(new GridId(int.Parse(gridId, CultureInfo.InvariantCulture))).GetAnchoredEntities(
|
||||
new Vector2i(
|
||||
int.Parse(indices.Split(',')[0], CultureInfo.InvariantCulture),
|
||||
int.Parse(indices.Split(',')[1], CultureInfo.InvariantCulture))))
|
||||
foreach (var entity in grid.GetAnchoredEntities(new Vector2i(
|
||||
int.Parse(indices.Split(',')[0], CultureInfo.InvariantCulture),
|
||||
int.Parse(indices.Split(',')[1], CultureInfo.InvariantCulture))))
|
||||
{
|
||||
shell.WriteLine(entity.ToString());
|
||||
}
|
||||
@@ -332,104 +324,103 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SetPlayerName : IConsoleCommand
|
||||
internal sealed class SetPlayerName : LocalizedCommands
|
||||
{
|
||||
public string Command => "overrideplayername";
|
||||
public string Description => "Changes the name used when attempting to connect to the server.";
|
||||
public string Help => Command + " <name>";
|
||||
[Dependency] private readonly IBaseClient _baseClient = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "overrideplayername";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 1)
|
||||
{
|
||||
shell.WriteLine(Help);
|
||||
return;
|
||||
}
|
||||
var client = IoCManager.Resolve<IBaseClient>();
|
||||
client.PlayerNameOverride = args[0];
|
||||
|
||||
_baseClient.PlayerNameOverride = args[0];
|
||||
|
||||
shell.WriteLine($"Overriding player name to \"{args[0]}\".");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class LoadResource : IConsoleCommand
|
||||
internal sealed class LoadResource : LocalizedCommands
|
||||
{
|
||||
public string Command => "ldrsc";
|
||||
public string Description => "Pre-caches a resource.";
|
||||
public string Help => "ldrsc <path> <type>";
|
||||
[Dependency] private readonly IResourceCache _res = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflection = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "ldrsc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 2)
|
||||
{
|
||||
shell.WriteLine(Help);
|
||||
return;
|
||||
}
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
var reflection = IoCManager.Resolve<IReflectionManager>();
|
||||
|
||||
Type type;
|
||||
|
||||
try
|
||||
{
|
||||
type = reflection.LooseGetType(args[1]);
|
||||
type = _reflection.LooseGetType(args[1]);
|
||||
}
|
||||
catch(ArgumentException)
|
||||
catch (ArgumentException)
|
||||
{
|
||||
shell.WriteError("Unable to find type");
|
||||
return;
|
||||
}
|
||||
|
||||
var getResourceMethod =
|
||||
resourceCache
|
||||
_res
|
||||
.GetType()
|
||||
.GetMethod("GetResource", new[] { typeof(string), typeof(bool) });
|
||||
DebugTools.Assert(getResourceMethod != null);
|
||||
var generic = getResourceMethod!.MakeGenericMethod(type);
|
||||
generic.Invoke(resourceCache, new object[] { args[0], true });
|
||||
generic.Invoke(_res, new object[] { args[0], true });
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ReloadResource : IConsoleCommand
|
||||
internal sealed class ReloadResource : LocalizedCommands
|
||||
{
|
||||
public string Command => "rldrsc";
|
||||
public string Description => "Reloads a resource.";
|
||||
public string Help => "rldrsc <path> <type>";
|
||||
[Dependency] private readonly IResourceCache _res = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflection = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "rldrsc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 2)
|
||||
{
|
||||
shell.WriteLine(Help);
|
||||
return;
|
||||
}
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
var reflection = IoCManager.Resolve<IReflectionManager>();
|
||||
|
||||
Type type;
|
||||
try
|
||||
{
|
||||
type = reflection.LooseGetType(args[1]);
|
||||
type = _reflection.LooseGetType(args[1]);
|
||||
}
|
||||
catch(ArgumentException)
|
||||
catch (ArgumentException)
|
||||
{
|
||||
shell.WriteError("Unable to find type");
|
||||
return;
|
||||
}
|
||||
|
||||
var getResourceMethod = resourceCache.GetType().GetMethod("ReloadResource", new[] { typeof(string) });
|
||||
var getResourceMethod = _res.GetType().GetMethod("ReloadResource", new[] { typeof(string) });
|
||||
DebugTools.Assert(getResourceMethod != null);
|
||||
var generic = getResourceMethod!.MakeGenericMethod(type);
|
||||
generic.Invoke(resourceCache, new object[] { args[0] });
|
||||
generic.Invoke(_res, new object[] { args[0] });
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GridTileCount : IConsoleCommand
|
||||
internal sealed class GridTileCount : LocalizedCommands
|
||||
{
|
||||
public string Command => "gridtc";
|
||||
public string Description => "Gets the tile count of a grid";
|
||||
public string Help => "Usage: gridtc <gridId>";
|
||||
[Dependency] private readonly IMapManager _map = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "gridtc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -437,40 +428,35 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!int.TryParse(args[0], out var id))
|
||||
if (!EntityUid.TryParse(args[0], out var gridUid))
|
||||
{
|
||||
shell.WriteLine($"{args[0]} is not a valid integer.");
|
||||
shell.WriteLine($"{args[0]} is not a valid entity UID.");
|
||||
return;
|
||||
}
|
||||
|
||||
var gridId = new GridId(int.Parse(args[0]));
|
||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
||||
|
||||
if (mapManager.TryGetGrid(gridId, out var grid))
|
||||
if (_map.TryGetGrid(gridUid, out var grid))
|
||||
{
|
||||
shell.WriteLine(mapManager.GetGrid(gridId).GetAllTiles().Count().ToString());
|
||||
shell.WriteLine(grid.GetAllTiles().Count().ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
shell.WriteError($"No grid exists with id {id}");
|
||||
shell.WriteError($"No grid exists with id {gridUid}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GuiDumpCommand : IConsoleCommand
|
||||
internal sealed class GuiDumpCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "guidump";
|
||||
public string Description => "Dump GUI tree to /guidump.txt in user data.";
|
||||
public string Help => "guidump";
|
||||
[Dependency] private readonly IUserInterfaceManager _ui = default!;
|
||||
[Dependency] private readonly IResourceCache _res = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "guidump";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var uiMgr = IoCManager.Resolve<IUserInterfaceManager>();
|
||||
var res = IoCManager.Resolve<IResourceManager>();
|
||||
using var writer = _res.UserData.OpenWriteText(new ResourcePath("/guidump.txt"));
|
||||
|
||||
using var writer = res.UserData.OpenWriteText(new ResourcePath("/guidump.txt"));
|
||||
|
||||
foreach (var root in uiMgr.AllRoots)
|
||||
foreach (var root in _ui.AllRoots)
|
||||
{
|
||||
writer.WriteLine($"ROOT: {root}");
|
||||
_writeNode(root, 0, writer);
|
||||
@@ -531,248 +517,107 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class UITestCommand : IConsoleCommand
|
||||
internal sealed class SetClipboardCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "uitest";
|
||||
public string Description => "Open a dummy UI testing window";
|
||||
public string Help => "uitest";
|
||||
[Dependency] private readonly IClipboardManager _clipboard = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "setclipboard";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var window = new DefaultWindow { MinSize = (500, 400)};
|
||||
var tabContainer = new TabContainer();
|
||||
window.Contents.AddChild(tabContainer);
|
||||
var scroll = new ScrollContainer();
|
||||
tabContainer.AddChild(scroll);
|
||||
//scroll.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide);
|
||||
var vBox = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
};
|
||||
scroll.AddChild(vBox);
|
||||
|
||||
var progressBar = new ProgressBar { MaxValue = 10, Value = 5 };
|
||||
vBox.AddChild(progressBar);
|
||||
|
||||
var optionButton = new OptionButton();
|
||||
optionButton.AddItem("Honk");
|
||||
optionButton.AddItem("Foo");
|
||||
optionButton.AddItem("Bar");
|
||||
optionButton.AddItem("Baz");
|
||||
optionButton.OnItemSelected += eventArgs => optionButton.SelectId(eventArgs.Id);
|
||||
vBox.AddChild(optionButton);
|
||||
|
||||
var tree = new Tree { VerticalExpand = true };
|
||||
var root = tree.CreateItem();
|
||||
root.Text = "Honk!";
|
||||
var child = tree.CreateItem();
|
||||
child.Text = "Foo";
|
||||
for (var i = 0; i < 20; i++)
|
||||
{
|
||||
child = tree.CreateItem();
|
||||
child.Text = $"Bar {i}";
|
||||
}
|
||||
|
||||
vBox.AddChild(tree);
|
||||
|
||||
var rich = new RichTextLabel();
|
||||
var message = new FormattedMessage();
|
||||
message.AddText("Foo\n");
|
||||
message.PushColor(Color.Red);
|
||||
message.AddText("Bar");
|
||||
message.Pop();
|
||||
rich.SetMessage(message);
|
||||
vBox.AddChild(rich);
|
||||
|
||||
var itemList = new ItemList();
|
||||
tabContainer.AddChild(itemList);
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
itemList.AddItem(i.ToString());
|
||||
}
|
||||
|
||||
var grid = new GridContainer { Columns = 3 };
|
||||
tabContainer.AddChild(grid);
|
||||
for (var y = 0; y < 3; y++)
|
||||
{
|
||||
for (var x = 0; x < 3; x++)
|
||||
{
|
||||
grid.AddChild(new Button
|
||||
{
|
||||
MinSize = (50, 50),
|
||||
Text = $"{x}, {y}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var group = new ButtonGroup();
|
||||
var vBoxRadioButtons = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
};
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
vBoxRadioButtons.AddChild(new Button
|
||||
{
|
||||
Text = i.ToString(),
|
||||
Group = group
|
||||
});
|
||||
|
||||
// ftftftftftftft
|
||||
}
|
||||
|
||||
tabContainer.AddChild(vBoxRadioButtons);
|
||||
|
||||
TabContainer.SetTabTitle(vBoxRadioButtons, "Radio buttons!!");
|
||||
|
||||
tabContainer.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Name = "Slider",
|
||||
Children =
|
||||
{
|
||||
new Slider()
|
||||
}
|
||||
});
|
||||
|
||||
tabContainer.AddChild(new SplitContainer
|
||||
{
|
||||
Orientation = SplitContainer.SplitOrientation.Horizontal,
|
||||
Children =
|
||||
{
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Red},
|
||||
Children =
|
||||
{
|
||||
new Label{ Text = "FOOBARBAZ"},
|
||||
}
|
||||
},
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Blue},
|
||||
Children =
|
||||
{
|
||||
new Label{ Text = "FOOBARBAZ"},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
window.OpenCentered();
|
||||
_clipboard.SetText(args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SetClipboardCommand : IConsoleCommand
|
||||
internal sealed class GetClipboardCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "setclipboard";
|
||||
public string Description => "Sets the system clipboard";
|
||||
public string Help => "setclipboard <text>";
|
||||
[Dependency] private readonly IClipboardManager _clipboard = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "getclipboard";
|
||||
|
||||
public override async void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IClipboardManager>();
|
||||
mgr.SetText(args[0]);
|
||||
shell.WriteLine(await _clipboard.GetText());
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GetClipboardCommand : IConsoleCommand
|
||||
internal sealed class ToggleLight : LocalizedCommands
|
||||
{
|
||||
public string Command => "getclipboard";
|
||||
public string Description => "Gets the system clipboard";
|
||||
public string Help => "getclipboard";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public async void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "togglelight";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IClipboardManager>();
|
||||
shell.WriteLine(await mgr.GetText());
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.Enabled = !_light.Enabled;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleLight : IConsoleCommand
|
||||
internal sealed class ToggleFOV : LocalizedCommands
|
||||
{
|
||||
public string Command => "togglelight";
|
||||
public string Description => "Toggles light rendering.";
|
||||
public string Help => "togglelight";
|
||||
[Dependency] private readonly IEyeManager _eye = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "togglefov";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.Enabled = !mgr.Enabled;
|
||||
_eye.CurrentEye.DrawFov = !_eye.CurrentEye.DrawFov;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleFOV : IConsoleCommand
|
||||
internal sealed class ToggleHardFOV : LocalizedCommands
|
||||
{
|
||||
public string Command => "togglefov";
|
||||
public string Description => "Toggles fov for client.";
|
||||
public string Help => "togglefov";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "togglehardfov";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IEyeManager>();
|
||||
if (mgr.CurrentEye != null)
|
||||
mgr.CurrentEye.DrawFov = !mgr.CurrentEye.DrawFov;
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.DrawHardFov = !_light.DrawHardFov;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleHardFOV : IConsoleCommand
|
||||
internal sealed class ToggleShadows : LocalizedCommands
|
||||
{
|
||||
public string Command => "togglehardfov";
|
||||
public string Description => "Toggles hard fov for client (for debugging space-station-14#2353).";
|
||||
public string Help => "togglehardfov";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "toggleshadows";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.DrawHardFov = !mgr.DrawHardFov;
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.DrawShadows = !_light.DrawShadows;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleShadows : IConsoleCommand
|
||||
internal sealed class ToggleLightBuf : LocalizedCommands
|
||||
{
|
||||
public string Command => "toggleshadows";
|
||||
public string Description => "Toggles shadow rendering.";
|
||||
public string Help => "toggleshadows";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.DrawShadows = !mgr.DrawShadows;
|
||||
}
|
||||
}
|
||||
internal sealed class ToggleLightBuf : IConsoleCommand
|
||||
{
|
||||
public string Command => "togglelightbuf";
|
||||
public string Description => "Toggles lighting rendering. This includes shadows but not FOV.";
|
||||
public string Help => "togglelightbuf";
|
||||
public override string Command => "togglelightbuf";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.DrawLighting = !mgr.DrawLighting;
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.DrawLighting = !_light.DrawLighting;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ChunkInfoCommand : IConsoleCommand
|
||||
internal sealed class ChunkInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "chunkinfo";
|
||||
public string Description => "Gets info about a chunk under your mouse cursor.";
|
||||
public string Help => Command;
|
||||
[Dependency] private readonly IMapManager _map = default!;
|
||||
[Dependency] private readonly IEyeManager _eye = default!;
|
||||
[Dependency] private readonly IInputManager _input = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "chunkinfo";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mapMan = IoCManager.Resolve<IMapManager>();
|
||||
var inputMan = IoCManager.Resolve<IInputManager>();
|
||||
var eyeMan = IoCManager.Resolve<IEyeManager>();
|
||||
var mousePos = _eye.ScreenToMap(_input.MouseScreenPosition);
|
||||
|
||||
var mousePos = eyeMan.ScreenToMap(inputMan.MouseScreenPosition);
|
||||
|
||||
if (!mapMan.TryFindGridAt(mousePos, out var grid))
|
||||
if (!_map.TryFindGridAt(mousePos, out var grid))
|
||||
{
|
||||
shell.WriteLine("No grid under your mouse cursor.");
|
||||
return;
|
||||
@@ -787,22 +632,20 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ReloadShadersCommand : IConsoleCommand
|
||||
internal sealed class ReloadShadersCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IResourceCacheInternal _res = default!;
|
||||
[Dependency] private readonly ITaskManager _taskManager = default!;
|
||||
|
||||
public string Command => "rldshader";
|
||||
|
||||
public string Description => "Reloads all shaders";
|
||||
|
||||
public string Help => "rldshader";
|
||||
public override string Command => "rldshader";
|
||||
|
||||
public static Dictionary<string, FileSystemWatcher>? _watchers;
|
||||
|
||||
public static ConcurrentDictionary<string, bool>? _reloadShadersQueued = new();
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IResourceCacheInternal resC;
|
||||
var resC = _res;
|
||||
if (args.Length == 1)
|
||||
{
|
||||
if (args[0] == "+watch")
|
||||
@@ -812,16 +655,16 @@ namespace Robust.Client.Console.Commands
|
||||
shell.WriteLine("Already watching.");
|
||||
return;
|
||||
}
|
||||
resC = IoCManager.Resolve<IResourceCacheInternal>();
|
||||
|
||||
_watchers = new Dictionary<string, FileSystemWatcher>();
|
||||
|
||||
var stringComparer = PathHelpers.IsFileSystemCaseSensitive()
|
||||
? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;
|
||||
? StringComparer.Ordinal
|
||||
: StringComparer.OrdinalIgnoreCase;
|
||||
|
||||
var reversePathResolution = new ConcurrentDictionary<string, HashSet<ResourcePath>>(stringComparer);
|
||||
|
||||
var taskManager = IoCManager.Resolve<ITaskManager>();
|
||||
var taskManager = _taskManager;
|
||||
|
||||
var shaderCount = 0;
|
||||
var created = 0;
|
||||
@@ -877,8 +720,7 @@ namespace Robust.Client.Console.Commands
|
||||
{
|
||||
try
|
||||
{
|
||||
IoCManager.Resolve<IResourceCache>()
|
||||
.ReloadResource<ShaderSourceResource>(resPath);
|
||||
resC.ReloadResource<ShaderSourceResource>(resPath);
|
||||
shell.WriteLine($"Reloaded shader: {resPath}");
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -939,8 +781,6 @@ namespace Robust.Client.Console.Commands
|
||||
|
||||
shell.WriteLine("Reloading content shader resources...");
|
||||
|
||||
resC = IoCManager.Resolve<IResourceCacheInternal>();
|
||||
|
||||
foreach (var (path, _) in resC.GetAllResources<ShaderSourceResource>())
|
||||
{
|
||||
try
|
||||
@@ -955,26 +795,23 @@ namespace Robust.Client.Console.Commands
|
||||
|
||||
shell.WriteLine("Done.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal sealed class ClydeDebugLayerCommand : IConsoleCommand
|
||||
internal sealed class ClydeDebugLayerCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "cldbglyr";
|
||||
public string Description => "Toggle fov and light debug layers";
|
||||
public string Help => "cldbglyr <layer>: Toggle <layer>\ncldbglyr: Turn all Layers off";
|
||||
[Dependency] private readonly IClydeInternal _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "cldbglyr";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var clyde = IoCManager.Resolve<IClydeInternal>();
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
clyde.DebugLayers = ClydeDebugLayers.None;
|
||||
_clyde.DebugLayers = ClydeDebugLayers.None;
|
||||
return;
|
||||
}
|
||||
|
||||
clyde.DebugLayers = args[0] switch
|
||||
_clyde.DebugLayers = args[0] switch
|
||||
{
|
||||
"fov" => ClydeDebugLayers.Fov,
|
||||
"light" => ClydeDebugLayers.Light,
|
||||
@@ -983,13 +820,13 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GetKeyInfoCommand : IConsoleCommand
|
||||
internal sealed class GetKeyInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "keyinfo";
|
||||
public string Description => "Keys key info for a key";
|
||||
public string Help => "keyinfo <Key>";
|
||||
[Dependency] private readonly IClydeInternal _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "keyinfo";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -997,13 +834,11 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var clyde = IoCManager.Resolve<IClydeInternal>();
|
||||
|
||||
if (Enum.TryParse(typeof(Keyboard.Key), args[0], true, out var parsed))
|
||||
{
|
||||
var key = (Keyboard.Key) parsed!;
|
||||
var key = (Keyboard.Key)parsed!;
|
||||
|
||||
var name = clyde.GetKeyName(key);
|
||||
var name = _clyde.GetKeyName(key);
|
||||
|
||||
shell.WriteLine($"name: '{name}' ");
|
||||
}
|
||||
|
||||
@@ -5,12 +5,11 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class DebugAnchoredCommand : IConsoleCommand
|
||||
public sealed class DebugAnchoredCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showanchored";
|
||||
public string Description => $"Shows anchored entities on a particular tile";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showanchored";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<DebugAnchoringSystem>().Enabled ^= true;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,11 @@ using Robust.Shared.ContentPack;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
#if DEBUG
|
||||
internal sealed class DumpMetadataMembersCommand : IConsoleCommand
|
||||
internal sealed class DumpMetadataMembersCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "dmetamem";
|
||||
public string Description => "Dumps a type's members in a format suitable for the sandbox configuration file.";
|
||||
public string Help => "Usage: dmetamem <type>";
|
||||
public override string Command => "dmetamem";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var type = Type.GetType(args[0]);
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class GridChunkBBCommand : IConsoleCommand
|
||||
public sealed class GridChunkBBCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showchunkbb";
|
||||
public string Description => "Displays chunk bounds for the purposes of rendering";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showchunkbb";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<GridChunkBoundsDebugSystem>().Enabled ^= true;
|
||||
}
|
||||
|
||||
@@ -9,19 +9,23 @@ using Robust.Shared.Network;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class LauncherAuthCommand : IConsoleCommand
|
||||
internal sealed class LauncherAuthCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "launchauth";
|
||||
public string Description => "Load authentication tokens from launcher data to aid in testing of live servers";
|
||||
public string Help => "launchauth [account name]";
|
||||
[Dependency] private readonly IAuthManager _auth = default!;
|
||||
[Dependency] private readonly IGameControllerInternal _gameController = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "launchauth";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var wantName = args.Length > 0 ? args[0] : null;
|
||||
|
||||
var basePath = Path.GetDirectoryName(UserDataDir.GetUserDataDir())!;
|
||||
var basePath = Path.GetDirectoryName(UserDataDir.GetUserDataDir(_gameController))!;
|
||||
var dbPath = Path.Combine(basePath, "launcher", "settings.db");
|
||||
|
||||
#if USE_SYSTEM_SQLITE
|
||||
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
|
||||
#endif
|
||||
using var con = new SqliteConnection($"Data Source={dbPath};Mode=ReadOnly");
|
||||
con.Open();
|
||||
using var cmd = con.CreateCommand();
|
||||
@@ -47,9 +51,8 @@ namespace Robust.Client.Console.Commands
|
||||
var userName = reader.GetString(1);
|
||||
var token = reader.GetString(2);
|
||||
|
||||
var cfg = IoCManager.Resolve<IAuthManager>();
|
||||
cfg.Token = token;
|
||||
cfg.UserId = new NetUserId(userId);
|
||||
_auth.Token = token;
|
||||
_auth.UserId = new NetUserId(userId);
|
||||
|
||||
shell.WriteLine($"Logged into account {userName}");
|
||||
}
|
||||
|
||||
@@ -5,12 +5,11 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class LightDebugCommand : IConsoleCommand
|
||||
internal sealed class LightDebugCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "lightbb";
|
||||
public string Description => "Toggles whether to show light bounding boxes";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "lightbb";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<DebugLightTreeSystem>().Enabled ^= true;
|
||||
}
|
||||
|
||||
@@ -7,17 +7,15 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class LsMonitorCommand : IConsoleCommand
|
||||
public sealed class LsMonitorCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "lsmonitor";
|
||||
public string Description => "";
|
||||
public string Help => "";
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "lsmonitor";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var clyde = IoCManager.Resolve<IClyde>();
|
||||
|
||||
foreach (var monitor in clyde.EnumerateMonitors())
|
||||
foreach (var monitor in _clyde.EnumerateMonitors())
|
||||
{
|
||||
shell.WriteLine(
|
||||
$"[{monitor.Id}] {monitor.Name}: {monitor.Size.X}x{monitor.Size.Y}@{monitor.RefreshRate}Hz");
|
||||
@@ -26,13 +24,13 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class MonitorInfoCommand : IConsoleCommand
|
||||
public sealed class MonitorInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "monitorinfo";
|
||||
public string Description => "";
|
||||
public string Help => "Usage: monitorinfo <id>";
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "monitorinfo";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 1)
|
||||
{
|
||||
@@ -40,8 +38,7 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var clyde = IoCManager.Resolve<IClyde>();
|
||||
var monitor = clyde.EnumerateMonitors().Single(c => c.Id == int.Parse(args[0]));
|
||||
var monitor = _clyde.EnumerateMonitors().Single(c => c.Id == int.Parse(args[0]));
|
||||
|
||||
shell.WriteLine($"{monitor.Id}: {monitor.Name}");
|
||||
shell.WriteLine($"Video modes:");
|
||||
@@ -54,19 +51,17 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class SetMonitorCommand : IConsoleCommand
|
||||
public sealed class SetMonitorCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "setmonitor";
|
||||
public string Description => "";
|
||||
public string Help => "Usage: setmonitor <id>";
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "setmonitor";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var clyde = IoCManager.Resolve<IClyde>();
|
||||
|
||||
var id = int.Parse(args[0]);
|
||||
var monitor = clyde.EnumerateMonitors().Single(m => m.Id == id);
|
||||
clyde.SetWindowMonitor(monitor);
|
||||
var monitor = _clyde.EnumerateMonitors().Single(m => m.Id == id);
|
||||
_clyde.SetWindowMonitor(monitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
using Robust.Client.Debugging;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class PhysicsOverlayCommands : IConsoleCommand
|
||||
public sealed class PhysicsOverlayCommands : LocalizedCommands
|
||||
{
|
||||
public string Command => "physics";
|
||||
public string Description => $"Shows a debug physics overlay. The arg supplied specifies the overlay.";
|
||||
public string Help => $"{Command} <aabbs / com / contactnormals / contactpoints / joints / shapeinfo / shapes>";
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "physics";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var system = EntitySystem.Get<DebugPhysicsSystem>();
|
||||
var system = _entitySystems.GetEntitySystem<DebugPhysicsSystem>();
|
||||
|
||||
switch (args[0])
|
||||
{
|
||||
@@ -35,6 +36,9 @@ namespace Robust.Client.Console.Commands
|
||||
case "contactpoints":
|
||||
system.Flags ^= PhysicsDebugFlags.ContactPoints;
|
||||
break;
|
||||
case "distance":
|
||||
system.Flags ^= PhysicsDebugFlags.Distance;
|
||||
break;
|
||||
case "joints":
|
||||
system.Flags ^= PhysicsDebugFlags.Joints;
|
||||
break;
|
||||
@@ -52,7 +56,7 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
if (args.Length != 1) return CompletionResult.Empty;
|
||||
|
||||
@@ -62,6 +66,7 @@ namespace Robust.Client.Console.Commands
|
||||
"com",
|
||||
"contactnormals",
|
||||
"contactpoints",
|
||||
"distance",
|
||||
"joints",
|
||||
"shapeinfo",
|
||||
"shapes",
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#if !FULL_RELEASE
|
||||
using System;
|
||||
using JetBrains.Profiler.Api;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Robust.Client.Console.Commands;
|
||||
|
||||
public sealed class ProfileEntitySpawningCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
|
||||
public string Command => "profileEntitySpawning";
|
||||
public string Description => "Profiles entity spawning with n entities";
|
||||
public string Help => $"Usage: {Command} | {Command} <amount> <prototype>";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var amount = 1000;
|
||||
string? prototype = null;
|
||||
|
||||
switch (args.Length)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 2:
|
||||
if (!int.TryParse(args[0], out amount))
|
||||
{
|
||||
shell.WriteError($"First argument is not an integer: {args[0]}");
|
||||
return;
|
||||
}
|
||||
|
||||
prototype = args[1];
|
||||
|
||||
break;
|
||||
default:
|
||||
shell.WriteError(Help);
|
||||
return;
|
||||
}
|
||||
|
||||
GC.Collect();
|
||||
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
|
||||
MeasureProfiler.StartCollectingData();
|
||||
|
||||
for (var i = 0; i < amount; i++)
|
||||
{
|
||||
_entities.SpawnEntity(prototype, MapCoordinates.Nullspace);
|
||||
}
|
||||
|
||||
MeasureProfiler.SaveData();
|
||||
|
||||
shell.WriteLine($"Client: Profiled spawning {amount} entities in {stopwatch.Elapsed.TotalMilliseconds:N3} ms");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4,27 +4,25 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
sealed class HardQuitCommand : IConsoleCommand
|
||||
sealed class HardQuitCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "hardquit";
|
||||
public string Description => "Kills the game client instantly.";
|
||||
public string Help => "Kills the game client instantly, leaving no traces. No telling the server goodbye";
|
||||
public override string Command => "hardquit";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
sealed class QuitCommand : IConsoleCommand
|
||||
sealed class QuitCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "quit";
|
||||
public string Description => "Shuts down the game client gracefully.";
|
||||
public string Help => "Properly shuts down the game client, notifying the connected server and such.";
|
||||
[Dependency] private readonly IGameController _gameController = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "quit";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<IGameController>().Shutdown("quit command used");
|
||||
_gameController.Shutdown("quit command used");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@ using Robust.Shared.Localization;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class ReloadLocalizationsCommand : IConsoleCommand
|
||||
internal sealed class ReloadLocalizationsCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "rldloc";
|
||||
public string Description => "Reloads localization (client & server)";
|
||||
public string Help => "Usage: rldloc";
|
||||
[Dependency] private readonly ILocalizationManager _loc = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "rldloc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<ILocalizationManager>().ReloadLocalizations();
|
||||
_loc.ReloadLocalizations();
|
||||
|
||||
shell.RemoteExecuteCommand("sudo rldloc");
|
||||
}
|
||||
|
||||
@@ -4,47 +4,42 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
#if CLIENT_SCRIPTING
|
||||
internal sealed class ScriptCommand : IConsoleCommand
|
||||
internal sealed class ScriptCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "csi";
|
||||
public string Description => "Opens a C# interactive console.";
|
||||
public string Help => "csi";
|
||||
public override string Command => "csi";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
new ScriptConsoleClient().OpenCentered();
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class WatchCommand : IConsoleCommand
|
||||
internal sealed class WatchCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "watch";
|
||||
public string Description => "Opens a variable watch window.";
|
||||
public string Help => "watch";
|
||||
public override string Command => "watch";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
new WatchWindow().OpenCentered();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
internal sealed class ServerScriptCommand : IConsoleCommand
|
||||
internal sealed class ServerScriptCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "scsi";
|
||||
public string Description => "Opens a C# interactive console on the server.";
|
||||
public string Help => "scsi";
|
||||
[Dependency] private readonly IScriptClient _scriptClient = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "scsi";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IScriptClient>();
|
||||
if (!mgr.CanScript)
|
||||
if (!_scriptClient.CanScript)
|
||||
{
|
||||
shell.WriteError("You do not have server side scripting permission.");
|
||||
return;
|
||||
}
|
||||
|
||||
mgr.StartSession();
|
||||
_scriptClient.StartSession();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,20 +4,19 @@ using Robust.Shared.Network;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class SendGarbageCommand : IConsoleCommand
|
||||
internal sealed class SendGarbageCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "sendgarbage";
|
||||
public string Description => "Sends garbage to the server.";
|
||||
public string Help => "The server will reply with 'no u'";
|
||||
[Dependency] private readonly IClientNetManager _netManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "sendgarbage";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
// MsgStringTableEntries is registered as NetMessageAccept.Client so the server will immediately deny it.
|
||||
// And kick us.
|
||||
var net = IoCManager.Resolve<IClientNetManager>();
|
||||
var msg = new MsgStringTableEntries();
|
||||
msg.Entries = new MsgStringTableEntries.Entry[0];
|
||||
net.ClientSendMessage(msg);
|
||||
_netManager.ClientSendMessage(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class SetInputContextCommand : IConsoleCommand
|
||||
public sealed class SetInputContextCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "setinputcontext";
|
||||
public string Description => "Sets the active input context.";
|
||||
public string Help => "setinputcontext <context>";
|
||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "setinputcontext";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -20,15 +20,13 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var inputMan = IoCManager.Resolve<IInputManager>();
|
||||
|
||||
if (!inputMan.Contexts.Exists(args[0]))
|
||||
if (!_inputManager.Contexts.Exists(args[0]))
|
||||
{
|
||||
shell.WriteLine("Context not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
inputMan.Contexts.SetActiveContext(args[0]);
|
||||
_inputManager.Contexts.SetActiveContext(args[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
285
Robust.Client/Console/Commands/UITestCommand.cs
Normal file
285
Robust.Client/Console/Commands/UITestCommand.cs
Normal file
@@ -0,0 +1,285 @@
|
||||
using System;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.Console.Commands;
|
||||
|
||||
internal sealed class UITestControl : Control
|
||||
{
|
||||
private const string Lipsum = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sed interdum diam. Duis erat risus, tincidunt at pulvinar non, accumsan non dui. Morbi feugiat nisi in odio consectetur, ac suscipit nulla mollis. Nulla consequat neque sit amet neque venenatis feugiat. Proin placerat eget mauris sit amet tincidunt. Sed pulvinar purus sed ex varius, et lobortis risus efficitur. Integer blandit eu neque quis elementum. Vivamus lacinia sem non lacinia eleifend. Integer sit amet est ac risus tempus iaculis sed quis leo. Proin eu dui tincidunt orci ornare elementum. Curabitur molestie enim scelerisque, porttitor ipsum vitae, posuere libero. Donec finibus placerat accumsan. Nam et arcu lacus.
|
||||
|
||||
Proin sed dui gravida nibh faucibus sodales ut sit amet dolor. Pellentesque ornare neque ac ante sagittis posuere. Maecenas ullamcorper pellentesque aliquet. Vestibulum ipsum ipsum, hendrerit eu venenatis eget, tempor aliquet ex. Etiam sed nunc eu orci condimentum consequat. Praesent commodo sem a lorem consequat, nec vestibulum elit dignissim. Sed fermentum maximus neque, non vestibulum felis. Quisque vulputate vehicula massa, sit amet accumsan purus condimentum nec. Ut tincidunt in purus sit amet lobortis. Nunc et eros vel elit sodales mollis. Aenean facilisis justo libero, at mollis arcu rutrum eget. Aenean rutrum, orci pretium faucibus auctor, tellus quam tincidunt diam, et feugiat turpis lectus nec sem.
|
||||
|
||||
Donec et ipsum urna. Vestibulum consequat risus vitae orci consectetur ornare id id ligula. Donec ac nunc venenatis, volutpat elit eget, eleifend ex. Fusce eget odio sed tortor luctus feugiat. Maecenas lobortis nulla sit amet nisl egestas vulputate. Aliquam a placerat nunc. Fusce porta ultricies tortor, vitae dictum elit aliquet ac. In massa sapien, lobortis laoreet odio dignissim, congue blandit nibh. Quisque et iaculis eros, sed pretium felis. Praesent venenatis porta odio sed vulputate. Vivamus lacus nulla, lacinia non commodo id, ultricies nec arcu. Donec scelerisque pretium mollis. Etiam eu facilisis leo.
|
||||
|
||||
Curabitur vulputate euismod massa, pulvinar tincidunt arcu vestibulum ut. Sed eu tempus velit, at porttitor justo. In eget turpis fermentum nibh euismod vestibulum. Proin vitae malesuada ipsum. Nunc at aliquet erat, sed maximus tortor. Cras tristique consequat elit, ut venenatis elit feugiat et. In malesuada, erat a tempus vehicula, nulla justo efficitur mauris, vitae ornare lectus massa eu sapien. Nam libero diam, gravida ac dapibus sed, hendrerit sed libero. Sed fringilla enim vel elit finibus congue. Fusce tristique, neque sit amet blandit posuere, ex urna malesuada ligula, ut sodales dolor est vitae lectus. Sed pharetra tincidunt pulvinar. Fusce sit amet finibus nulla, vel maximus tellus. Etiam in nisl ex. Fusce tempus augue lectus, eu sagittis arcu tempor id. Sed feugiat venenatis semper. Cras eget mollis nisi.
|
||||
|
||||
Suspendisse hendrerit blandit urna ut laoreet. Suspendisse ac elit at erat malesuada commodo id vel dolor. Etiam sem magna, placerat lobortis mattis a, tincidunt at nisi. Ut gravida arcu purus, eu feugiat turpis accumsan non. Sed sit amet varius enim, sed ornare ante. Integer porta felis felis. Vestibulum euismod velit sit amet eleifend posuere. Cras laoreet fermentum condimentum. Suspendisse potenti. Donec iaculis sodales vestibulum. Etiam quis dictum nisl. Fusce dui ex, viverra nec lacus sed, tincidunt accumsan odio. Nulla sit amet ipsum eros. Curabitur et lectus ut nisi lobortis sollicitudin a eu turpis. Etiam molestie purus vitae porttitor auctor.
|
||||
";
|
||||
|
||||
|
||||
private readonly TabContainer _tabContainer;
|
||||
|
||||
public UITestControl()
|
||||
{
|
||||
_tabContainer = new TabContainer();
|
||||
AddChild(_tabContainer);
|
||||
var scroll = new ScrollContainer();
|
||||
_tabContainer.AddChild(scroll);
|
||||
//scroll.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide);
|
||||
var vBox = new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical
|
||||
};
|
||||
scroll.AddChild(vBox);
|
||||
|
||||
var progressBar = new ProgressBar { MaxValue = 10, Value = 5 };
|
||||
vBox.AddChild(progressBar);
|
||||
|
||||
var optionButton = new OptionButton();
|
||||
optionButton.AddItem("Honk");
|
||||
optionButton.AddItem("Foo");
|
||||
optionButton.AddItem("Bar");
|
||||
optionButton.AddItem("Baz");
|
||||
optionButton.OnItemSelected += eventArgs => optionButton.SelectId(eventArgs.Id);
|
||||
vBox.AddChild(optionButton);
|
||||
|
||||
var tree = new Tree { VerticalExpand = true };
|
||||
var root = tree.CreateItem();
|
||||
root.Text = "Honk!";
|
||||
var child = tree.CreateItem();
|
||||
child.Text = "Foo";
|
||||
for (var i = 0; i < 20; i++)
|
||||
{
|
||||
child = tree.CreateItem();
|
||||
child.Text = $"Bar {i}";
|
||||
}
|
||||
|
||||
vBox.AddChild(tree);
|
||||
|
||||
var rich = new RichTextLabel();
|
||||
var message = new FormattedMessage();
|
||||
message.AddText("Foo\n");
|
||||
message.PushColor(Color.Red);
|
||||
message.AddText("Bar");
|
||||
message.Pop();
|
||||
rich.SetMessage(message);
|
||||
vBox.AddChild(rich);
|
||||
|
||||
var itemList = new ItemList();
|
||||
_tabContainer.AddChild(itemList);
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
itemList.AddItem(i.ToString());
|
||||
}
|
||||
|
||||
var grid = new GridContainer { Columns = 3 };
|
||||
_tabContainer.AddChild(grid);
|
||||
for (var y = 0; y < 3; y++)
|
||||
{
|
||||
for (var x = 0; x < 3; x++)
|
||||
{
|
||||
grid.AddChild(new Button
|
||||
{
|
||||
MinSize = (50, 50),
|
||||
Text = $"{x}, {y}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var group = new ButtonGroup();
|
||||
var vBoxRadioButtons = new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical
|
||||
};
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
vBoxRadioButtons.AddChild(new Button
|
||||
{
|
||||
Text = i.ToString(),
|
||||
Group = group
|
||||
});
|
||||
|
||||
// ftftftftftftft
|
||||
}
|
||||
|
||||
_tabContainer.AddChild(vBoxRadioButtons);
|
||||
|
||||
TabContainer.SetTabTitle(vBoxRadioButtons, "Radio buttons!!");
|
||||
|
||||
_tabContainer.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical,
|
||||
Name = "Slider",
|
||||
Children =
|
||||
{
|
||||
new Slider()
|
||||
}
|
||||
});
|
||||
|
||||
_tabContainer.AddChild(new SplitContainer
|
||||
{
|
||||
Orientation = SplitContainer.SplitOrientation.Horizontal,
|
||||
Children =
|
||||
{
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Red },
|
||||
Children =
|
||||
{
|
||||
new Label { Text = "FOOBARBAZ" },
|
||||
}
|
||||
},
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Blue },
|
||||
Children =
|
||||
{
|
||||
new Label { Text = "FOOBARBAZ" },
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
_tabContainer.AddChild(TabTextEdit());
|
||||
_tabContainer.AddChild(TabRichText());
|
||||
}
|
||||
|
||||
private Control TabTextEdit()
|
||||
{
|
||||
var textEdit = new TextEdit
|
||||
{
|
||||
Placeholder = new Rope.Leaf("You deleted the lipsum OwO")
|
||||
};
|
||||
TabContainer.SetTabTitle(textEdit, "TextEdit");
|
||||
|
||||
var lipsumRope = new Rope.Branch(Rope.Leaf.Empty, null);
|
||||
|
||||
var startIndex = 0;
|
||||
while (true)
|
||||
{
|
||||
var nextIndex = Lipsum.IndexOf(' ', startIndex);
|
||||
var str = nextIndex == -1 ? Lipsum[startIndex..] : Lipsum[startIndex..(nextIndex+1)];
|
||||
|
||||
lipsumRope = new Rope.Branch(lipsumRope, new Rope.Leaf(str));
|
||||
if (lipsumRope.Depth > 250)
|
||||
lipsumRope = (Rope.Branch)Rope.Rebalance(lipsumRope);
|
||||
|
||||
if (nextIndex == -1)
|
||||
break;
|
||||
|
||||
startIndex = nextIndex + 1;
|
||||
}
|
||||
|
||||
var rope = new Rope.Branch(lipsumRope, null);
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
rope = new Rope.Branch(rope, lipsumRope);
|
||||
}
|
||||
|
||||
rope = (Rope.Branch) Rope.Rebalance(rope);
|
||||
|
||||
textEdit.TextRope = rope;
|
||||
|
||||
return textEdit;
|
||||
}
|
||||
|
||||
private Control TabRichText()
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.SetMessage(FormattedMessage.FromMarkup(Lipsum));
|
||||
|
||||
TabContainer.SetTabTitle(label, "RichText");
|
||||
return label;
|
||||
}
|
||||
|
||||
public void SelectTab(Tab tab)
|
||||
{
|
||||
_tabContainer.CurrentTab = (int)tab;
|
||||
}
|
||||
|
||||
public enum Tab : byte
|
||||
{
|
||||
Untitled1 = 0,
|
||||
Untitled2 = 1,
|
||||
Untitled3 = 2,
|
||||
RadioButtons = 3,
|
||||
Slider = 4,
|
||||
Untitled4 = 5,
|
||||
TextEdit = 6,
|
||||
RichText = 7,
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class UITestCommand : LocalizedCommands
|
||||
{
|
||||
public override string Command => "uitest";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var window = new DefaultWindow { MinSize = (500, 400) };
|
||||
window.Contents.AddChild(new UITestControl());
|
||||
|
||||
window.OpenCentered();
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class UITest2Command : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
[Dependency] private readonly IUserInterfaceManager _uiMgr = default!;
|
||||
|
||||
public override string Command => "uitest2";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length > 1)
|
||||
{
|
||||
shell.WriteError(Loc.GetString("cmd-uitest2-error-args"));
|
||||
return;
|
||||
}
|
||||
|
||||
var control = new UITestControl();
|
||||
|
||||
if (args.Length == 1)
|
||||
{
|
||||
if (!Enum.TryParse(args[0], out UITestControl.Tab tab))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("cmd-uitest2-error-tab", ("value", args[0])));
|
||||
return;
|
||||
}
|
||||
|
||||
control.SelectTab(tab);
|
||||
}
|
||||
|
||||
var window = _clyde.CreateWindow(new WindowCreateParameters
|
||||
{
|
||||
Title = Loc.GetString("cmd-uitest2-title"),
|
||||
});
|
||||
|
||||
var root = _uiMgr.CreateWindowRoot(window);
|
||||
window.DisposeOnClose = true;
|
||||
|
||||
root.AddChild(control);
|
||||
}
|
||||
|
||||
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
if (args.Length == 1)
|
||||
{
|
||||
return CompletionResult.FromHintOptions(
|
||||
Enum.GetNames<UITestControl.Tab>(),
|
||||
Loc.GetString("cmd-uitest2-arg-tab"));
|
||||
}
|
||||
|
||||
return CompletionResult.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,19 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class VelocitiesCommand : IConsoleCommand
|
||||
public sealed class VelocitiesCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showvelocities";
|
||||
public string Description => "Displays your angular and linear velocities";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public override string Command => "showvelocities";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<VelocityDebugSystem>().Enabled ^= true;
|
||||
_entitySystems.GetEntitySystem<VelocityDebugSystem>().Enabled ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace Robust.Client.Console
|
||||
{
|
||||
private readonly ScriptConsoleClient _owner;
|
||||
|
||||
[field: Dependency] public override IViewVariablesManager vvm { get; } = default!;
|
||||
[field: Dependency] public override IClientViewVariablesManager vvm { get; } = default!;
|
||||
|
||||
public ScriptGlobalsImpl(ScriptConsoleClient owner)
|
||||
{
|
||||
@@ -243,7 +243,7 @@ namespace Robust.Client.Console
|
||||
[PublicAPI]
|
||||
public abstract class ScriptGlobals : ScriptGlobalsShared
|
||||
{
|
||||
public abstract IViewVariablesManager vvm { get; }
|
||||
public abstract IClientViewVariablesManager vvm { get; }
|
||||
|
||||
public abstract void vv(object a);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -15,10 +17,18 @@ namespace Robust.Client.Credits
|
||||
/// <summary>
|
||||
/// Gets a list of open source software used in the engine and their license.
|
||||
/// </summary>
|
||||
[Obsolete("Use overload that takes in an explicit resource manager instead.")]
|
||||
public static IEnumerable<LicenseEntry> GetLicenses()
|
||||
{
|
||||
var resM = IoCManager.Resolve<IResourceManager>();
|
||||
using var file = resM.ContentFileRead("/EngineCredits/Libraries.yml");
|
||||
return GetLicenses(IoCManager.Resolve<IResourceManager>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of open source software used in the engine and their license.
|
||||
/// </summary>
|
||||
public static IEnumerable<LicenseEntry> GetLicenses(IResourceManager resources)
|
||||
{
|
||||
using var file = resources.ContentFileRead("/EngineCredits/Libraries.yml");
|
||||
using var reader = new StreamReader(file);
|
||||
var yamlStream = new YamlStream();
|
||||
yamlStream.Load(reader);
|
||||
|
||||
@@ -17,10 +17,11 @@ namespace Robust.Client.Debugging
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IUserInterfaceManager _userInterface = default!;
|
||||
|
||||
private Label? _label;
|
||||
|
||||
private (GridId GridId, TileRef Tile)? _hovered;
|
||||
private (EntityUid GridId, TileRef Tile)? _hovered;
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
@@ -34,11 +35,11 @@ namespace Robust.Client.Debugging
|
||||
if (_enabled)
|
||||
{
|
||||
_label = new Label();
|
||||
IoCManager.Resolve<IUserInterfaceManager>().StateRoot.AddChild(_label);
|
||||
_userInterface.StateRoot.AddChild(_label);
|
||||
}
|
||||
else
|
||||
{
|
||||
IoCManager.Resolve<IUserInterfaceManager>().StateRoot.RemoveChild(_label!);
|
||||
_userInterface.StateRoot.RemoveChild(_label!);
|
||||
_label = null;
|
||||
_hovered = null;
|
||||
}
|
||||
@@ -71,9 +72,9 @@ namespace Robust.Client.Debugging
|
||||
var tile = grid.GetTileRef(spot);
|
||||
_label.Position = mouseSpot.Position + new Vector2(32, 0);
|
||||
|
||||
if (_hovered?.GridId == grid.Index && _hovered?.Tile == tile) return;
|
||||
if (_hovered?.GridId == grid.GridEntityId && _hovered?.Tile == tile) return;
|
||||
|
||||
_hovered = (grid.Index, tile);
|
||||
_hovered = (grid.GridEntityId, tile);
|
||||
|
||||
var text = new StringBuilder();
|
||||
|
||||
|
||||
@@ -46,8 +46,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -57,9 +59,11 @@ using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Collision;
|
||||
using Robust.Shared.Physics.Collision.Shapes;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Physics.Dynamics.Contacts;
|
||||
using Robust.Shared.Physics.Dynamics.Joints;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
namespace Robust.Client.Debugging
|
||||
{
|
||||
@@ -90,8 +94,10 @@ namespace Robust.Client.Debugging
|
||||
IoCManager.Resolve<IEyeManager>(),
|
||||
IoCManager.Resolve<IInputManager>(),
|
||||
IoCManager.Resolve<IMapManager>(),
|
||||
IoCManager.Resolve<IPlayerManager>(),
|
||||
IoCManager.Resolve<IResourceCache>(),
|
||||
this,
|
||||
Get<EntityLookupSystem>(),
|
||||
Get<SharedPhysicsSystem>()));
|
||||
|
||||
if (value == PhysicsDebugFlags.None)
|
||||
@@ -171,16 +177,23 @@ namespace Robust.Client.Debugging
|
||||
/// Shows Center of Mass for all bodies in the viewport.
|
||||
/// </summary>
|
||||
COM = 1 << 6,
|
||||
|
||||
/// <summary>
|
||||
/// Shows nearest edge from target to player.
|
||||
/// </summary>
|
||||
Distance = 1 << 7,
|
||||
}
|
||||
|
||||
internal sealed class PhysicsDebugOverlay : Overlay
|
||||
{
|
||||
private IEntityManager _entityManager = default!;
|
||||
private IEyeManager _eyeManager = default!;
|
||||
private IInputManager _inputManager = default!;
|
||||
private IMapManager _mapManager = default!;
|
||||
private DebugPhysicsSystem _debugPhysicsSystem = default!;
|
||||
private SharedPhysicsSystem _physicsSystem = default!;
|
||||
private readonly IEntityManager _entityManager;
|
||||
private readonly IEyeManager _eyeManager;
|
||||
private readonly IInputManager _inputManager;
|
||||
private readonly IMapManager _mapManager;
|
||||
private readonly IPlayerManager _playerManager;
|
||||
private readonly DebugPhysicsSystem _debugPhysicsSystem;
|
||||
private readonly EntityLookupSystem _lookup;
|
||||
private readonly SharedPhysicsSystem _physicsSystem;
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace | OverlaySpace.ScreenSpace;
|
||||
|
||||
@@ -190,13 +203,15 @@ namespace Robust.Client.Debugging
|
||||
|
||||
private HashSet<Joint> _drawnJoints = new();
|
||||
|
||||
public PhysicsDebugOverlay(IEntityManager entityManager, IEyeManager eyeManager, IInputManager inputManager, IMapManager mapManager, IResourceCache cache, DebugPhysicsSystem system, SharedPhysicsSystem physicsSystem)
|
||||
public PhysicsDebugOverlay(IEntityManager entityManager, IEyeManager eyeManager, IInputManager inputManager, IMapManager mapManager, IPlayerManager playerManager, IResourceCache cache, DebugPhysicsSystem system, EntityLookupSystem lookup, SharedPhysicsSystem physicsSystem)
|
||||
{
|
||||
_entityManager = entityManager;
|
||||
_eyeManager = eyeManager;
|
||||
_inputManager = inputManager;
|
||||
_mapManager = mapManager;
|
||||
_playerManager = playerManager;
|
||||
_debugPhysicsSystem = system;
|
||||
_lookup = lookup;
|
||||
_physicsSystem = physicsSystem;
|
||||
_font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10);
|
||||
}
|
||||
@@ -220,7 +235,7 @@ namespace Robust.Client.Debugging
|
||||
foreach (var fixture in _entityManager.GetComponent<FixturesComponent>(physBody.Owner).Fixtures.Values)
|
||||
{
|
||||
// Invalid shape - Box2D doesn't check for IsSensor but we will for sanity.
|
||||
if (physBody.BodyType == BodyType.Dynamic && fixture.Mass == 0f && fixture.Hard)
|
||||
if (physBody.BodyType == BodyType.Dynamic && fixture.Density == 0f && fixture.Hard)
|
||||
{
|
||||
DrawShape(worldHandle, fixture, xform, Color.Red.WithAlpha(AlphaModifier));
|
||||
}
|
||||
@@ -381,6 +396,35 @@ namespace Robust.Client.Debugging
|
||||
row++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((_debugPhysicsSystem.Flags & PhysicsDebugFlags.Distance) != 0x0)
|
||||
{
|
||||
var mapPos = _eyeManager.ScreenToMap(mousePos);
|
||||
|
||||
if (mapPos.MapId != args.MapId)
|
||||
return;
|
||||
|
||||
var player = _playerManager.LocalPlayer?.ControlledEntity;
|
||||
|
||||
if (!_entityManager.TryGetComponent<TransformComponent>(player, out var playerXform) ||
|
||||
playerXform.MapID != args.MapId)
|
||||
return;
|
||||
|
||||
var flags = EntityLookupSystem.DefaultFlags;
|
||||
flags &= ~LookupFlags.Contained;
|
||||
|
||||
foreach (var ent in _lookup.GetEntitiesIntersecting(mapPos, flags))
|
||||
{
|
||||
if (!_entityManager.TryGetComponent<FixturesComponent>(ent, out var managerB))
|
||||
continue;
|
||||
|
||||
if (_physicsSystem.TryGetDistance(player.Value, ent, out var distance, managerB: managerB))
|
||||
{
|
||||
screenHandle.DrawString(_font, mousePos.Position, $"Ent: {_entityManager.ToPrettyString(ent)}\nDistance: {distance:0.00}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected internal override void Draw(in OverlayDrawArgs args)
|
||||
|
||||
@@ -20,9 +20,14 @@ namespace Robust.Client
|
||||
_inputManager.KeyUp(keyEvent);
|
||||
}
|
||||
|
||||
public void TextEntered(TextEventArgs textEvent)
|
||||
public void TextEntered(TextEnteredEventArgs textEnteredEvent)
|
||||
{
|
||||
_userInterfaceManager.TextEntered(textEvent);
|
||||
_userInterfaceManager.TextEntered(textEnteredEvent);
|
||||
}
|
||||
|
||||
public void TextEditing(TextEditingEventArgs textEvent)
|
||||
{
|
||||
_userInterfaceManager.TextEditing(textEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -10,17 +10,17 @@ namespace Robust.Client
|
||||
// Partial of GameController to initialize IoC and some other low-level systems like it.
|
||||
internal sealed partial class GameController
|
||||
{
|
||||
private static void InitIoC(DisplayMode mode)
|
||||
private static void InitIoC(DisplayMode mode, IDependencyCollection deps)
|
||||
{
|
||||
ClientIoC.RegisterIoC(mode);
|
||||
IoCManager.BuildGraph();
|
||||
RegisterReflection();
|
||||
ClientIoC.RegisterIoC(mode, deps);
|
||||
deps.BuildGraph();
|
||||
RegisterReflection(deps);
|
||||
}
|
||||
|
||||
internal static void RegisterReflection()
|
||||
internal static void RegisterReflection(IDependencyCollection deps)
|
||||
{
|
||||
// Gets a handle to the shared and the current (client) dll.
|
||||
IoCManager.Resolve<IReflectionManager>().LoadAssemblies(new List<Assembly>(2)
|
||||
deps.Resolve<IReflectionManager>().LoadAssemblies(new List<Assembly>(2)
|
||||
{
|
||||
// Do NOT register Robust.Client.Godot.
|
||||
// At least not for now.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Robust.Client.Timing;
|
||||
using Robust.LoaderApi;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -13,7 +14,7 @@ namespace Robust.Client
|
||||
{
|
||||
private IGameLoop? _mainLoop;
|
||||
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IClientGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IDependencyCollection _dependencyCollection = default!;
|
||||
|
||||
private static bool _hasStarted;
|
||||
@@ -44,13 +45,12 @@ namespace Robust.Client
|
||||
|
||||
private static void ParsedMain(CommandLineArgs args, bool contentStart, IMainArgs? loaderArgs, GameControllerOptions options)
|
||||
{
|
||||
IoCManager.InitThread();
|
||||
|
||||
var deps = IoCManager.InitThread();
|
||||
var mode = args.Headless ? DisplayMode.Headless : DisplayMode.Clyde;
|
||||
|
||||
InitIoC(mode);
|
||||
InitIoC(mode, deps);
|
||||
|
||||
var gc = IoCManager.Resolve<GameController>();
|
||||
var gc = deps.Resolve<GameController>();
|
||||
gc.SetCommandLineArgs(args);
|
||||
gc._loaderArgs = loaderArgs;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Robust.Client
|
||||
CleanupWindowThread();
|
||||
|
||||
Logger.Debug("Goodbye");
|
||||
IoCManager.Clear();
|
||||
_dependencyCollection.Clear();
|
||||
}
|
||||
|
||||
private void GameThreadMain(DisplayMode mode)
|
||||
|
||||
@@ -13,6 +13,7 @@ using Robust.Client.Placement;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.State;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Themes;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Client.ViewVariables;
|
||||
using Robust.Client.WebViewHook;
|
||||
@@ -39,7 +40,7 @@ namespace Robust.Client
|
||||
{
|
||||
internal sealed partial class GameController : IGameControllerInternal
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManagerInternal _configurationManager = default!;
|
||||
[Dependency] private readonly INetConfigurationManagerInternal _configurationManager = default!;
|
||||
[Dependency] private readonly IResourceCacheInternal _resourceCache = default!;
|
||||
[Dependency] private readonly IRobustSerializer _serializer = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
@@ -57,7 +58,7 @@ namespace Robust.Client
|
||||
[Dependency] private readonly IOverlayManagerInternal _overlayManager = default!;
|
||||
[Dependency] private readonly ILogManager _logManager = default!;
|
||||
[Dependency] private readonly ITaskManager _taskManager = default!;
|
||||
[Dependency] private readonly IViewVariablesManagerInternal _viewVariablesManager = default!;
|
||||
[Dependency] private readonly IClientViewVariablesManagerInternal _viewVariablesManager = default!;
|
||||
[Dependency] private readonly IDiscordRichPresence _discord = default!;
|
||||
[Dependency] private readonly IClydeInternal _clyde = default!;
|
||||
[Dependency] private readonly IClydeAudioInternal _clydeAudio = default!;
|
||||
@@ -71,6 +72,7 @@ namespace Robust.Client
|
||||
[Dependency] private readonly IParallelManagerInternal _parallelMgr = default!;
|
||||
[Dependency] private readonly ProfManager _prof = default!;
|
||||
[Dependency] private readonly IRuntimeLog _runtimeLog = default!;
|
||||
[Dependency] private readonly ISerializationManager _serializationManager = default!;
|
||||
|
||||
private IWebViewManagerHook? _webViewHook;
|
||||
|
||||
@@ -123,17 +125,14 @@ namespace Robust.Client
|
||||
_configurationManager.LoadCVarsFromAssembly(loadedModule);
|
||||
}
|
||||
|
||||
IoCManager.Resolve<ISerializationManager>().Initialize();
|
||||
_serializationManager.Initialize();
|
||||
|
||||
// Call Init in game assemblies.
|
||||
_modLoader.BroadcastRunLevel(ModRunLevel.PreInit);
|
||||
_modLoader.BroadcastRunLevel(ModRunLevel.Init);
|
||||
|
||||
_resourceCache.PreloadTextures();
|
||||
_userInterfaceManager.Initialize();
|
||||
_eyeManager.Initialize();
|
||||
_networkManager.Initialize(false);
|
||||
IoCManager.Resolve<INetConfigurationManager>().SetupNetworking();
|
||||
_configurationManager.SetupNetworking();
|
||||
_serializer.Initialize();
|
||||
_inputManager.Initialize();
|
||||
_console.Initialize();
|
||||
@@ -141,16 +140,18 @@ namespace Robust.Client
|
||||
_prototypeManager.LoadDirectory(new ResourcePath("/EnginePrototypes/"));
|
||||
_prototypeManager.LoadDirectory(Options.PrototypeDirectory);
|
||||
_prototypeManager.ResolveResults();
|
||||
_userInterfaceManager.Initialize();
|
||||
_eyeManager.Initialize();
|
||||
_entityManager.Initialize();
|
||||
_mapManager.Initialize();
|
||||
_gameStateManager.Initialize();
|
||||
_placementManager.Initialize();
|
||||
_viewVariablesManager.Initialize();
|
||||
_scriptClient.Initialize();
|
||||
|
||||
_client.Initialize();
|
||||
_discord.Initialize();
|
||||
_modLoader.BroadcastRunLevel(ModRunLevel.PostInit);
|
||||
_userInterfaceManager.PostInitialize();
|
||||
|
||||
if (_commandLineArgs?.Username != null)
|
||||
{
|
||||
@@ -383,6 +384,7 @@ namespace Robust.Client
|
||||
}
|
||||
|
||||
_clyde.TextEntered += TextEntered;
|
||||
_clyde.TextEditing += TextEditing;
|
||||
_clyde.MouseMove += MouseMove;
|
||||
_clyde.KeyUp += KeyUp;
|
||||
_clyde.KeyDown += KeyDown;
|
||||
@@ -516,9 +518,16 @@ namespace Robust.Client
|
||||
{
|
||||
using (_prof.Group("Entity"))
|
||||
{
|
||||
// The last real tick is the current tick! This way we won't be in "prediction" mode.
|
||||
_gameTiming.LastRealTick = _gameTiming.CurTick;
|
||||
_entityManager.TickUpdate(frameEventArgs.DeltaSeconds, noPredictions: false);
|
||||
if (ContentEntityTickUpdate != null)
|
||||
{
|
||||
ContentEntityTickUpdate.Invoke(frameEventArgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The last real tick is the current tick! This way we won't be in "prediction" mode.
|
||||
_gameTiming.LastRealTick = _gameTiming.LastProcessedTick = _gameTiming.CurTick;
|
||||
_entityManager.TickUpdate(frameEventArgs.DeltaSeconds, noPredictions: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -649,7 +658,7 @@ namespace Robust.Client
|
||||
return Path.Combine(exeDir ?? throw new InvalidOperationException(), "user_data");
|
||||
}
|
||||
|
||||
return UserDataDir.GetUserDataDir();
|
||||
return UserDataDir.GetUserDataDir(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -685,5 +694,7 @@ namespace Robust.Client
|
||||
string? SplashLogo,
|
||||
bool AutoConnect
|
||||
);
|
||||
|
||||
public event Action<FrameEventArgs>? ContentEntityTickUpdate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Reflection;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
@@ -15,8 +16,6 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
RegisterClass<MetaDataComponent>();
|
||||
RegisterClass<TransformComponent>();
|
||||
RegisterClass<MapComponent>();
|
||||
RegisterClass<MapGridComponent>();
|
||||
RegisterClass<PhysicsComponent>();
|
||||
RegisterClass<CollisionWakeComponent>();
|
||||
RegisterClass<ClientUserInterfaceComponent>();
|
||||
|
||||
@@ -3,11 +3,11 @@ using System.Collections.Generic;
|
||||
using Prometheus;
|
||||
using Robust.Client.GameStates;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.Timing;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Network.Messages;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
@@ -19,8 +19,8 @@ namespace Robust.Client.GameObjects
|
||||
{
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IClientNetManager _networkManager = default!;
|
||||
[Dependency] private readonly IClientGameStateManager _gameStateManager = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IClientGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IClientGameStateManager _stateMan = default!;
|
||||
|
||||
protected override int NextEntityUid { get; set; } = EntityUid.ClientUid + 1;
|
||||
|
||||
@@ -31,6 +31,17 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
public override void Shutdown()
|
||||
{
|
||||
using var _ = _gameTiming.StartStateApplicationArea();
|
||||
base.Shutdown();
|
||||
}
|
||||
|
||||
public override void Cleanup()
|
||||
{
|
||||
using var _ = _gameTiming.StartStateApplicationArea();
|
||||
base.Cleanup();
|
||||
}
|
||||
|
||||
EntityUid IClientEntityManagerInternal.CreateEntity(string? prototypeName, EntityUid uid)
|
||||
{
|
||||
@@ -47,6 +58,48 @@ namespace Robust.Client.GameObjects
|
||||
base.StartEntity(entity);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void DirtyEntity(EntityUid uid, MetaDataComponent? meta = null)
|
||||
{
|
||||
// Client only dirties during prediction
|
||||
if (_gameTiming.InPrediction)
|
||||
base.DirtyEntity(uid, meta);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Dirty(Component component, MetaDataComponent? meta = null)
|
||||
{
|
||||
// Client only dirties during prediction
|
||||
if (_gameTiming.InPrediction)
|
||||
base.Dirty(component, meta);
|
||||
}
|
||||
|
||||
public override EntityStringRepresentation ToPrettyString(EntityUid uid)
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity == uid)
|
||||
return base.ToPrettyString(uid) with { Session = _playerManager.LocalPlayer.Session };
|
||||
else
|
||||
return base.ToPrettyString(uid);
|
||||
}
|
||||
|
||||
public override void RaisePredictiveEvent<T>(T msg)
|
||||
{
|
||||
var localPlayer = _playerManager.LocalPlayer;
|
||||
DebugTools.AssertNotNull(localPlayer);
|
||||
|
||||
var sequence = _stateMan.SystemMessageDispatched(msg);
|
||||
EntityNetManager?.SendSystemNetworkMessage(msg, sequence);
|
||||
|
||||
if (!_stateMan.IsPredictionEnabled)
|
||||
return;
|
||||
|
||||
DebugTools.Assert(_gameTiming.InPrediction && _gameTiming.IsFirstTimePredicted);
|
||||
|
||||
var eventArgs = new EntitySessionEventArgs(localPlayer!.Session);
|
||||
EventBus.RaiseEvent(EventSource.Local, msg);
|
||||
EventBus.RaiseEvent(EventSource.Local, new EntitySessionMessage<T>(eventArgs, msg));
|
||||
}
|
||||
|
||||
#region IEntityNetworkManager impl
|
||||
|
||||
public override IEntityNetworkManager EntityNetManager => this;
|
||||
@@ -67,11 +120,11 @@ namespace Robust.Client.GameObjects
|
||||
{
|
||||
using (histogram?.WithLabels("EntityNet").NewTimer())
|
||||
{
|
||||
while (_queue.Count != 0 && _queue.Peek().msg.SourceTick <= _gameStateManager.CurServerTick)
|
||||
while (_queue.Count != 0 && _queue.Peek().msg.SourceTick <= _gameTiming.LastRealTick)
|
||||
{
|
||||
var (_, msg) = _queue.Take();
|
||||
// Logger.DebugS("net.ent", "Dispatching: {0}: {1}", seq, msg);
|
||||
DispatchMsgEntity(msg);
|
||||
DispatchReceivedNetworkMsg(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,9 +156,9 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
private void HandleEntityNetworkMessage(MsgEntity message)
|
||||
{
|
||||
if (message.SourceTick <= _gameStateManager.CurServerTick)
|
||||
if (message.SourceTick <= _gameTiming.LastRealTick)
|
||||
{
|
||||
DispatchMsgEntity(message);
|
||||
DispatchReceivedNetworkMsg(message);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -115,20 +168,24 @@ namespace Robust.Client.GameObjects
|
||||
_queue.Add((++_incomingMsgSequence, message));
|
||||
}
|
||||
|
||||
private void DispatchMsgEntity(MsgEntity message)
|
||||
private void DispatchReceivedNetworkMsg(MsgEntity message)
|
||||
{
|
||||
switch (message.Type)
|
||||
{
|
||||
case EntityMessageType.SystemMessage:
|
||||
var msg = message.SystemMessage;
|
||||
var sessionType = typeof(EntitySessionMessage<>).MakeGenericType(msg.GetType());
|
||||
var sessionMsg = Activator.CreateInstance(sessionType, new EntitySessionEventArgs(_playerManager.LocalPlayer!.Session), msg)!;
|
||||
ReceivedSystemMessage?.Invoke(this, msg);
|
||||
ReceivedSystemMessage?.Invoke(this, sessionMsg);
|
||||
DispatchReceivedNetworkMsg(message.SystemMessage);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void DispatchReceivedNetworkMsg(EntityEventArgs msg)
|
||||
{
|
||||
var sessionType = typeof(EntitySessionMessage<>).MakeGenericType(msg.GetType());
|
||||
var sessionMsg = Activator.CreateInstance(sessionType, new EntitySessionEventArgs(_playerManager.LocalPlayer!.Session), msg)!;
|
||||
ReceivedSystemMessage?.Invoke(this, msg);
|
||||
ReceivedSystemMessage?.Invoke(this, sessionMsg);
|
||||
}
|
||||
|
||||
private sealed class MessageTickComparer : IComparer<(uint seq, MsgEntity msg)>
|
||||
{
|
||||
public int Compare((uint seq, MsgEntity msg) x, (uint seq, MsgEntity msg) y)
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using static Robust.Client.Animations.AnimationPlaybackShared;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
@@ -29,7 +30,7 @@ namespace Robust.Client.GameObjects
|
||||
/// </param>
|
||||
public void Play(Animation animation, string key)
|
||||
{
|
||||
EntitySystem.Get<AnimationPlayerSystem>().AddComponent(this);
|
||||
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AnimationPlayerSystem>().AddComponent(this);
|
||||
var playback = new AnimationPlayback(animation);
|
||||
|
||||
PlayingAnimations.Add(key, playback);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Robust.Client.GameObjects;
|
||||
|
||||
@@ -13,7 +11,17 @@ namespace Robust.Client.GameObjects;
|
||||
[ComponentReference(typeof(AppearanceComponent)), Access(typeof(AppearanceSystem))]
|
||||
public sealed class ClientAppearanceComponent : AppearanceComponent
|
||||
{
|
||||
[ViewVariables]
|
||||
[DataField("visuals")]
|
||||
internal List<AppearanceVisualizer> Visualizers = new();
|
||||
|
||||
/// <summary>
|
||||
/// If true, then this entity's visuals will get updated in the next frame update regardless of whether or not
|
||||
/// this entity is currently inside of PVS range.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This defaults to true, because it is possible for an entity to both be initialized and detached to null
|
||||
/// during the same tick. This can happen because entity states & pvs-departure messages are sent & handled
|
||||
/// separately. However, we want to ensure that each entity has an initial appearance update.
|
||||
/// </remarks>
|
||||
internal bool UpdateDetached = true;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,17 @@ namespace Robust.Client.GameObjects
|
||||
[DataField("zoom")]
|
||||
private Vector2 _setZoomOnInitialize = Vector2.One;
|
||||
|
||||
/// <summary>
|
||||
/// If not null, this entity is used to update the eye's position instead of just using the component's owner.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is useful for things like vehicles that effectively need to hijack the eye. This allows them to do
|
||||
/// that without messing with the main viewport's eye. This is important as there are some overlays that are
|
||||
/// only be drawn if that viewport's eye belongs to the currently controlled entity.
|
||||
/// </remarks>
|
||||
[ViewVariables]
|
||||
public EntityUid? Target;
|
||||
|
||||
public IEye? Eye => _eye;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
@@ -136,15 +147,15 @@ namespace Robust.Client.GameObjects
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (!(curState is EyeComponentState state))
|
||||
if (curState is not EyeComponentState state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DrawFov = state.DrawFov;
|
||||
// TODO: Should be a way for content to override lerping and lerp the zoom
|
||||
Zoom = state.Zoom;
|
||||
Offset = state.Offset;
|
||||
Rotation = state.Rotation;
|
||||
VisibilityMask = state.VisibilityMask;
|
||||
}
|
||||
|
||||
@@ -162,8 +173,14 @@ namespace Robust.Client.GameObjects
|
||||
public void UpdateEyePosition()
|
||||
{
|
||||
if (_eye == null) return;
|
||||
var mapPos = _entityManager.GetComponent<TransformComponent>(Owner).MapPosition;
|
||||
_eye.Position = new MapCoordinates(mapPos.Position, mapPos.MapId);
|
||||
|
||||
if (!_entityManager.TryGetComponent(Target, out TransformComponent? xform))
|
||||
{
|
||||
xform = _entityManager.GetComponent<TransformComponent>(Owner);
|
||||
Target = null;
|
||||
}
|
||||
|
||||
_eye.Position = xform.MapPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Robust.Client.GameObjects
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
[ViewVariables] private (GridId, Vector2i) _lastPosition;
|
||||
[ViewVariables] private (EntityUid, Vector2i) _lastPosition;
|
||||
[ViewVariables] internal OccluderDir Occluding { get; private set; }
|
||||
[ViewVariables] internal uint UpdateGeneration { get; set; }
|
||||
|
||||
@@ -46,8 +46,9 @@ namespace Robust.Client.GameObjects
|
||||
if(!xform.Anchored)
|
||||
return;
|
||||
|
||||
var grid = _mapManager.GetGrid(xform.GridID);
|
||||
_lastPosition = (xform.GridID, grid.TileIndicesFor(xform.Coordinates));
|
||||
var gridId = xform.GridUid ?? throw new InvalidOperationException("Anchored without a grid");
|
||||
var grid = _mapManager.GetGrid(gridId);
|
||||
_lastPosition = (gridId, grid.TileIndicesFor(xform.Coordinates));
|
||||
}
|
||||
|
||||
protected override void Shutdown()
|
||||
@@ -92,7 +93,7 @@ namespace Robust.Client.GameObjects
|
||||
if (!xform.Anchored)
|
||||
return;
|
||||
|
||||
var grid = _mapManager.GetGrid(xform.GridID);
|
||||
var grid = _mapManager.GetGrid(xform.GridUid ?? throw new InvalidOperationException("Anchored without a grid"));
|
||||
var position = xform.Coordinates;
|
||||
void CheckDir(Direction dir, OccluderDir oclDir)
|
||||
{
|
||||
|
||||
@@ -103,12 +103,6 @@ namespace Robust.Client.GameObjects
|
||||
set => _visibleNested = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether this pointlight should cast shadows
|
||||
/// </summary>
|
||||
[DataField("castShadows")]
|
||||
public bool CastShadows = true;
|
||||
|
||||
[DataField("nestedvisible")]
|
||||
private bool _visibleNested = true;
|
||||
[DataField("autoRot")]
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace Robust.Client.GameObjects
|
||||
/// <exception cref="ArgumentNullException">
|
||||
/// Thrown if <paramref name="key"/> is null.
|
||||
/// </exception>
|
||||
bool LayerMapTryGet(object key, out int layer);
|
||||
bool LayerMapTryGet(object key, out int layer, bool logError = false);
|
||||
|
||||
/// <summary>
|
||||
/// Create a new blank layer and add it to the layer map,
|
||||
|
||||
@@ -10,12 +10,11 @@ using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
{
|
||||
public sealed class ShowSpriteBBCommand : IConsoleCommand
|
||||
public sealed class ShowSpriteBBCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showspritebb";
|
||||
public string Description => "Toggle whether sprite bounds are shown";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showspritebb";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<SpriteBoundsSystem>().Enabled ^= true;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Reflection;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
@@ -17,14 +16,12 @@ namespace Robust.Client.GameObjects
|
||||
[Dependency] private readonly IDynamicTypeFactory _dynamicTypeFactory = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IEntityNetworkManager _netMan = default!;
|
||||
|
||||
private readonly Dictionary<object, BoundUserInterface> _openInterfaces =
|
||||
internal readonly Dictionary<Enum, BoundUserInterface> _openInterfaces =
|
||||
new();
|
||||
|
||||
private readonly Dictionary<object, PrototypeData> _interfaces = new();
|
||||
|
||||
[DataField("interfaces", readOnly: true)]
|
||||
private List<PrototypeData> _interfaceData = new();
|
||||
internal readonly Dictionary<Enum, PrototypeData> _interfaces = new();
|
||||
|
||||
[ViewVariables]
|
||||
public IEnumerable<BoundUserInterface> Interfaces => _openInterfaces.Values;
|
||||
@@ -72,7 +69,7 @@ namespace Robust.Client.GameObjects
|
||||
// TODO: This type should be cached, but I'm too lazy.
|
||||
var type = _reflectionManager.LooseGetType(data.ClientType);
|
||||
var boundInterface =
|
||||
(BoundUserInterface) _dynamicTypeFactory.CreateInstance(type, new[] {this, wrapped.UiKey});
|
||||
(BoundUserInterface) _dynamicTypeFactory.CreateInstance(type, new object[] {this, wrapped.UiKey});
|
||||
boundInterface.Open();
|
||||
_openInterfaces[wrapped.UiKey] = boundInterface;
|
||||
|
||||
@@ -81,7 +78,7 @@ namespace Robust.Client.GameObjects
|
||||
_entityManager.EventBus.RaiseLocalEvent(Owner, new BoundUIOpenedEvent(wrapped.UiKey, Owner, playerSession), true);
|
||||
}
|
||||
|
||||
internal void Close(object uiKey, bool remoteCall)
|
||||
internal void Close(Enum uiKey, bool remoteCall)
|
||||
{
|
||||
if (!_openInterfaces.TryGetValue(uiKey, out var boundUserInterface))
|
||||
{
|
||||
@@ -98,10 +95,9 @@ namespace Robust.Client.GameObjects
|
||||
_entityManager.EventBus.RaiseLocalEvent(Owner, new BoundUIClosedEvent(uiKey, Owner, playerSession), true);
|
||||
}
|
||||
|
||||
internal void SendMessage(BoundUserInterfaceMessage message, object uiKey)
|
||||
internal void SendMessage(BoundUserInterfaceMessage message, Enum uiKey)
|
||||
{
|
||||
EntitySystem.Get<UserInterfaceSystem>()
|
||||
.Send(new BoundUIWrapMessage(Owner, message, uiKey));
|
||||
_netMan.SendSystemNetworkMessage(new BoundUIWrapMessage(Owner, message, uiKey));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,14 +107,15 @@ namespace Robust.Client.GameObjects
|
||||
public abstract class BoundUserInterface : IDisposable
|
||||
{
|
||||
protected ClientUserInterfaceComponent Owner { get; }
|
||||
protected object UiKey { get; }
|
||||
|
||||
public readonly Enum UiKey;
|
||||
|
||||
/// <summary>
|
||||
/// The last received state object sent from the server.
|
||||
/// </summary>
|
||||
protected BoundUserInterfaceState? State { get; private set; }
|
||||
|
||||
protected BoundUserInterface(ClientUserInterfaceComponent owner, object uiKey)
|
||||
protected BoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey)
|
||||
{
|
||||
Owner = owner;
|
||||
UiKey = uiKey;
|
||||
@@ -149,7 +146,7 @@ namespace Robust.Client.GameObjects
|
||||
/// <summary>
|
||||
/// Invoked to close the UI.
|
||||
/// </summary>
|
||||
protected void Close()
|
||||
public void Close()
|
||||
{
|
||||
Owner.Close(UiKey, false);
|
||||
}
|
||||
@@ -157,7 +154,7 @@ namespace Robust.Client.GameObjects
|
||||
/// <summary>
|
||||
/// Sends a message to the server-side UI.
|
||||
/// </summary>
|
||||
protected void SendMessage(BoundUserInterfaceMessage message)
|
||||
public void SendMessage(BoundUserInterfaceMessage message)
|
||||
{
|
||||
Owner.SendMessage(message, UiKey);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using Robust.Client.GameStates;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
{
|
||||
@@ -11,16 +7,7 @@ namespace Robust.Client.GameObjects
|
||||
public static void RaisePredictiveEvent<T>(this IEntityManager entityManager, T msg)
|
||||
where T : EntityEventArgs
|
||||
{
|
||||
var localPlayer = IoCManager.Resolve<IPlayerManager>().LocalPlayer;
|
||||
DebugTools.AssertNotNull(localPlayer);
|
||||
|
||||
var sequence = IoCManager.Resolve<IClientGameStateManager>().SystemMessageDispatched(msg);
|
||||
entityManager.EntityNetManager?.SendSystemNetworkMessage(msg, sequence);
|
||||
|
||||
var eventArgs = new EntitySessionEventArgs(localPlayer!.Session);
|
||||
|
||||
entityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
||||
entityManager.EventBus.RaiseEvent(EventSource.Local, new EntitySessionMessage<T>(eventArgs, msg));
|
||||
((IClientEntityManager)entityManager).RaisePredictiveEvent(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
@@ -9,6 +11,8 @@ namespace Robust.Client.GameObjects
|
||||
{
|
||||
private readonly List<AnimationPlayerComponent> _activeAnimations = new();
|
||||
|
||||
[Dependency] private readonly IComponentFactory _compFact = default!;
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
{
|
||||
for (var i = _activeAnimations.Count - 1; i >= 0; i--)
|
||||
@@ -76,6 +80,39 @@ namespace Robust.Client.GameObjects
|
||||
AddComponent(component);
|
||||
var playback = new AnimationPlaybackShared.AnimationPlayback(animation);
|
||||
|
||||
#if DEBUG
|
||||
// Component networking checks
|
||||
foreach (var track in animation.AnimationTracks)
|
||||
{
|
||||
if (track is not AnimationTrackComponentProperty compTrack)
|
||||
continue;
|
||||
|
||||
if (compTrack.ComponentType == null)
|
||||
{
|
||||
Logger.Error($"Attempted to play a component animation without any component specified.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EntityManager.TryGetComponent(component.Owner, compTrack.ComponentType, out var animatedComp))
|
||||
{
|
||||
Logger.Error(
|
||||
$"Attempted to play a component animation, but the entity {ToPrettyString(component.Owner)} does not have the component to be animated: {compTrack.ComponentType}.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.Owner.IsClientSide() || !animatedComp.NetSyncEnabled)
|
||||
continue;
|
||||
|
||||
var reg = _compFact.GetRegistration(animatedComp);
|
||||
|
||||
// In principle there is nothing wrong with this, as long as the property of the component being
|
||||
// animated is not part of the networked state and setting it does not dirty the component. Hence only a
|
||||
// warning in debug mode.
|
||||
if (reg.NetID != null)
|
||||
Logger.Warning($"Playing a component animation on a networked component {reg.Name} belonging to {ToPrettyString(component.Owner)}");
|
||||
}
|
||||
#endif
|
||||
|
||||
component.PlayingAnimations.Add(key, playback);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,33 +79,38 @@ namespace Robust.Client.GameObjects
|
||||
return newDict;
|
||||
}
|
||||
|
||||
public override void MarkDirty(AppearanceComponent component)
|
||||
public override void MarkDirty(AppearanceComponent component, bool updateDetached = false)
|
||||
{
|
||||
var clientComp = (ClientAppearanceComponent)component;
|
||||
clientComp.UpdateDetached |= updateDetached;
|
||||
|
||||
if (component.AppearanceDirty)
|
||||
return;
|
||||
|
||||
_queuedUpdates.Enqueue((ClientAppearanceComponent) component);
|
||||
_queuedUpdates.Enqueue(clientComp);
|
||||
component.AppearanceDirty = true;
|
||||
}
|
||||
|
||||
internal void UnmarkDirty(ClientAppearanceComponent component)
|
||||
{
|
||||
component.AppearanceDirty = false;
|
||||
}
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
{
|
||||
var spriteQuery = GetEntityQuery<SpriteComponent>();
|
||||
var metaQuery = GetEntityQuery<MetaDataComponent>();
|
||||
while (_queuedUpdates.TryDequeue(out var appearance))
|
||||
{
|
||||
if (appearance.Deleted)
|
||||
continue;
|
||||
|
||||
appearance.AppearanceDirty = false;
|
||||
|
||||
// If the entity is no longer within the clients PVS, don't bother updating.
|
||||
if ((metaQuery.GetComponent(appearance.Owner).Flags & MetaDataFlags.Detached) != 0 && !appearance.UpdateDetached)
|
||||
continue;
|
||||
|
||||
appearance.UpdateDetached = false;
|
||||
|
||||
// Sprite comp is allowed to be null, so that things like spriteless point-lights can use this system
|
||||
spriteQuery.TryGetComponent(appearance.Owner, out var sprite);
|
||||
|
||||
OnChangeData(appearance.Owner, sprite, appearance);
|
||||
UnmarkDirty(appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -81,7 +81,7 @@ namespace Robust.Client.GameObjects
|
||||
occluderQuery.HasComponent(sender))
|
||||
{
|
||||
var xform = EntityManager.GetComponent<TransformComponent>(sender);
|
||||
if (!_mapManager.TryGetGrid(xform.GridID, out grid))
|
||||
if (!_mapManager.TryGetGrid(xform.GridUid, out grid))
|
||||
return;
|
||||
|
||||
var coords = xform.Coordinates;
|
||||
@@ -122,13 +122,13 @@ namespace Robust.Client.GameObjects
|
||||
/// </summary>
|
||||
internal sealed class OccluderDirtyEvent : EntityEventArgs
|
||||
{
|
||||
public OccluderDirtyEvent(EntityUid sender, (GridId grid, Vector2i pos)? lastPosition)
|
||||
public OccluderDirtyEvent(EntityUid sender, (EntityUid grid, Vector2i pos)? lastPosition)
|
||||
{
|
||||
LastPosition = lastPosition;
|
||||
Sender = sender;
|
||||
}
|
||||
|
||||
public (GridId grid, Vector2i pos)? LastPosition { get; }
|
||||
public (EntityUid grid, Vector2i pos)? LastPosition { get; }
|
||||
public EntityUid Sender { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Robust.Shared.Collections;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using static Robust.Shared.Containers.ContainerManagerComponent;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
{
|
||||
public sealed class ContainerSystem : SharedContainerSystem
|
||||
{
|
||||
[Dependency] private readonly INetManager _netMan = default!;
|
||||
[Dependency] private readonly IRobustSerializer _serializer = default!;
|
||||
[Dependency] private readonly IDynamicTypeFactoryInternal _dynFactory = default!;
|
||||
|
||||
@@ -32,13 +35,16 @@ namespace Robust.Client.GameObjects
|
||||
UpdatesBefore.Add(typeof(SpriteSystem));
|
||||
}
|
||||
|
||||
protected override void ValidateMissingEntity(EntityUid uid, IContainer cont, EntityUid missing)
|
||||
{
|
||||
DebugTools.Assert(ExpectedEntities.TryGetValue(missing, out var expectedContainer) && expectedContainer == cont && cont.ExpectedEntities.Contains(missing));
|
||||
}
|
||||
|
||||
private void HandleEntityInitialized(EntityInitializedMessage ev)
|
||||
{
|
||||
if (!ExpectedEntities.TryGetValue(ev.Entity, out var container))
|
||||
if (!RemoveExpectedEntity(ev.Entity, out var container))
|
||||
return;
|
||||
|
||||
RemoveExpectedEntity(ev.Entity);
|
||||
|
||||
if (container.Deleted)
|
||||
return;
|
||||
|
||||
@@ -54,18 +60,12 @@ namespace Robust.Client.GameObjects
|
||||
var toDelete = new ValueList<string>();
|
||||
foreach (var (id, container) in component.Containers)
|
||||
{
|
||||
// TODO: This is usually O(n^2) to the amount of containers.
|
||||
foreach (var stateContainer in cast.ContainerSet)
|
||||
{
|
||||
if (stateContainer.Id == id)
|
||||
goto skip;
|
||||
}
|
||||
if (cast.Containers.ContainsKey(id))
|
||||
continue;
|
||||
|
||||
container.EmptyContainer(true, entMan: EntityManager);
|
||||
container.Shutdown();
|
||||
EmptyContainer(container, true, null, false, EntityManager);
|
||||
container.Shutdown(EntityManager, _netMan);
|
||||
toDelete.Add(id);
|
||||
|
||||
skip: ;
|
||||
}
|
||||
|
||||
foreach (var dead in toDelete)
|
||||
@@ -75,7 +75,7 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
// Add new containers and update existing contents.
|
||||
|
||||
foreach (var (containerType, id, showEnts, occludesLight, entityUids) in cast.ContainerSet)
|
||||
foreach (var (containerType, id, showEnts, occludesLight, entityUids) in cast.Containers.Values)
|
||||
{
|
||||
if (!component.Containers.TryGetValue(id, out var container))
|
||||
{
|
||||
@@ -114,13 +114,13 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
foreach (var entityUid in removedExpected)
|
||||
{
|
||||
RemoveExpectedEntity(entityUid);
|
||||
RemoveExpectedEntity(entityUid, out _);
|
||||
}
|
||||
|
||||
// Add new entities.
|
||||
foreach (var entity in entityUids)
|
||||
{
|
||||
if (!EntityManager.EntityExists(entity))
|
||||
if (!EntityManager.TryGetComponent(entity, out MetaDataComponent? meta))
|
||||
{
|
||||
AddExpectedEntity(entity, container);
|
||||
continue;
|
||||
@@ -133,14 +133,17 @@ namespace Robust.Client.GameObjects
|
||||
// from the container. It would then subsequently be parented to the container without ever being
|
||||
// re-inserted, leading to the client seeing what should be hidden entities attached to
|
||||
// containers/players.
|
||||
if (Transform(entity).MapID == MapId.Nullspace)
|
||||
if ((meta.Flags & MetaDataFlags.Detached) != 0)
|
||||
{
|
||||
AddExpectedEntity(entity, container);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!container.ContainedEntities.Contains(entity))
|
||||
container.Insert(entity);
|
||||
if (container.Contains(entity))
|
||||
continue;
|
||||
|
||||
RemoveExpectedEntity(entity, out _);
|
||||
container.Insert(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,7 +161,7 @@ namespace Robust.Client.GameObjects
|
||||
if (message.OldParent != null && message.OldParent.Value.IsValid())
|
||||
return;
|
||||
|
||||
if (!ExpectedEntities.TryGetValue(message.Entity, out var container))
|
||||
if (!RemoveExpectedEntity(message.Entity, out var container))
|
||||
return;
|
||||
|
||||
if (xform.ParentUid != container.Owner)
|
||||
@@ -168,8 +171,6 @@ namespace Robust.Client.GameObjects
|
||||
return;
|
||||
}
|
||||
|
||||
RemoveExpectedEntity(message.Entity);
|
||||
|
||||
if (container.Deleted)
|
||||
return;
|
||||
|
||||
@@ -189,20 +190,35 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
public void AddExpectedEntity(EntityUid uid, IContainer container)
|
||||
{
|
||||
if (ExpectedEntities.ContainsKey(uid))
|
||||
return;
|
||||
DebugTools.Assert(!TryComp(uid, out MetaDataComponent? meta) ||
|
||||
(meta.Flags & ( MetaDataFlags.Detached | MetaDataFlags.InContainer) ) == MetaDataFlags.Detached,
|
||||
$"Adding entity {ToPrettyString(uid)} to list of expected entities for container {container.ID} in {ToPrettyString(container.Owner)}, despite it already being in a container.");
|
||||
|
||||
ExpectedEntities.Add(uid, container);
|
||||
if (!ExpectedEntities.TryAdd(uid, container))
|
||||
{
|
||||
// It is possible that we were expecting this entity in one container, but it has now moved to another
|
||||
// container, and this entity's state is just being applied before the old container is getting updated.
|
||||
var oldContainer = ExpectedEntities[uid];
|
||||
ExpectedEntities[uid] = container;
|
||||
DebugTools.Assert(oldContainer.ExpectedEntities.Contains(uid),
|
||||
$"Entity {ToPrettyString(uid)} is expected, but not expected in the given container? Container: {oldContainer.ID} in {ToPrettyString(oldContainer.Owner)}");
|
||||
oldContainer.ExpectedEntities.Remove(uid);
|
||||
}
|
||||
|
||||
DebugTools.Assert(!container.ExpectedEntities.Contains(uid),
|
||||
$"Contained entity {ToPrettyString(uid)} was not yet expected by the system, but was already expected by the container: {container.ID} in {ToPrettyString(container.Owner)}");
|
||||
container.ExpectedEntities.Add(uid);
|
||||
}
|
||||
|
||||
public void RemoveExpectedEntity(EntityUid uid)
|
||||
public bool RemoveExpectedEntity(EntityUid uid, [NotNullWhen(true)] out IContainer? container)
|
||||
{
|
||||
if (!ExpectedEntities.TryGetValue(uid, out var container))
|
||||
return;
|
||||
if (!ExpectedEntities.Remove(uid, out container))
|
||||
return false;
|
||||
|
||||
ExpectedEntities.Remove(uid);
|
||||
DebugTools.Assert(container.ExpectedEntities.Contains(uid),
|
||||
$"While removing expected contained entity {ToPrettyString(uid)}, the entity was missing from the container expected set. Container: {container.ID} in {ToPrettyString(container.Owner)}");
|
||||
container.ExpectedEntities.Remove(uid);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
|
||||
@@ -6,17 +6,17 @@ using Robust.Shared.Enums;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Utility;
|
||||
using Color = Robust.Shared.Maths.Color;
|
||||
|
||||
namespace Robust.Client.GameObjects;
|
||||
|
||||
public sealed class DebugEntityLookupCommand : IConsoleCommand
|
||||
public sealed class DebugEntityLookupCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "togglelookup";
|
||||
public string Description => "Shows / hides entitylookup bounds via an overlay";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "togglelookup";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<DebugEntityLookupSystem>().Enabled ^= true;
|
||||
}
|
||||
@@ -79,11 +79,29 @@ public sealed class EntityLookupOverlay : Overlay
|
||||
var lookupAABB = invMatrix.TransformBox(args.WorldBounds);
|
||||
var ents = new List<EntityUid>();
|
||||
|
||||
// Gonna allocate a lot but debug overlay sooo
|
||||
lookup.Tree._b2Tree.FastQuery(ref lookupAABB, (ref EntityUid data) =>
|
||||
lookup.DynamicTree.QueryAabb(ref ents, static (ref List<EntityUid> state, in FixtureProxy value) =>
|
||||
{
|
||||
ents.Add(data);
|
||||
});
|
||||
state.Add(value.Fixture.Body.Owner);
|
||||
return true;
|
||||
}, lookupAABB);
|
||||
|
||||
lookup.StaticTree.QueryAabb(ref ents, static (ref List<EntityUid> state, in FixtureProxy value) =>
|
||||
{
|
||||
state.Add(value.Fixture.Body.Owner);
|
||||
return true;
|
||||
}, lookupAABB);
|
||||
|
||||
lookup.StaticSundriesTree.QueryAabb(ref ents, static (ref List<EntityUid> state, in EntityUid value) =>
|
||||
{
|
||||
state.Add(value);
|
||||
return true;
|
||||
}, lookupAABB);
|
||||
|
||||
lookup.SundriesTree.QueryAabb(ref ents, static (ref List<EntityUid> state, in EntityUid value) =>
|
||||
{
|
||||
state.Add(value);
|
||||
return true;
|
||||
}, lookupAABB);
|
||||
|
||||
foreach (var ent in ents)
|
||||
{
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace Robust.Client.GameObjects
|
||||
var deltaPosition = new Vector2(0f, 0f);
|
||||
|
||||
//If we have an emitter we can do special effects around that emitter position
|
||||
if (_mapManager.GridExists(EmitterCoordinates.GetGridId(_entityManager)))
|
||||
if (_mapManager.GridExists(EmitterCoordinates.GetGridUid(_entityManager)))
|
||||
{
|
||||
//Calculate delta p due to radial velocity
|
||||
var positionRelativeToEmitter =
|
||||
|
||||
@@ -26,26 +26,11 @@ namespace Robust.Client.GameObjects
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
//WARN: Tightly couples this system with InputSystem, and assumes InputSystem exists and is initialized
|
||||
CommandBinds.Builder
|
||||
.Bind(EngineKeyFunctions.CameraRotateRight, new NullInputCmdHandler())
|
||||
.Bind(EngineKeyFunctions.CameraRotateLeft, new NullInputCmdHandler())
|
||||
.Register<EyeUpdateSystem>();
|
||||
|
||||
// Make sure this runs *after* entities have been moved by interpolation and movement.
|
||||
UpdatesAfter.Add(typeof(TransformSystem));
|
||||
UpdatesAfter.Add(typeof(PhysicsSystem));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Shutdown()
|
||||
{
|
||||
//WARN: Tightly couples this system with InputSystem, and assumes InputSystem exists and is initialized
|
||||
CommandBinds.Unregister<EyeUpdateSystem>();
|
||||
base.Shutdown();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void FrameUpdate(float frameTime)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.GameObjects;
|
||||
|
||||
internal class GridRenderingSystem : EntitySystem
|
||||
internal sealed class GridRenderingSystem : EntitySystem
|
||||
{
|
||||
private readonly IClydeInternal _clyde;
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
using Robust.Client.Physics;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
{
|
||||
internal sealed class MapSystem : SharedMapSystem
|
||||
public sealed class MapSystem : SharedMapSystem
|
||||
{
|
||||
|
||||
protected override void OnMapAdd(EntityUid uid, MapComponent component, ComponentAdd args)
|
||||
{
|
||||
EnsureComp<PhysicsMapComponent>(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,13 +78,12 @@ namespace Robust.Client.GameObjects
|
||||
SubscribeLocalEvent<GridInitializeEvent>(MapManagerOnGridCreated);
|
||||
|
||||
// Due to how recursion works, this must be done.
|
||||
// Note that this also implicitly handles parent changes.
|
||||
SubscribeLocalEvent<MoveEvent>(AnythingMoved);
|
||||
|
||||
SubscribeLocalEvent<SpriteComponent, EntParentChangedMessage>(SpriteParentChanged);
|
||||
SubscribeLocalEvent<SpriteComponent, ComponentRemove>(RemoveSprite);
|
||||
SubscribeLocalEvent<SpriteComponent, SpriteUpdateEvent>(HandleSpriteUpdate);
|
||||
SubscribeLocalEvent<SpriteComponent, UpdateSpriteTreeEvent>(HandleSpriteUpdate);
|
||||
|
||||
SubscribeLocalEvent<PointLightComponent, EntParentChangedMessage>(LightParentChanged);
|
||||
SubscribeLocalEvent<PointLightComponent, PointLightRadiusChangedEvent>(PointLightRadiusChanged);
|
||||
SubscribeLocalEvent<PointLightComponent, PointLightUpdateEvent>(HandleLightUpdate);
|
||||
|
||||
@@ -107,10 +106,9 @@ namespace Robust.Client.GameObjects
|
||||
QueueLightUpdate(component);
|
||||
}
|
||||
|
||||
private void HandleSpriteUpdate(EntityUid uid, SpriteComponent component, SpriteUpdateEvent args)
|
||||
private void HandleSpriteUpdate(EntityUid uid, SpriteComponent component, UpdateSpriteTreeEvent args)
|
||||
{
|
||||
if (component.TreeUpdateQueued) return;
|
||||
QueueSpriteUpdate(component);
|
||||
_spriteQueue.Add(component);
|
||||
}
|
||||
|
||||
private void AnythingMoved(ref MoveEvent args)
|
||||
@@ -118,18 +116,21 @@ namespace Robust.Client.GameObjects
|
||||
var pointQuery = EntityManager.GetEntityQuery<PointLightComponent>();
|
||||
var spriteQuery = EntityManager.GetEntityQuery<SpriteComponent>();
|
||||
var xformQuery = EntityManager.GetEntityQuery<TransformComponent>();
|
||||
var renderingQuery = EntityManager.GetEntityQuery<RenderingTreeComponent>();
|
||||
|
||||
AnythingMovedSubHandler(args.Sender, xformQuery, pointQuery, spriteQuery);
|
||||
AnythingMovedSubHandler(args.Sender, args.Component, xformQuery, pointQuery, spriteQuery, renderingQuery);
|
||||
}
|
||||
|
||||
private void AnythingMovedSubHandler(
|
||||
EntityUid uid,
|
||||
TransformComponent xform,
|
||||
EntityQuery<TransformComponent> xformQuery,
|
||||
EntityQuery<PointLightComponent> pointQuery,
|
||||
EntityQuery<SpriteComponent> spriteQuery)
|
||||
EntityQuery<SpriteComponent> spriteQuery,
|
||||
EntityQuery<RenderingTreeComponent> renderingQuery)
|
||||
{
|
||||
// To avoid doing redundant updates (and we don't need to update a grid's children ever)
|
||||
if (!_checkedChildren.Add(uid) || EntityManager.HasComponent<RenderingTreeComponent>(uid)) return;
|
||||
if (!_checkedChildren.Add(uid) || renderingQuery.HasComponent(uid)) return;
|
||||
|
||||
// This recursive search is needed, as MoveEvent is defined to not care about indirect events like children.
|
||||
// WHATEVER YOU DO, DON'T REPLACE THIS WITH SPAMMING EVENTS UNLESS YOU HAVE A GUARANTEE IT WON'T LAG THE GC.
|
||||
@@ -141,13 +142,12 @@ namespace Robust.Client.GameObjects
|
||||
if (pointQuery.TryGetComponent(uid, out var light))
|
||||
QueueLightUpdate(light);
|
||||
|
||||
if (!xformQuery.TryGetComponent(uid, out var xform)) return;
|
||||
|
||||
var childEnumerator = xform.ChildEnumerator;
|
||||
|
||||
while (childEnumerator.MoveNext(out var child))
|
||||
{
|
||||
AnythingMovedSubHandler(child.Value, xformQuery, pointQuery, spriteQuery);
|
||||
if (xformQuery.TryGetComponent(uid, out var childXform))
|
||||
AnythingMovedSubHandler(child.Value, childXform, xformQuery, pointQuery, spriteQuery, renderingQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,11 +158,6 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
#region SpriteHandlers
|
||||
|
||||
private void SpriteParentChanged(EntityUid uid, SpriteComponent component, ref EntParentChangedMessage args)
|
||||
{
|
||||
QueueSpriteUpdate(component);
|
||||
}
|
||||
|
||||
private void RemoveSprite(EntityUid uid, SpriteComponent component, ComponentRemove args)
|
||||
{
|
||||
ClearSprite(component);
|
||||
@@ -187,11 +182,6 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
#region LightHandlers
|
||||
|
||||
private void LightParentChanged(EntityUid uid, PointLightComponent component, ref EntParentChangedMessage args)
|
||||
{
|
||||
QueueLightUpdate(component);
|
||||
}
|
||||
|
||||
private void PointLightRadiusChanged(EntityUid uid, PointLightComponent component, PointLightRadiusChangedEvent args)
|
||||
{
|
||||
QueueLightUpdate(component);
|
||||
@@ -242,7 +232,7 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
private void MapManagerOnGridCreated(GridInitializeEvent ev)
|
||||
{
|
||||
EntityManager.EnsureComponent<RenderingTreeComponent>(_mapManager.GetGrid(ev.GridId).GridEntityId);
|
||||
EntityManager.EnsureComponent<RenderingTreeComponent>(_mapManager.GetGrid(ev.EntityUid).GridEntityId);
|
||||
}
|
||||
|
||||
private RenderingTreeComponent? GetRenderTree(EntityUid entity, TransformComponent xform, EntityQuery<TransformComponent> xforms)
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
@@ -15,7 +18,9 @@ namespace Robust.Client.GameObjects
|
||||
public sealed partial class SpriteSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly RenderingTreeSystem _treeSystem = default!;
|
||||
[Dependency] private readonly TransformSystem _transform = default!;
|
||||
|
||||
private readonly Queue<SpriteComponent> _inertUpdateQueue = new();
|
||||
private HashSet<ISpriteComponent> _manualUpdate = new();
|
||||
@@ -26,12 +31,19 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
_proto.PrototypesReloaded += OnPrototypesReloaded;
|
||||
SubscribeLocalEvent<SpriteUpdateInertEvent>(QueueUpdateInert);
|
||||
_cfg.OnValueChanged(CVars.RenderSpriteDirectionBias, OnBiasChanged, true);
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
_proto.PrototypesReloaded -= OnPrototypesReloaded;
|
||||
_cfg.UnsubValueChanged(CVars.RenderSpriteDirectionBias, OnBiasChanged);
|
||||
}
|
||||
|
||||
private void OnBiasChanged(double value)
|
||||
{
|
||||
SpriteComponent.DirectionBias = value;
|
||||
}
|
||||
|
||||
private void QueueUpdateInert(SpriteUpdateInertEvent ev)
|
||||
@@ -62,20 +74,23 @@ namespace Robust.Client.GameObjects
|
||||
}
|
||||
|
||||
var xforms = EntityManager.GetEntityQuery<TransformComponent>();
|
||||
var spriteState = (frameTime, _manualUpdate);
|
||||
|
||||
foreach (var comp in _treeSystem.GetRenderTrees(currentMap, pvsBounds))
|
||||
{
|
||||
var bounds = xforms.GetComponent(comp.Owner).InvWorldMatrix.TransformBox(pvsBounds);
|
||||
var invMatrix = _transform.GetInvWorldMatrix(comp.Owner, xforms);
|
||||
var bounds = invMatrix.TransformBox(pvsBounds);
|
||||
|
||||
comp.SpriteTree.QueryAabb(ref frameTime, (ref float state, in ComponentTreeEntry<SpriteComponent> value) =>
|
||||
comp.SpriteTree.QueryAabb(ref spriteState, static (ref (
|
||||
float frameTime,
|
||||
HashSet<ISpriteComponent> _manualUpdate) tuple, in ComponentTreeEntry<SpriteComponent> value) =>
|
||||
{
|
||||
if (value.Component.IsInert)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!_manualUpdate.Contains(value.Component))
|
||||
value.Component.FrameUpdate(state);
|
||||
if (!tuple._manualUpdate.Contains(value.Component))
|
||||
value.Component.FrameUpdate(tuple.frameTime);
|
||||
|
||||
return true;
|
||||
}, bounds, true);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ public sealed partial class TransformSystem
|
||||
{
|
||||
public override void SetLocalPosition(TransformComponent xform, Vector2 value)
|
||||
{
|
||||
xform._prevPosition = xform._localPosition;
|
||||
xform._nextPosition = value;
|
||||
xform.PrevPosition = xform._localPosition;
|
||||
xform.NextPosition = value;
|
||||
xform.LerpParent = xform.ParentUid;
|
||||
base.SetLocalPosition(xform, value);
|
||||
ActivateLerp(xform);
|
||||
@@ -16,17 +16,28 @@ public sealed partial class TransformSystem
|
||||
|
||||
public override void SetLocalPositionNoLerp(TransformComponent xform, Vector2 value)
|
||||
{
|
||||
xform._nextPosition = null;
|
||||
xform.NextPosition = null;
|
||||
xform.LerpParent = EntityUid.Invalid;
|
||||
base.SetLocalPositionNoLerp(xform, value);
|
||||
}
|
||||
|
||||
public override void SetLocalRotation(TransformComponent xform, Angle angle)
|
||||
{
|
||||
xform._prevRotation = xform._localRotation;
|
||||
xform._nextRotation = angle;
|
||||
xform.PrevRotation = xform._localRotation;
|
||||
xform.NextRotation = angle;
|
||||
xform.LerpParent = xform.ParentUid;
|
||||
base.SetLocalRotation(xform, angle);
|
||||
ActivateLerp(xform);
|
||||
}
|
||||
|
||||
public override void SetLocalPositionRotation(TransformComponent xform, Vector2 pos, Angle rot)
|
||||
{
|
||||
xform.PrevPosition = xform._localPosition;
|
||||
xform.NextPosition = pos;
|
||||
xform.PrevRotation = xform._localRotation;
|
||||
xform.NextRotation = rot;
|
||||
xform.LerpParent = xform.ParentUid;
|
||||
base.SetLocalPositionRotation(xform, pos, rot);
|
||||
ActivateLerp(xform);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,16 +35,33 @@ namespace Robust.Client.GameObjects
|
||||
// Much faster than iterating 3000+ transforms every frame.
|
||||
[ViewVariables] private readonly List<TransformComponent> _lerpingTransforms = new();
|
||||
|
||||
public override void Initialize()
|
||||
public void Reset()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<TransformStartLerpMessage>(TransformStartLerpHandler);
|
||||
foreach (var xform in _lerpingTransforms)
|
||||
{
|
||||
xform.ActivelyLerping = false;
|
||||
xform.NextPosition = null;
|
||||
xform.NextRotation = null;
|
||||
xform.LerpParent = EntityUid.Invalid;
|
||||
}
|
||||
_lerpingTransforms.Clear();
|
||||
}
|
||||
|
||||
private void TransformStartLerpHandler(TransformStartLerpMessage ev)
|
||||
public override void ActivateLerp(TransformComponent xform)
|
||||
{
|
||||
_lerpingTransforms.Add(ev.Transform);
|
||||
if (xform.ActivelyLerping)
|
||||
return;
|
||||
|
||||
xform.ActivelyLerping = true;
|
||||
_lerpingTransforms.Add(xform);
|
||||
}
|
||||
|
||||
public override void DeactivateLerp(TransformComponent component)
|
||||
{
|
||||
// this should cause the lerp to do nothing
|
||||
component.NextPosition = null;
|
||||
component.NextRotation = null;
|
||||
component.LerpParent = EntityUid.Invalid;
|
||||
}
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
@@ -60,35 +77,36 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
// Only lerp if parent didn't change.
|
||||
// E.g. entering lockers would do it.
|
||||
if (transform.LerpParent == transform.ParentUid &&
|
||||
transform.ParentUid.IsValid())
|
||||
if (transform.LerpParent == transform.ParentUid
|
||||
&& transform.ParentUid.IsValid()
|
||||
&& !transform.Deleted)
|
||||
{
|
||||
if (transform.LerpDestination != null)
|
||||
if (transform.NextPosition != null)
|
||||
{
|
||||
var lerpDest = transform.LerpDestination.Value;
|
||||
var lerpSource = transform.LerpSource;
|
||||
var lerpDest = transform.NextPosition.Value;
|
||||
var lerpSource = transform.PrevPosition;
|
||||
var distance = (lerpDest - lerpSource).LengthSquared;
|
||||
|
||||
if (distance is > MinInterpolationDistanceSquared and < MaxInterpolationDistanceSquared)
|
||||
{
|
||||
transform.LocalPosition = Vector2.Lerp(lerpSource, lerpDest, step);
|
||||
// Setting LocalPosition clears LerpPosition so fix that.
|
||||
transform.LerpDestination = lerpDest;
|
||||
transform.NextPosition = lerpDest;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (transform.LerpAngle != null)
|
||||
if (transform.NextRotation != null)
|
||||
{
|
||||
var lerpDest = transform.LerpAngle.Value;
|
||||
var lerpSource = transform.LerpSourceAngle;
|
||||
var lerpDest = transform.NextRotation.Value;
|
||||
var lerpSource = transform.PrevRotation;
|
||||
var distance = Math.Abs(Angle.ShortestDistance(lerpDest, lerpSource));
|
||||
|
||||
if (distance is > MinInterpolationAngle and < MaxInterpolationAngle)
|
||||
{
|
||||
transform.LocalRotation = Angle.Lerp(lerpSource, lerpDest, step);
|
||||
// Setting LocalRotation clears LerpAngle so fix that.
|
||||
transform.LerpAngle = lerpDest;
|
||||
transform.NextRotation = lerpDest;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user