internal static void InstallEvents() { FriendStateChange_t.Install(x => OnPersonaStateChange?.Invoke(new Friend(x.SteamID))); GameRichPresenceJoinRequested_t.Install(x => OnGameRichPresenceJoinRequested?.Invoke(new Friend(x.SteamIDFriend), x.Connect)); GameConnectedFriendChatMsg_t.Install(OnFriendChatMessage); GameOverlayActivated_t.Install(x => OnGameOverlayActivated?.Invoke()); GameServerChangeRequested_t.Install(x => OnGameServerChangeRequested?.Invoke(x.Server, x.Password)); GameLobbyJoinRequested_t.Install(x => OnGameLobbyJoinRequested?.Invoke(x.SteamIDLobby, x.SteamIDFriend)); FriendRichPresenceUpdate_t.Install(x => OnFriendRichPresenceUpdate?.Invoke(new Friend(x.SteamIDFriend))); }
internal static void InstallEvents() { FriendStateChange_t.Install((FriendStateChange_t x) => { Action <Friend> onPersonaStateChange = SteamFriends.OnPersonaStateChange; if (onPersonaStateChange != null) { onPersonaStateChange(new Friend(x.SteamID)); } else { } }, false); GameRichPresenceJoinRequested_t.Install((GameRichPresenceJoinRequested_t x) => { Action <Friend, string> onGameRichPresenceJoinRequested = SteamFriends.OnGameRichPresenceJoinRequested; if (onGameRichPresenceJoinRequested != null) { onGameRichPresenceJoinRequested(new Friend(x.SteamIDFriend), x.Connect); } else { } }, false); GameConnectedFriendChatMsg_t.Install(new Action <GameConnectedFriendChatMsg_t>(SteamFriends.OnFriendChatMessage), false); GameOverlayActivated_t.Install((GameOverlayActivated_t x) => { Action onGameOverlayActivated = SteamFriends.OnGameOverlayActivated; if (onGameOverlayActivated != null) { onGameOverlayActivated(); } else { } }, false); GameServerChangeRequested_t.Install((GameServerChangeRequested_t x) => { Action <string, string> onGameServerChangeRequested = SteamFriends.OnGameServerChangeRequested; if (onGameServerChangeRequested != null) { onGameServerChangeRequested(x.Server, x.Password); } else { } }, false); GameLobbyJoinRequested_t.Install((GameLobbyJoinRequested_t x) => { Action <Lobby, SteamId> onGameLobbyJoinRequested = SteamFriends.OnGameLobbyJoinRequested; if (onGameLobbyJoinRequested != null) { onGameLobbyJoinRequested(new Lobby(x.SteamIDLobby), x.SteamIDFriend); } else { } }, false); FriendRichPresenceUpdate_t.Install((FriendRichPresenceUpdate_t x) => { Action <Friend> onFriendRichPresenceUpdate = SteamFriends.OnFriendRichPresenceUpdate; if (onFriendRichPresenceUpdate != null) { onFriendRichPresenceUpdate(new Friend(x.SteamIDFriend)); } else { } }, false); }