@quenty/playerutils 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerutils@2.3.1...@quenty/playerutils@2.4.0) (2023-01-01)
7
+
8
+ **Note:** Version bump only for package @quenty/playerutils
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.3.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerutils@2.3.0...@quenty/playerutils@2.3.1) (2022-12-27)
7
15
 
8
16
  **Note:** Version bump only for package @quenty/playerutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/playerutils",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "Player utility functions",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -28,9 +28,9 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@quenty/brio": "^8.2.1",
31
+ "@quenty/brio": "^8.3.0",
32
32
  "@quenty/loader": "^6.0.1",
33
- "@quenty/rx": "^7.2.1"
33
+ "@quenty/rx": "^7.3.0"
34
34
  },
35
- "gitHead": "ff0c0732eca3400949945c58c1d3cb8a479c9789"
35
+ "gitHead": "b2393f15774341318803f9bdd1377a4aa9d2fb0e"
36
36
  }
@@ -25,6 +25,19 @@ function PlayerUtils.formatName(player)
25
25
  return PlayerUtils.formatDisplayName(name, displayName)
26
26
  end
27
27
 
28
+ --[=[
29
+ Human-readable version of a player name. If the player's name is the same
30
+ as the display name, then returns that player's name. Otherwise returns
31
+ a formatted name with the player's name like this "oot (@martxn)" which
32
+ lets you know the username and the display name.
33
+
34
+ Note this is not localized, although most languages should be ok. Great for
35
+ output for dev logs and command services which are less picky.
36
+
37
+ @param name string
38
+ @param displayName string
39
+ @return string -- Formatted name
40
+ ]=]
28
41
  function PlayerUtils.formatDisplayName(name, displayName)
29
42
  if name:lower() == displayName:lower() then
30
43
  return displayName
@@ -62,6 +75,7 @@ end
62
75
 
63
76
  --[=[
64
77
  Retrieves the display name color for a given player (for the Roblox chat)
78
+
65
79
  @param displayName string
66
80
  @return Color3
67
81
  ]=]
@@ -28,7 +28,7 @@ function RxPlayerUtils.observePlayersBrio(predicate: (Player) -> boolean?)
28
28
  if predicate == nil or predicate(player) then
29
29
  local brio = Brio.new(player)
30
30
  maid[player] = brio
31
-
31
+
32
32
  sub:Fire(brio)
33
33
  end
34
34
  end
@@ -38,7 +38,7 @@ function RxPlayerUtils.observePlayersBrio(predicate: (Player) -> boolean?)
38
38
  maid:GiveTask(Players.PlayerRemoving:Connect(function(player)
39
39
  maid[player] = nil
40
40
  end))
41
-
41
+
42
42
  for _, player in Players:GetPlayers() do
43
43
  handlePlayer(player)
44
44
  end