Support player display names and merge Util.GetNames with transformInstanceSet #342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Display Name Support
Related to #335
This pull request adds support for Player.DisplayName in command argument completions.
Usernames are now displayed one of two ways:
Only the player's username is displayed if the Player's
DisplayName
andName
are the same.This functionality is implemented through the
Util.lua
module, eliminating the need to modify the various different built-in types (such as Player, PlayerId, Team).This should also assist with compatibility of any custom types created by Cmdr users, assuming they are also using the utility functions available through Cmdr.
Example showing players with a different DisplayName and Name
Example showing a player with the same DisplayName and Name
Merge Util.GetNames with transformInstanceSet
I made this change as a result of seeing both methods having a very similar functionality.
The only difference was
Util.GetNames
supported values not needing aName
property, defaulting totostring
when it didn't exist.Adding this functionality to
transformInstanceSet
has no breaking effects on any internal code, and any users interacting with Cmdr's utiltiies should also not be affected, giventransformInstanceSet
is not accessible by default.This change is essentially just the removal of unnecessary code repetition.
Declarations: