mirror of
https://github.com/edgegamers/Jailbreak.git
synced 2025-12-06 04:42:57 -08:00
Hardcode our behavior for now
This commit is contained in:
5
mod/Gangs.BaseImpl/GangCommandManager.cs
Normal file
5
mod/Gangs.BaseImpl/GangCommandManager.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Gangs.BaseImpl;
|
||||
|
||||
public class GangCommandManager {
|
||||
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
using GangsAPI.Services;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using GangsAPI.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Gangs.BombIconPerk;
|
||||
|
||||
public class BombIconBootstrap {
|
||||
public BombIconBootstrap(IServiceProvider collection) {
|
||||
new BombIconCommand(collection).Start();
|
||||
public BombIconBootstrap(IServiceProvider collection, BasePlugin plugin) {
|
||||
new BombIconCommand(collection, plugin).Start();
|
||||
collection.GetRequiredService<IPerkManager>()
|
||||
.Perks.Add(new BombPerk(collection));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Commands;
|
||||
using GangsAPI;
|
||||
using GangsAPI.Data;
|
||||
using GangsAPI.Data.Command;
|
||||
@@ -14,10 +15,12 @@ using GangsAPI.Services.Menu;
|
||||
using GangsAPI.Services.Player;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Gangs.BombIconPerk;
|
||||
|
||||
public class BombIconCommand(IServiceProvider provider) : ICommand {
|
||||
public class BombIconCommand(IServiceProvider provider, BasePlugin plugin)
|
||||
: ICommand {
|
||||
private readonly IEcoManager eco = provider.GetRequiredService<IEcoManager>();
|
||||
|
||||
private readonly IGangChatPerk? gangChat =
|
||||
@@ -40,16 +43,19 @@ public class BombIconCommand(IServiceProvider provider) : ICommand {
|
||||
|
||||
private readonly IRankManager ranks =
|
||||
provider.GetRequiredService<IRankManager>();
|
||||
|
||||
|
||||
private readonly ICommandManager commands =
|
||||
provider.GetRequiredService<ICommandManager>();
|
||||
|
||||
public string Name => "css_bombicon";
|
||||
public string[] Usage => ["<icon>"];
|
||||
|
||||
public void Start(BasePlugin? plugin, bool hotReload) {
|
||||
Server.PrintToConsole("Registering Bomb Icon Command");
|
||||
Server.PrintToConsole("Registered: " + commands.RegisterCommand(this));
|
||||
public void Start() {
|
||||
plugin.AddCommand("css_bombicon", "", (player, info) => {
|
||||
var playerWrapper = player == null ? null : new PlayerWrapper(player);
|
||||
var infoWrapper = new CommandInfoWrapper(info);
|
||||
Task.Run(async () => await Execute(playerWrapper, infoWrapper));
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<CommandResult> Execute(PlayerWrapper? executor,
|
||||
|
||||
@@ -24,6 +24,6 @@ public class GangsInit : IPluginBehavior {
|
||||
services, services == null, API.Gangs, API.Gangs == null);
|
||||
if (services == null) return;
|
||||
|
||||
_ = new BombIconBootstrap(services);
|
||||
_ = new BombIconBootstrap(services, basePlugin);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user