Support player display names and merge Util.GetNames with transformInstanceSet#342
Open
itsrenderman wants to merge 1 commit intoevaera:masterfrom
Open
Support player display names and merge Util.GetNames with transformInstanceSet#342itsrenderman wants to merge 1 commit intoevaera:masterfrom
itsrenderman wants to merge 1 commit intoevaera:masterfrom
Conversation
Contributor
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
DisplayNameandNameare the same.This functionality is implemented through the
Util.luamodule, 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.GetNamessupported values not needing aNameproperty, defaulting totostringwhen it didn't exist.Adding this functionality to
transformInstanceSethas no breaking effects on any internal code, and any users interacting with Cmdr's utiltiies should also not be affected, giventransformInstanceSetis not accessible by default.This change is essentially just the removal of unnecessary code repetition.
Declarations: