Hello Developers,
When we released the Avatar Context Menu (ACM), we received a lot of feedback from the development community, including members of the dev forum, incubators and accelerators. We compiled a list and addressed every major issue and request we were aware of. New features include being able to easily customize the ACM to fit the theme of your game, and a new API to allow you to open and close the Avatar Context Menu directly through game logic. The full list includes the following changes:
- New API to allow developers to customize the UI of the ACM
- New API to enable developers to open/close the ACM
- Developer custom menu options are now placed at the top of the list
- The menu now closes after clicking custom menu items
- Made whisper button more reliable, button disabled when you can’t chat with the player
- ACM works properly while clicking on player in the dynamic thumbstick area
- Made the Add Friend and Whisper buttons respect Blocked Status
- Made the ACM work with Tap to Move correctly
- Fixed bugs with using the ACM in first person
- Minor UI improvements and polish
If you are interested in trying out the latest version of ACM, additional documentation is available on the Developer Hub:
Open/Close API
We have added a new SetCore/GetCore API to allow you to open and close the AvatarContextMenu. This API also allows you to check if the AvatarContextMenu is open. This can be used to make sure the Avatar Context Menu is only available in your game when it doesn’t conflict with other UI or gameplay. For example you may want to only have the ACM available in the lobby of your game and close it when users enter the round. This API could also be used to implement an alternative method of access to the ACM in your game.
void StarterGui:SetCore(“AvatarContextMenuTarget”, Player)
Opens the Avatar Context Menu with the given Player selected. If no player is given it will hide the avatar context menu if visible.
Player StarterGui:GetCore(“AvatarContextMenuTarget”)
Returns the selected player in the avatar context menu if it is open. Otherwise it returns nil.
Example:
local selectedPlayer = StarterGui:GetCore("AvatarContextMenuTarget")
StarterGui:SetCore("AvatarContextMenuTarget", nil) -- Close ACM
ImportantPromptModule:DoImportantPrompt()
wait(10)
StarterGui:SetCore("AvatarContextMenuTarget", selectedPlayer) --Reopen the ACM
Customizing the Avatar Context Menu
This new API allows you to customize the look and feel of the ACM to better fit the style of your game. There are 30 different options to allow you to customize the menu to your heart’s content!
Example:
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("AvatarContextMenuTheme", {
BackgroundImage = "",
BackgroundTransparency = 0.5,
BackgroundColor = Color3.fromRGB(111, 145, 242),
NameTagColor = Color3.fromRGB(0, 0, 200),
NameUnderlineColor = Color3.fromRGB(213, 233, 255),
ButtonFrameColor = Color3.fromRGB(15, 24, 65),
ButtonFrameTransparency = 0.2,
ButtonUnderlineColor = Color3.fromRGB(213, 233, 255),
Font = Enum.Font.SciFi
})