Added a /setghosttheme command to set the theme and color of the players ghost. #888

Merged
EchoOfNothing merged 3 commits from QuillTheCreature/Byrd:commands/setghosttheme into master 2026-09-03 08:57:51 +00:00
Contributor

Short description

I added a /setghosttheme <theme> [color] command which allows a player to change their ghost theme or color via a command.

The command should take care already of all edge case:

  • Resets color to white if the theme isn't colorizable
  • Theme and Category Permission checks
  • Shell check if it's a player

It also auto completes ghost themes the user can equip and colors if it's colorizeable.

Why we need to add this

Exec file automation.

(Setting stuff commands is also faster than via a gui)

Media (Video/Screenshots)

Checklist

  • I do not require assistance to complete the PR.
  • I have verified that the changes work before posting/requesting review of my PR.
  • I have added screenshots/videos of the changes, or this PR does not change in-game mechanics.
  • I have read the [Pull Request and Changelog Guidelines][guidelines] and [Byrd Station's Contributor Ruleset][ruleset].

Ingame Changelog

🆑 Quill

  • add: Added a /setghosttheme command
## Short description I added a `/setghosttheme <theme> [color]` command which allows a player to change their ghost theme or color via a command. The command should take care already of all edge case: * Resets color to white if the theme isn't colorizable * Theme and Category Permission checks * Shell check if it's a player It also auto completes ghost themes the user can equip and colors if it's colorizeable. ## Why we need to add this Exec file automation. (Setting stuff commands is also faster than via a gui) ## Media (Video/Screenshots) <video src="/attachments/ef11f435-2695-42b8-b6a3-bb810b82435c" title="Screencast_20260831_155746" controls></video> ## Checklist <!-- Check boxes for faster reviewing of your PR --> - [x] I do not require assistance to complete the PR. - [x] I have verified that the changes work before posting/requesting review of my PR. - [x] I have added screenshots/videos of the changes, or this PR does not change in-game mechanics. - [x] I have read the [Pull Request and Changelog Guidelines][guidelines] and [Byrd Station's Contributor Ruleset][ruleset]. ### Ingame Changelog :cl: Quill - add: Added a /setghosttheme command
Added a /setghosttheme command to set the theme and color of the players ghost.
Some checks failed
Close PRs on master / run (pull_request_target) Has been skipped
Labels: PR / labeler (pull_request_target) Successful in 1m2s
Labels: Size / size-label (pull_request_target) Failing after 1m2s
RSI Validator / Validate RSIs (pull_request) Successful in 2m49s
CRLF Check / CRLF Check (pull_request) Successful in 4m53s
RGA schema validator / YAML RGA schema validator (pull_request) Successful in 4m36s
Map file schema validator / YAML map schema validator (pull_request) Successful in 8m31s
YAML Linter / YAML Linter (pull_request) Successful in 8m4s
Test Packaging / Test Packaging (pull_request) Successful in 18m11s
7a234090af
EchoOfNothing requested changes 2026-08-31 16:54:27 +00:00
Dismissed
@ -0,0 +15,4 @@
/// This command ensures the player has permissions to use the ghost theme.
/// </remarks>
[AnyCommand]
public sealed class SetGhostThemeCommand : LocalizedCommands
Member

Judging by the ftl file this is a byrd change, so why is this in Content.Omu.Server/Commands/ and not /Content.Server/_Byrd/Commands/?

Judging by the ftl file this is a byrd change, so why is this in `Content.Omu.Server/Commands/` and not `/Content.Server/_Byrd/Commands/`?
QuillTheCreature marked this conversation as resolved
@ -0,0 +113,4 @@
/// <returns>A <see cref="CompletionResult"/> that includes all allowed ghost themes and if they're colorizable or not.</returns>
private CompletionResult GenerateThemeCompletionOptionsOrThrow(AdminData? adminData, List<GhostThemePrototype> themes, List<GhostThemeCategoryPrototype> categories)
{
return CompletionResult.FromOptions(themes
Member

Would be nice if you could change this to use a utility function in Content.Shared/_Byrd/GhostTheme/SharedGhostThemesSystem.cs that returns all themes that are available to a session. (i.e. Params: ICommonSession, Returns: List<GhostThemePrototype>)

Would be nice if you could change this to use a utility function in `Content.Shared/_Byrd/GhostTheme/SharedGhostThemesSystem.cs` that returns all themes that are available to a session. (i.e. Params: `ICommonSession`, Returns: `List<GhostThemePrototype>`)
QuillTheCreature marked this conversation as resolved
@ -0,0 +199,4 @@
/// <param name="requirements">The list of required admin flags.</param>
/// <param name="adminData">The admin data of the user attempting to equip the theme.</param>
/// <exception cref="InvalidOperationException">Thrown if the admin data does not have the proper permissions.</exception>
private void ForceProperPermissionsOrThrow(List<AdminFlags>? requirements, AdminData? adminData)
Member

Permission check should be performed by a utility function in Content.Shared/_Byrd/GhostTheme/SharedGhostThemesSystem.cs to avoid code duplication.

Permission check should be performed by a utility function in `Content.Shared/_Byrd/GhostTheme/SharedGhostThemesSystem.cs` to avoid code duplication.
QuillTheCreature marked this conversation as resolved
Moved fetching ghost themes and permission checks into the shared ghost theme system.
All checks were successful
Labels: PR / labeler (pull_request_target) Successful in 1m3s
Labels: Size / size-label (pull_request_target) Successful in 1m4s
CRLF Check / CRLF Check (pull_request) Successful in 3m3s
RGA schema validator / YAML RGA schema validator (pull_request) Successful in 3m30s
RSI Validator / Validate RSIs (pull_request) Successful in 3m36s
Map file schema validator / YAML map schema validator (pull_request) Successful in 9m23s
YAML Linter / YAML Linter (pull_request) Successful in 8m54s
Test Packaging / Test Packaging (pull_request) Successful in 18m40s
6a763dd75d
EchoOfNothing requested changes 2026-09-01 19:47:14 +00:00
Dismissed
@ -61,4 +62,0 @@
themes.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.Ordinal));
categories.AddRange(_prototypeManager.EnumeratePrototypes<GhostThemeCategoryPrototype>());
categories = categories.OrderBy(category => category.Priority).ToList();
Member

Categories are no longer in correct order.

Categories are no longer in correct order.
QuillTheCreature marked this conversation as resolved
@ -0,0 +114,4 @@
{
var sharedGhostThemesSystem = _entitySystemManager.GetEntitySystem<SharedGhostThemesSystem>();
return CompletionResult.FromOptions(sharedGhostThemesSystem.GetAvailableGhostThemes(session)
Member

This shows even themes that the player cannot equip.

This shows even themes that the player cannot equip.
QuillTheCreature marked this conversation as resolved
@ -14,0 +26,4 @@
/// <param name="session">The session of the user to check if they can be equipped.</param>
/// <returns>A list of tuples containing the ghost theme, its optional category, and if it can be equipped.</returns>
public List<(GhostThemePrototype theme, GhostThemeCategoryPrototype? category, bool canEquip)>
GetAvailableGhostThemes(ICommonSession session)
Member

I feel like function with the name GetAvailableGhostThemes should only return themes that the player can equip (available to equip). GetAllGhostThemes would be better suited to a function that returns all ghost themes.

I feel like function with the name `GetAvailableGhostThemes` should only return themes that the player can equip (available to equip). `GetAllGhostThemes` would be better suited to a function that returns all ghost themes.
QuillTheCreature marked this conversation as resolved
@ -0,0 +7,4 @@
cmd-setghosttheme-error-themenotcolorizeable = The theme '{ $themeId }' is not colorizeable.
cmd-setghosttheme-error-couldnotconverttocolor = Could not convert '{ $color }' to a color.
cmd-setghosttheme-error-mustbeadmin = You must be an admin to use this theme.
Member

cmd-setghosttheme-error-mustbeadmin is no longer used.

`cmd-setghosttheme-error-mustbeadmin` is no longer used.
QuillTheCreature marked this conversation as resolved
@ -0,0 +8,4 @@
cmd-setghosttheme-error-couldnotconverttocolor = Could not convert '{ $color }' to a color.
cmd-setghosttheme-error-mustbeadmin = You must be an admin to use this theme.
cmd-setghosttheme-error-nopermissions = You do not have permissions to use this theme.
Member

cmd-setghosttheme-error-nopermissions is no longer used.

`cmd-setghosttheme-error-nopermissions` is no longer used.
QuillTheCreature marked this conversation as resolved
Added some more checks to the ghost theme command
All checks were successful
Labels: PR / labeler (pull_request_target) Successful in 4s
Labels: Size / size-label (pull_request_target) Successful in 3s
CRLF Check / CRLF Check (pull_request) Successful in 2m17s
RGA schema validator / YAML RGA schema validator (pull_request) Successful in 2m42s
RSI Validator / Validate RSIs (pull_request) Successful in 3m52s
Map file schema validator / YAML map schema validator (pull_request) Successful in 10m17s
YAML Linter / YAML Linter (pull_request) Successful in 9m28s
Test Packaging / Test Packaging (pull_request) Successful in 21m31s
PR Changelogs / changelog (pull_request_target) Successful in 1m10s
0d00e9516b
EchoOfNothing left a comment

LGTM. Thank you for your contribution!

LGTM. Thank you for your contribution!
byrdbot referenced this pull request from a commit 2026-09-03 08:59:01 +00:00
Sign in to join this conversation.
No description provided.