Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Sep 18, 2024
1 parent 2e03df0 commit 402a87b
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 34 deletions.
1 change: 0 additions & 1 deletion lang/Jailbreak.English/RTD/RTDLocale.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CounterStrikeSharp.API.Modules.Utils;
using Jailbreak.Formatting.Base;
using Jailbreak.Formatting.Logistics;
using Jailbreak.Formatting.Views;
using Jailbreak.Formatting.Views.RTD;
using Jailbreak.Public.Mod.RTD;

Expand Down
2 changes: 1 addition & 1 deletion mod/Gangs.BaseImpl/BasePerk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public abstract class BasePerk : BaseStat, IPerk {
}

public abstract class BasePerk<TV>(IServiceProvider provider)
: BasePerk(), IPerk, IStat<TV> {
: BasePerk, IPerk, IStat<TV> {
protected IServiceProvider Provider { get; } = provider;
public override Type ValueType => typeof(TV);
public abstract TV Value { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion mod/Gangs.BombIconPerk/BombIconBootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Gangs.BombIconPerk;

public class BombIconBootstrap {
public BombIconBootstrap(IServiceProvider collection, BasePlugin plugin) {
new BombIconCommand(collection, plugin).Start();
new BombIconCommand(collection).Start();
collection.GetRequiredService<IPerkManager>()
.Perks.Add(new BombPerk(collection));
}
Expand Down
15 changes: 5 additions & 10 deletions mod/Gangs.BombIconPerk/BombIconCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Commands;
using GangsAPI;
using GangsAPI;
using GangsAPI.Data;
using GangsAPI.Data.Command;
using GangsAPI.Exceptions;
Expand All @@ -15,12 +12,13 @@
using GangsAPI.Services.Player;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;

namespace Gangs.BombIconPerk;

public class BombIconCommand(IServiceProvider provider, BasePlugin plugin)
: ICommand {
public class BombIconCommand(IServiceProvider provider) : ICommand {
private readonly ICommandManager commands =
provider.GetRequiredService<ICommandManager>();

private readonly IEcoManager eco = provider.GetRequiredService<IEcoManager>();

private readonly IGangChatPerk? gangChat =
Expand All @@ -44,9 +42,6 @@ public class BombIconCommand(IServiceProvider provider, BasePlugin plugin)
private readonly IRankManager ranks =
provider.GetRequiredService<IRankManager>();

private readonly ICommandManager commands =
provider.GetRequiredService<ICommandManager>();

public string Name => "css_bombicon";
public string[] Usage => ["<icon>"];

Expand Down
7 changes: 2 additions & 5 deletions mod/Gangs.BombIconPerk/BombIconMenu.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
using CounterStrikeSharp.API.Modules.Commands;
using CounterStrikeSharp.API.Modules.Utils;
using GangsAPI.Data;
using GangsAPI.Exceptions;
using GangsAPI.Extensions;
using GangsAPI.Menu;
using GangsAPI.Services.Commands;
using GangsAPI.Services.Gang;
using GangsAPI.Services.Menu;
using Menu;
using Microsoft.Extensions.DependencyInjection;

namespace Gangs.BombIconPerk;

public class BombIconMenu(IServiceProvider provider, BombPerkData data)
: AbstractPagedMenu<BombIcon>(provider, NativeSenders.Chat, 7) {
: AbstractPagedMenu<BombIcon>(provider, NativeSenders.Chat) {
private readonly ICommandManager commands =
provider.GetRequiredService<ICommandManager>();

Expand Down
5 changes: 3 additions & 2 deletions mod/Gangs.BombIconPerk/BombPerk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ namespace Gangs.BombIconPerk;
public class BombPerk(IServiceProvider provider)
: BasePerk<BombPerkData>(provider) {
public const string STAT_ID = "jb_bomb_icon";
public override string StatId => STAT_ID;
public override string Name => "Bomb Icon";

private readonly IGangStatManager gangStats =
provider.GetRequiredService<IGangStatManager>();

public override string StatId => STAT_ID;
public override string Name => "Bomb Icon";

public override string? Description
=> "Customize the icon that is shown when you bomb a CT";

Expand Down
4 changes: 1 addition & 3 deletions mod/Gangs.Boostrap/GangsServiceExtension.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core;
using Gangs.BombIconPerk;
using Jailbreak.Public;
using Jailbreak.Public.Behaviors;
using Jailbreak.Public.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace Gangs.Boostrap;

Expand Down
2 changes: 1 addition & 1 deletion mod/Jailbreak.LastRequest/Jailbreak.LastRequest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<Reference Include="GangsAPI">
<HintPath>..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll</HintPath>
<HintPath>..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll</HintPath>
</Reference>
<Reference Include="MStatsShared">
<HintPath>..\..\public\Jailbreak.Public\Mixin\MStatsShared.dll</HintPath>
Expand Down
1 change: 0 additions & 1 deletion mod/Jailbreak.RTD/Rewards/CannotScope.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using Jailbreak.Public.Extensions;
using Jailbreak.Public.Mod.RTD;

namespace Jailbreak.RTD.Rewards;

Expand Down
4 changes: 2 additions & 2 deletions mod/Jailbreak.Rebel/C4Bomb/C4Behavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class C4Behavior(IC4Locale ic4Locale, IRebelService rebelService)

private readonly Dictionary<CC4, C4Metadata> bombs = new();

private readonly Dictionary<ulong, string> cachedBombIcons = new();

// EmitSound(CBaseEntity* pEnt, const char* sSoundName, int nPitch, float flVolume, float flDelay)
private readonly MemoryFunctionVoid<CBaseEntity, string, int, float, float>
// ReSharper disable once InconsistentNaming
Expand All @@ -49,8 +51,6 @@ private readonly MemoryFunctionVoid<CBaseEntity, string, int, float, float>

private readonly Dictionary<int, int> deathToKiller = new();

private readonly Dictionary<ulong, string> cachedBombIcons = new();

private bool giveNextRound = true;

private BasePlugin? plugin;
Expand Down
4 changes: 2 additions & 2 deletions mod/Jailbreak.Rebel/Jailbreak.Rebel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<ItemGroup>
<ProjectReference Include="..\..\public\Jailbreak.Formatting\Jailbreak.Formatting.csproj"/>
<ProjectReference Include="..\..\public\Jailbreak.Public\Jailbreak.Public.csproj"/>
<ProjectReference Include="..\Gangs.BombIconPerk\Gangs.BombIconPerk.csproj" />
<ProjectReference Include="..\Gangs.BombIconPerk\Gangs.BombIconPerk.csproj"/>
</ItemGroup>

<ItemGroup>
<Reference Include="GangsAPI">
<HintPath>..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll</HintPath>
<HintPath>..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll</HintPath>
</Reference>
<Reference Include="MStatsShared">
<HintPath>..\..\public\Jailbreak.Public\Mixin\MStatsShared.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions mod/Jailbreak.SpecialDay/SpecialDays/HideAndSeekDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public class HideAndSeekDay(BasePlugin plugin, IServiceProvider provider)
public static readonly FakeConVar<string> CV_GUARD_WEAPONS = new(
"jb_sd_hns_weapons_ct",
"List of weapons/items CTs may use, empty for no restrictions",
string.Join(",", Tag.PISTOLS.Union(Tag.UTILITY)),
ConVarFlags.FCVAR_NONE, new ItemValidator(allowMultiple: true));
string.Join(",", Tag.PISTOLS.Union(Tag.UTILITY)), ConVarFlags.FCVAR_NONE,
new ItemValidator(allowMultiple: true));

public static readonly FakeConVar<string> CV_PRISONER_WEAPONS = new(
"jb_sd_hns_weapons_t",
Expand Down
5 changes: 2 additions & 3 deletions mod/Jailbreak.SpecialDay/SpecialDays/NoScopeDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ public class NoScopeDay(BasePlugin plugin, IServiceProvider provider)
"jb_sd_noscope_allowedweapons",
"Weapons to allow players to use, empty for no restrictions",
string.Join(",",
Tag.UTILITY.Union(new[] { "weapon_ssg08", "weapon_knife" }
.ToHashSet())), ConVarFlags.FCVAR_NONE,
new ItemValidator(allowMultiple: true));
Tag.UTILITY.Union(new[] { "weapon_ssg08", "weapon_knife" }.ToHashSet())),
ConVarFlags.FCVAR_NONE, new ItemValidator(allowMultiple: true));

public static readonly FakeConVar<int> CV_KNIFE_DELAY = new(
"jb_sd_noscope_knife_delay",
Expand Down
Binary file modified public/Jailbreak.Public/Mixin/GangsAPI.dll
Binary file not shown.

0 comments on commit 402a87b

Please sign in to comment.