Skip to content

Commit

Permalink
added isDlcInstalled, activateOverlayStore
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Jul 5, 2018
1 parent 8b59a47 commit a38afd6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions native/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ HL_PRIM vbyte *HL_NAME(get_current_game_language)(){
return (vbyte*)SteamApps()->GetCurrentGameLanguage();
}

HL_PRIM bool HL_NAME(is_dlc_installed)( int appid ) {
return SteamApps()->BIsDlcInstalled((AppId_t)appid);
}

vdynamic *CallbackHandler::EncodeAuthSessionTicketResponse(GetAuthSessionTicketResponse_t *d) {
HLValue ret;
ret.Set("authTicket", d->m_hAuthTicket);
Expand All @@ -199,6 +203,7 @@ HL_PRIM void HL_NAME(cancel_call_result)( CClosureCallResult<int> *m_call ) {
DEFINE_PRIM(_UID, get_steam_id, _NO_ARG);
DEFINE_PRIM(_BOOL, restart_app_if_necessary, _I32);
DEFINE_PRIM(_BOOL, is_overlay_enabled, _NO_ARG);
DEFINE_PRIM(_BOOL, is_dlc_installed, _I32);
DEFINE_PRIM(_BOOL, boverlay_needs_present, _NO_ARG);
DEFINE_PRIM(_BOOL, is_steam_in_big_picture_mode, _NO_ARG);
DEFINE_PRIM(_BOOL, is_steam_running, _NO_ARG);
Expand Down
6 changes: 6 additions & 0 deletions native/friends.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ HL_PRIM void HL_NAME(activate_overlay_user)( vbyte *dialog, vuid uid ) {
SteamFriends()->ActivateGameOverlayToUser((char*)dialog,hl_to_uid(uid));
}

HL_PRIM void HL_NAME(activate_overlay_store)( int appid, int flag ) {
SteamFriends()->ActivateGameOverlayToStore((AppId_t)appid,(EOverlayToStoreFlag)flag);
}

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);

11 changes: 11 additions & 0 deletions steam/Api.hx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,17 @@ class Api
return _IsOverlayEnabled();
}

public static function isDlcInstalled( appid : Int ) : Bool {
if( !active )
return false;
return _IsDlcInstalled(appid);
}

@:hlNative("steam","is_dlc_installed")
static function _IsDlcInstalled( appid : Int ) : Bool {
return false;
}

public static function BOverlayNeedsPresent() {
if (!active)
return false;
Expand Down
8 changes: 8 additions & 0 deletions steam/Friends.hx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ package steam;
public function toString() return this;
}

@:enum abstract OverlayToStoreFlag(Int) {
var None = 0;
var AddToCart = 1;
var AddToCartAndShow = 2;
}

@:hlNative("steam")
class Friends {

Expand All @@ -86,6 +92,8 @@ 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 {}

static function get_friends( flags : FriendFlags ) : hl.NativeArray<UID> { return null; }
static function has_friend( uid : UID, flags : FriendFlags ) : Bool { return false; }
Expand Down

0 comments on commit a38afd6

Please sign in to comment.