Compare commits

...

400 Commits

Author SHA1 Message Date
metalgearsloth
8a898adaa2 Version: 0.65.2.0 2022-11-17 19:08:47 +11:00
metalgearsloth
031dceeb48 Parallel physics broadphase (#3483) 2022-11-17 19:01:29 +11:00
Pieter-Jan Briers
bf6928703f Custom YAML -> DataNode parser. (#3496) 2022-11-16 22:17:30 +01:00
Pieter-Jan Briers
75288ba5e7 More clarity in glibc bug warning. 2022-11-16 21:59:31 +01:00
DrSmugleaf
96938ca85a Remove redundant read-only VV from datafields (#3494) 2022-11-16 21:02:39 +01:00
metalgearsloth
a60011d612 Use static lambda for pvs grid query (#3490) 2022-11-16 21:02:16 +01:00
Leon Friedrich
60e0c0b804 Expose more state/tick logic to content (#3474) 2022-11-16 20:56:02 +01:00
Leon Friedrich
a0c23c7fee Add ClydeAudio.StopAllAudio() (#3473) 2022-11-16 20:44:01 +01:00
Pieter-Jan Briers
46183aa41a Add WebView to solution.
This makes sure it will be built by CI
2022-11-16 20:33:28 +01:00
Pieter-Jan Briers
3f175a8d2a Add Robust.Packaging to solution 2022-11-16 20:27:00 +01:00
Amy
fac1b2c469 Fix bad reference (#3484)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2022-11-16 20:15:15 +01:00
DrSmugleaf
bb137d69a2 Version: 0.65.1.0 2022-11-16 19:55:52 +01:00
Jezithyr
1723be3d5b Implementing value protoIds for dictionary serializers (#3470)
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
2022-11-16 12:03:16 +01:00
DrSmugleaf
a35632d89e Add test for (de)serializing data record structs (#3493) 2022-11-16 07:14:50 +01:00
Leon Friedrich
f956ad2008 Fixes lerping clean up issue added in #3472 (#3489) 2022-11-16 12:39:41 +11:00
Pieter-Jan Briers
1646297039 Remove most static IoCManager. accesses from engine. (#3466)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-11-15 22:00:28 +11:00
metalgearsloth
c26c8fb81e Version: 0.65.0.1 2022-11-15 11:58:59 +11:00
DrSmugleaf
38f2808816 Fix responses and error in tpgrid command (#3486) 2022-11-14 20:41:40 +01:00
metalgearsloth
7994935b23 Use field for setlocalposrot (#3482) 2022-11-15 01:07:08 +11:00
metalgearsloth
7120000ef5 Version: 0.65.0.0 2022-11-14 22:02:30 +11:00
metalgearsloth
7c3fd3eaa9 Destroy non-colliding contacts (#3481) 2022-11-14 21:58:29 +11:00
Leon Friedrich
8bd47cd7f8 Misc lerping changes (#3472) 2022-11-14 21:42:30 +11:00
metalgearsloth
1068458beb Force grids to be collidable (#3480) 2022-11-14 21:38:53 +11:00
metalgearsloth
54db524e53 Fix testbeds (#3478) 2022-11-14 17:38:53 +11:00
Pieter-Jan Briers
9265af75bf Automatically update release notes in version.py
General cleanup to the script too.
2022-11-13 18:47:57 +01:00
Pieter-Jan Briers
037bff9099 RichTextEntry uses ValueList, OutputPanel list refs. 2022-11-13 16:09:43 +01:00
Pieter-Jan Briers
6de1b41d9c Changelog for 0.64.1.0 2022-11-13 15:53:14 +01:00
Pieter-Jan Briers
0ab9f34046 Version: 0.64.1.0 2022-11-13 15:51:32 +01:00
Pieter-Jan Briers
2746dccfc6 Fix RichTextEntry wrapping. 2022-11-13 15:51:11 +01:00
DrSmugleaf
eae54d0327 Fix help string for server ProfileEntitySpawningCommand and doc for UserInterfaceManager._dependencies (#3469) 2022-11-13 10:56:52 +01:00
metalgearsloth
c1195d1f1d Version: 0.64.0.0 2022-11-13 17:32:50 +11:00
metalgearsloth
5a02c5c03f 0.64.0.0 release notes 2022-11-13 17:32:37 +11:00
metalgearsloth
d9c59164f2 Refactor maploader to a system (#3385) 2022-11-13 17:29:57 +11:00
metalgearsloth
72a952fbdd ECS grid methods and map partials (#3441) 2022-11-13 15:37:01 +11:00
metalgearsloth
45e58c1ed8 Fix release notes
oop
2022-11-13 15:02:31 +11:00
metalgearsloth
127d1d7eaf Release notes for 0.63.0.0 2022-11-13 14:59:55 +11:00
metalgearsloth
18c9c6bf0a Version: 0.63.0.0 2022-11-13 14:59:39 +11:00
Leon Friedrich
89ec06468f Fix map saves sometimes not including new components (#3461) 2022-11-13 14:49:40 +11:00
Leon Friedrich
9920e409ca Add support for saving missing prototype components (#3462)
Fixes https://github.com/space-wizards/RobustToolbox/issues/2824
2022-11-13 14:49:18 +11:00
Pieter-Jan Briers
f1681b2128 Fix hot reload unit tests 2022-11-12 15:09:54 +01:00
Pieter-Jan Briers
490a4efff8 IoCManager.InitThread now returns new IDependencyCollection. 2022-11-12 12:24:31 +01:00
Pieter-Jan Briers
a416eedff0 Fix some bad doc comment links to IoCManager.Resolve{T}() 2022-11-12 12:23:12 +01:00
Pieter-Jan Briers
2fe0c94d84 Register<T> extension for IDependencyCollection. 2022-11-12 12:12:05 +01:00
Pieter-Jan Briers
2f22de4eff Make IoC Register have where TInterface : class 2022-11-12 12:11:19 +01:00
Pieter-Jan Briers
2017d943fb Move entity prototype reload logic to entity system.
Removes dependency of IPrototypeManager -> IEntityManager.
2022-11-12 12:03:15 +01:00
Pieter-Jan Briers
e34935c9e2 TextEdit control & a bunch of other stuff (#3436) 2022-11-12 03:12:49 +01:00
Pieter-Jan Briers
db95c6284b Oops I forgot to commit a file 2022-11-12 00:31:09 +01:00
Pieter-Jan Briers
6255ee6e96 Cache JsonSerializerOptions in benchmarks exporter. 2022-11-12 00:30:17 +01:00
Pieter-Jan Briers
d1b16d9a52 Engine HttpClient usage fixes.
Properly pool them.
Extend keep-alive timeout for hub advertisements.
Proper user-agents
2022-11-12 00:28:37 +01:00
Pieter-Jan Briers
708b3b2acf Remove unnecessary IoC resolve from new theming system. 2022-11-11 01:25:17 +01:00
Pieter-Jan Briers
2e471366b7 Profile group for UIRefactor controllers 2022-11-11 01:25:11 +01:00
metalgearsloth
ca9ce7c7ed Allow render targets to not clear (#3457) 2022-11-10 23:33:18 +01:00
metalgearsloth
81cd43f988 Random timespan support (#3458) 2022-11-10 23:32:52 +01:00
Mervill
cf5c72e7ea CVar game.type is obsolete (#3460) 2022-11-10 23:32:28 +01:00
Mervill
2629fd3efb LoadFromDocument properly detects duplicate entities (#3448)
I circled back around to this and discovered that the fix is (probably?) easy.

Closes #3079

I tested this locally but I'm pushing the change via the web editor so I don't have to go to the trouble of setting up a Robust fork of my own.
2022-11-10 09:37:47 +01:00
Pieter-Jan Briers
338fcd5fcb Read Lidgren status change from data message. 2022-11-10 01:48:16 +01:00
Pieter-Jan Briers
b5395c0bc0 New version of Robust.LoaderApi to remove warning on .NET 7 2022-11-10 01:45:31 +01:00
Pieter-Jan Briers
97bdc1edee Fix bad \n in DebugClydePanel. 2022-11-10 01:41:58 +01:00
Pieter-Jan Briers
8a0464ed35 Use shared target framework for Avalonia.Base project. 2022-11-10 01:39:34 +01:00
Pieter-Jan Briers
31d68dcd49 .NET 7 compilation fixes. 2022-11-10 01:26:05 +01:00
ElectroJr
3b337bf88d Version: 0.62.1.0 2022-11-08 19:37:03 -05:00
ElectroJr
f3e0706488 release notes 2022-11-08 19:36:51 -05:00
Leon Friedrich
3378f1ff98 Add new anchoring test (#3447) 2022-11-09 11:14:51 +11:00
Leon Friedrich
f160508da3 Fix PVS error (#3452)
Fixes https://github.com/space-wizards/RobustToolbox/issues/3413
2022-11-09 11:14:10 +11:00
Leon Friedrich
1ba5c9120f Remove redundant client-side error (#3450) 2022-11-09 10:56:10 +11:00
Leon Friedrich
701606c75a Better client state exception tolerance (#3451) 2022-11-09 10:55:56 +11:00
Leon Friedrich
efa0fa3f1b Remove more "real" nullspace maps (#3449) 2022-11-08 13:29:56 +11:00
ElectroJr
63b9b56006 Version: 0.62.0.1 2022-11-06 16:22:56 -04:00
ElectroJr
4b082baf37 release notes 2022-11-06 16:22:45 -04:00
Leon Friedrich
698d65c5af Fix sprite animations not updating (#3446) 2022-11-07 07:20:40 +11:00
Leon Friedrich
c9dd27658e Fix anchoring bug (#3445)
Fixes https://github.com/space-wizards/RobustToolbox/issues/3444
2022-11-07 06:35:42 +11:00
ElectroJr
266223c3fd Version: 0.62.0.0 2022-11-06 12:28:11 -04:00
ElectroJr
521e4746c6 update release notes 2022-11-06 12:27:33 -04:00
Leon Friedrich
72efbe543c Better ResetPredictedEntities error handling (#3442) 2022-11-07 03:20:53 +11:00
metalgearsloth
b69ccc2241 Remove obsolete map event handlers (#3440) 2022-11-07 03:18:52 +11:00
Leon Friedrich
656992ae5f More lookup fixes (#3438) 2022-11-06 18:15:08 +11:00
Moony
947f04ebb9 Remove SAO mode from the engine (makes sure the client actually gets its command permissions) (#3439) 2022-11-06 01:20:09 +01:00
Leon Friedrich
603b88c77a Client entity deletion error tolerance (#3435) 2022-11-06 03:45:28 +11:00
Ygg01
108e270f9e Localize commands (#3374) 2022-11-06 03:00:57 +11:00
metalgearsloth
d3edd10714 Entity query struct enumerators (#3334) 2022-11-04 11:46:43 +11:00
ElectroJr
125d138e16 Version: 0.61.0.0 2022-11-03 19:38:18 -04:00
ElectroJr
f5c210b990 release notes 2022-11-03 19:38:04 -04:00
metalgearsloth
4521dc37f5 Remove IMap / IMapGrid comps (#3434) 2022-11-04 10:12:36 +11:00
Jacob Tong
adcdb9f736 Clean up audiosystem (#3251) 2022-11-04 09:48:33 +11:00
ElectroJr
2116230f58 Version: 0.60.0.0 2022-11-02 21:56:52 -04:00
ElectroJr
dd0d186314 release notes 2022-11-02 21:56:30 -04:00
Paul Ritter
329e2b0cdc removes beforeserialization hook (#3422) 2022-11-03 12:50:40 +11:00
Paul Ritter
a562675553 misc optimizations in pvs (#3427) 2022-11-03 12:39:11 +11:00
metalgearsloth
89a1d32e1d Remove some redundant physics calls (#3425) 2022-11-03 12:33:41 +11:00
metalgearsloth
05fb110f40 Fix client fixture state handling (#3431) 2022-11-03 12:32:07 +11:00
Leon Friedrich
c6896e9bd9 More broadphase fixes (#3429) 2022-11-03 12:30:14 +11:00
DrSmugleaf
2678fad629 Call GC.Collect before running profileEntitySpawning (#3428) 2022-11-02 15:53:10 +01:00
Rane
7d0e9f9635 method to return all open uis on a session (#3424) 2022-11-01 14:44:11 +11:00
ElectroJr
7a5df9a718 Version: 0.59.0.0 2022-10-31 20:40:00 -04:00
ElectroJr
856fbd0480 release notes 2022-10-31 20:39:57 -04:00
metalgearsloth
828ac48f7c Remove transform methods from MapGrid (#3382) 2022-11-01 11:27:41 +11:00
Leon Friedrich
d0e11a755c Fix PVS exception (#3423) 2022-11-01 09:49:14 +11:00
Leon Friedrich
b637967163 Remove some duplicate code in DetachParentToNull() (#3417) 2022-11-01 00:53:23 +11:00
Leon Friedrich
50dce4d56b Make Resolve<TComp> protected (#3411) 2022-10-31 21:26:05 +11:00
Leon Friedrich
e9af594448 PVS tweaks (#3419) 2022-10-31 21:24:22 +11:00
Leon Friedrich
b5662007d5 Fix GetEntitiesIntersecting bug (#3420) 2022-10-31 21:22:41 +11:00
ElectroJr
03acded657 Version: 0.58.1.1 2022-10-30 21:57:54 -04:00
ElectroJr
6b0e2deede release notes 2022-10-30 21:57:36 -04:00
Leon Friedrich
ffe1689be6 Fix misc container and lookup bugs (#3418) 2022-10-31 12:54:37 +11:00
Leon Friedrich
2f3f7976f1 Fix containers not force ejecting (#3416) 2022-10-31 11:11:28 +11:00
ElectroJr
df7933b890 Version: 0.58.1.0 2022-10-30 19:52:26 -04:00
ElectroJr
5778ca87e7 release notes 2022-10-30 19:52:14 -04:00
Leon Friedrich
af8a21df53 Don't raise physics events before initialization (#3415) 2022-10-31 10:48:59 +11:00
ElectroJr
cd02dddd5d Version: 0.58.0.0 2022-10-30 19:14:52 -04:00
ElectroJr
e44805cd20 Update release notes 2022-10-30 19:14:18 -04:00
Leon Friedrich
635387a23e Disable collision for fixtureless entities. (#3412) 2022-10-31 10:06:47 +11:00
Leon Friedrich
2b594f6356 Cache broadphases and container rejig (#3407) 2022-10-31 10:06:08 +11:00
Leon Friedrich
cec14ae861 Add exception for infinite loop in Balance() (#3398) 2022-10-30 19:15:08 +11:00
metalgearsloth
a12a973a26 Mark component.Dirty() as obsolete (#3409) 2022-10-30 19:14:50 +11:00
DrSmugleaf
45a315bb69 Add command to profile entity spawning (#3404) 2022-10-30 14:09:30 +11:00
Leon Friedrich
1e843bf3a2 More Transform ECS (#3368) 2022-10-30 03:36:23 +11:00
Vera Aguilera Puerto
26c85725a5 Version: 0.57.0.4 2022-10-29 18:14:00 +02:00
Vera Aguilera Puerto
467d391ec8 Extra-graceful entity deletions. (#3405) 2022-10-29 18:10:19 +02:00
Leon Friedrich
601feb7cc0 Optimize DeparentAllEntsOnTile (#3401) 2022-10-29 14:26:04 +11:00
Leon Friedrich
cd1466cdc0 Replaces ContainsEntity() with metadata flag check (#3392) 2022-10-29 11:37:43 +11:00
Leon Friedrich
94aeb309b2 Add additional container assert (#3397) 2022-10-29 10:53:29 +11:00
Leon Friedrich
3fba59eb6c Lookup movement handling changes. (#3369) 2022-10-29 10:44:48 +11:00
metalgearsloth
508754f4bc Disable kinematic controller collisions (#3358) 2022-10-29 05:05:36 +11:00
Leon Friedrich
3f4ae0f02a Better AddComponent error (#3394) 2022-10-28 17:16:11 +11:00
ElectroJr
b0daf64d94 Version: 0.57.0.3 2022-10-27 23:07:44 -04:00
ElectroJr
c4223f015d release notes 2022-10-27 23:07:23 -04:00
Leon Friedrich
33ebb99b9c Fix lookups for StaticSundriesTree (#3393) 2022-10-28 14:04:54 +11:00
Leon Friedrich
dad176aca1 fix pvs parent change (#3386) 2022-10-28 12:35:36 +11:00
metalgearsloth
cac1f3e018 Version: 0.57.0.2 2022-10-28 12:25:57 +11:00
Leon Friedrich
49dfb2d2f1 Lookup fixes (#3390) 2022-10-28 11:23:23 +11:00
Leon Friedrich
4e0821c6c1 Replace some GetAABB() with GetAABBNoContainer() (#3391) 2022-10-28 11:16:03 +11:00
ElectroJr
39800d57d1 Version: 0.57.0.1 2022-10-27 10:49:20 -04:00
ElectroJr
52b9729bb8 update release notes 2022-10-27 10:49:04 -04:00
metalgearsloth
5a49ce1812 Don't raise rotation event before parent change (#3384) 2022-10-28 01:46:38 +11:00
metalgearsloth
c3d27fb338 Update engine CL (#3383) 2022-10-28 00:10:12 +11:00
metalgearsloth
07378f4503 Version: 0.57.0.0 2022-10-27 23:37:49 +11:00
metalgearsloth
ae2f3fe70c Remove EntityLookupComponent and de-dupe AABBs (#3367)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-27 23:36:01 +11:00
Leon Friedrich
6edd5d8a63 Slight movement PVS performance improvement (#3381) 2022-10-27 14:59:28 +11:00
metalgearsloth
08c6e52806 Pool contact pairbuffer (#3344)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-27 13:55:26 +11:00
metalgearsloth
f13a066bdd Use static lambdas for sprites / lights (#3335) 2022-10-27 13:52:04 +11:00
metalgearsloth
c478ef3a4b Re-use contact linkedlist nodes (#3343)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-27 13:50:59 +11:00
ElectroJr
1d3bf8d072 Version: 0.56.1.1 2022-10-26 22:31:48 -04:00
ElectroJr
12f40d951d Update release notes 2022-10-26 22:31:17 -04:00
Leon Friedrich
c98e409ad8 PVS bugfix (#3380) 2022-10-27 13:21:06 +11:00
metalgearsloth
ef6efd3c68 Fix parent change velocity (#3378) 2022-10-26 18:46:21 +02:00
ElectroJr
c4b0534240 Version: 0.56.1.0 2022-10-25 21:54:44 -04:00
ElectroJr
ff0dbecbee Update changelog 2022-10-25 21:54:11 -04:00
Leon Friedrich
b0d59e5e3f PVS budget tweaks (#3360) 2022-10-26 12:31:29 +11:00
Leon Friedrich
e3d29ae28f Change PVS parent-change handing (#3362) 2022-10-25 23:44:35 +11:00
estacaoespacialpirata
9aebaa3749 Update pt-BR locale (#3372)
Co-authored-by: zero <ribeirolucasdev@gmail.com>
2022-10-24 15:35:04 -07:00
Leon Friedrich
2bae6abbc0 Entity deletion changes (#3355) 2022-10-24 03:50:58 +11:00
Vera Aguilera Puerto
880160e7af Fix VV type handler removal. 2022-10-23 14:51:27 +02:00
DrSmugleaf
801b513cde Make Box2Serializer split on a span (#3365) 2022-10-23 13:03:39 +02:00
Leon Friedrich
bd284cc945 Improve GetOccluderTree() (#3366) 2022-10-23 18:42:37 +11:00
metalgearsloth
c481b50a8b Remove IEnumerable abuse from entitylookup (#3333) 2022-10-23 15:48:38 +11:00
DrSmugleaf
c889c2b2aa Optimize client entity spawning by 15% (#3364) 2022-10-23 15:46:46 +11:00
Leon Friedrich
60c150269e improve rendering tree movement handling (#3361) 2022-10-23 13:55:08 +11:00
metalgearsloth
8dffeef261 Nuke grid enumeration allocs (#3342)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-23 13:54:48 +11:00
Leon Friedrich
6943693d3f Add trace to mid-deletion reparenting error logs. (#3356) 2022-10-21 15:39:34 +11:00
metalgearsloth
964ab60020 Fix a bunch of warnings (#3289) 2022-10-21 00:17:29 +11:00
Paul Ritter
8fad4d291f fixes heaps of build warnings (#3329)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-10-20 23:36:32 +11:00
Kara
d3adcb83db Version: 0.56.0.2 2022-10-19 16:05:16 -07:00
Kara
3c046b5f6f Rename _lib.ftl to _engine_lib.ftl to avoid overwriting
Engine and content locales get merged into the same folder. This is causing two files named the same thing to be in the same place, presumably causing extracting the build to fail? Hopefully?
2022-10-19 16:04:48 -07:00
Kara
dd567a4cc8 Version: 0.56.0.1 2022-10-19 15:22:06 -07:00
DrSmugleaf
fe78883a93 Fix instantiation of data records containing value types (#3352) 2022-10-19 16:04:03 +02:00
Kara
1d0c9e9512 notes 2022-10-18 19:48:12 -07:00
Kara
1a61f1925c Version: 0.56.0.0 2022-10-18 19:35:48 -07:00
estacaoespacialpirata
18567c7051 Add the pt-BR locale (#3168)
Co-authored-by: zero <ribeirolucasdev@gmail.com>
2022-10-18 19:01:22 -07:00
Kara
4932487859 Partially move content _lib.ftl to engine + CONJUGATE-BASIC (#3262) 2022-10-18 18:57:31 -07:00
metalgearsloth
506f0b0a1e Fix audio fallback coords (#3306) 2022-10-18 18:49:35 -07:00
Vera Aguilera Puerto
ae2e6bca82 Add new helpers to TypeHandlers, fix bug with TypeHandler listing. (#3348) 2022-10-18 18:48:30 -07:00
Paul Ritter
0b19d04c1c makes some loops for in pvs for free perf (#3338) 2022-10-18 18:47:41 -07:00
metalgearsloth
8344e8ba10 Fix inverse vec2 allocations (#3341)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-18 18:30:34 -07:00
Kevin Zheng
5dd1b58357 Move CastShadows to SharedPointLightComponent (#3346) 2022-10-19 10:10:30 +11:00
metalgearsloth
537e1ab4f9 Update release-notes + version (#3347) 2022-10-17 15:48:07 +11:00
metalgearsloth
7247171b4b TryGetNearest update to allow passing in transforms (#3330)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-17 15:34:58 +11:00
Francesco
155a35ab06 Adds a getter to AnimationHelper (#3345) 2022-10-17 03:54:10 +11:00
metalgearsloth
3c50db8b5e Don't allocate a list per physics contact (#3332) 2022-10-16 11:53:32 +11:00
Ygg01
78ba02432e Fix obsolete warnings in tests (#3340) 2022-10-16 11:12:11 +11:00
Leon Friedrich
32f8b6f4b8 Prevent singular sprite matrices (#3339) 2022-10-16 11:04:53 +11:00
Leon Friedrich
97d52393ed Add a new Logger.Info() to MapLoader (#3320) 2022-10-16 11:03:36 +11:00
Leon Friedrich
576abe7adb Enable release mode PVS debug commands (#3337) 2022-10-15 16:18:16 +11:00
Vera Aguilera Puerto
d404494018 ViewVariables Exorcism Part 1: Of paths and commands (#3214) 2022-10-14 19:03:44 +02:00
Игорь Спичкин
80e390a74b Use invariant culture in serialization (#3323) 2022-10-12 14:10:04 +02:00
ElectroJr
cf912d8c07 Version: 0.55.4.1 2022-10-11 20:51:36 -04:00
Leon Friedrich
ae8a7481bc Fix eye networking (#3328) 2022-10-12 11:50:38 +11:00
Paul
dbcb9bde3d Version: 0.55.4.0 2022-10-12 01:41:24 +02:00
Paul
6dc06e7690 fixes statistics crash 2022-10-12 01:40:52 +02:00
Paul
f2cbfbf705 fixes typo 2022-10-12 01:20:28 +02:00
Paul
ca79d1fc13 overhauls benchmarks 2022-10-12 01:15:30 +02:00
Paul
2bcfca3d78 makes benchmarks use subfolders 2022-10-11 20:48:54 +02:00
Paul
74c86bf08c Version: 0.55.3.0 2022-10-11 20:19:39 +02:00
Paul Ritter
b8397a1a27 required changes for content benchmarks (#3327) 2022-10-11 20:16:09 +02:00
metalgearsloth
4c2da94a58 Fix Saltern in default config (#3326) 2022-10-11 13:18:55 +02:00
metalgearsloth
42c6b9976a Version: 0.55.2.0 2022-10-11 16:17:37 +11:00
Leon Friedrich
cd40916df0 Remove Dirty(comp) on component init. (#3303) 2022-10-11 16:14:08 +11:00
Leon Friedrich
95525a549a Make TransformComponent._localMatrix public (#3325) 2022-10-11 16:13:10 +11:00
ElectroJr
07c5c0ca0e Version: 0.55.1.0 2022-10-10 21:19:14 -04:00
Leon Friedrich
c8e36eadf7 Fix mapfile validator (#3324) 2022-10-11 12:18:04 +11:00
Paul Ritter
b3df54d2bb fixes benchmark names (#3322) 2022-10-10 19:27:02 +02:00
Paul Ritter
007bfe4447 fixes the benchmark db schema and adds a json variant of params (#3321) 2022-10-10 16:48:25 +02:00
ElectroJr
ea1691c7f5 Version: 0.55.0.0 2022-10-09 21:31:03 -04:00
Leon Friedrich
f82e3e8432 Fix error in HandlePhysicsMapRemove (#3319) 2022-10-10 12:19:52 +11:00
Paul Ritter
59d8cb37f0 re-enables running all benchmarks (#3318) 2022-10-10 03:09:19 +02:00
Paul Ritter
cf52985eaf fixes benchmark db write (#3317) 2022-10-10 02:28:10 +02:00
Paul Ritter
aa412c2b47 temporarily makes benchmarks only run one benchmark (#3316) 2022-10-10 02:17:59 +02:00
Paul Ritter
917280b4d7 reworks benchmarks db stuff (#3314) 2022-10-10 02:11:24 +02:00
ElectroJr
51c6ff934e Version: 0.54.0.0 2022-10-09 17:44:23 -04:00
Leon Friedrich
e534fcd800 Unrevert "Remove obsolete GridId and all references to it" (#3279) 2022-10-10 08:41:58 +11:00
Leon Friedrich
6105be4b14 Fix saving entities without prototypes (#3312) 2022-10-10 06:58:34 +11:00
metalgearsloth
205147c0f0 Store paused time on entities (#3288) 2022-10-10 04:58:08 +11:00
Leon Friedrich
f6d722f7c3 Make InitializeAndStartEntity public (#3305) 2022-10-10 04:57:41 +11:00
keronshb
d1c1bffc4f Got Inserted Event for containers (#3311) 2022-10-10 04:57:04 +11:00
metalgearsloth
54316b7255 Version: 0.53.0.1 (#3310)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-09 21:51:02 +11:00
metalgearsloth
2d7cd49dbc Revert "Container tweaks (#3293)" (#3309)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-09 21:42:12 +11:00
metalgearsloth
5832cb3866 Version: 0.53.0.0 2022-10-09 17:34:07 +11:00
metalgearsloth
818ea1a629 Revert "Remove obsolete GridId and all references to it" (#3308) 2022-10-09 17:32:54 +11:00
metalgearsloth
58c0f7796b Version: 0.51.0.1 2022-10-09 16:47:01 +11:00
metalgearsloth
55217c982d Fix build (#3307) 2022-10-09 16:45:22 +11:00
metalgearsloth
036951ae62 Version: 0.51.0.0 2022-10-09 16:25:23 +11:00
SpaceManiac
ebaa8d9ac3 Remove obsolete GridId and all references to it (#3279) 2022-10-09 16:23:40 +11:00
Leon Friedrich
e222f82059 Fix map loader entity dirtying (#3301) 2022-10-09 16:19:32 +11:00
Leon Friedrich
d867661c24 Add MetadataComponent argument to Dirty() (#3302) 2022-10-09 16:19:09 +11:00
Alex Evgrashin
ac7c44ab2e Grid line enumerator (#3278) 2022-10-09 13:27:05 +11:00
themias
b861182846 Fix EmptyContainer and CleanContainer (#3300) 2022-10-09 04:30:46 +11:00
Vera Aguilera Puerto
1f3e42b013 Use our own NFluidsynth NuGet package. (#3304) 2022-10-08 12:29:53 +02:00
Leon Friedrich
7b0c4dd7fb Fix component removal / PVS bugs (#3275) 2022-10-08 13:22:32 +11:00
Kevin Zheng
2898e1413b Add build property to use system SQLite3 (#3298) 2022-10-08 00:15:49 +02:00
metalgearsloth
ba3525c0c0 Version: 0.50.2.1 2022-10-07 11:31:08 +11:00
metalgearsloth
5ff11980b7 Fix nearest check for non-hard bodies (#3297) 2022-10-07 11:30:38 +11:00
metalgearsloth
29274986f8 Version: 0.50.2.0 2022-10-07 00:35:56 +11:00
metalgearsloth
57d862f9fc Add API to get nearest distance for 2 entities (#3291)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-07 00:35:25 +11:00
metalgearsloth
31da2557d5 Container tweaks (#3293) 2022-10-06 13:12:43 +02:00
Kevin Zheng
9752996497 Update OpenTK.OpenAL to 4.7.5 (#3296) 2022-10-06 13:00:35 +02:00
metalgearsloth
7c7c8d23fb Version: 0.50.1.0 2022-10-04 16:10:31 +11:00
metalgearsloth
e1dc83a573 Add method to get velocity from a point (#3239) 2022-10-04 16:09:58 +11:00
metalgearsloth
520461ff95 Version: 0.50.0.0 2022-10-04 15:30:56 +11:00
metalgearsloth
7c2a010c71 Change mass to density (#3282) 2022-10-04 15:30:33 +11:00
metalgearsloth
c17faedccf Version: 0.49.0.0 2022-10-03 20:28:58 +11:00
metalgearsloth
36495fe81b Add time offset serializer (#3287)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2022-10-03 20:28:28 +11:00
Leon Friedrich
9e3851b847 Allow EyeComponent to centre on other entities. (#3292) 2022-10-03 20:03:22 +11:00
Pieter-Jan Briers
582e705088 Update Lidgren to v0.2.2 2022-10-01 00:06:55 +02:00
Pieter-Jan Briers
cf893c3c32 Avoid rogue obj/ folders breaking Lidgren build. 2022-10-01 00:06:55 +02:00
Pieter-Jan Briers
3a5cc20a88 Compile Lidgren net6.0, change assembly name. 2022-10-01 00:06:55 +02:00
Pieter-Jan Briers
cb209df0e5 Add MTU-related CVars for Lidgren. 2022-10-01 00:06:55 +02:00
Pieter-Jan Briers
eb64f55ce5 Release notes template 2022-10-01 00:06:55 +02:00
metalgearsloth
00ab9c6474 Version: 0.48.2.0 2022-09-30 15:28:00 +10:00
Pieter-Jan Briers
26eaa38e89 Improve MsgState ReliableThreshold
Explain real reason for it (I didn't know it at the time). Make the constant pegged to Lidgren's.
2022-09-30 01:43:00 +02:00
metalgearsloth
42bc16d4c9 Add some more types to type reflection (#3283) 2022-09-29 13:00:33 +02:00
metalgearsloth
498ce86176 Add API to get text dimensions (#3290) 2022-09-29 12:50:06 +02:00
metalgearsloth
3104678140 Version: 0.48.1.0 2022-09-29 16:04:50 +10:00
metalgearsloth
c63984eaca Add alt use key (#3253) 2022-09-29 16:04:27 +10:00
Leon Friedrich
078b81d495 Better sprite errors (#3285) 2022-09-28 16:32:37 +10:00
Leon Friedrich
4c341f0289 Replace Logger.Error with IRuntimeLog (#3267) 2022-09-28 11:07:45 +10:00
Leon Friedrich
bb4461587e Mark server-side SpriteComponent as obsolete. (#3276) 2022-09-28 11:07:25 +10:00
SpaceManiac
fe45af151a Allow startup to continue if prototype watching fails (#3273)
* Allow startup to continue if prototype watching fails

* Move _watchers.Add inside try, so dud watchers are not saved
2022-09-26 16:18:07 +02:00
wrexbe
ae2b0e9d8f Version: 0.48.0.1 2022-09-25 21:53:39 -07:00
wrexbe
ddf4828bf9 UI popup size fix (#3281) 2022-09-25 21:51:23 -07:00
DrSmugleaf
b1d0dbf03c Make UIControllers available to each other through IoC (#3277) 2022-09-25 07:54:58 +02:00
metalgearsloth
a91b134c5d Version: 0.48.0.0 2022-09-23 13:57:17 +10:00
Leon Friedrich
660b0b05d3 Remove RotateEvent (#3270) 2022-09-23 13:56:13 +10:00
Paul Ritter
e14493246e moves generic pooling policies out of pvssystem and adds listpolicy (#3272) 2022-09-22 15:44:50 -07:00
Leon Friedrich
d93a35b620 Replace some obsolete physics function calls (#3271) 2022-09-22 15:25:02 +10:00
Paul Ritter
2e12a712fa removes unused property (#3269) 2022-09-22 08:46:45 +10:00
metalgearsloth
29a84a6621 Version: 0.47.1.0 2022-09-21 20:45:26 +10:00
metalgearsloth
51f00d4b3b ECS 90% of physics component (#3256) 2022-09-21 20:44:49 +10:00
Leon Friedrich
a67b22cce8 Add get-matrix functions to IViewportControl (#3264) 2022-09-21 20:42:17 +10:00
metalgearsloth
cfbfdbf420 Don't sleep initialised items (#3259) 2022-09-21 20:35:17 +10:00
Leon Friedrich
a76d053818 Prevent PVS error spam and add more debugging asserts (#3263)
Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
2022-09-21 09:49:14 +10:00
Leon Friedrich
1587ee3c93 Store username inn player data (#3265) 2022-09-19 17:44:00 -07:00
Vera Aguilera Puerto
662808d0d3 Adjust MIDI logging to prevent log spam on RELEASE. 2022-09-17 09:54:31 +02:00
metalgearsloth
9d88857b55 Version: 0.47.0.2 2022-09-16 00:14:47 +10:00
metalgearsloth
3c92794aed Revert "Don't do any splitting when disabled" (#3257) 2022-09-16 00:14:21 +10:00
wrexbe
527879c048 Version: 0.47.0.1 2022-09-14 17:27:56 -07:00
Jacob Tong
d2494bcdc7 Allow Content to use InitializeTesting (#3019)
* Allow Content to use InitializeTesting

* Remove internal redefinition

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2022-09-14 17:25:22 -07:00
metalgearsloth
486aa1423b Version: 0.47.0.0 2022-09-14 19:39:23 +10:00
Pieter-Jan Briers
20659789b0 Robust.Packaging system (#3016)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-09-14 19:39:00 +10:00
Leon Friedrich
d87d6f7f8c Session specific state support (#3249) 2022-09-14 19:29:46 +10:00
Leon Friedrich
fa5fdcb5a5 Move appearance state to shared (#3252)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2022-09-14 18:20:44 +10:00
metalgearsloth
e6af084c22 Version: 0.46.0.0 2022-09-14 17:24:32 +10:00
metalgearsloth
de01b9d8cb Raise collision events by-ref (#3201) 2022-09-14 17:23:35 +10:00
Leon Friedrich
c9aa2c61bd Pass IRobustSerializer to NetMessage (#3220) 2022-09-14 17:23:17 +10:00
metalgearsloth
8200f1d942 Version: 0.45.8.0 2022-09-14 16:49:51 +10:00
Leon Friedrich
1af0ebca6c Make RaisePredictiveEvent check IsPredictionEnabled (#3246) 2022-09-14 16:39:49 +10:00
Leon Friedrich
fe5957bb91 RemoveComponentDeferred changes (#3245) 2022-09-14 15:53:50 +10:00
Leon Friedrich
be08f1787f Allow appearance to ignore PVS state (#3250) 2022-09-14 15:53:00 +10:00
metalgearsloth
ea35e6c03f Version: 0.45.7.0 2022-09-14 12:57:16 +10:00
metalgearsloth
a6c6b22393 Add entitylookup for components (#3065) 2022-09-13 19:52:46 +10:00
Leon Friedrich
5e6e5cb5ea Fix container debug assert (#3244) 2022-09-13 07:44:26 +10:00
Jacob Tong
64d2a3ca28 Fix non-map or grid coordinate returns for most cases (#3241) 2022-09-11 08:01:46 +10:00
Pieter-Jan Briers
bee4e499a8 Fix Rider analysis complaints 2022-09-10 10:57:30 +02:00
metalgearsloth
55da2dc5e5 TryGet for moved grids (#3238) 2022-09-08 13:09:30 +10:00
metalgearsloth
177eca0f90 Version: 0.45.6.1 2022-09-07 22:18:25 +10:00
metalgearsloth
ae229a03d8 Don't do any splitting when disabled (#3172) 2022-09-07 21:48:21 +10:00
metalgearsloth
2dc8093660 Fix fixture clearing on SetTiles (#3235) 2022-09-07 21:47:55 +10:00
metalgearsloth
071acbc818 Move MoveBuffer to the physicsmapcomponent (#3199)
Co-authored-by: Kara <lunarautomaton6@gmail.com>
2022-09-07 21:44:41 +10:00
metalgearsloth
3f5982cac0 Version: 0.45.6.0 2022-09-07 18:48:33 +10:00
Leon Friedrich
6f387402fe Fix OnParentChange bug (#3237) 2022-09-07 15:33:37 +10:00
Leon Friedrich
363e28561c Sprite direction bias (#3232)
* Sprite direction bias

* cvar
2022-09-06 21:54:07 -07:00
Jacob Tong
4d63b54259 Fix construction ghost rotation on entities without directional sprites (#3206) 2022-09-06 17:58:10 -07:00
Leon Friedrich
7fa05c7db3 make /tpto use AttachToGridOrMap() (#3234) 2022-09-05 22:21:26 -07:00
Leon Friedrich
c466f5f17f Don't update appearance while applying states (#3233) 2022-09-06 14:18:28 +10:00
metalgearsloth
b6f302b71e Version: 0.45.5.0 2022-09-06 13:11:50 +10:00
Leon Friedrich
7d9db6f7b2 NetSyncEnabled & animation changes (#3228) 2022-09-06 13:10:59 +10:00
Leon Friedrich
8bedba2da7 Fix initial tile & entity spawn menu sizes (#3230) 2022-09-05 20:00:35 -07:00
Leon Friedrich
837dde78c9 Fix interp overlay (#3229) 2022-09-05 20:00:19 -07:00
metalgearsloth
a01629969d Version: 0.45.4.0 2022-09-05 23:14:22 +10:00
metalgearsloth
15e13c7f92 Fix yml reflection (#3227) 2022-09-05 23:11:31 +10:00
metalgearsloth
3dd80b90eb Allow !type:float and !type:double in yml (#3176) 2022-09-05 22:47:24 +10:00
metalgearsloth
cb8e295ad9 Use TryComp instead of GetComp for animation playback (#3224) 2022-09-05 22:29:03 +10:00
Leon Friedrich
909163a923 Fix awake bodies in containers (#3219) 2022-09-05 15:04:37 +10:00
ElectroJr
6aa2408364 Version: 0.45.3.1 2022-09-04 20:04:23 -04:00
Leon Friedrich
afc1eed7ae QueueUpdateIsInert fixes (#3221) 2022-09-05 10:02:48 +10:00
wrexbe
85c8dc05fe Version: 0.45.3.0 2022-09-04 16:13:16 -07:00
Jezithyr
710371d7d1 UI refactor and UITheme implementations (#2712)
* UIControllerManager


Implemented UI Controller Manager

* added fetch function

* added note

* Hiding some internal stuff

* Implemented event on gamestate switch for ui

* Fix serialization field assigner emit

* fixing issues with ILEmitter stuff

* AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Blame Smug

* fixing nullref

* Add checking for no backing field / property for ui system dependencies

* fixes Gamestate detection

* Implemented event on UIControllers on system load

* Updated systemload/unload listeners

* Had this backwards lol

* Fix nulling systems before calling OnSystemUnloaded, broke InventoryUIController.Hands.cs

* Created UI Window management system

- A manager that allows for easy creation and access of popup or gamestate windows

* Changing to use basewindow instead of default window

* Implemented UI Theming that isn't ass

* Updated default theme loading and validation

* Added path validation for themes

* Implemented UI Themes

* Implemented UI Theme prototypes

* Implementing theming for texture buttons and Texturerects

* fixing server error

* Remove IUILink

* Implemented default theme overriding and theme colors

* Fixing sandbox lul

* Added error for not finding UITheme

* fixing setting default theme in content

* Move entity and tile spawn window logic to controllers

* Add 2 TODOs

* Merge fixes

* Add IOnStateChanged for UI controllers

* Fix inventory window being slow to open
Caches resources when the UI theme is changed

* Remove caching on theme change
The real fix was fixing the path for resources

* Remove test method

* Fix crash when controllers implement non generic interfaces

* Add controllers frame update

* Split UserInterfaceManager into partials

- Created UI screen

* Converted more UI managers into partials

* Setup UIScreen manager system

* Added some widget utility funcs


updated adding widgets

* Started removing HUDManager

* Moved UiController Manager to Partials


Finished moving all UIController code to UIManager

* Fixed screen loading

* Fixed Screen scaling

* Fixed Screen scaling


cleanup

* wat

* IwantToDie

* Fixed resolving ResourceCache instead of IResourceCache

* Split IOnStateChanged into IOnStateEntered and IOnStateExited

* Implemented helpers for adjusting UIAutoscale for screens

* Fixed autoscale, removed archiving from autoscale

* Implemented popups and adjusted some stuff

* Fixing some popup related shinanegans

* Fixing some draw order issues

* fixing dumb shit

* Fix indentation in UserInterfaceManager.Input.cs

* Moved screen setup to post init (run after content)

* Fix updating theme

* Merge fixes

* Fix resolving sprite system on control creation

* Fix min size of tile spawn window

* Add UIController.Initialize method

* https://tenor.com/view/minor-spelling-mistake-gif-21179057

* Add doc comment to UIController

* Split UIController.cs and UISystemDependency.cs into their own files

* Add more documentation to ui controllers

* Add AttributeUsage to UISystemDependencyAttribute

* Fix method naming

* Add documentation for assigners

* Return casted widgets where relevant

* Fix entity spawner scroll (#1)

* Add CloseOnClick and CloseOnEscape for popups

* Remove named windows and popups

* Cleanup controller code

* Add IOnStateChanged, IOnSystemChanged, IOnSystemLoaded, IOnSystemUnloaded

* Add more docs to state and system change interfaces

* Fixing Window issues

* Fixing some window fuckery

* Added OnOpen event to windows, updated sandbox window

Sandbox windows now persist values and positions

* Recurse through controls to register widgets (#2)

* Allow path to be folder

* Fix local player shutdown

* Fixing escape menu

* Fix backing field in DataDefinition.Emitters

* Ent+Tile spawn no crash

* Skip no-spawn in entity spawn menu

Co-authored-by: Jezithyr <jmaster9999@gmail.com>
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
Co-authored-by: Flipp Syder <76629141+vulppine@users.noreply.github.com>
Co-authored-by: wrexbe <wrexbe@protonmail.com>
2022-09-04 16:10:54 -07:00
ElectroJr
9f651646d7 Version: 0.45.2.0 2022-09-04 13:13:08 -04:00
Leon Friedrich
d2860c80a9 Predict component adding and removal (#2876) 2022-09-05 03:09:42 +10:00
Alex Evgrashin
e1b9ae22b6 Box2 from two points (#3211) 2022-09-05 02:49:16 +10:00
Leon Friedrich
5d64f35c96 Sprite BB fixes (#3217) 2022-09-04 16:20:15 +10:00
Flipp Syder
5cfea0cd97 Includes paused for user interface updates (#3215) 2022-09-03 17:20:20 -07:00
Jacob Tong
a165556bf5 Make AudioSystem.PlayingStream public (#3208) 2022-09-03 09:32:23 +10:00
Kara
dee2881203 Fix loadmap command typo (#3209) 2022-09-01 06:27:54 -07:00
DrSmugleaf
da0891a5f4 Add element picker to dev window (#3180) 2022-09-01 06:18:30 +02:00
DrSmugleaf
1ed9796700 Add DataRecordAttribute to turn a whole record into a data definition (#3207)
Co-authored-by: Paul <ritter.paul1@googlemail.com>
2022-09-01 01:13:43 +02:00
Leon Friedrich
578a967a31 Misc PVS error logging / debugging changes (#3197) 2022-08-30 10:17:11 +10:00
Paul Ritter
14c0c58e87 adds includedatafields to serv3 (#3101)
* adds includedatafields to serv3

* fixes some stuff and adds tests

* checks for circular include

* fix writing

* this one should fix it frfrf

* ok now this one is gonna be it i swear

* we can save a few operations here

* goofy string

Co-authored-by: Paul <ritter.paul1@gmail.com>
2022-08-29 17:16:04 +02:00
Vera Aguilera Puerto
766d909a08 Fixes MIDI bank selection not working. (#3182) 2022-08-29 11:52:29 +02:00
metalgearsloth
9c50a217da Version: 0.45.1.0 2022-08-29 15:13:31 +10:00
Leon Friedrich
4f9db0cdb7 Fix bug in spin command (#3198) 2022-08-29 14:37:59 +10:00
Leon Friedrich
3c19937750 Update sprite bounds for SnapCardinals (#3195) 2022-08-29 13:52:23 +10:00
metalgearsloth
c509764014 Add camera reset rotation key (#3185) 2022-08-29 11:09:32 +10:00
wrexbe
75e06e4060 Version: 0.45.0.3 2022-08-28 15:34:15 -07:00
wrexbe
1b909f71a1 Fix some test issues (#3196) 2022-08-28 14:04:14 -07:00
metalgearsloth
1a8764f54b Add support for snapping sprites to south (#3186) 2022-08-29 05:02:50 +10:00
metalgearsloth
9152c97de7 Make mapload errors more obvious (#3193) 2022-08-29 04:08:14 +10:00
Paul Ritter
45cb04f928 makes all serv3 null checks use the proper logic (#3128) 2022-08-27 21:37:38 +02:00
Pieter-Jan Briers
a700750d9e Make ALC context not current before destroying it.
Let's hope this fixes the hangs.
2022-08-27 00:32:05 +02:00
wrexbe
07d327eb8b Version: 0.45.0.2 2022-08-25 21:31:36 -07:00
wrexbe
2275ec9573 Update YamlDotNet (#3082) 2022-08-25 21:28:12 -07:00
wrexbe
5848b449f6 Expose way to test sandbox (#3166) 2022-08-25 21:27:42 -07:00
metalgearsloth
67aa32e694 Version: 0.45.0.1 2022-08-26 12:21:45 +10:00
Leon Friedrich
dbd2961b9f Fix client state handling bug (#3192) 2022-08-26 12:00:40 +10:00
Pieter-Jan Briers
b77b49c667 Mapped string serializer hit/miss stats.
Fixes #3190
2022-08-26 01:58:17 +02:00
Leon Friedrich
0eabe62bdb Fix prototype reloading debug assert failure (#3188) 2022-08-26 09:57:58 +10:00
Leon Friedrich
31e2ea2770 Fix AudioParams deserialization (#3191) 2022-08-25 16:46:44 -07:00
metalgearsloth
7a636b3b87 Version: 0.45.0.0 2022-08-25 23:33:10 +10:00
Leon Friedrich
98ce017b4a Physics get-colliding tweaks (#3183) 2022-08-25 23:29:46 +10:00
Leon Friedrich
26b04f0d66 Fix container init IDs (#3184) 2022-08-25 23:28:48 +10:00
Leon Friedrich
f4f2dea688 Fix load grid errors (#3181) 2022-08-25 23:28:29 +10:00
metalgearsloth
e9a0f9a4c1 Bandaid maploader for loading onto an existing one (#3160) 2022-08-24 15:49:46 +10:00
Leon Friedrich
de438ae94c Prevent players from attaching to terminating entities (#3175) 2022-08-24 01:42:48 +10:00
metalgearsloth
9ec77f20ee Version: 0.44.0.0 2022-08-23 16:35:59 +10:00
Leon Friedrich
da01040b52 Hopefully fix container issues? (#3174) 2022-08-23 16:35:02 +10:00
metalgearsloth
dce2a5ddb2 Fix physics grid reparent crash (#3122) 2022-08-23 11:33:36 +10:00
Acruid
5c99fbabf2 Map serialization postmapinit bugfix (#3165) 2022-08-23 10:52:23 +10:00
Leon Friedrich
9d0846c0e9 Add PVS/entity-state debug commands (#3169) 2022-08-23 10:50:23 +10:00
metalgearsloth
035ecfb098 Fix joint collision (#3161)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-08-23 10:48:19 +10:00
metalgearsloth
3693f5aee7 Physics component cleanup (#3158) 2022-08-23 10:45:28 +10:00
ElectroJr
b859815b07 Version: 0.43.1.1 2022-08-22 17:03:25 -04:00
Leon Friedrich
3701ca83e4 Only request full state on missing metadata. (#3170) 2022-08-23 07:01:41 +10:00
Leon Friedrich
1473f1d34c Fix entity state exception tolerance (#3171) 2022-08-23 07:01:31 +10:00
ElectroJr
889c140fb9 Version: 0.43.1.0 2022-08-22 13:32:57 -04:00
metalgearsloth
c8259915f8 LoadBP completion results (#3159) 2022-08-23 02:58:56 +10:00
Leon Friedrich
a2a25fb296 Add session info for client-side ToPrettyString() (#3162) 2022-08-23 02:56:09 +10:00
Leon Friedrich
938a9929ea Fix deferred component remove error (#3163) 2022-08-23 02:55:59 +10:00
wrexbe
7726075b9b Fix gamestate debug display (#3167) 2022-08-23 02:55:41 +10:00
Leon Friedrich
03b3d1bbe7 Maybe fix PVS bug (#3164) 2022-08-23 02:54:50 +10:00
wrexbe
17ec51b74c Add reusing username+id in tests (#3143) 2022-08-22 05:57:07 +10:00
Leon Friedrich
e92998d1ec Remove a PVS warning on full release (#3154) 2022-08-22 05:50:52 +10:00
metalgearsloth
6691512136 Version: 0.43.0.2 2022-08-21 17:10:05 +10:00
metalgearsloth
a80f4ad76c Add broadphase AABB back in (#3157) 2022-08-21 16:56:01 +10:00
Leon Friedrich
2c6f4cd80c Fix PVS/container bug (#3155) 2022-08-21 16:06:44 +10:00
ElectroJr
51a4c6dcf2 Version: 0.43.0.1 2022-08-20 19:49:03 -04:00
Leon Friedrich
1f402e581a Fix state interpolation (#3153) 2022-08-21 09:47:15 +10:00
ElectroJr
17ea92bfda Version: 0.43.0.0 2022-08-20 18:31:48 -04:00
Leon Friedrich
6a8266af7e Revert "Revert "PVS & client state handling changes"" (#3152) 2022-08-21 08:30:28 +10:00
ElectroJr
f6b7606648 Version: 0.42.0.0 2022-08-20 15:28:34 -04:00
Leon Friedrich
9cd8adae93 Revert "PVS & client state handling changes" (#3151) 2022-08-21 05:27:16 +10:00
ElectroJr
c5ba8b75c8 Version: 0.41.0.0 2022-08-20 13:42:20 -04:00
Leon Friedrich
3d73cc7289 Make AudioSystem accept nullable SoundSpecifier (#3133) 2022-08-21 03:40:49 +10:00
Leon Friedrich
11aa062ee0 Un-revert BUI PRs (#3139) 2022-08-21 03:40:29 +10:00
Leon Friedrich
b4358a9e33 PVS & client state handling changes (#3000) 2022-08-21 03:40:18 +10:00
Leon Friedrich
0cce4714a1 Make a specific EntityUid error more descriptive (#3132) 2022-08-20 16:30:11 +10:00
metalgearsloth
9c4e6a6595 Hotfix tile placement brrrrt (#3140) 2022-08-20 16:29:38 +10:00
DrSmugleaf
1ddd541fe9 Add IEntityManager.Systems proxy methods (#3150) 2022-08-20 16:28:36 +10:00
Leon Friedrich
e45aa3f2fe Assert that components are not added to terminating entities (#3144) 2022-08-20 16:28:09 +10:00
Leon Friedrich
99efdb6061 Include stack trace in deletion errors (#3145) 2022-08-20 16:27:54 +10:00
DrSmugleaf
32f0ffdc79 Move ContainerHelpers methods to SharedContainerSystem (#3149) 2022-08-20 07:57:56 +02:00
DrSmugleaf
cf166483c9 Change state manager methods to return the new state (#3137) 2022-08-15 22:05:48 +02:00
Pieter-Jan Briers
49631867f4 Fix sRGB conversion in WindowRoot background color. 2022-08-15 16:51:23 +02:00
metalgearsloth
9f56eaec9a Obsolote EntitySystem.Get<T> (#3142) 2022-08-15 16:22:06 +02:00
DrSmugleaf
04f2b732a5 Add TryFirstOrNull and TryFirstOrDefault without predicates (#3141) 2022-08-15 16:21:40 +02:00
metalgearsloth
b8cfabc339 Version: 0.40.3.3 2022-08-15 14:06:22 +10:00
metalgearsloth
1cdd39202f Make tile grid placement somewhat bearable (#3131)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-08-15 14:05:27 +10:00
Leon Friedrich
3290720b4c Don't error on missing entity suffixes (#3124) 2022-08-15 14:04:50 +10:00
Leon Friedrich
49badb06cb Fix fixture init/state bug. (#3125) 2022-08-15 14:03:57 +10:00
Visne
2c6941e73b Version: 0.40.3.2 2022-08-15 02:49:34 +02:00
wrexbe
5e5883cb88 Fix map schema (#3138) 2022-08-15 02:40:56 +02:00
ElectroJr
02c504445e Version: 0.40.3.1 2022-08-14 19:21:42 -04:00
wrexbe
4d5075a792 Update mapfile_validators.py (#3136) 2022-08-15 09:20:12 +10:00
750 changed files with 30877 additions and 14907 deletions

View File

@@ -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 }}

View File

@@ -1,7 +1,3 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<Import Project="..\MSBuild\Robust.Properties.targets" />
</Project>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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 -->

View File

@@ -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>

View File

@@ -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
View 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`

View File

@@ -0,0 +1,3 @@
- type: uiTheme
id: Default
path: /textures/interface/Default

View 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 }
}

View 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.

View File

@@ -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...]

View File

@@ -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.

View 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 }
}

View 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.

View 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.

View 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

View 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

View File

@@ -0,0 +1 @@
defaultwindow-placeholder-title = Exemplo de título de janela aqui

View 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>

View File

@@ -0,0 +1 @@
cmd-midipanic-desc = Desliga cada nota para cada renderizador MIDI ativo.

View File

@@ -0,0 +1 @@
tab-container-not-tab-title-provided = Sem título

View 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]

View File

@@ -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}";
}
}

View 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
}
}
}

View 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");
}
}
}

View 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
}
}
}

View 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);
}
}
}

View File

@@ -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");

View 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!;
}

View File

@@ -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));

View File

@@ -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; }

View File

@@ -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();
}
}
}
}
}

View File

@@ -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

View File

@@ -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();
}
}

View File

@@ -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();

View File

@@ -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)
{

View File

@@ -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;
}
}

View File

@@ -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)
{

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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:

View File

@@ -238,7 +238,7 @@ namespace Robust.Client
private void GameStoppedReset()
{
IoCManager.Resolve<INetConfigurationManager>().FlushMessages();
_configManager.FlushMessages();
_gameStates.Reset();
_playMan.Shutdown();
_entityManager.Shutdown();

View File

@@ -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>();
}
}
}

View File

@@ -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)

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}

View File

@@ -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();
}
}

View File

@@ -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++)
{

View File

@@ -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}' ");
}

View File

@@ -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;
}

View File

@@ -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]);

View File

@@ -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;
}

View File

@@ -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}");
}

View File

@@ -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;
}

View File

@@ -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);
}
}
}

View File

@@ -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",

View File

@@ -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

View File

@@ -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");
}
}
}

View File

@@ -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");
}

View File

@@ -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();
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -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]);
}
}
}

View 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;
}
}

View File

@@ -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;
}
}
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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();

View File

@@ -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)

View File

@@ -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>

View File

@@ -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.

View File

@@ -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)

View File

@@ -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;
}
}

View File

@@ -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>();

View File

@@ -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)

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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;
}
}
}

View File

@@ -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)
{

View File

@@ -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")]

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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);
}
}
}

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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; }
}
}

View File

@@ -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)

View File

@@ -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)
{

View File

@@ -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 =

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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