⚙️ Add AllowedTeam and bump to 0.1.1

Restrict flashlight by CT/T/Any via config, drop tracked docs, and
ship the 0.1.1 version bump.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Tobias Thiele 2026-07-21 07:34:09 +02:00
parent 6f46cee3c1
commit c7779740c7
8 changed files with 73 additions and 212 deletions

View file

@ -11,6 +11,12 @@ public class FlashlightConfig : BasePluginConfig
[JsonPropertyName("AllowUseKey")]
public bool AllowUseKey { get; set; } = true;
/// <summary>
/// Which team may use the flashlight: Any, CT, or T.
/// </summary>
[JsonPropertyName("AllowedTeam")]
public string AllowedTeam { get; set; } = "Any";
[JsonPropertyName("ToggleCooldownSeconds")]
public float ToggleCooldownSeconds { get; set; } = 0.25f;
@ -97,5 +103,17 @@ public class FlashlightConfig : BasePluginConfig
{
LightCookie = "materials/effects/lightcookies/flashlight.vtex";
}
AllowedTeam = NormalizeAllowedTeam(AllowedTeam);
}
public static string NormalizeAllowedTeam(string? value)
{
return value?.Trim().ToUpperInvariant() switch
{
"T" or "TERRORIST" or "TERRORISTS" => "T",
"CT" or "COUNTERTERRORIST" or "COUNTERTERRORISTS" or "COUNTER-TERRORIST" or "COUNTER-TERRORISTS" => "CT",
_ => "Any"
};
}
}