mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 05:35:35 +03:00
Add Overlay.IsOpen
This commit is contained in:
parent
971751f89d
commit
80a383730b
@ -62,6 +62,7 @@ public partial class Client : BaseSteamworks
|
||||
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 )
|
||||
{
|
||||
@ -107,6 +108,7 @@ public Client( uint appId ) : base( appId )
|
||||
MicroTransactions = new MicroTransactions( this );
|
||||
User = new User( this );
|
||||
RemoteStorage = new RemoteStorage( this );
|
||||
Overlay = new Overlay( this );
|
||||
|
||||
Workshop.friends = Friends;
|
||||
|
||||
|
@ -2,25 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SteamNative;
|
||||
|
||||
namespace Facepunch.Steamworks
|
||||
{
|
||||
public partial class Client : IDisposable
|
||||
{
|
||||
private Overlay _overlay;
|
||||
|
||||
public Overlay Overlay
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( _overlay == null )
|
||||
_overlay = new Overlay { client = this };
|
||||
|
||||
return _overlay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Overlay
|
||||
{
|
||||
internal Client client;
|
||||
@ -30,6 +15,20 @@ 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 ); }
|
||||
|
Loading…
Reference in New Issue
Block a user