Widgets

Kronos includes some UserWidgets with a bunch of helper function to help with project implementation.

User Auth Widget

Widget that represents user authentication state. Created by the KronosUserManager and automatically removed when entering the game default map after authentication.

  • OnUserAuthStarted: Event when user authentication is started.

  • OnUserAuthStateChanged: Event when user authentication state is changed.

  • OnUserAuthComplete: Event when user authentication is complete.

Matchmaking State Widget

Widget for displaying the current matchmaking state.

  • OnMatchmakingStarted: Event when the matchmaking is started.

  • OnMatchmakingCanceled: Event when the matchmaking is canceled.

  • OnMatchmakingComplete: Event when the matchmaking is complete.

  • OnMatchmakingUpdated: Event when the matchmaking state or time changes.

Matchmaking Session Widget

Widget intended to be used for displaying session search result. After a successful search, loop through the search results and for each result create an instance of this widget. After the widget is created, the InitSessionWidget must be called on it with the session search result that it is intended to represent.

  • InitSessionWidget: Initializes the session widget by giving it a search result.

  • GetOwningSession: Get the owning search result this widget represents.

  • OnSessionWidgetInitialized: Event when the session widget is initialized. At this point the owning session is set.

Party Widget

Widget that represents the party. It automatically creates UserWidgets for each player in the party when needed, for example if a new player joins or when an existing player leaves. It also creates widgets for each open slot in the party.

Create this widget once, when the main menu loads for example.

The widget has optional bindings for two DynamicEntryBox widgets with the following names: "PartyPlayerEntryBox" and "PartySlotEntryBox". If you decide to create these entry boxes inside the party widget, their EntryWidgetClass must be set to the following: The "PartyPlayerEntryBox" should have a custom KronosPartyPlayerWidget as its entry widget class, while the "PartySlotEntryBox" can use any widget class.

Inside the UMG widget editor, if you switch over to Graph -> Class Settings, there is a variable called CreateEntryForLocalPlayer which controls whether a player widget should be created for the local player or not.

  • OnConnectedToParty: Event when the local player joined a party.

  • OnDisconnectedFromParty: Event when the local player left a party.

  • OnPlayerJoinedParty: Event when a new player joins the party.

  • OnPlayerLeftParty: Event when an existing player leaves the party.

  • OnChatMessageReceived: Event when a party chat message is received.

Party Player Widget

Widget that represents an existing player in the party. It is intended to be used as the "EntryWidgetClass" of the "PartyPlayerEntryBox" in the KronosPartyWidget, or as the "PlayerWidgetClass" in the KronosPartyPlayerActor.

  • InitPlayerWidget: Initialize the player widget with its owning player. Called automatically in intended use cases (see above).

  • GetPlayerUniqueId: Get the owning player's unique id.

  • GetPlayerName: Get the owning player's name.

  • GetPlayerElo: Get the owning player's elo score.

  • GetPlayerData: Get the owning player's current player data.

  • IsPartyLeader: Whether the owning player is the party leader or not. Since there is no host migration, the party leader is always the party host.

  • OnPlayerWidgetInitialized: Event when the player widget is initialized. At this point the owning player is set, and relevant events are bound.

  • OnPlayerEloChanged: Event when the player elo changes, including the first time it replicates.

  • OnPlayerDataChanged: Event when the player data changes, including the first time it replicates.

  • OnPartyLeaderChanged: Event when the party leader changes, including the first time it replicates.

Lobby Widget

Widget that represents the lobby. Create this widget once, when your lobby level is loaded for example.

  • GetLobbyGameState: Get the lobby state.

  • GetLocalPlayerState: Get the local player's state.

  • GetPlayerHasAuthority: Whether the local player has server authority or not.

  • OnLobbyWidgetInitialized: Event when the lobby widget is initialized. At this point both the GameState and PlayerState have replicated and relevant events are bound.

  • OnPlayerJoinedLobby: Event when a new player joins the lobby.

  • OnPlayerLeftLobby: Event when an existing player leaves the lobby.

  • OnLobbyUpdated: Event when the lobby state changes.

  • OnPlayerIsReadyChanged: Event when the local player's ready state changes.

  • OnStartingMatch: Event when the match is starting.

  • OnStartingMatchCanceled: Event when the match was starting but it was canceled for some reason.

Lobby Player Widget

Widget that represents an existing player in the lobby. You can use this widget as the "NameplateWidgetClass" for the player's KronosNameplateComponent. When used this way, the nameplate component will call InitPlayerWidget automatically.

If you are not using nameplate components, you can add these widgets to the screen directly as well when a player joins the lobby. Inside the UMG widget editor if you switch over to Graph -> Class Settings, there is a variable called AutoRemoveWidget that controls whether the widget should be removed automatically once the owning player of the widget leaves.

  • InitPlayerWidget: Initalize the player widget with its owning player. Called automatically if used with the KronosNameplateComponent.

  • GetOwningLobbyPlayerState: Get the player state of the owning player.

  • GetOwningLobbyPawn: Get the player pawn of the owning player.

  • OnPlayerWidgetInitialized: Event when the player widget is initialized. At this point the owning player is set, and relevant events are bound.

  • OnPlayerNameChanged: Event when the owning player's name changes, including the first time it replicates.

  • OnPlayerIsReadyChanged: Event when the owning player's ready state changes.

  • OnPlayerDisconnecting: Event when the owning player is leaving the match.

Last updated