Skip to content

Commit

Permalink
feat: add invsim_ws_print_full_url convar
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlucas committed Oct 20, 2024
1 parent 9e2fdb8 commit 5f8863e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ Submit a PR or open an issue if you happen to know a workaround for them.
* **Type:** `int`
* **Default:** `30`

#### `invsim_ws_print_full_url` ConVar

* Whether print full URL when the player uses `!ws` command.
* **Type:** `bool`
* **Default:** `true`

#### `invsim_spraychanger_enabled` ConVar

* Whether to change player vanilla spray if they have a graffiti equipped.
Expand Down
3 changes: 2 additions & 1 deletion source/InventorySimulator/InventorySimulator.Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public partial class InventorySimulator
[ConsoleCommand("css_ws", "Refreshes player's inventory.")]
public void OnWSCommand(CCSPlayerController? player, CommandInfo _)
{
player?.PrintToChat(Localizer["invsim.announce", GetApiUrl()]);
var url = invsim_ws_print_full_url.Value ? GetApiUrl() : invsim_hostname.Value;
player?.PrintToChat(Localizer["invsim.announce", url]);

if (!invsim_ws_enabled.Value || player == null) return;
if (PlayerCooldownManager.TryGetValue(player.SteamID, out var timestamp))
Expand Down
1 change: 1 addition & 0 deletions source/InventorySimulator/InventorySimulator.State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public partial class InventorySimulator
public readonly FakeConVar<bool> invsim_stattrak_ignore_bots = new("invsim_stattrak_ignore_bots", "Whether to ignore StatTrak increments for bot kills.", true);
public readonly FakeConVar<bool> invsim_spraychanger_enabled = new("invsim_spraychanger_enabled", "Whether to change player vanilla spray if they have a graffiti equipped.", false);
public readonly FakeConVar<bool> invsim_ws_enabled = new("invsim_ws_enabled", "Whether players can refresh their inventory using !ws.", false);
public readonly FakeConVar<bool> invsim_ws_print_full_url = new("invsim_ws_print_full_url", "Whether print full URL when the player uses !ws.", true);
public readonly FakeConVar<int> invsim_minmodels = new("invsim_minmodels", "Allows agents or use specific models for each team.", 0, flags: ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 2));
public readonly FakeConVar<int> invsim_ws_cooldown = new("invsim_ws_cooldown", "Cooldown in seconds between player inventory refreshes.", 30);
public readonly FakeConVar<int> invsim_spray_cooldown = new("invsim_spray_cooldown", "Cooldown in seconds between player sprays.", 30);
Expand Down

0 comments on commit 5f8863e

Please sign in to comment.