mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 22:58:01 +03:00
Overlays
This commit is contained in:
parent
088e9918e0
commit
ca20e5a75a
@ -65,7 +65,6 @@ namespace Facepunch.Steamworks
|
||||
public MicroTransactions MicroTransactions { get; private set; }
|
||||
public User User { get; private set; }
|
||||
public RemoteStorage RemoteStorage { get; private set; }
|
||||
public Overlay Overlay { get; private set; }
|
||||
|
||||
public Client( uint appId ) : base( appId )
|
||||
{
|
||||
@ -109,7 +108,6 @@ namespace Facepunch.Steamworks
|
||||
MicroTransactions = new MicroTransactions( this );
|
||||
User = new User( this );
|
||||
RemoteStorage = new RemoteStorage( this );
|
||||
Overlay = new Overlay( this );
|
||||
|
||||
Workshop.friends = Friends;
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SteamNative;
|
||||
|
||||
namespace Facepunch.Steamworks
|
||||
{
|
||||
public class Overlay
|
||||
{
|
||||
internal Client client;
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get { return client.native.utils.IsOverlayEnabled(); }
|
||||
}
|
||||
|
||||
public bool IsOpen { get; private set; }
|
||||
|
||||
internal Overlay( Client c )
|
||||
{
|
||||
client = c;
|
||||
|
||||
c.RegisterCallback<GameOverlayActivated_t>( OverlayStateChange );
|
||||
}
|
||||
|
||||
private void OverlayStateChange( GameOverlayActivated_t activation )
|
||||
{
|
||||
IsOpen = activation.Active == 1;
|
||||
}
|
||||
|
||||
public void OpenUserPage( string name, ulong steamid ) { client.native.friends.ActivateGameOverlayToUser( name, steamid ); }
|
||||
|
||||
public void OpenProfile( ulong steamid ) { OpenUserPage( "steamid", steamid ); }
|
||||
public void OpenChat( ulong steamid ){ OpenUserPage( "chat", steamid ); }
|
||||
public void OpenTrade( ulong steamid ) { OpenUserPage( "jointrade", steamid ); }
|
||||
public void OpenStats( ulong steamid ) { OpenUserPage( "stats", steamid ); }
|
||||
public void OpenAchievements( ulong steamid ) { OpenUserPage( "achievements", steamid ); }
|
||||
public void AddFriend( ulong steamid ) { OpenUserPage( "friendadd", steamid ); }
|
||||
public void RemoveFriend( ulong steamid ) { OpenUserPage( "friendremove", steamid ); }
|
||||
public void AcceptFriendRequest( ulong steamid ) { OpenUserPage( "friendrequestaccept", steamid ); }
|
||||
public void IgnoreFriendRequest( ulong steamid ) { OpenUserPage( "friendrequestignore", steamid ); }
|
||||
|
||||
public void OpenUrl( string url, bool modal = false ) { client.native.friends.ActivateGameOverlayToWebPage( url, modal ? ActivateGameOverlayToWebPageMode.Modal : ActivateGameOverlayToWebPageMode.Default ); }
|
||||
}
|
||||
}
|
@ -67,7 +67,51 @@ namespace Steamworks
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The dialog to open. Valid options are:
|
||||
/// "friends",
|
||||
/// "community",
|
||||
/// "players",
|
||||
/// "settings",
|
||||
/// "officialgamegroup",
|
||||
/// "stats",
|
||||
/// "achievements".
|
||||
/// </summary>
|
||||
public static void OpenOverlay( string type ) => Internal.ActivateGameOverlay( type );
|
||||
|
||||
/// <summary>
|
||||
/// "steamid" - Opens the overlay web browser to the specified user or groups profile.
|
||||
/// "chat" - Opens a chat window to the specified user, or joins the group chat.
|
||||
/// "jointrade" - Opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API.
|
||||
/// "stats" - Opens the overlay web browser to the specified user's stats.
|
||||
/// "achievements" - Opens the overlay web browser to the specified user's achievements.
|
||||
/// "friendadd" - Opens the overlay in minimal mode prompting the user to add the target user as a friend.
|
||||
/// "friendremove" - Opens the overlay in minimal mode prompting the user to remove the target friend.
|
||||
/// "friendrequestaccept" - Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.
|
||||
/// "friendrequestignore" - Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite.
|
||||
/// </summary>
|
||||
public static void OpenUserOverlay( CSteamID id, string type ) => Internal.ActivateGameOverlayToUser( type, id );
|
||||
|
||||
/// <summary>
|
||||
/// Activates the Steam Overlay to the Steam store page for the provided app.
|
||||
/// </summary>
|
||||
public static void OpenStoreOverlay( AppId id ) => Internal.ActivateGameOverlayToStore( id.Value, OverlayToStoreFlag.None );
|
||||
|
||||
/// <summary>
|
||||
/// Activates Steam Overlay web browser directly to the specified URL.
|
||||
/// </summary>
|
||||
public static void OpenWebOverlay( string url, bool modal = false ) => Internal.ActivateGameOverlayToWebPage( url, modal ? ActivateGameOverlayToWebPageMode.Modal : ActivateGameOverlayToWebPageMode.Default );
|
||||
|
||||
/// <summary>
|
||||
/// Activates the Steam Overlay to open the invite dialog. Invitations sent from this dialog will be for the provided lobby.
|
||||
/// </summary>
|
||||
public static void OpenGameInviteOverlay( CSteamID lobby ) => Internal.ActivateGameOverlayInviteDialog( lobby );
|
||||
|
||||
/// <summary>
|
||||
/// Mark a target user as 'played with'.
|
||||
/// NOTE: The current user must be in game with the other player for the association to work.
|
||||
/// </summary>
|
||||
public static void SetPlayedWith( CSteamID steamid ) => Internal.SetPlayedWith( steamid );
|
||||
|
||||
}
|
||||
}
|
@ -54,6 +54,11 @@ namespace Steamworks
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsIn( CSteamID group_or_room )
|
||||
{
|
||||
return Friends.Internal.IsUserInSource( Id, group_or_room );
|
||||
}
|
||||
|
||||
public struct FriendGameInfo
|
||||
{
|
||||
internal ulong GameID; // m_gameID class CGameID
|
||||
@ -75,5 +80,6 @@ namespace Steamworks
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user