Skip to content

Commit

Permalink
Fix messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sailro committed Aug 31, 2024
1 parent ae3d72d commit 1c87004
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

# Disabled diagnostics
dotnet_diagnostic.CA1016.severity = none
dotnet_diagnostic.CA1824.severity = none

# C++ Files
[*.{cpp,h,in}]
curly_bracket_next_line = true
Expand Down
5 changes: 2 additions & 3 deletions ConsoleCommands/SpawnBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ private static string[] GetBotNames()
{
var filter = new[] { "test", "event", "spirit", "shooterbtr" };

return Enum
return [.. Enum
.GetNames(typeof(WildSpawnType))
.Where(n => !filter.Any(f => n.IndexOf(f, StringComparison.OrdinalIgnoreCase) >= 0))
.OrderBy(n => n)
.ToArray();
.OrderBy(n => n)];
}
}
2 changes: 1 addition & 1 deletion Features/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class Commands : FeatureRenderer
public override KeyCode Key { get; set; } = KeyCode.RightAlt;

private bool Registered { get; set; } = false;
private Dictionary<string, string> PropertyDisplays { get; } = new();
private Dictionary<string, string> PropertyDisplays { get; } = [];

protected override void Update()
{
Expand Down
2 changes: 2 additions & 0 deletions Features/Health.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ internal class Health : ToggleFeature

private static readonly Array _bodyParts = Enum.GetValues(typeof(EBodyPart));

#pragma warning disable IDE0060
[UsedImplicitly]
protected static bool ApplyDamagePrefix(EBodyPart bodyPart, ActiveHealthController? __instance, ref float __result)
{
Expand All @@ -44,6 +45,7 @@ protected static bool ReceiveDamagePrefix(float damage, EBodyPart part, EDamageT
{
return UseBuiltinDamageLogic(__instance, part);
}
#pragma warning restore IDE0060

protected static bool UseBuiltinDamageLogic(Player? player, EBodyPart bodyPart)
{
Expand Down
10 changes: 0 additions & 10 deletions Features/SceneDumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ public class NamedData
{
public string? Name;

[UsedImplicitly]
public NamedData()
{
}

public override string ToString()
{
return Name ?? string.Empty;
Expand Down Expand Up @@ -57,11 +52,6 @@ public class ComponentData
{
public string? Type;

[UsedImplicitly]
public ComponentData()
{
}

public override string ToString()
{
return Type ?? string.Empty;
Expand Down
2 changes: 1 addition & 1 deletion Installer/InstallCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private static async Task<CompilationResult> GetCompilationAsync(CompilationCont
.GetResources(context)
.ToArray();

if (compiler.IsLocalizationSupported() && !resources.Any())
if (compiler.IsLocalizationSupported() && resources.Length == 0)
{
AnsiConsole.MarkupLine($"[yellow]Warning: no localization support for language '{context.Language.EscapeMarkup()}'.[/]");
compilation = null;
Expand Down

0 comments on commit 1c87004

Please sign in to comment.