Merge pull request #2943 from sgkoishi/dump-commands

Fix dump-reference-data mutate command name
This commit is contained in:
Lucas Nicodemus 2025-01-25 21:34:44 +09:00 committed by GitHub
commit 2755450277
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 13 deletions

View file

@ -529,18 +529,9 @@ namespace TShockAPI
field.GetCustomAttributes(false).FirstOrDefault(o => o is DescriptionAttribute) as DescriptionAttribute; field.GetCustomAttributes(false).FirstOrDefault(o => o is DescriptionAttribute) as DescriptionAttribute;
var desc = descattr != null && !string.IsNullOrWhiteSpace(descattr.Description) ? descattr.Description : GetString("No description available."); var desc = descattr != null && !string.IsNullOrWhiteSpace(descattr.Description) ? descattr.Description : GetString("No description available.");
var commands = GetCommands(name); var strs = GetCommands(name).Select(c => c.Names.Count > 1
foreach (var c in commands) ? $"/{c.Name} (/{string.Join(" /", c.Names.Skip(1))})"
{ : $"/{c.Name}");
for (var i = 0; i < c.Names.Count; i++)
{
c.Names[i] = "/" + c.Names[i];
}
}
var strs =
commands.Select(
c =>
c.Name + (c.Names.Count > 1 ? " ({0})".SFormat(string.Join(" ", c.Names.ToArray(), 1, c.Names.Count - 1)) : ""));
sb.AppendLine($"## {name}"); sb.AppendLine($"## {name}");
sb.AppendLine($"{desc}"); sb.AppendLine($"{desc}");

View file

@ -78,7 +78,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
* If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. --> * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. -->
## Upcoming changes ## Upcoming changes
* You know the drill * Fixed `/dump-reference-data` mutate the command names. (#2943, @sgkoishi)
## TShock 5.2.1 ## TShock 5.2.1
* Updated `TSPlayer.GodMode`. (@AgaSpace) * Updated `TSPlayer.GodMode`. (@AgaSpace)