-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcecde3
commit 84691c3
Showing
5 changed files
with
99 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Hiding Players | ||
|
||
You can hide specific players if you don't want them to show up at all in the HUD. | ||
This may be useful for coaches that are misrepresented as dead players. | ||
Please note that if you hide a real player, you will run into issues. | ||
|
||
To hide a player, use the `teams.hiddenPlayers` option on the HUD config page at http://127.0.0.1:31982/config. | ||
Provide either a player's SteamID64, or a player's name. | ||
Provide one player per line. | ||
|
||
If you use a player's name, you'll need to exactly match the name that would otherwise be displayed by the HUD. | ||
If you've changed their name using [Player Name Overrides](https://github.com/drweissbrot/cs-hud/blob/master/docs/player-name-overrides.md), use the name that you used for the override. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { options } from '/hud/core/state.js' | ||
|
||
export const getHiddenPlayers = () => { | ||
const hiddenPlayerNames = new Set() | ||
const hiddenPlayerSteam64Ids = new Set() | ||
|
||
const opt = options['teams.hiddenPlayers']?.trim() | ||
if (! opt?.length) return { hiddenPlayerNames, hiddenPlayerSteam64Ids } | ||
|
||
const lines = opt.split('\n') | ||
|
||
for (const rawLine of lines) { | ||
const line = rawLine.trim() | ||
if (! line?.length) continue | ||
|
||
if (/^7656\d+$/.test(line)) { | ||
hiddenPlayerSteam64Ids.add(line) | ||
} else { | ||
hiddenPlayerNames.add(line) | ||
} | ||
} | ||
|
||
return { hiddenPlayerNames, hiddenPlayerSteam64Ids } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters