Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion native/friends.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,20 @@ HL_PRIM void HL_NAME(activate_overlay_store)( int appid, int flag ) {
SteamFriends()->ActivateGameOverlayToStore((AppId_t)appid,(EOverlayToStoreFlag)flag);
}

HL_PRIM bool HL_NAME(set_rich_presence)( vbyte *pchKey, vbyte *pchValue ) {
return SteamFriends()->SetRichPresence((char*)pchKey, (char*)pchValue);
}

HL_PRIM void HL_NAME(clear_rich_presence)() {
SteamFriends()->ClearRichPresence();
}

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);
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(_BOOL, set_rich_presence, _BYTES _BYTES);
DEFINE_PRIM(_VOID, clear_rich_presence, _NO_ARG);
15 changes: 13 additions & 2 deletions steam/Friends.hx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,22 @@ class Friends {
public static function activateOverlay( overlay : OverlayKind, ?uid : UID ) {
activate_overlay_user( overlay == None ? null : @:privateAccess overlay.toString().toUtf8(), uid);
}

public static function activateOverlayStore( appId : Int, flags : OverlayToStoreFlag ) : Void {}

/**
Key `steam_display` requires localized token as value, see https://partner.steamgames.com/doc/api/ISteamFriends#richpresencelocalization
Set `value` to empty or null to remove the key.
**/
public static function setRichPresence( key : String, value : Null<String> ) : Bool {
return @:privateAccess set_rich_presence(key.toUtf8(), value == null ? null : value.toUtf8());
}

public static function clearRichPresence() : Void {}

static function get_friends( flags : FriendFlags ) : hl.NativeArray<UID> { 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 ) : Bool { return false; }

}
}