-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into map-testing
- Loading branch information
Showing
13 changed files
with
168 additions
and
51 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
Content.Server/DeltaV/Administration/Commands/AnnounceCustomCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Content.Server.Chat.Systems; | ||
using Content.Shared.Administration; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Console; | ||
using Robust.Shared.ContentPack; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Administration.Commands; | ||
|
||
[AdminCommand(AdminFlags.Fun)] | ||
public sealed class AnnounceCustomCommand : IConsoleCommand | ||
{ | ||
[Dependency] private readonly IPrototypeManager _protoManager = default!; | ||
[Dependency] private readonly IResourceManager _res = default!; | ||
|
||
public string Command => "announcecustom"; | ||
public string Description => Loc.GetString("cmd-announcecustom-desc"); | ||
public string Help => Loc.GetString("cmd-announcecustom-help", ("command", Command)); | ||
|
||
public void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
var chat = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ChatSystem>(); | ||
|
||
switch (args.Length) | ||
{ | ||
case 0: | ||
shell.WriteError(Loc.GetString("shell-need-minimum-one-argument")); | ||
return; | ||
case > 4: | ||
shell.WriteError(Loc.GetString("shell-wrong-arguments-number")); | ||
return; | ||
} | ||
|
||
var message = args[0]; | ||
var sender = "Central Command"; | ||
var color = Color.Gold; | ||
var sound = new SoundPathSpecifier("/Audio/Announcements/announce.ogg"); | ||
|
||
// Optional sender argument | ||
if (args.Length >= 2) | ||
sender = args[1]; | ||
|
||
// Optional color argument | ||
if (args.Length >= 3) | ||
{ | ||
try | ||
{ | ||
color = Color.FromHex(args[2]); | ||
} | ||
catch | ||
{ | ||
shell.WriteError(Loc.GetString("shell-invalid-color-hex")); | ||
return; | ||
} | ||
} | ||
|
||
// Optional sound argument | ||
if (args.Length >= 4) | ||
sound = new SoundPathSpecifier(args[3]); | ||
|
||
chat.DispatchGlobalAnnouncement(message, sender, true, sound, color); | ||
shell.WriteLine(Loc.GetString("shell-command-success")); | ||
} | ||
|
||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args) | ||
{ | ||
return args.Length switch | ||
{ | ||
1 => CompletionResult.FromHint(Loc.GetString("cmd-announcecustom-arg-message")), | ||
2 => CompletionResult.FromHint(Loc.GetString("shell-argument-username-optional-hint")), | ||
3 => CompletionResult.FromHint(Loc.GetString("cmd-announcecustom-arg-color")), | ||
4 => CompletionResult.FromHintOptions( | ||
CompletionHelper.AudioFilePath(args[3], _protoManager, _res), | ||
Loc.GetString("cmd-announcecustom-arg-sound") | ||
), | ||
_ => CompletionResult.Empty | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Resources/Locale/en-US/deltav/administration/commands/announce-custom.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## AnnounceCustomCommand | ||
cmd-announcecustom-desc = Send an in-game announcement with custom color and sound. | ||
cmd-announcecustom-help = {$command} <message> [sender] [color] [sound] - Send announcement. Sender defaults to CentCom, color to Gold, sound to announce.ogg | ||
# Completion hints | ||
cmd-announcecustom-arg-message = message | ||
cmd-announcecustom-arg-color = color in #RRGGBB format (optional) | ||
cmd-announcecustom-arg-sound = sound path (optional) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- type: technology | ||
id: SyringeGun | ||
name: research-technology-syringe-gun | ||
icon: | ||
sprite: Objects/Weapons/Guns/Cannons/syringe_gun.rsi | ||
state: syringe_gun | ||
discipline: CivilianServices | ||
tier: 2 | ||
cost: 10000 | ||
recipeUnlocks: | ||
- LauncherSyringe | ||
- MiniSyringe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Resources/ServerInfo/Guidebook/DeltaV/Rules/RoleRules/C3_Antags.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters