mirror of
https://github.com/creazy231/cs2-css-flashlight.git
synced 2026-09-27 20:17:04 +02:00
⚙️ 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:
parent
6f46cee3c1
commit
c7779740c7
8 changed files with 73 additions and 212 deletions
|
|
@ -121,4 +121,32 @@ public class FlashlightLogicTests
|
|||
Assert.Equal("axis_of_intent", config.AttachmentName);
|
||||
Assert.Equal("materials/effects/lightcookies/flashlight.vtex", config.LightCookie);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Any", 2, true)]
|
||||
[InlineData("Any", 3, true)]
|
||||
[InlineData("Any", 1, true)]
|
||||
[InlineData("T", 2, true)]
|
||||
[InlineData("T", 3, false)]
|
||||
[InlineData("CT", 3, true)]
|
||||
[InlineData("CT", 2, false)]
|
||||
public void IsTeamAllowed_RespectsConfiguredSide(string allowedTeam, byte team, bool expected)
|
||||
{
|
||||
Assert.Equal(expected, FlashlightLogic.IsTeamAllowed(allowedTeam, team));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("t", "T")]
|
||||
[InlineData("Terrorist", "T")]
|
||||
[InlineData("ct", "CT")]
|
||||
[InlineData("CounterTerrorist", "CT")]
|
||||
[InlineData("any", "Any")]
|
||||
[InlineData("something-else", "Any")]
|
||||
[InlineData(null, "Any")]
|
||||
public void ConfigClamp_NormalizesAllowedTeam(string? input, string expected)
|
||||
{
|
||||
var config = new FlashlightConfig { AllowedTeam = input! };
|
||||
config.Clamp();
|
||||
Assert.Equal(expected, config.AllowedTeam);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue