Falco Engine 3.9.0.1 (beta)
Friends.cs
Go to the documentation of this file.
1using System;
2using System.Runtime.CompilerServices;
3
4namespace FalcoEngine
5{
6 public static partial class SteamAPI
7 {
8 public static class Friends
9 {
10 public delegate void AvatarImageLoaded(User.SteamID steamID, int image, int width, int height);
12
13 public delegate void GameOverlayActivated(bool active);
15
16 public enum PersonaState
17 {
18 Offline = 0, //Offline
19 Online = 1, //Online
20 Busy = 2, //Online, busy
21 Away = 3, //Online, away from PC
22 Snooze = 4, //Online, away from PC for too long
23 LookingToTrade = 5, //Online, trading
24 LookingToPlay = 6 //Online, want to play
25 }
26
28 {
29 Friends,
30 Community,
31 Players,
32 Settings,
33 OfficialGameGroup,
34 Stats,
35 Achievements
36 }
37
39 {
40 SteamID,
41 Chat,
42 JoinTrade,
43 Stats,
44 Achievements,
45 FriendAdd,
46 FriendRemove,
47 FriendRequestAccept,
48 FriendRequestIgnore
49 }
50
52 {
53 Default,
54 Modal
55 }
56
57 public enum FriendFlags
58 {
59 None = 0x00,
60 Blocked = 0x01,
61 FriendshipRequested = 0x02,
62 Immediate = 0x04,
63 ClanMember = 0x08,
64 OnGameServer = 0x10,
65 RequestingFriendship = 0x80,
66 RequestingInfo = 0x100,
67 Ignored = 0x200,
68 IgnoredFriend = 0x400,
69 ChatMember = 0x1000,
70 All = 0xFFFF
71 }
72
74 {
75 None = 0,
76 Blocked = 1,
77 RequestRecipient = 2,
78 Friend = 3,
79 RequestInitiator = 4,
80 Ignored = 5,
81 IgnoredFriend = 6
82 }
83
84 [MethodImpl(MethodImplOptions.InternalCall)]
85 public static extern string GetPersonaName();
86
87 [MethodImpl(MethodImplOptions.InternalCall)]
88 public static extern bool RequestUserInformation(User.SteamID steamIDUser, bool requireNameOnly);
89
91 {
92 return (PersonaState)INTERNAL_GetPersonaState();
93 }
94
95 [MethodImpl(MethodImplOptions.InternalCall)]
96 private static extern int INTERNAL_GetPersonaState();
97
98 public static int GetSmallFriendAvatar(User.SteamID steamID)
99 {
100 return INTERNAL_GetSmallFriendAvatar(ref steamID);
101 }
102
103 public static int GetMediumFriendAvatar(User.SteamID steamID)
104 {
105 return INTERNAL_GetMediumFriendAvatar(ref steamID);
106 }
107
108 public static int GetLargeFriendAvatar(User.SteamID steamID)
109 {
110 return INTERNAL_GetLargeFriendAvatar(ref steamID);
111 }
112
113 [MethodImpl(MethodImplOptions.InternalCall)]
114 private static extern int INTERNAL_GetSmallFriendAvatar(ref User.SteamID steamID);
115
116 [MethodImpl(MethodImplOptions.InternalCall)]
117 private static extern int INTERNAL_GetMediumFriendAvatar(ref User.SteamID steamID);
118
119 [MethodImpl(MethodImplOptions.InternalCall)]
120 private static extern int INTERNAL_GetLargeFriendAvatar(ref User.SteamID steamID);
121
122 public static void ActivateGameOverlay(OverlayDialogType dialogType)
123 {
124 INTERNAL_ActivateGameOverlay((int)dialogType);
125 }
126
127 public static void ActivateGameOverlayToUser(OverlayUserDialogType dialogType, User.SteamID steamID)
128 {
129 INTERNAL_ActivateGameOverlayToUser((int)dialogType, ref steamID);
130 }
131
133 {
134 INTERNAL_ActivateGameOverlayToWebPage(url, (int)mode);
135 }
136
137 [MethodImpl(MethodImplOptions.InternalCall)]
138 private static extern void INTERNAL_ActivateGameOverlay(int dialogType);
139
140 [MethodImpl(MethodImplOptions.InternalCall)]
141 private static extern void INTERNAL_ActivateGameOverlayToUser(int dialogType, ref User.SteamID steamID);
142
143 [MethodImpl(MethodImplOptions.InternalCall)]
144 private static extern void INTERNAL_ActivateGameOverlayToWebPage(string url, int mode);
145
146 [MethodImpl(MethodImplOptions.InternalCall)]
147 public static extern void ClearRichPresence();
148
150 {
151 INTERNAL_CloseClanChatWindowInSteam(ref id);
152 }
153
154 [MethodImpl(MethodImplOptions.InternalCall)]
155 private static extern void INTERNAL_CloseClanChatWindowInSteam(ref User.SteamID id);
156
157 public static int GetFriendCount(FriendFlags flags)
158 {
159 return INTERNAL_GetFriendCount((int)flags);
160 }
161
162 public static User.SteamID GetFriendByIndex(FriendFlags flags, int index)
163 {
164 INTERNAL_GetFriendByIndex((int)flags, index, out User.SteamID steamID);
165
166 return steamID;
167 }
168
169 [MethodImpl(MethodImplOptions.InternalCall)]
170 private static extern int INTERNAL_GetFriendCount(int flags);
171
172 [MethodImpl(MethodImplOptions.InternalCall)]
173 private static extern void INTERNAL_GetFriendByIndex(int flags, int index, out User.SteamID steamID);
174
175 public static string GetFriendPersonaName(User.SteamID steamID)
176 {
177 return INTERNAL_GetFriendPersonaName(ref steamID);
178 }
179
181 {
182 return (PersonaState)INTERNAL_GetFriendPersonaState(ref steamID);
183 }
184
185 [MethodImpl(MethodImplOptions.InternalCall)]
186 private static extern string INTERNAL_GetFriendPersonaName(ref User.SteamID steamID);
187
188 [MethodImpl(MethodImplOptions.InternalCall)]
189 private static extern int INTERNAL_GetFriendPersonaState(ref User.SteamID steamID);
190
191 public static UInt32 GetFriendCoplayGame(User.SteamID steamID)
192 {
193 return INTERNAL_GetFriendCoplayGame(ref steamID);
194 }
195
196 [MethodImpl(MethodImplOptions.InternalCall)]
197 private static extern UInt32 INTERNAL_GetFriendCoplayGame(ref User.SteamID steamID);
198
200 {
201 return (FriendRelationship)INTERNAL_GetFriendRelationship(ref steamID);
202 }
203
204 [MethodImpl(MethodImplOptions.InternalCall)]
205 private static extern int INTERNAL_GetFriendRelationship(ref User.SteamID steamID);
206
207 public static int GetFriendRichPresenceKeyCount(User.SteamID steamID)
208 {
209 return INTERNAL_GetFriendRichPresenceKeyCount(ref steamID);
210 }
211
212 [MethodImpl(MethodImplOptions.InternalCall)]
213 private static extern int INTERNAL_GetFriendRichPresenceKeyCount(ref User.SteamID steamID);
214
215 public static string GetFriendRichPresenceKeyByIndex(User.SteamID steamID, int index)
216 {
217 return INTERNAL_GetFriendRichPresenceKeyByIndex(ref steamID, index);
218 }
219
220 [MethodImpl(MethodImplOptions.InternalCall)]
221 private static extern string INTERNAL_GetFriendRichPresenceKeyByIndex(ref User.SteamID steamID, int index);
222
223 public static string GetFriendRichPresence(User.SteamID steamID, string key)
224 {
225 return INTERNAL_GetFriendRichPresence(ref steamID, key);
226 }
227
228 [MethodImpl(MethodImplOptions.InternalCall)]
229 private static extern string INTERNAL_GetFriendRichPresence(ref User.SteamID steamID, string key);
230
231 private static void RunAvatarImageLoadedCallbacks(User.SteamID steamID, int image, int width, int height)
232 {
233 OnAvatarImageLoaded?.Invoke(steamID, image, width, height);
234 }
235
236 private static void RunGameOverlayActivatedCallbacks(bool active)
237 {
238 OnGameOverlayActivated?.Invoke(active);
239 }
240 }
241 }
242}
static string GetFriendPersonaName(User.SteamID steamID)
Definition: Friends.cs:175
static PersonaState GetPersonaState()
Definition: Friends.cs:90
delegate void AvatarImageLoaded(User.SteamID steamID, int image, int width, int height)
static int GetFriendRichPresenceKeyCount(User.SteamID steamID)
Definition: Friends.cs:207
static string GetFriendRichPresenceKeyByIndex(User.SteamID steamID, int index)
Definition: Friends.cs:215
static void ActivateGameOverlayToUser(OverlayUserDialogType dialogType, User.SteamID steamID)
Definition: Friends.cs:127
static void ActivateGameOverlayToWebPage(string url, ActivateGameOverlayToWebPageMode mode)
Definition: Friends.cs:132
static User.SteamID GetFriendByIndex(FriendFlags flags, int index)
Definition: Friends.cs:162
delegate void GameOverlayActivated(bool active)
static bool RequestUserInformation(User.SteamID steamIDUser, bool requireNameOnly)
static FriendRelationship GetFriendRelationship(User.SteamID steamID)
Definition: Friends.cs:199
static UInt32 GetFriendCoplayGame(User.SteamID steamID)
Definition: Friends.cs:191
static GameOverlayActivated OnGameOverlayActivated
Definition: Friends.cs:14
static int GetMediumFriendAvatar(User.SteamID steamID)
Definition: Friends.cs:103
static int GetSmallFriendAvatar(User.SteamID steamID)
Definition: Friends.cs:98
static int GetFriendCount(FriendFlags flags)
Definition: Friends.cs:157
static void ClearRichPresence()
static void ActivateGameOverlay(OverlayDialogType dialogType)
Definition: Friends.cs:122
static string GetFriendRichPresence(User.SteamID steamID, string key)
Definition: Friends.cs:223
static int GetLargeFriendAvatar(User.SteamID steamID)
Definition: Friends.cs:108
static string GetPersonaName()
static AvatarImageLoaded OnAvatarImageLoaded
Definition: Friends.cs:11
static PersonaState GetFriendPersonaState(User.SteamID steamID)
Definition: Friends.cs:180
static void CloseClanChatWindowInSteam(User.SteamID id)
Definition: Friends.cs:149