From 0d71fad5f6ca8e188296151d8576b708ed13c94c Mon Sep 17 00:00:00 2001 From: Rollin'Barrel Date: Sun, 21 Sep 2025 11:17:48 +0300 Subject: [PATCH] add Friends.setRichPresence --- native/friends.cpp | 5 +++++ steam/Friends.hx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/native/friends.cpp b/native/friends.cpp index f4ad92d..65e54de 100644 --- a/native/friends.cpp +++ b/native/friends.cpp @@ -60,6 +60,10 @@ HL_PRIM void HL_NAME(activate_overlay_store)( int appid, int flag ) { SteamFriends()->ActivateGameOverlayToStore((AppId_t)appid,(EOverlayToStoreFlag)flag); } +HL_PRIM void HL_NAME(set_rich_presence)( vbyte *pchKey, vbyte *pchValue ) { + SteamFriends()->SetRichPresence((char*)pchKey, (char*)pchValue); +} + DEFINE_PRIM(_BYTES, get_user_name, _UID); DEFINE_PRIM(_BYTES, get_user_avatar, _UID _I32 _REF(_I32) _REF(_I32)); DEFINE_PRIM(_BOOL, request_user_information, _UID _BOOL); @@ -67,4 +71,5 @@ DEFINE_PRIM(_ARR, get_friends, _I32); DEFINE_PRIM(_BOOL, has_friend, _UID _I32); DEFINE_PRIM(_VOID, activate_overlay_user, _BYTES _UID); DEFINE_PRIM(_VOID, activate_overlay_store, _I32 _I32); +DEFINE_PRIM(_VOID, set_rich_presence, _UID _UID); diff --git a/steam/Friends.hx b/steam/Friends.hx index 75b1262..a04e10d 100644 --- a/steam/Friends.hx +++ b/steam/Friends.hx @@ -92,11 +92,16 @@ class Friends { public static function activateOverlay( overlay : OverlayKind, ?uid : UID ) { activate_overlay_user( overlay == None ? null : @:privateAccess overlay.toString().toUtf8(), uid); } + + public static function setRichPresence(key:String, value:String) { + @:privateAccess set_rich_presence(key.toUtf8(), value.toUtf8()); + } public static function activateOverlayStore( appId : Int, flags : OverlayToStoreFlag ) : Void {} static function get_friends( flags : FriendFlags ) : hl.NativeArray { return null; } static function has_friend( uid : UID, flags : FriendFlags ) : Bool { return false; } static function activate_overlay_user( overlay : hl.Bytes, uid : UID ) : Void {} + static function set_rich_presence( pchKey:hl.Bytes, pchValue:hl.Bytes ) : Void {} } \ No newline at end of file