user_interface - YoYoGames/GMEXT-EpicOnlineServices GitHub Wiki
Epic Online Services Interface: UI Interface
Epic Online Services (EOS) supports product-independent overlay windows through its overlay system; these overlays give users product-independent access to various features. The UI Interface manages interactions with the overlays by providing status updates, showing or hiding the overlays, and adjusting display and hotkey preferences.
These functions are provided for handling user interface:
- eos_ui_acknowledge_event_id
- eos_ui_add_notify_display_settings_updated
- eos_ui_get_friends_visible
- eos_ui_get_notification_location_preference
- eos_ui_hide_friends
- eos_ui_remove_notify_display_settings_updated
- eos_ui_set_display_preference
- eos_ui_show_friends
These are the constants used by this API:
Epic Online Services Function: EOS_UI_AcknowledgeEventId
This function lets the SDK know that the given UI event ID has been acknowledged and should be released. EOS_RESULT.SUCCESS
is returned if the UI event ID has been acknowledged. EOS_RESULT.NOT_FOUND
is returned if the UI event ID does not exist.
Syntax:
eos_ui_acknowledge_event_id(ui_event_id)
Argument | Type | Description |
---|---|---|
ui_event_id | Real | The event ID being acknowledged |
Returns:
Epic Online Services Function: EOS_UI_AddNotifyDisplaySettingsUpdated
This function registers to receive notifications when the overlay display settings are updated. Newly registered handlers will always be called the next tick with the current state.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
eos_ui_add_notify_display_settings_updated()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "eos_ui_add_notify_display_settings_updated"
|
is_exclusive_input | Boolean |
true when the overlay has switched to exclusive input mode. While in exclusive input mode, no keyboard or mouse input will be sent to the game. |
is_visible | Boolean |
true when any portion of the overlay is visible. |
Example:
identifier = eos_ui_add_notify_display_settings_updated();
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "eos_ui_add_notify_display_settings_updated")
{
var _is_exclusive_input = async_load[? "is_exclusive_input"];
var _is_visible = async_load[? "is_visible"];
}
The code above matches the response against the correct event type and logs the success of the task.
Epic Online Services Function: EOS_UI_GetFriendsVisible
This function gets the friends overlay visibility.
Syntax:
eos_ui_get_friends_visible(account_id)
Argument | Type | Description |
---|---|---|
account_id | Real | The Epic Account ID of the user whose overlay is being updated. |
Returns:
Example:
if (eos_ui_get_friends_visible(account_id))
{
pause_game(); // add logic to pause the game here
}
The above code shows an example of how the function should be used. If the Friends UI is being displayed, the developer must make sure the game is set to pause.
Epic Online Services Function: EOS_UI_GetNotificationLocationPreference
This function returns the current notification location display preference.
Syntax:
eos_ui_get_notification_location_preference()
Returns:
Example:
show_debug_message("LocationPreference: " + eos_ui_get_notification_location_preference());
The above code shows an example of how the function should be used.
Epic Online Services Function: EOS_UI_HideFriends
This function hides the active Social Overlay.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
eos_ui_hide_friends(account_id)
Argument | Type | Description |
---|---|---|
account_id | Real | The Epic Account ID of the user whose friend list is being shown |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "eos_ui_hide_friends"
|
status | EOS_RESULT | The status code for the operation. EOS_RESULT.SUCCESS indicates that the operation succeeded; other codes indicate errors |
status_message | String | Text representation of the status code |
identifier | Real | The asynchronous listener ID. |
Example:
identifier = eos_ui_hide_friends();
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "eos_ui_hide_friends")
if (async_load[? "identifier"] == identifier)
{
if (async_load[? "status"] == EOS_RESULT.SUCCESS)
{
show_debug_message(async_load[? "type"] + " succeeded!");
}
else
{
show_debug_message(async_load[? "type"] + " failed: " + async_load[? "status_message"]);
}
}
The code above matches the response against the correct event type and logs the success of the task.
Epic Online Services Function: EOS_UI_RemoveNotifyDisplaySettingsUpdated
This function unregisters from receiving notifications when the overlay display settings are updated.
Syntax:
eos_ui_remove_notify_display_settings_updated(id)
Argument | Type | Description |
---|---|---|
id | Real | The handle representing the registered callback (return by eos_ui_add_notify_display_settings_updated) |
Returns:
N/A
Example:
handle = eos_ui_add_notify_display_settings_updated();
//...
//...Later
//...
eos_ui_remove_notify_display_settings_updated(handle);
The code sample above enables the display settings update notifications (eos_ui_add_notify_display_settings_updated) and later disables them by referring to the previously generated handle.
Epic Online Services Function: EOS_UI_SetDisplayPreference
This function defines any preferences for any display settings.
Syntax:
eos_ui_set_display_preference(location)
Argument | Type | Description |
---|---|---|
location | EOS_UI_NOTIFICATION_LOCATION | The preference for notification pop-up locations |
Returns:
Example:
eos_ui_set_display_preference(EOS_UI_NOTIFICATION_LOCATION.TOP_LEFT);
The above code shows an example of how the function should be used. The position of the notifications will now be the top-left corner of the game screen.
Epic Online Services Function: EOS_UI_ShowFriends
This function opens the Social Overlay with a request to show the friends list.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
eos_ui_show_friends(arg)
Argument | Type | Description |
---|---|---|
arg | Real | The argument to be passed in |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "eos_ui_show_friends"
|
status | EOS_RESULT | The status code for the operation. EOS_RESULT.SUCCESS indicates that the operation succeeded; other codes indicate errors |
status_message | String | Text representation of the status code |
identifier | Real | The asynchronous listener ID |
Example:
identifier = eos_ui_show_friends();
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "eos_ui_show_friends")
if (async_load[? "identifier"] == identifier)
{
if (async_load[? "status"] == EOS_RESULT.SUCCESS)
{
show_debug_message(async_load[? "type"] + " succeeded!");
}
else
{
show_debug_message(async_load[? "type"] + " failed: " + async_load[? "status_message"]);
}
}
The code above matches the response against the correct event type and logs the success of the task.
Epic Online Services Enum: EOS_UI_ENotificationLocation
The UI Notification Location allows to change the positioning of the EOS notifications.
These constants are referenced by the following functions:
Member | Description |
---|---|
TOP_LEFT |
Positions the overlay notification on the top-left corner |
TOP_RIGHT |
Positions the overlay notification on the top-right corner |
BOTTOM_LEFT |
Positions the overlay notification on the bottom-left corner |
BOTTOM_RIGHT |
Positions the overlay notification on the bottom-right corner |