Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
288 commits
Select commit Hold shift + click to select a range
3ddaceb
- SafeStorageService glow up.
MapleWheels Jan 15, 2026
6362a9c
- Work on LuaCs system state machine.
MapleWheels Jan 16, 2026
6a21255
- IT BUILDS!!2:BARO BOOGALOO
MapleWheels Jan 19, 2026
6e7b7c8
- Added other package locations to if statement check.
MapleWheels Jan 19, 2026
dda26df
For sure this time....right guys?
MapleWheels Jan 19, 2026
f1e1b92
The deadlock situation is craaaaazy
evilfactory Jan 20, 2026
cc07db9
- Fixed the "deadlock" (tasks not started).
MapleWheels Jan 20, 2026
7e0e671
- ConfigService.cs alpha testing.
MapleWheels Jan 22, 2026
09faa84
Fixed StatemMachine State delegate assignment being backwards.
MapleWheels Jan 22, 2026
15e0a2b
Disabled LuaCsConfig until ModConfig.xml and ISettingEntry<T> are com…
MapleWheels Jan 22, 2026
6e66a31
- Made Package loading conditional on resources being available.
MapleWheels Jan 23, 2026
ee09885
Add ModConfig for test mod
evilfactory Jan 24, 2026
6faf1a0
Fix perfidious task moment
evilfactory Jan 24, 2026
8dc5844
MoveToImmutable -> ToImmutable
evilfactory Jan 24, 2026
d0f5cb8
- Fixed resource data not returning into the correct context.
MapleWheels Jan 25, 2026
8dedc54
Add Any for Platform and Target enums
evilfactory Jan 25, 2026
2508146
Add the content package and move the Lua files to it
evilfactory Jan 25, 2026
c2aa7dd
Added packages to running packages list on execution.
MapleWheels Jan 25, 2026
0a9c673
- Removed unused settings
MapleWheels Jan 25, 2026
ed09908
- Added default load context type resolution.
MapleWheels Jan 25, 2026
b626fd1
- The GetType lag situation is craazy.
MapleWheels Jan 25, 2026
adf9303
- The GetType lag situation is less crazy.
MapleWheels Jan 25, 2026
295c365
- The return null situation is no longer crazy.
MapleWheels Jan 25, 2026
3d51abc
Semi-working Lua scripts
evilfactory Jan 25, 2026
60ed549
- Removed unused scheduler context.
MapleWheels Jan 26, 2026
f9a4674
- Removed all MoveImmute situations.
MapleWheels Jan 26, 2026
b36224f
Removed unused data interfaces.
MapleWheels Jan 26, 2026
440cbed
- Fixed find files in package using the wrong ContentPackage property.
MapleWheels Jan 26, 2026
297f6a3
Basic legacy Lua converter
evilfactory Jan 26, 2026
009957e
- Added alpha legacy mod support.
MapleWheels Jan 27, 2026
2a1d776
- Enabled caching for LuaScriptLoader.cs
MapleWheels Jan 27, 2026
c776a54
Made GetType return interfaces by default.
MapleWheels Jan 29, 2026
6619def
The concurrent toolbox dictionary situation is crazy
evilfactory Jan 29, 2026
92232d1
Ensures that ILuaCsHook will resolve to the existing event service in…
MapleWheels Jan 29, 2026
22f587b
Changed ModConfig.xml spec: RunFile => IsAutorun.
MapleWheels Jan 29, 2026
ab2638b
Fix event service not clearing _luaOrphanSubscribers
evilfactory Jan 29, 2026
f28749d
Missing IsAutorun
evilfactory Jan 29, 2026
f0f09c2
Plugin moment
evilfactory Jan 29, 2026
67d3d5f
Reimplementation of DoString with lua/cl_lua commands and fix Lua scr…
evilfactory Jan 29, 2026
a28a6f3
- Added LuaCs ordering filter.
MapleWheels Jan 29, 2026
37e3a19
- Now logs results from SyncLoadedPackagesList
MapleWheels Jan 29, 2026
13a9bc4
- Some work on PluginManagementService, IAssemblyLoaderService and IA…
MapleWheels Jan 29, 2026
708fe93
Some extra logging and bring back LuaCsTimer
evilfactory Jan 29, 2026
3b65ea9
Remove unused LuaCsConfig
evilfactory Jan 29, 2026
c6c0aad
Rename LuaCsHook
evilfactory Jan 29, 2026
dfb31ee
Move Lua classes to the appropriate places
evilfactory Jan 29, 2026
6b8a0a7
Take in account ForcedAutorun for legacy as well
evilfactory Jan 30, 2026
4f02cb4
Working Hook.Patch and old patch methods
evilfactory Jan 30, 2026
5421c7d
- Made SyncPackages function always complete the unload->reload process.
MapleWheels Jan 30, 2026
9b95291
Added limited multithreaded compatibility. Still requires locks.
MapleWheels Feb 1, 2026
5777b64
Move LuaUserData and registration into a proper service
evilfactory Feb 1, 2026
cb171d3
Alpha PluginManagementService, plugin loading functionality implemented.
MapleWheels Feb 1, 2026
bb88692
- Refactored the EventService interfaces and event system, incomplete.
MapleWheels Feb 1, 2026
7e541ce
- Removed ACsMod.cs
MapleWheels Feb 1, 2026
b325a01
Rewrote the EventService.
MapleWheels Feb 2, 2026
0cab795
Fixed immediate errors (untested).
MapleWheels Feb 2, 2026
024b07d
Added logging to the EventService.
MapleWheels Feb 2, 2026
36bed09
- Fixed stack ovewrflow from ServicesProvider (???).
MapleWheels Feb 2, 2026
7b529bc
Revert "- Removed ACsMod.cs"
MapleWheels Feb 2, 2026
244c0fb
Made ACsMod even more useless so hopefully people stop using it...
MapleWheels Feb 2, 2026
2eb593f
- Debugging LuaCsHook compat issues.
MapleWheels Feb 3, 2026
06348d3
It works. Except (HookMethod->Harmony: L189) is throwing NRE.
MapleWheels Feb 3, 2026
ea602f6
Woof
MapleWheels Feb 3, 2026
70dd602
Move the Lua IL patching bullshit to a separate service
evilfactory Feb 3, 2026
02a7338
Removed duplicate rawrrs
MapleWheels Feb 3, 2026
fd03715
- Fixed recursion deadlock due to the EventService.Reset() being call…
MapleWheels Feb 3, 2026
4cf4b16
Fixed some NREs.
MapleWheels Feb 3, 2026
cf25145
Fix EventService.Call not implemented correctly
evilfactory Feb 4, 2026
80555ef
IT WORKS!!!!!!!!!!!!!!!!!!!!
evilfactory Feb 4, 2026
cae3741
Made most of the networking interfaces public.
MapleWheels Feb 4, 2026
9cc20a0
Fixed networking references errors.
MapleWheels Feb 4, 2026
863ee23
- Some work on config service.
MapleWheels Feb 5, 2026
e752085
- Config Services almost ready.
MapleWheels Feb 6, 2026
771e73a
- Basic Config & Settings working (read-only, changes must be made vi…
MapleWheels Feb 6, 2026
fa340e9
Fixed an issue affecting parsing the required runstate to edit a sett…
MapleWheels Feb 6, 2026
b3d0fbe
Add cfg_setvalue command
evilfactory Feb 6, 2026
dcd7df4
Fixed TrySetValue returning an incorrect result.
MapleWheels Feb 6, 2026
c84d966
Add command cfg_getvalue
evilfactory Feb 6, 2026
2c29969
- Oops.
MapleWheels Feb 6, 2026
d47b75c
Give Lua references to IEvent and finally add an alias for think
evilfactory Feb 7, 2026
87dc9be
-Changed NetworkSync interfaces.
MapleWheels Feb 7, 2026
ba10d9d
Working NetworkingService without net vars
evilfactory Feb 7, 2026
422e8a6
Misc Lua fixes
evilfactory Feb 8, 2026
e76aaf5
Fix deadlock when reloading packages
evilfactory Feb 8, 2026
02b1f52
Re-enable DefaultHook.lua
evilfactory Feb 8, 2026
67c1950
Network Sync work. Added network unique key.
MapleWheels Feb 8, 2026
c637e34
Fix GUI enums in Lua
evilfactory Feb 8, 2026
f01ee61
Clear file cache when resetting LuaScriptManagementService
evilfactory Feb 8, 2026
224e32c
Some work on save/load for configs.
MapleWheels Feb 8, 2026
ce4cd1f
Implement most of the net var networking functionality
evilfactory Feb 8, 2026
705137e
Finalize networking service
evilfactory Feb 8, 2026
36a1267
Register INetworkIdProvider
evilfactory Feb 8, 2026
5b10661
Legacy network stuff
evilfactory Feb 8, 2026
0a91b89
Add publicized assemblies to metadata references
evilfactory Feb 9, 2026
668197a
Fix Lua/Cs execute order
evilfactory Feb 9, 2026
bcc4357
Pass in cs enabled check in ExecuteLoadedScripts
evilfactory Feb 9, 2026
a505d48
- Loading/Saving for Settings via console.
MapleWheels Feb 9, 2026
e8bec96
THE REQUIRE PATHS WORK!@!!!!!!11!
evilfactory Feb 9, 2026
70e9846
nuh uh
evilfactory Feb 9, 2026
511f98e
- Added pre-touch to the ContentPath.FullPath to make them thread-safe.
MapleWheels Feb 9, 2026
9537662
- Added LuaCsForBarotrauma check to enabled packages list.
MapleWheels Feb 9, 2026
dc1093e
Added LuaCs package lookup to the info provider.
MapleWheels Feb 9, 2026
64831bd
- Made the assembly compilation logs output in production builds.
MapleWheels Feb 9, 2026
a61e705
Better LoggerService
evilfactory Feb 9, 2026
f1bae4c
- Added Copy-On-Build for publicized assemblies to the luatrauma loca…
MapleWheels Feb 9, 2026
d14c353
Remove old LuaCsNetworking
evilfactory Feb 10, 2026
fb4648d
Converting everything into Harmony patches part 1
evilfactory Feb 10, 2026
30149b5
- Added publicized assemblies to LuaCsForBarotrauma package via ModCo…
MapleWheels Feb 10, 2026
6b9e48f
- Added ISystem (automatically run services) service type.
MapleWheels Feb 10, 2026
9dde5ca
Fixed Evil's obsession with OnKeyUpdate.
MapleWheels Feb 10, 2026
6bbe5be
Fix networking being completely bamboozled
evilfactory Feb 10, 2026
9e2fc13
- Fixed the server not loading saved convars and not having absolute …
MapleWheels Feb 10, 2026
5e33a90
Removed NIException.
MapleWheels Feb 11, 2026
948b7c4
-- MonoMod.Hook replacement.
MapleWheels Feb 11, 2026
59584fe
- Updated dependencies versions.
MapleWheels Feb 11, 2026
471e256
Revert "-- MonoMod.Hook replacement."
MapleWheels Feb 11, 2026
ad152ee
- pOoosh
MapleWheels Feb 11, 2026
5747d89
- Removed ImpromptuInterfaces
MapleWheels Feb 12, 2026
07d838e
Finished removing Impromptu Interfaces package.
MapleWheels Feb 12, 2026
5f38b4a
Fix bullshit Lua issues
evilfactory Feb 13, 2026
dff38f7
- Added XmlDoc for InternalScript instance.
MapleWheels Feb 13, 2026
36471f2
Move more events to be Harmony patches
evilfactory Feb 13, 2026
a36bd70
Strip down the original logger class
evilfactory Feb 13, 2026
a50dce8
Forgot to remove old Hook Call
evilfactory Feb 13, 2026
13bfffa
More events moved
evilfactory Feb 15, 2026
f70251f
Event pain
evilfactory Feb 15, 2026
6ac49a1
- XML GUI Asset service implemented (alpha, requires testing).
MapleWheels Feb 15, 2026
a0287b8
Oops
MapleWheels Feb 15, 2026
c28a08a
Revert "Oops"
MapleWheels Feb 16, 2026
c8657ca
Update .NET SDK version from 6 to 8 in README
Regalis11 Feb 20, 2026
f52617d
The great event move
evilfactory Feb 20, 2026
124b1e5
Fix missing ILuaCsNetworking API
evilfactory Feb 20, 2026
ddd9dac
Fix Descriptors not being populated correctly
evilfactory Feb 20, 2026
da5b938
Fix missing HookMethod APIs in the interface
evilfactory Feb 20, 2026
a7e9dc8
oops
evilfactory Feb 20, 2026
9199219
Fix return events not working in Lua
evilfactory Feb 20, 2026
f4138d2
- Added networking permission checks to SettingEntry.
MapleWheels Feb 22, 2026
a28333f
Implemented ConfigProfiles internally.
MapleWheels Feb 23, 2026
394856f
- Final commit before migration to /dev
MapleWheels Feb 23, 2026
d9d9801
- Moved all console commands to their respective services and added v…
MapleWheels Feb 24, 2026
94556fd
- SettingsMenuService added.
MapleWheels Feb 25, 2026
6e556a0
I'm cooked, will finish this later.
MapleWheels Feb 27, 2026
ebf2935
- Some menu implementation.
MapleWheels Feb 27, 2026
9b61cda
- SettingsMenu work.
MapleWheels Feb 27, 2026
c676233
[Save/Sync] Work on SettingsMenu
MapleWheels Feb 27, 2026
8e8b8eb
GameMain.LuaCs is no more
evilfactory Feb 28, 2026
de73a18
Compatibility for in memory scripts that used GameMain.LuaCs
evilfactory Feb 28, 2026
3192cc8
Remove need to define custom network header in upstream
evilfactory Feb 28, 2026
e2c4282
Add netMessageReceived hook back
evilfactory Feb 28, 2026
28b3559
Add missing ILuaCsNetworking APIs
evilfactory Feb 28, 2026
09bc2d0
- Weird LuaCs Settings Menu bug present: package is loaded on startup…
MapleWheels Mar 1, 2026
e74f083
LuaCs package bug fixed.
MapleWheels Mar 1, 2026
9b55bf4
[Save/Sync] Work on the settings menu.
MapleWheels Mar 1, 2026
845fcef
Fix Start(0 not returning an empty write only message
evilfactory Mar 1, 2026
22a74bf
Move compat hooks
evilfactory Mar 1, 2026
9ee4728
Better logging
evilfactory Mar 1, 2026
f8ff97d
Fix debug console commands
evilfactory Mar 1, 2026
580f26b
New CI files
evilfactory Mar 1, 2026
800dec3
I guess this doesnt exist anymore
evilfactory Mar 1, 2026
0452c1f
oops
evilfactory Mar 1, 2026
5cbb635
Ok this should be the last one
evilfactory Mar 1, 2026
168ce83
Fixed potential NRE that shouldn't happen so long as the LuaCsForBaro…
MapleWheels Mar 1, 2026
4b04131
Added post-publishing publicized assemblies copy task.
MapleWheels Mar 2, 2026
26b3827
- Made publicizer only copy the required assemblies.
MapleWheels Mar 2, 2026
83c198b
[Save/Sync] Commit work before .NET 10 tests.
MapleWheels Mar 4, 2026
a66b904
Fixed reference name error.
MapleWheels Mar 4, 2026
d0969cc
- Fixed assembly references not resolving for minor dll signature dif…
MapleWheels Mar 4, 2026
ce8b984
Fixed Csharp/Shared path resolution in ModConfigService.
MapleWheels Mar 4, 2026
f38a7bd
The gameplay settings menu kinda works (only for luacsforbarotrauma).
MapleWheels Mar 5, 2026
1fe68aa
- Added float, double settingentry types. Adjusted display formatting.
MapleWheels Mar 5, 2026
368b18d
- Fixed shet.
MapleWheels Mar 5, 2026
947a481
Added spacer to settings labels.
MapleWheels Mar 6, 2026
8470e81
Added tooltips and SettingControl input listener to the settings menu…
MapleWheels Mar 6, 2026
5a45270
Minor adjustment to setting entry height and styles.
MapleWheels Mar 6, 2026
5b52d22
Added references cache for some hot paths services.
MapleWheels Mar 6, 2026
e26cfa2
[Untested][Save/Sync]
MapleWheels Mar 6, 2026
8190b3f
Fixed cs enabled prompt for hosts.
MapleWheels Mar 9, 2026
e5aa381
performance fixes for IDE/attached debugger stuttering.
MapleWheels Mar 10, 2026
dd51bda
Revert "performance fixes for IDE/attached debugger stuttering."
evilfactory Mar 14, 2026
103f284
Register setting types
evilfactory Mar 14, 2026
d4b7746
ModUtils namespace compatibility
evilfactory Mar 14, 2026
ecc4d8a
Update moonsharp
evilfactory Mar 14, 2026
f802356
Add legacy redirect for LuaCsSetup.Timer
evilfactory Mar 14, 2026
cf2c8b8
Add missing HttpGet in the interface
evilfactory Mar 14, 2026
8083245
Added api for getting content package associatged with a plugin type.
MapleWheels Mar 15, 2026
b402e09
Move MainMenu code to a separate service that just injects our stuff …
evilfactory Mar 15, 2026
8717706
Fix check ready to run not working properly
evilfactory Mar 15, 2026
fe34dcb
Added null location check to assembly inclusion list.
MapleWheels Mar 17, 2026
b0e3faa
Make LuaCsLogger public
evilfactory Mar 21, 2026
9946108
Fixed deadlock scenario caused by unsubscribing during an event.
MapleWheels Mar 22, 2026
de53b45
Fix console command registration
evilfactory Mar 22, 2026
23e0ff7
Remove types that have been registered when unloading
evilfactory Mar 22, 2026
44a9ce2
Guh?
evilfactory Mar 22, 2026
e62450c
Actually subscribe to IEventAssemblyUnloading
evilfactory Mar 22, 2026
ac329a7
- Reduced console spam when failing to load config file in release bu…
MapleWheels Mar 22, 2026
cf3a50d
- Added back modifyChatMessage.
MapleWheels Mar 22, 2026
7c8dd45
SettingsList implementation.
MapleWheels Mar 22, 2026
cf6104f
Added Dropdown menu implementation for settings list.
MapleWheels Mar 23, 2026
5c136aa
Added test debug settings for settings list.
MapleWheels Mar 23, 2026
26ac37e
Added fallback native assembly resolver.
MapleWheels Mar 22, 2026
3dd9cfa
Implemented plugin assembly lookup api.
MapleWheels Mar 21, 2026
1e76377
- Added full implementation of lua event "modifyChatMessage" in IEvents.
MapleWheels Mar 23, 2026
28acf02
Updated client-side/common files tracking list for luacsinstaller.
MapleWheels Mar 23, 2026
b70b6bf
Fixed deadlock scenario in the event dispatcher CRUD API.
MapleWheels Mar 24, 2026
c1fdedf
Fixed ConfigService not filtering out configs that it shouldn't be lo…
MapleWheels Mar 24, 2026
57daa3c
Fix missing type register
evilfactory Mar 28, 2026
bb2490e
Fix wrong arguments in RemovePatch
evilfactory Mar 28, 2026
2ea97d3
Add CallLuaFunction legacy redirect
evilfactory Mar 28, 2026
5bfa155
Move partial classes to extension methods, the ones that can't, turn …
evilfactory Mar 28, 2026
6481877
Whoops
evilfactory Mar 28, 2026
b8f1642
Simplify command register
evilfactory Mar 28, 2026
b358882
This should be ItemPrefab, not Item, also add it the source code compat
evilfactory Mar 28, 2026
958335a
Replicate old Add() method signature structure
evilfactory Mar 28, 2026
14c610e
Re-added the install_cl_lua command
evilfactory Mar 29, 2026
bcec409
Fix deep-fried main menu text
evilfactory Mar 29, 2026
f1808d9
Added verbose cs compilation.
MapleWheels Mar 29, 2026
4f2da55
- Added legacy LuaCsPerformanceCounter.cs
MapleWheels Mar 31, 2026
413cc3e
- Added setting to disable lua scripts caching in the storage service…
MapleWheels Apr 3, 2026
4167448
Fix Game.Settings being nil
evilfactory Apr 4, 2026
f05d4ef
Fic CSharp enabling message printing before config got loaded
evilfactory Apr 4, 2026
121f670
Fix character.death hook getting called a billion times per second
evilfactory Apr 4, 2026
5e003bc
Fix missing Game.Commands
evilfactory Apr 5, 2026
9b05c51
Fix calling Hook.Call directly from Lua being broken
evilfactory Apr 5, 2026
0e14983
Allow System.Console
evilfactory Apr 5, 2026
7055480
- Fixed publicized Barotrauma.dll missing error on DedicatedServer.
MapleWheels Apr 5, 2026
df0a4e6
Added logging for additional plugin loading exceptions.
MapleWheels Apr 7, 2026
232f720
Fixed shared Csharp src files not being included if there weren't als…
MapleWheels Apr 7, 2026
4c8e016
- Added extra source code translation (for CTS).
MapleWheels Apr 8, 2026
1294ba6
- Added API to get package by name to PackageManagementService.cs and…
MapleWheels Apr 8, 2026
d440ccb
Register IConfigService and add back some missing APIs
evilfactory Apr 8, 2026
ebe8ec4
LuaCs CSharp Enabled Rework
MapleWheels Apr 7, 2026
bdd4dcf
Disabled caching on the ConfigService.
MapleWheels Apr 8, 2026
6c32873
Only register ILuaConfigService
evilfactory Apr 8, 2026
c882b0b
Update moonsharp
evilfactory Apr 8, 2026
eeeb3d9
Expose all settings in Lua
evilfactory Apr 8, 2026
e9673bf
Update moonsharp
evilfactory Apr 8, 2026
b0b4acf
- Made readonly readonly.
MapleWheels Apr 8, 2026
2e65650
- Added null check to get string value.
MapleWheels Apr 8, 2026
e161d92
Fix settings not being properly exposed to Lua
evilfactory Apr 8, 2026
b9b4572
Test Lua config mod
evilfactory Apr 8, 2026
3a5fbfd
Fix cs enabled for session state not being preserved between reloads
evilfactory Apr 8, 2026
89aa818
Made Config initialization errors more forgiving to noobs.
MapleWheels Apr 8, 2026
53be3f0
Fixed lua attempting to invoke the base interface type.
MapleWheels Apr 8, 2026
84cb7cf
server auth var.
MapleWheels Apr 9, 2026
ef66d27
- Fixed network synchro of vars, needs synctype testing.
MapleWheels Apr 9, 2026
a4607df
v1.12.6.2 (Spring Update 2026)
Regalis11 Apr 9, 2026
790378d
Merge remote-tracking branch 'upstream/master' into develop
evilfactory Apr 9, 2026
87e0191
- Debug tests.
MapleWheels Apr 9, 2026
a963498
Fix signalReceived hook not being called
evilfactory Apr 9, 2026
928cfb4
Re-add loaded Lua hook call
evilfactory Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 7 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ env:
Mono.Cecil.Mdb.dll
Mono.Cecil.Pdb.dll
Mono.Cecil.Rocks.dll
Microsoft.CodeAnalysis.CSharp.Scripting.dll
LightInject.dll
OneOf.dll
FluentResults.dll
Basic.Reference.Assemblies.Net80.dll
Microsoft.Extensions.Logging.Abstractions.dll
Microsoft.Toolkit.Diagnostics.dll
Microsoft.CodeAnalysis.CSharp.dll
Microsoft.CodeAnalysis.dll
Microsoft.CodeAnalysis.Scripting.dll
System.Collections.Immutable.dll
System.Reflection.Metadata.dll
System.Runtime.CompilerServices.Unsafe.dll
mscordaccore_amd64_amd64_*
Lua
LocalMods/LuaCsForBarotrauma

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bld/
[Rr]eleaseMac/
[Dd]ebugLinux/
[Rr]eleaseLinux/
LocalMods/
*.o
*/Barotrauma*/doc/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,24 @@ public override void DebugDraw(SpriteBatch spriteBatch)
}
}
}
else if (SelectedAiTarget?.Entity != null)
else if (SelectedAiTarget?.Entity != null && AttackLimb != null)
{
Vector2 targetPos = SelectedAiTarget.Entity.DrawPosition;
if (State == AIState.Attack)
{
targetPos = attackWorldPos;
}
targetPos.Y = -targetPos.Y;

GUI.DrawLine(spriteBatch, pos, targetPos, GUIStyle.Red * 0.5f, 0, 4);
Vector2 attackLimbPos = AttackLimb.DrawPosition;
attackLimbPos.Y = -attackLimbPos.Y;
GUI.DrawLine(spriteBatch, attackLimbPos, targetPos, GUIStyle.Red * 0.75f, 0, 4);
if (wallTarget != null && !IsCoolDownRunning)
{
Vector2 wallTargetPos = wallTarget.Position;
if (wallTarget.Structure.Submarine != null) { wallTargetPos += wallTarget.Structure.Submarine.DrawPosition; }
wallTargetPos.Y = -wallTargetPos.Y;
GUI.DrawRectangle(spriteBatch, wallTargetPos - new Vector2(10.0f, 10.0f), new Vector2(20.0f, 20.0f), Color.Orange, false);
GUI.DrawLine(spriteBatch, pos, wallTargetPos, Color.Orange * 0.5f, 0, 5);
GUI.DrawLine(spriteBatch, attackLimbPos, wallTargetPos, Color.Orange * 0.75f, 0, 5);
}
GUI.DrawString(spriteBatch, pos - Vector2.UnitY * 60.0f, $"{SelectedAiTarget.Entity}", GUIStyle.Red, Color.Black);
GUI.DrawString(spriteBatch, pos - Vector2.UnitY * 40.0f, $"{targetValue.FormatZeroDecimal()} (M: {CurrentTargetMemory?.Priority.FormatZeroDecimal()}, P: {CurrentTargetingParams?.Priority.FormatZeroDecimal()})", GUIStyle.Red, Color.Black);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public override void DebugDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spri
//GUI.DrawString(spriteBatch, pos + textOffset, $"AI TARGET: {SelectedAiTarget.Entity.ToString()}", Color.White, Color.Black);
}

Vector2 spacing = new Vector2(0, GUIStyle.Font.MeasureChar('T').Y);

Vector2 stringDrawPos = pos + textOffset;
GUI.DrawString(spriteBatch, stringDrawPos, Character.Name, Color.White, Color.Black);

Expand All @@ -33,14 +35,14 @@ public override void DebugDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spri
currentOrders.Sort((x, y) => y.ManualPriority.CompareTo(x.ManualPriority));
for (int i = 0; i < currentOrders.Count; i++)
{
stringDrawPos += new Vector2(0, 20);
stringDrawPos += spacing;
var order = currentOrders[i];
GUI.DrawString(spriteBatch, stringDrawPos, $"ORDER {i + 1}: {order.Objective.DebugTag} ({order.Objective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
}
}
else if (ObjectiveManager.WaitTimer > 0)
{
stringDrawPos += new Vector2(0, 20);
stringDrawPos += spacing;
GUI.DrawString(spriteBatch, stringDrawPos - textOffset, $"Waiting... {ObjectiveManager.WaitTimer.FormatZeroDecimal()}", Color.White, Color.Black);
}
var currentObjective = ObjectiveManager.CurrentObjective;
Expand All @@ -49,19 +51,19 @@ public override void DebugDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spri
int offset = currentOrder != null ? 20 + ((ObjectiveManager.CurrentOrders.Count - 1) * 20) : 0;
if (currentOrder == null || currentOrder.Priority <= 0)
{
stringDrawPos += new Vector2(0, 20);
stringDrawPos += spacing;
GUI.DrawString(spriteBatch, stringDrawPos, $"MAIN OBJECTIVE: {currentObjective.DebugTag} ({currentObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
}
var subObjective = currentObjective.CurrentSubObjective;
if (subObjective != null)
{
stringDrawPos += new Vector2(0, 20);
stringDrawPos += spacing;
GUI.DrawString(spriteBatch, stringDrawPos, $"SUBOBJECTIVE: {subObjective.DebugTag} ({subObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
}
var activeObjective = ObjectiveManager.GetActiveObjective();
if (activeObjective != null)
{
stringDrawPos += new Vector2(0, 20);
stringDrawPos += spacing;
GUI.DrawString(spriteBatch, stringDrawPos, $"ACTIVE OBJECTIVE: {activeObjective.DebugTag} ({activeObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
}
if (currentObjective is AIObjectiveCombat
Expand All @@ -85,12 +87,12 @@ public override void DebugDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spri
}
}

Vector2 objectiveStringDrawPos = stringDrawPos + new Vector2(120, 40);
Vector2 objectiveStringDrawPos = stringDrawPos + new Vector2(120, spacing.Y * 2);
for (int i = 0; i < ObjectiveManager.Objectives.Count; i++)
{
var objective = ObjectiveManager.Objectives[i];
GUI.DrawString(spriteBatch, objectiveStringDrawPos, $"{objective.DebugTag} ({objective.Priority.FormatZeroDecimal()})", Color.White, Color.Black * 0.5f);
objectiveStringDrawPos += new Vector2(0, 18);
objectiveStringDrawPos += spacing * 0.8f;
}

if (steeringManager is IndoorsSteeringManager pathSteering)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ partial void SeverLimbJointProjSpecific(LimbJoint limbJoint, bool playSound)
}
}

public void Draw(SpriteBatch spriteBatch, Camera cam)
public void Draw(SpriteBatch spriteBatch, Camera cam, bool onlyDrawSeveredLimbs)
{
if (simplePhysicsEnabled) { return; }

Expand All @@ -573,8 +573,12 @@ public void Draw(SpriteBatch spriteBatch, Camera cam)
{
foreach (Limb limb in limbs) { limb.ActiveSprite.Depth += depthOffset; }
}
for (int i = 0; i < limbs.Length; i++)
for (int i = 0; i < inversedLimbDrawOrder.Length; i++)
{
if (onlyDrawSeveredLimbs && !inversedLimbDrawOrder[i].IsSevered)
{
continue;
}
inversedLimbDrawOrder[i].Draw(spriteBatch, cam, color);
}
if (!MathUtils.NearlyEqual(depthOffset, 0.0f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,8 @@ public void DoVisibilityCheck(Camera cam)

public void Draw(SpriteBatch spriteBatch, Camera cam)
{
if (!Enabled || InvisibleTimer > 0.0f) { return; }
AnimController.Draw(spriteBatch, cam);
if (!Enabled) { return; }
AnimController.Draw(spriteBatch, cam, onlyDrawSeveredLimbs: InvisibleTimer > 0.0f);
}

public void DrawHUD(SpriteBatch spriteBatch, Camera cam, bool drawHealth = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using Barotrauma.Items.Components;
using System.Linq;

namespace Barotrauma;

Expand Down Expand Up @@ -106,12 +107,17 @@ private static void RecalculateLabelPositions(Camera cam, Character character)
}

RectangleF textRect = GetLabelRect(interactableInRange, cam);

if (labels.None(l => l.Item == interactableInRange))
var existingLabel = labels.FirstOrDefault(l => l.Item == interactableInRange);
if (existingLabel == null)
{
var labelData = new LabelData(interactableInRange, textRect, RichString.Rich(interactableInRange.Prefab.Name), cam);
labels.Add(labelData);
}
//size of the label doesn't match - can happen when we're using a CJK font which we asynchronously render new symbols for
else if (existingLabel.TextRect.Size != textRect.Size)
{
existingLabel.TextRect = textRect;
}
}

PreventInteractionLabelOverlap(centerPos: character.Position);
Expand All @@ -127,7 +133,11 @@ private static bool IsLooseItem(Item item)
private static RectangleF GetLabelRect(Item item, Camera cam)
{
// create rectangle for overlap prevention
Vector2 itemTextSizeScreen = GUIStyle.SubHeadingFont.MeasureString(RichString.Rich(item.Prefab.Name).SanitizedValue) * LabelScale;

string nameText = RichString.Rich(item.Prefab.Name).SanitizedValue;

var font = GUIStyle.SubHeadingFont.GetFontForStr(nameText)!;
Vector2 itemTextSizeScreen = font.MeasureString(nameText) * LabelScale;
Vector2 interactablePosScreen = cam.WorldToScreen(item.Position);
RectangleF textRect = new RectangleF(interactablePosScreen.X, interactablePosScreen.Y, itemTextSizeScreen.X, itemTextSizeScreen.Y);
// center the rectangle on the item
Expand Down
11 changes: 5 additions & 6 deletions Barotrauma/BarotraumaClient/ClientSource/Characters/Limb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,6 @@ partial void InitProjSpecific(ContentXElement element)
break;
case "randomcolor":
randomColor = subElement.GetAttributeColorArray("colors", null)?.GetRandomUnsynced();
if (randomColor.HasValue)
{
Params.GetSprite().Color = randomColor.Value;
}
break;
case "lightsource":
LightSource = new LightSource(subElement, GetConditionalTarget())
Expand Down Expand Up @@ -631,6 +627,8 @@ partial void AddDamageProjSpecific(bool playSound, AttackResult result)
SoundPlayer.PlayDamageSound(damageSoundType, Math.Max(damage, bleedingDamage), WorldPosition);
}

if (character.InvisibleTimer > 0.0f) { return; }

// spawn damage particles
float damageParticleAmount = damage < 1 ? 0 : Math.Min(damage / 5, 1.0f) * damageMultiplier;
if (damageParticleAmount > 0.001f)
Expand Down Expand Up @@ -734,7 +732,8 @@ public void Draw(SpriteBatch spriteBatch, Camera cam, Color? overrideColor = nul
if (spriteParams == null || Alpha <= 0) { return; }
float burn = spriteParams.IgnoreTint ? 0 : burnOverLayStrength;
float brightness = Math.Max(1.0f - burn, 0.2f);
Color tintedColor = spriteParams.Color;
Color baseColor = randomColor ?? spriteParams.Color;
Color tintedColor = baseColor;
if (!spriteParams.IgnoreTint)
{
tintedColor = tintedColor.Multiply(ragdoll.RagdollParams.Color);
Expand All @@ -752,7 +751,7 @@ public void Draw(SpriteBatch spriteBatch, Camera cam, Color? overrideColor = nul
}
}
Color color = new Color(tintedColor.Multiply(brightness), tintedColor.A);
Color colorWithoutTint = new Color(spriteParams.Color.Multiply(brightness), spriteParams.Color.A);
Color colorWithoutTint = new Color(baseColor.Multiply(brightness), baseColor.A);
Color blankColor = new Color(brightness, brightness, brightness, 1);
if (deadTimer > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void PromptEdit(GUIComponent parent)

GUILayoutGroup connLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.12f), labelList.Content.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft);
new GUITextBlock(new RectTransform(new Vector2(0.4f, 1f), connLayout.RectTransform), text: conn.Connection.DisplayName, font: GUIStyle.SubHeadingFont);
GUITextBox box = GUI.CreateTextBoxWithPlaceholder(new RectTransform(new Vector2(0.6f, 1f), connLayout.RectTransform), text: found ? labelOverride : string.Empty, conn.Connection.DisplayName.Value);
GUITextBox box = GUI.CreateTextBoxWithPlaceholder(new RectTransform(new Vector2(0.6f, 1f), connLayout.RectTransform), text: found ? labelOverride : string.Empty, conn.Connection.DefaultDisplayName.Value);
box.MaxTextLength = MaxConnectionLabelLength;

textBoxes.Add(conn.Name, box);
Expand Down
54 changes: 1 addition & 53 deletions Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Barotrauma.LuaCs.Events;
using static Barotrauma.FabricationRecipe;

namespace Barotrauma
Expand Down Expand Up @@ -222,8 +223,6 @@ public static void Toggle()

private static bool IsCommandPermitted(Identifier command, GameClient client)
{
if (GameMain.LuaCs.Game.IsCustomCommandPermitted(command)) { return true; }

switch (command.Value.ToLowerInvariant())
{
case "kick":
Expand Down Expand Up @@ -659,14 +658,6 @@ async Task gameOwnershipTokenTest()
return;
}

bool luaCsEnabled = true;
if (args.Length > 3)
{
bool.TryParse(args[3], out luaCsEnabled);
}

if (luaCsEnabled) { GameMain.LuaCs.Initialize(); }

GameMain.MainMenuScreen.QuickStart(fixedSeed: false, subName, difficulty, levelGenerationParams);

}, getValidArgs: () => new[] { SubmarineInfo.SavedSubmarines.Select(s => s.Name).Distinct().OrderBy(s => s).ToArray() }));
Expand Down Expand Up @@ -4223,51 +4214,8 @@ void getTextsFromElement(XElement element, List<string> list, string parentName)
NewMessage("Minimum main path width: " + (Level.Loaded.LevelData?.MinMainPathWidth?.ToString() ?? "unknown"));
}
});

commands.Add(new Command("cl_lua", $"cl_lua: Runs a string on the client.", (string[] args) =>
{
if (GameMain.Client != null && !GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands))
{
ThrowError("Command not permitted.");
return;
}

if (GameMain.LuaCs.Lua == null)
{
ThrowError("LuaCs not initialized, use the console command cl_reloadluacs to force initialization.");
return;
}

try
{
GameMain.LuaCs.Lua.DoString(string.Join(" ", args));
}
catch(Exception ex)
{
LuaCsLogger.HandleException(ex, LuaCsMessageOrigin.LuaMod);
}
}));

commands.Add(new Command("cl_reloadlua|cl_reloadcs|cl_reloadluacs", "Re-initializes the LuaCs environment.", (string[] args) =>
{
GameMain.LuaCs.Initialize();
}));

commands.Add(new Command("cl_toggleluadebug", "Toggles the MoonSharp Debug Server.", (string[] args) =>
{
int port = 41912;

if (args.Length > 0)
{
int.TryParse(args[0], out port);
}

GameMain.LuaCs.ToggleDebugger(port);
}));
}



private static void ReloadWearables(Character character, int variant = 0)
{
foreach (var limb in character.AnimController.Limbs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ void AssignActionsToButtons(List<GUIButton> optionButtons, GUIMessageBox target)
int selectedOption = (userdata as int?) ?? 0;
if (actionInstance != null)
{
var option = actionInstance.Options[selectedOption];
if (GameMain.Client == null && option.ForceSay)
{
Character.Controlled.ForceSay(
option.ForceSayText.IsNullOrEmpty() ? TextManager.Get(option.Text).Fallback(option.Text) : TextManager.Get(option.ForceSayText).Fallback(option.ForceSayText),
option.ForceSayInRadio,
option.ForceSayRemoveQuotes);
}
actionInstance.selectedOption = selectedOption;
DisableButtons(optionButtons, btn);
btn.ExternalHighlight = true;
Expand Down Expand Up @@ -340,7 +348,8 @@ private static List<GUIButton> CreateConversation(GUIListBox parentBox, Localize
if (speaker?.Info != null && drawChathead)
{
// chathead
new GUICustomComponent(new RectTransform(new Vector2(0.15f, 0.8f), content.RectTransform), onDraw: (sb, customComponent) =>
int chatHeadWidth = (int)(content.RectTransform.Rect.Width * 0.15f);
new GUICustomComponent(new RectTransform(new Point(chatHeadWidth, chatHeadWidth), content.RectTransform, isFixedSize: true), onDraw: (sb, customComponent) =>
{
speaker.Info.DrawIcon(sb, customComponent.Rect.Center.ToVector2(), customComponent.Rect.Size.ToVector2());
});
Expand Down Expand Up @@ -382,7 +391,7 @@ private static List<GUIButton> CreateConversation(GUIListBox parentBox, Localize
}

textContent.RectTransform.MinSize = new Point(0, textContent.Children.Sum(c => c.Rect.Height + textContent.AbsoluteSpacing) + GUI.IntScale(16));
content.RectTransform.MinSize = new Point(0, content.Children.Sum(c => c.Rect.Height));
content.RectTransform.MinSize = textContent.RectTransform.MinSize;

// Recalculate the text size as it is scaled up and no longer matching the text height due to the textContent's minSize increasing
textBlock.CalculateHeightFromText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,9 @@ public override void ClientReadInitial(IReadMessage msg)
{
Item.ReadSpawnData(msg);
}
if (character.Submarine != null && character.AIController is EnemyAIController enemyAi)
if (character.AIController is EnemyAIController enemyAi && character.Submarine is Submarine ownSub)
{
enemyAi.UnattackableSubmarines.Add(character.Submarine);
if (Submarine.MainSub != null)
{
enemyAi.UnattackableSubmarines.Add(Submarine.MainSub);
foreach (Submarine sub in Submarine.MainSub.DockedTo)
{
enemyAi.UnattackableSubmarines.Add(sub);
}
}
enemyAi.SetUnattackableSubmarines(ownSub);
}
}
if (characters.Contains(null))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#nullable enable
namespace Barotrauma;

internal sealed partial class CustomMission : Mission
{
public override bool DisplayAsCompleted => State == SuccessState;
public override bool DisplayAsFailed => State == FailureState;
}
Loading
Loading