feat: Panorama skill HUD and menu, CSS 1.0.375
- Skill card and W/S/E target menu drawn as CCSCustomHudLayout panels via PanoramaManager (panorama/ sources), replacing PrintToCenterHtml and WASDMenuAPI; WASDMenuAPI.dll dropped - Custom status lines (cooldowns, charges) overwrite the description on the card; Medic keeps its description with the charge count below - css_setoverride toggles a per-player cooldown bypass - YourSkillChatInfo also gates the round-start skill description in chat - Language: "[css_useSkill]" becomes the configured button name, "Press ... key" wording, welcome message trimmed to its first line - Build against CounterStrikeSharp.API 1.0.375
This commit is contained in:
parent
20dafd2a7c
commit
793370a55f
37 changed files with 1076 additions and 415 deletions
|
|
@ -37,6 +37,7 @@ namespace src.command
|
|||
var commands = new Dictionary<IEnumerable<string>, (string description, CommandInfo.CommandCallback handler)>
|
||||
{
|
||||
{ SplitCommands(config.NormalCommands.SetSkillCommand.Alias), ("Set skill", Command_SetSkill) },
|
||||
{ SplitCommands(config.NormalCommands.SetOverrideCommand.Alias), ("Toggle cooldown bypass", Command_SetOverride) },
|
||||
{ SplitCommands(config.NormalCommands.SkillsListCommand.Alias), ("Delete all records", Command_SkillsListMenu) },
|
||||
{ SplitCommands(config.NormalCommands.UseSkillCommand.Alias), ("Use/Type skill", Command_UseTypeSkill) },
|
||||
{ SplitCommands(config.NormalCommands.ConsoleCommand.Alias), ("Console command", Command_CustomCommand) },
|
||||
|
|
@ -101,6 +102,38 @@ namespace src.command
|
|||
}
|
||||
|
||||
[CommandHelper(minArgs: 0, whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
|
||||
private static void Command_SetOverride(CCSPlayerController? player, CommandInfo command)
|
||||
{
|
||||
Debug.WriteToDebug($"Player {player?.PlayerName} used the css_setoverride {command.ArgString} command.");
|
||||
if (!string.IsNullOrEmpty(config.NormalCommands.SetOverrideCommand.Permissions) && !AdminManager.PlayerHasPermissions(player, config.NormalCommands.SetOverrideCommand.Permissions)) return;
|
||||
|
||||
void Reply(string message)
|
||||
{
|
||||
if (player == null) Server.PrintToConsole(message);
|
||||
else SkillUtils.PrintToChat(player, message);
|
||||
}
|
||||
|
||||
if (command.ArgCount < 2)
|
||||
{
|
||||
Reply("Usage: css_setoverride <name or steamid64>");
|
||||
return;
|
||||
}
|
||||
|
||||
var targetPlayer = Utilities.GetPlayers().FirstOrDefault(p => p != null && p.IsValid
|
||||
&& (p.SteamID.ToString().Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase)
|
||||
|| p.PlayerName.Equals(command.GetArg(1), StringComparison.OrdinalIgnoreCase)));
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
Reply(player == null
|
||||
? Localization.GetTranslationWithoutIlliterate("player_not_found_setskill")
|
||||
: player.GetTranslationWithoutIlliterate("player_not_found_setskill"));
|
||||
return;
|
||||
}
|
||||
|
||||
bool enabled = CooldownOverride.Toggle(targetPlayer);
|
||||
Reply($"Cooldown override {(enabled ? $"{ChatColors.Lime}ON" : $"{ChatColors.LightRed}OFF")}{ChatColors.Default} for {ChatColors.LightRed}\u202A{targetPlayer.PlayerName}\u202C");
|
||||
}
|
||||
|
||||
private static void Command_SetSkill(CCSPlayerController? player, CommandInfo command)
|
||||
{
|
||||
Debug.WriteToDebug($"Player {player?.PlayerName} used the css_setskill {command.ArgString} command.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue