There was an error while loading. Please reload this page.
1 parent 240cfc1 commit a5f62a3Copy full SHA for a5f62a3
2 files changed
native/friends.cpp
@@ -60,11 +60,20 @@ HL_PRIM void HL_NAME(activate_overlay_store)( int appid, int flag ) {
60
SteamFriends()->ActivateGameOverlayToStore((AppId_t)appid,(EOverlayToStoreFlag)flag);
61
}
62
63
+HL_PRIM bool HL_NAME(set_rich_presence)( vbyte *pchKey, vbyte *pchValue ) {
64
+ return SteamFriends()->SetRichPresence((char*)pchKey, (char*)pchValue);
65
+}
66
+
67
+HL_PRIM void HL_NAME(clear_rich_presence)() {
68
+ SteamFriends()->ClearRichPresence();
69
70
71
DEFINE_PRIM(_BYTES, get_user_name, _UID);
72
DEFINE_PRIM(_BYTES, get_user_avatar, _UID _I32 _REF(_I32) _REF(_I32));
73
DEFINE_PRIM(_BOOL, request_user_information, _UID _BOOL);
74
DEFINE_PRIM(_ARR, get_friends, _I32);
75
DEFINE_PRIM(_BOOL, has_friend, _UID _I32);
76
DEFINE_PRIM(_VOID, activate_overlay_user, _BYTES _UID);
77
DEFINE_PRIM(_VOID, activate_overlay_store, _I32 _I32);
-
78
+DEFINE_PRIM(_BOOL, set_rich_presence, _BYTES _BYTES);
79
+DEFINE_PRIM(_VOID, clear_rich_presence, _NO_ARG);
steam/Friends.hx
@@ -92,11 +92,22 @@ class Friends {
92
public static function activateOverlay( overlay : OverlayKind, ?uid : UID ) {
93
activate_overlay_user( overlay == None ? null : @:privateAccess overlay.toString().toUtf8(), uid);
94
95
96
public static function activateOverlayStore( appId : Int, flags : OverlayToStoreFlag ) : Void {}
97
98
+ /**
99
+ Key `steam_display` requires localized token as value, see https://partner.steamgames.com/doc/api/ISteamFriends#richpresencelocalization
100
+ Set `value` to empty or null to remove the key.
101
+ **/
102
+ public static function setRichPresence( key : String, value : Null<String> ) : Bool {
103
+ return @:privateAccess set_rich_presence(key.toUtf8(), value == null ? null : value.toUtf8());
104
+ }
105
106
+ public static function clearRichPresence() : Void {}
107
108
static function get_friends( flags : FriendFlags ) : hl.NativeArray<UID> { return null; }
109
static function has_friend( uid : UID, flags : FriendFlags ) : Bool { return false; }
110
static function activate_overlay_user( overlay : hl.Bytes, uid : UID ) : Void {}
111
+ static function set_rich_presence( pchKey : hl.Bytes, pchValue : hl.Bytes ) : Bool { return false; }
112
-}
113
0 commit comments