Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
26a5631
refactor: Deprecate OnEntityTouchHook event
ELDment Nov 1, 2025
c9c9539
chore: Cleanup code
ELDment Nov 1, 2025
9dc7607
Merge pull request #64 from ELDment/beta-1
skuzzis Nov 1, 2025
0015c0c
fix(menus/slider): Value Wrap
skuzzis Nov 1, 2025
c7344dd
feat: Add menu scroll style options for enhanced navigation
ELDment Nov 2, 2025
ecd5ffc
Merge remote-tracking branch 'upstream/beta' into beta-1
ELDment Nov 2, 2025
5f54f41
fix: Enable circular scrolling for CenterFixed menu style
ELDment Nov 2, 2025
f352f1d
refactor: Rename ArrowFollow to LinearScroll and improve documentation
ELDment Nov 2, 2025
bc6bb97
feat: Add bounds validation for MaxVisibleItems
ELDment Nov 2, 2025
ffb5223
fix: LinearScroll first option not displaying when MaxVisibleItems=1
ELDment Nov 2, 2025
f1b2d57
refactor: Simplify menu scroll logic and add comments
ELDment Nov 2, 2025
750d492
refactor: Introduce IMenuDesign and deprecate design-related methods …
ELDment Nov 2, 2025
83806cc
refactor: Replace SetScrollStyle with SetVerticalScrollStyle
ELDment Nov 2, 2025
f1e1fe9
feat(managed): give item without generic type
samyycX Nov 2, 2025
de2c8b6
feat: Implement text width calculation utilities
ELDment Nov 2, 2025
c440a20
feat: Implement horizontal text overflow style
ELDment Nov 2, 2025
4d91bc2
feat: Implement TruncateEnd and TruncateBothEnds styles
ELDment Nov 2, 2025
dc10aee
feat: Implement initial ScrollLeftFade and ScrollRightFade styles
ELDment Nov 2, 2025
2afac15
feat: Implement initial ScrollLeftLoop and ScrollRightLoop styles
ELDment Nov 2, 2025
82a40a4
feat: Add TicksPerScroll parameter to control scroll speed
ELDment Nov 2, 2025
bd504a1
refactor: Improve scroll implementation and eliminate redundant code
ELDment Nov 2, 2025
291515f
Merge remote-tracking branch 'upstream/beta' into beta-1
ELDment Nov 2, 2025
3b131af
fix(crash): Segfault HostFXR Load (#67)
skuzzis Nov 2, 2025
5d537cc
fix(host): fuck you gcc/msvc diff
skuzzis Nov 2, 2025
0db4f07
feat: Add support for per-element horizontal overflow styles
ELDment Nov 3, 2025
416a63a
Merge remote-tracking branch 'upstream/beta' into beta-1
ELDment Nov 3, 2025
6ba74ff
[no ci] chore: Looking for a more reliable length estimation method
ELDment Nov 3, 2025
cbe0af1
feat: Initial support for HTML tags in menu items
ELDment Nov 3, 2025
0d6e0ed
feat: Support custom animation speed for menu items
ELDment Nov 3, 2025
9a1bedf
feat: Support animations for individual menu items when global style …
ELDment Nov 3, 2025
39a3271
feat: Add overflow animation support for most menu item types
ELDment Nov 3, 2025
419a8c2
feat: Add horizontal style support for most menu items
ELDment Nov 3, 2025
b40734f
feat: Add TOML configuration support with InitializeTomlWithModel method
T3Marius Nov 3, 2025
5add503
refactor: Initial implementation of better HTML style support for men…
ELDment Nov 3, 2025
222f2b3
chore: Add necessary comments
ELDment Nov 3, 2025
425d741
refactor: use Tomlyn's built-in serialization instead of manual refle…
T3Marius Nov 3, 2025
2e32d5b
refactor: Implement HTML tag support in ScrollTextWithFade
ELDment Nov 3, 2025
b5fed33
update(editor): .editorconfig
skuzzis Nov 3, 2025
8d1a8cb
fix: double interface reload
oscar-wos Nov 4, 2025
a073ef0
Merge branch 'swiftly-solution:master' into fix-double-interface-reload
oscar-wos Nov 4, 2025
39c6e5c
refactor: Implement HTML tag support in ScrollTextWithLoop
ELDment Nov 4, 2025
606b20e
fix(managed): early exit if plugin by id not found on reload
oscar-wos Nov 4, 2025
0b1d479
feat: Implement HtmlGradient class for gradient text generation
ELDment Nov 4, 2025
50a3ff2
fix: Correct animation update conditions in Rerender
ELDment Nov 4, 2025
ec030a3
fix: Close all menus when player disconnects and map unloads
ELDment Nov 4, 2025
f7f527a
feat: Add pause support after scroll animation cycle completes
ELDment Nov 4, 2025
61fa15b
fix: Close all player menus when plugin unloads
ELDment Nov 4, 2025
6732bd9
chore: Implement boundary check for MaxWidth
ELDment Nov 4, 2025
9e8a6de
[no ci] Shipped It
ELDment Nov 4, 2025
99f767c
Merge remote-tracking branch 'upstream/beta' into beta-1
ELDment Nov 4, 2025
2e97d11
Merge pull request #71 from oscar-wos/fix-double-interface-reload
skuzzis Nov 4, 2025
68084c3
Merge pull request #69 from T3Marius/feat/toml-config-support
skuzzis Nov 4, 2025
15bb0ba
Merge pull request #68 from ELDment/beta-1
skuzzis Nov 4, 2025
3d9a627
update(CRecipientFilter): AddAllPlayers
skuzzis Nov 4, 2025
2dae990
fix: .NET runtime initialization crash on Windows
ELDment Nov 4, 2025
c90861b
feat(engine): DispatchParticleEffect
skuzzis Nov 4, 2025
66583a2
Merge pull request #74 from ELDment/beta-1
skuzzis Nov 4, 2025
c49e61e
fix(player): ExecuteCommand
skuzzis Nov 4, 2025
09e28a8
feat(managed): Add transmit control to entity object
samyycX Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,104 @@ cpp_wrap_preserve_blocks = one_liners

cpp_include_cleanup_add_missing_error_tag_type = suggestion
cpp_include_cleanup_remove_unused_error_tag_type = dimmed

[*.cs]
dotnet_style_qualification_for_field = true
dotnet_style_qualification_for_property = true
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_event = true
dotnet_diagnostic.IDE0003.severity = suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
dotnet_diagnostic.IDE0049.severity = warning
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
dotnet_diagnostic.IDE0036.severity = suggestion
dotnet_style_require_accessibility_modifiers = always
dotnet_diagnostic.IDE0040.severity = warning
dotnet_style_readonly_field = true
dotnet_diagnostic.IDE0044.severity = warning
csharp_prefer_static_local_function = true
dotnet_diagnostic.IDE0062.severity = warning
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_diagnostic.IDE0047.severity = suggestion
dotnet_diagnostic.IDE0048.severity = suggestion
dotnet_diagnostic.IDE0010.severity = warning
dotnet_style_object_initializer = true
dotnet_diagnostic.IDE0017.severity = warning
csharp_style_inlined_variable_declaration = true
dotnet_diagnostic.IDE0018.severity = warning
dotnet_style_collection_initializer = true
dotnet_diagnostic.IDE0028.severity = warning
dotnet_style_prefer_auto_properties = true
dotnet_diagnostic.IDE0032.severity = warning
dotnet_style_explicit_tuple_names = true
dotnet_diagnostic.IDE0033.severity = warning
csharp_prefer_simple_default_expression = true
dotnet_diagnostic.IDE0034.severity = warning
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_diagnostic.IDE0037.severity = warning
csharp_style_prefer_local_over_anonymous_function = true
dotnet_diagnostic.IDE0039.severity = warning
csharp_style_deconstructed_variable_declaration = false
dotnet_diagnostic.IDE0042.severity = warning
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_diagnostic.IDE0045.severity = warning
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_diagnostic.IDE0046.severity = warning
dotnet_style_prefer_compound_assignment = true
dotnet_diagnostic.IDE0054.severity = warning
dotnet_diagnostic.IDE0074.severity = warning
csharp_style_prefer_index_operator = true
dotnet_diagnostic.IDE0056.severity = warning
csharp_style_prefer_range_operator = false
dotnet_diagnostic.IDE0057.severity = warning
dotnet_diagnostic.IDE0070.severity = warning
dotnet_style_prefer_simplified_interpolation = true
dotnet_diagnostic.IDE0071.severity = warning
dotnet_diagnostic.IDE0072.severity = warning
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_diagnostic.IDE0075.severity = warning
dotnet_diagnostic.IDE0082.severity = warning
csharp_style_implicit_object_creation_when_type_is_apparent = true
dotnet_diagnostic.IDE0090.severity = warning
dotnet_diagnostic.IDE0180.severity = warning
csharp_style_namespace_declarations = file_scoped
dotnet_diagnostic.IDE0160.severity = warning
dotnet_diagnostic.IDE0161.severity = warning
csharp_style_throw_expression = true
dotnet_diagnostic.IDE0016.severity = warning
dotnet_style_coalesce_expression = true
dotnet_diagnostic.IDE0029.severity = warning
dotnet_diagnostic.IDE0030.severity = warning
dotnet_style_null_propagation = true
dotnet_diagnostic.IDE0031.severity = warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_diagnostic.IDE0041.severity = warning
csharp_style_prefer_null_check_over_type_check = true
dotnet_diagnostic.IDE0150.severity = warning
csharp_style_conditional_delegate_call = true
dotnet_diagnostic.IDE1005.severity = warning
csharp_style_var_for_built_in_types = true
csharp_style_var_when_type_is_apparent = true
csharp_style_var_elsewhere = true
dotnet_diagnostic.IDE0007.severity = warning
dotnet_diagnostic.IDE0008.severity = warning
dotnet_diagnostic.IDE0001.severity = warning
dotnet_diagnostic.IDE0002.severity = warning
dotnet_diagnostic.IDE0004.severity = warning
dotnet_diagnostic.IDE0005.severity = warning
dotnet_diagnostic.IDE0035.severity = warning
dotnet_diagnostic.IDE0051.severity = warning
dotnet_diagnostic.IDE0052.severity = warning
csharp_style_unused_value_expression_statement_preference = discard_variable
dotnet_diagnostic.IDE0058.severity = warning
csharp_style_unused_value_assignment_preference = discard_variable
dotnet_diagnostic.IDE0059.severity = warning

indent_style = space
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_new_line_before_open_brace = types, object_collection, methods, control_blocks, lambdas
dotnet_sort_system_directives_first = true
csharp_space_between_method_declaration_parameter_list_parentheses = true
5 changes: 4 additions & 1 deletion managed/managed.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.6" />
<PackageReference Include="MySqlConnector" Version="2.4.0" />
<PackageReference Include="Npgsql" Version="9.0.3" />
<PackageReference Include="Spectre.Console" Version="0.51.1" />
<PackageReference Include="System.Data.SQLite" Version="2.0.2" />
<PackageReference Include="Tomlyn" Version="0.17.0" />
<PackageReference Include="Tomlyn.Extensions.Configuration" Version="1.0.6" />

</ItemGroup>

Expand All @@ -63,5 +66,5 @@
<Compile Remove="**\bin\**\*.cs" />
</ItemGroup>


</Project>
25 changes: 20 additions & 5 deletions managed/src/SwiftlyS2.Core/Modules/Engine/EngineService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
using SwiftlyS2.Shared.Services;
using SwiftlyS2.Core.Extensions;
using SwiftlyS2.Shared.Natives;
using SwiftlyS2.Shared.SchemaDefinitions;

namespace SwiftlyS2.Core.Services;

internal class EngineService : IEngineService
{
private readonly CommandTrackerManager _commandTrackedManager;

public EngineService(CommandTrackerManager commandTrackedManager)
public EngineService( CommandTrackerManager commandTrackedManager )
{
this._commandTrackedManager = commandTrackedManager;
}
Expand All @@ -27,25 +28,39 @@ public EngineService(CommandTrackerManager commandTrackedManager)

public int TickCount => GlobalVars.TickCount;

public void ExecuteCommand(string command)
public void ExecuteCommand( string command )
{
NativeEngineHelpers.ExecuteCommand(command);
}

public void ExecuteCommandWithBuffer(string command, Action<string> bufferCallback)
public void ExecuteCommandWithBuffer( string command, Action<string> bufferCallback )
{
_commandTrackedManager.EnqueueCommand(bufferCallback);
NativeEngineHelpers.ExecuteCommand($"^wb^{command}");
}

public bool IsMapValid(string map)
public bool IsMapValid( string map )
{
return NativeEngineHelpers.IsMapValid(map);
}

public nint? FindGameSystemByName(string name)
public nint? FindGameSystemByName( string name )
{
var handle = NativeEngineHelpers.FindGameSystemByName(name);
return handle == nint.Zero ? null : handle;
}

public void DispatchParticleEffect( string particleName, ParticleAttachment_t attachmentType, byte attachmentPoint, CUtlSymbolLarge attachmentName, CRecipientFilter filter, bool resetAllParticlesOnEntity = false, int splitScreenSlot = 0, CBaseEntity? entity = null )
{
GameFunctions.DispatchParticleEffect(
particleName,
(uint)attachmentType,
entity?.Address ?? 0,
attachmentPoint,
attachmentName,
resetAllParticlesOnEntity,
splitScreenSlot,
filter
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,33 @@

namespace SwiftlyS2.Core.Events;

[Obsolete("OnEntityTouchHookEvent is deprecated. Use OnEntityStartTouchEvent, OnEntityTouchEvent, or OnEntityEndTouchEvent instead.")]
internal class OnEntityTouchHookEvent : IOnEntityTouchHookEvent
{
public required CBaseEntity Entity { get; init; }

public required CBaseEntity OtherEntity { get; init; }

public required EntityTouchType TouchType { get; init; }
}

internal class OnEntityStartTouchEvent : IOnEntityStartTouchEvent
{
public required CBaseEntity Entity { get; init; }

public required CBaseEntity OtherEntity { get; init; }
}

internal class OnEntityTouchEvent : IOnEntityTouchEvent
{
public required CBaseEntity Entity { get; init; }

public required CBaseEntity OtherEntity { get; init; }
}

internal class OnEntityEndTouchEvent : IOnEntityEndTouchEvent
{
public required CBaseEntity Entity { get; init; }

public required CBaseEntity OtherEntity { get; init; }
}
55 changes: 55 additions & 0 deletions managed/src/SwiftlyS2.Core/Modules/Events/EventPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ public static void OnPrecacheResource(nint pResourceManifest)
}
}

[Obsolete("InvokeOnEntityTouchHook is deprecated. Use InvokeOnEntityStartTouch, InvokeOnEntityTouch, or InvokeOnEntityEndTouch instead.")]
public static void InvokeOnEntityTouchHook(OnEntityTouchHookEvent @event)
{
if (_subscribers.Count == 0) return;
Expand All @@ -531,6 +532,60 @@ public static void InvokeOnEntityTouchHook(OnEntityTouchHookEvent @event)
}
}

public static void InvokeOnEntityStartTouch(OnEntityStartTouchEvent @event)
{
if (_subscribers.Count == 0) return;
try
{
foreach (var subscriber in _subscribers)
{
subscriber.InvokeOnEntityStartTouch(@event);
}
return;
}
catch (Exception e)
{
AnsiConsole.WriteException(e);
return;
}
}

public static void InvokeOnEntityTouch(OnEntityTouchEvent @event)
{
if (_subscribers.Count == 0) return;
try
{
foreach (var subscriber in _subscribers)
{
subscriber.InvokeOnEntityTouch(@event);
}
return;
}
catch (Exception e)
{
AnsiConsole.WriteException(e);
return;
}
}

public static void InvokeOnEntityEndTouch(OnEntityEndTouchEvent @event)
{
if (_subscribers.Count == 0) return;
try
{
foreach (var subscriber in _subscribers)
{
subscriber.InvokeOnEntityEndTouch(@event);
}
return;
}
catch (Exception e)
{
AnsiConsole.WriteException(e);
return;
}
}

public static void InvokeOnCanAcquireHook(OnItemServicesCanAcquireHookEvent @event)
{
if (_subscribers.Count == 0) return;
Expand Down
58 changes: 58 additions & 0 deletions managed/src/SwiftlyS2.Core/Modules/Events/EventSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
public event EventDelegates.OnConVarCreated? OnConVarCreated;
public event EventDelegates.OnEntityTakeDamage? OnEntityTakeDamage;
public event EventDelegates.OnPrecacheResource? OnPrecacheResource;
public event EventDelegates.OnEntityTouchHook? OnEntityTouchHook;

Check warning on line 49 in managed/src/SwiftlyS2.Core/Modules/Events/EventSubscriber.cs

View workflow job for this annotation

GitHub Actions / managed

'EventDelegates.OnEntityTouchHook' is obsolete: 'OnEntityTouchHook is deprecated. Use OnEntityStartTouch, OnEntityTouch, or OnEntityEndTouch instead.'

Check warning on line 49 in managed/src/SwiftlyS2.Core/Modules/Events/EventSubscriber.cs

View workflow job for this annotation

GitHub Actions / managed

'EventDelegates.OnEntityTouchHook' is obsolete: 'OnEntityTouchHook is deprecated. Use OnEntityStartTouch, OnEntityTouch, or OnEntityEndTouch instead.'

Check warning on line 49 in managed/src/SwiftlyS2.Core/Modules/Events/EventSubscriber.cs

View workflow job for this annotation

GitHub Actions / managed

'EventDelegates.OnEntityTouchHook' is obsolete: 'OnEntityTouchHook is deprecated. Use OnEntityStartTouch, OnEntityTouch, or OnEntityEndTouch instead.'

Check warning on line 49 in managed/src/SwiftlyS2.Core/Modules/Events/EventSubscriber.cs

View workflow job for this annotation

GitHub Actions / managed

'EventDelegates.OnEntityTouchHook' is obsolete: 'OnEntityTouchHook is deprecated. Use OnEntityStartTouch, OnEntityTouch, or OnEntityEndTouch instead.'

Check warning on line 49 in managed/src/SwiftlyS2.Core/Modules/Events/EventSubscriber.cs

View workflow job for this annotation

GitHub Actions / nuget

'EventDelegates.OnEntityTouchHook' is obsolete: 'OnEntityTouchHook is deprecated. Use OnEntityStartTouch, OnEntityTouch, or OnEntityEndTouch instead.'

Check warning on line 49 in managed/src/SwiftlyS2.Core/Modules/Events/EventSubscriber.cs

View workflow job for this annotation

GitHub Actions / nuget

'EventDelegates.OnEntityTouchHook' is obsolete: 'OnEntityTouchHook is deprecated. Use OnEntityStartTouch, OnEntityTouch, or OnEntityEndTouch instead.'
public event EventDelegates.OnEntityStartTouch? OnEntityStartTouch;
public event EventDelegates.OnEntityTouch? OnEntityTouch;
public event EventDelegates.OnEntityEndTouch? OnEntityEndTouch;
public event EventDelegates.OnItemServicesCanAcquireHook? OnItemServicesCanAcquireHook;
public event EventDelegates.OnWeaponServicesCanUseHook? OnWeaponServicesCanUseHook;
public event EventDelegates.OnConsoleOutput? OnConsoleOutput;
Expand Down Expand Up @@ -344,6 +347,7 @@
}
}

[Obsolete("InvokeOnEntityTouchHook is deprecated. Use InvokeOnEntityStartTouch, InvokeOnEntityTouch, or InvokeOnEntityEndTouch instead.")]
public void InvokeOnEntityTouchHook(OnEntityTouchHookEvent @event)
{
try
Expand All @@ -362,6 +366,60 @@
}
}

public void InvokeOnEntityStartTouch(OnEntityStartTouchEvent @event)
{
try
{
if (OnEntityStartTouch == null) return;
_Profiler.StartRecording("Event::OnEntityStartTouch");
OnEntityStartTouch?.Invoke(@event);
}
catch (Exception e)
{
_Logger.LogError(e, "Error invoking OnEntityStartTouch.");
}
finally
{
_Profiler.StopRecording("Event::OnEntityStartTouch");
}
}

public void InvokeOnEntityTouch(OnEntityTouchEvent @event)
{
try
{
if (OnEntityTouch == null) return;
_Profiler.StartRecording("Event::OnEntityTouch");
OnEntityTouch?.Invoke(@event);
}
catch (Exception e)
{
_Logger.LogError(e, "Error invoking OnEntityTouch.");
}
finally
{
_Profiler.StopRecording("Event::OnEntityTouch");
}
}

public void InvokeOnEntityEndTouch(OnEntityEndTouchEvent @event)
{
try
{
if (OnEntityEndTouch == null) return;
_Profiler.StartRecording("Event::OnEntityEndTouch");
OnEntityEndTouch?.Invoke(@event);
}
catch (Exception e)
{
_Logger.LogError(e, "Error invoking OnEntityEndTouch.");
}
finally
{
_Profiler.StopRecording("Event::OnEntityEndTouch");
}
}

public void InvokeOnItemServicesCanAcquireHook(OnItemServicesCanAcquireHookEvent @event)
{
try
Expand Down
Loading
Loading