public void AcceptInviteAfterExitLobby(NodeRemoveEvent e, LobbyNode lobby, [JoinAll, Combine] SingleNode <WaitingLobbyExitComponent> dialog, [JoinAll] SingleNode <SelfUserComponent> user) { AcceptInviteEvent acceptInviteEvent = dialog.Entity.GetComponent <WaitingLobbyExitComponent>().AcceptInviteEvent; dialog.Entity.RemoveComponent <WaitingLobbyExitComponent>(); base.ScheduleEvent(acceptInviteEvent, user); }
public void InitUI(NodeAddedEvent e, SingleNode <MatchLobbyGUIComponent> ui, LobbyNode lobby, [JoinByMap] MapNode map) { GameModesDescriptionData data = ConfiguratorService.GetConfig("localization/battle_mode").ConvertTo <GameModesDescriptionData>(); ui.component.SetTeamBattleMode(lobby.battleMode.BattleMode != BattleMode.DM, lobby.userLimit.TeamLimit, lobby.userLimit.UserLimit); ui.component.ModeName = data.battleModeLocalization[lobby.battleMode.BattleMode]; ui.component.MapName = map.descriptionItem.Name; ui.component.ShowSearchingText = !lobby.Entity.HasComponent <CustomBattleLobbyComponent>(); if (map.Entity.HasComponent <MapPreviewDataComponent>()) { ui.component.SetMapPreview((Texture2D)map.Entity.GetComponent <MapPreviewDataComponent>().Data); } else { AssetRequestEvent eventInstance = new AssetRequestEvent(); eventInstance.Init <MapPreviewDataComponent>(map.mapPreview.AssetGuid); base.ScheduleEvent(eventInstance, map); } if (ui.Entity.HasComponent <BattleLobbyGroupComponent>()) { ui.Entity.GetComponent <BattleLobbyGroupComponent>().Detach(ui.Entity); } lobby.battleLobbyGroup.Attach(ui.Entity); ui.component.paramGravity.text = ConfiguratorService.GetConfig("localization/gravity_type").ConvertTo <GravityTypeNames>().Names[lobby.gravity.GravityType]; }
public void DeinitUI(NodeRemoveEvent e, LobbyNode lobby, SingleNode <MatchLobbyGUIComponent> ui) { if (lobby.Entity.HasComponent <BattleLobbyGroupComponent>() && ui.Entity.HasComponent <BattleLobbyGroupComponent>()) { lobby.battleLobbyGroup.Detach(ui.Entity); } }
private void Invite(List <long> userIds, LobbyNode lobby) { InviteToLobbyEvent eventInstance = new InviteToLobbyEvent { InvitedUserIds = userIds.ToArray() }; base.ScheduleEvent(eventInstance, lobby); }
public void Invite(ButtonClickEvent e, InviteToLobbyButtonNode button, [JoinByUser] UserNode user, [JoinAll] LobbyNode lobby, [JoinAll] SingleNode <FriendsComponent> friends) { List <long> userIds = new List <long> { user.Entity.Id }; this.Invite(userIds, lobby); if (user.Entity.HasComponent <InvitedToLobbyUserComponent>()) { user.Entity.RemoveComponent <InvitedToLobbyUserComponent>(); } friends.component.InLobbyInvitations[user.userGroup.Key] = DateTime.Now; user.Entity.AddComponent <InvitedToLobbyUserComponent>(); }
private void UpdateCustomGameTitle(ButtonNode button, LobbyNode lobby, int currentPlayersCount) { string modeName = ConfiguratorService.GetConfig("localization/battle_mode").ConvertTo <GameModesDescriptionData>().battleModeLocalization[lobby.battleMode.BattleMode]; button.playButton.SetCustomModeTitle(modeName, currentPlayersCount, lobby.userLimit.UserLimit); }
public void SendStartCustomBattle(ButtonClickEvent e, SingleNode <PlayButtonStartCustomBattleStateComponent> button, [JoinAll] LobbyNode lobby) { base.ScheduleEvent <StartBattleEvent>(lobby); }
public void SetSelfUserTeamColor(NodeAddedEvent e, SelfBattleLobbyUser selfUserNode, [JoinByBattleLobby] LobbyNode lobby, [JoinAll, Context] LobbyUINode ui) { ui.matchLobbyGUI.UserTeamColor = !lobby.Entity.HasComponent <CustomBattleLobbyComponent>() ? TeamColor.NONE : selfUserNode.teamColor.TeamColor; }
private void ShowTooltipInLobby(LobbyInteractableUserButtonNode userButton, SelfUserNode selfUser, LobbyNode lobby) { if (!userButton.lobbyUserListItem.Empty) { long id = userButton.lobbyUserListItem.userEntity.Id; this.RequestTooltipDisplay(id, userButton.userInteractionsButton.tooltipPrefab, selfUser.Entity, InteractionSource.LOBBY, lobby.Entity.Id); } }
public void ShowTooltipInLobbyRightClick(RightMouseButtonClickEvent e, LobbyInteractableUserButtonNode userButton, [JoinAll] SelfUserNode selfUser, [JoinByBattleLobby] LobbyNode lobby) { this.ShowTooltipInLobby(userButton, selfUser, lobby); }