Added a /setghosttheme command to set the theme and color of the players ghost. #888
No reviewers
Labels
No labels
bug
Changes: Audio
Changes: Map
Changes: No C#
Changes: Sprites
Changes: UI
documentation
DON'T MERGE
duplicate
enhancement
good first issue
help wanted
holding to vote
invalid
question
size/L
size/M
size/S
size/XL
size/XS
S: Merge Conflict
S: Untriaged
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Byrd-Station/Byrd!888
Loading…
Reference in a new issue
No description provided.
Delete branch "QuillTheCreature/Byrd:commands/setghosttheme"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
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
Ingame Changelog
🆑 Quill
@ -0,0 +15,4 @@/// This command ensures the player has permissions to use the ghost theme./// </remarks>[AnyCommand]public sealed class SetGhostThemeCommand : LocalizedCommandsJudging by the ftl file this is a byrd change, so why is this in
Content.Omu.Server/Commands/and not/Content.Server/_Byrd/Commands/?@ -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(themesWould be nice if you could change this to use a utility function in
Content.Shared/_Byrd/GhostTheme/SharedGhostThemesSystem.csthat returns all themes that are available to a session. (i.e. Params:ICommonSession, Returns:List<GhostThemePrototype>)@ -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)Permission check should be performed by a utility function in
Content.Shared/_Byrd/GhostTheme/SharedGhostThemesSystem.csto avoid code duplication.@ -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();Categories are no longer in correct order.
@ -0,0 +114,4 @@{var sharedGhostThemesSystem = _entitySystemManager.GetEntitySystem<SharedGhostThemesSystem>();return CompletionResult.FromOptions(sharedGhostThemesSystem.GetAvailableGhostThemes(session)This shows even themes that the player cannot equip.
@ -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)I feel like function with the name
GetAvailableGhostThemesshould only return themes that the player can equip (available to equip).GetAllGhostThemeswould be better suited to a function that returns all ghost themes.@ -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.cmd-setghosttheme-error-mustbeadminis no longer used.@ -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.cmd-setghosttheme-error-nopermissionsis no longer used.LGTM. Thank you for your contribution!