This commit is contained in:
Garry Newman 2019-04-14 22:05:51 +01:00
parent ca96362a5f
commit e7aa122c1f
4 changed files with 71 additions and 71 deletions

View File

@ -14,7 +14,7 @@ namespace Steamworks
public static class Apps
{
static Internal.ISteamApps _internal;
internal static Internal.ISteamApps steamapps
internal static Internal.ISteamApps Internal
{
get
{
@ -47,62 +47,62 @@ internal static void InstallEvents()
/// <summary>
/// Checks if the active user is subscribed to the current App ID
/// </summary>
public static bool IsSubscribed => steamapps.BIsSubscribed();
public static bool IsSubscribed => Internal.BIsSubscribed();
/// <summary>
/// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID
/// </summary>
public static bool IsSubscribedFromFamilySharing => steamapps.BIsSubscribedFromFamilySharing();
public static bool IsSubscribedFromFamilySharing => Internal.BIsSubscribedFromFamilySharing();
/// <summary>
/// Checks if the license owned by the user provides low violence depots.
/// Low violence depots are useful for copies sold in countries that have content restrictions
/// </summary>
public static bool IsLowVoilence => steamapps.BIsLowViolence();
public static bool IsLowVoilence => Internal.BIsLowViolence();
/// <summary>
/// Checks whether the current App ID license is for Cyber Cafes.
/// </summary>
public static bool IsCybercafe => steamapps.BIsCybercafe();
public static bool IsCybercafe => Internal.BIsCybercafe();
/// <summary>
/// CChecks if the user has a VAC ban on their account
/// </summary>
public static bool IsVACBanned => steamapps.BIsVACBanned();
public static bool IsVACBanned => Internal.BIsVACBanned();
/// <summary>
/// Gets the current language that the user has set.
/// This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title.
/// </summary>
public static string GameLanguage => steamapps.GetCurrentGameLanguage();
public static string GameLanguage => Internal.GetCurrentGameLanguage();
/// <summary>
/// Gets a list of the languages the current app supports.
/// </summary>
public static string[] AvailablLanguages => steamapps.GetAvailableGameLanguages().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
public static string[] AvailablLanguages => Internal.GetAvailableGameLanguages().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
/// <summary>
/// Checks if the active user is subscribed to a specified AppId.
/// Only use this if you need to check ownership of another game related to yours, a demo for example.
/// </summary>
public static bool IsSubscribedToApp( AppId appid ) => steamapps.BIsSubscribedApp( appid.Value );
public static bool IsSubscribedToApp( AppId appid ) => Internal.BIsSubscribedApp( appid.Value );
/// <summary>
/// Checks if the user owns a specific DLC and if the DLC is installed
/// </summary>
public static bool IsDlcInstalled( AppId appid ) => steamapps.BIsDlcInstalled( appid.Value );
public static bool IsDlcInstalled( AppId appid ) => Internal.BIsDlcInstalled( appid.Value );
/// <summary>
/// Returns the time of the purchase of the app
/// </summary>
public static DateTime PurchaseTime( AppId appid ) => Facepunch.Steamworks.Utility.Epoch.ToDateTime( steamapps.GetEarliestPurchaseUnixTime( appid.Value ) );
public static DateTime PurchaseTime( AppId appid ) => Facepunch.Steamworks.Utility.Epoch.ToDateTime( Internal.GetEarliestPurchaseUnixTime( appid.Value ) );
/// <summary>
/// Checks if the user is subscribed to the current app through a free weekend
/// This function will return false for users who have a retail or other type of license
/// Before using, please ask your Valve technical contact how to package and secure your free weekened
/// </summary>
public static bool IsSubscribedFromFreeWeekend => steamapps.BIsSubscribedFromFreeWeekend();
public static bool IsSubscribedFromFreeWeekend => Internal.BIsSubscribedFromFreeWeekend();
/// <summary>
/// Returns metadata for all available DLC
@ -112,11 +112,11 @@ public static IEnumerable<DlcInformation> DlcInformation()
var appid = default( SteamNative.AppId_t );
var available = false;
for ( int i = 0; i < steamapps.GetDLCCount(); i++ )
for ( int i = 0; i < Internal.GetDLCCount(); i++ )
{
var sb = SteamNative.Helpers.TakeStringBuilder();
if ( !steamapps.BGetDLCDataByIndex( i, ref appid, ref available, sb, sb.Capacity ) )
if ( !Internal.BGetDLCDataByIndex( i, ref appid, ref available, sb, sb.Capacity ) )
continue;
yield return new DlcInformation
@ -131,12 +131,12 @@ public static IEnumerable<DlcInformation> DlcInformation()
/// <summary>
/// Install/Uninstall control for optional DLC
/// </summary>
public static void InstallDlc( AppId appid ) => steamapps.InstallDLC( appid.Value );
public static void InstallDlc( AppId appid ) => Internal.InstallDLC( appid.Value );
/// <summary>
/// Install/Uninstall control for optional DLC
/// </summary>
public static void UninstallDlc( AppId appid ) => steamapps.UninstallDLC( appid.Value );
public static void UninstallDlc( AppId appid ) => Internal.UninstallDLC( appid.Value );
/// <summary>
/// Returns null if we're not on a beta branch, else the name of the branch
@ -147,7 +147,7 @@ public static string CurrentBetaName
{
var sb = SteamNative.Helpers.TakeStringBuilder();
if ( !steamapps.GetCurrentBetaName( sb, sb.Capacity ) )
if ( !Internal.GetCurrentBetaName( sb, sb.Capacity ) )
return null;
return sb.ToString();
@ -160,7 +160,7 @@ public static string CurrentBetaName
/// If you detect the game is out-of-date(for example, by having the client detect a version mismatch with a server),
/// you can call use MarkContentCorrupt to force a verify, show a message to the user, and then quit.
/// </summary>
public static void MarkContentCorrupt( bool missingFilesOnly ) => steamapps.MarkContentCorrupt( missingFilesOnly );
public static void MarkContentCorrupt( bool missingFilesOnly ) => Internal.MarkContentCorrupt( missingFilesOnly );
/// <summary>
/// Gets a list of all installed depots for a given App ID in mount order
@ -170,7 +170,7 @@ public static IEnumerable<DepotId> InstalledDepots( AppId appid )
var depots = new SteamNative.DepotId_t[32];
uint count = 0;
count = steamapps.GetInstalledDepots( appid.Value, depots, (uint) depots.Length );
count = Internal.GetInstalledDepots( appid.Value, depots, (uint) depots.Length );
for ( int i = 0; i < count; i++ )
{
@ -186,7 +186,7 @@ public static string AppInstallDir( AppId appid )
{
var sb = SteamNative.Helpers.TakeStringBuilder();
if ( steamapps.GetAppInstallDir( appid.Value, sb, (uint) sb.Capacity ) == 0 )
if ( Internal.GetAppInstallDir( appid.Value, sb, (uint) sb.Capacity ) == 0 )
return null;
return sb.ToString();
@ -195,12 +195,12 @@ public static string AppInstallDir( AppId appid )
/// <summary>
/// The app may not actually be owned by the current user, they may have it left over from a free weekend, etc.
/// </summary>
public static bool IsAppInstalled( AppId appid ) => steamapps.BIsAppInstalled( appid.Value );
public static bool IsAppInstalled( AppId appid ) => Internal.BIsAppInstalled( appid.Value );
/// <summary>
/// Gets the Steam ID of the original owner of the current app. If it's different from the current user then it is borrowed..
/// </summary>
public static SteamId AppOwner => steamapps.GetAppOwner().Value;
public static SteamId AppOwner => Internal.GetAppOwner().Value;
/// <summary>
/// Gets the associated launch parameter if the game is run via steam://run/appid/?param1=value1;param2=value2;param3=value3 etc.
@ -208,7 +208,7 @@ public static string AppInstallDir( AppId appid )
/// Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,
/// but it is advised that you not param names beginning with an underscore for your own features.
/// </summary>
public static string GetLaunchParam( string param ) => steamapps.GetLaunchQueryParam( param );
public static string GetLaunchParam( string param ) => Internal.GetLaunchQueryParam( param );
/// <summary>
/// Gets the download progress for optional DLC.
@ -218,7 +218,7 @@ public static DownloadProgress DlcDownloadProgress( AppId appid )
ulong punBytesDownloaded = 0;
ulong punBytesTotal = 0;
if ( !steamapps.GetDlcDownloadProgress( appid.Value, ref punBytesDownloaded, ref punBytesTotal ) )
if ( !Internal.GetDlcDownloadProgress( appid.Value, ref punBytesDownloaded, ref punBytesTotal ) )
return default( DownloadProgress );
return new DownloadProgress { BytesDownloaded = punBytesDownloaded, BytesTotal = punBytesTotal, Active = true };
@ -228,7 +228,7 @@ public static DownloadProgress DlcDownloadProgress( AppId appid )
/// Gets the buildid of this app, may change at any time based on backend updates to the game.
/// Defaults to 0 if you're not running a build downloaded from steam.
/// </summary>
public static int BuildId => steamapps.GetAppBuildId();
public static int BuildId => Internal.GetAppBuildId();
/// <summary>
@ -237,7 +237,7 @@ public static DownloadProgress DlcDownloadProgress( AppId appid )
/// </summary>
public static async Task<FileDetails> GetFileDetails( string filename )
{
var r = await steamapps.GetFileDetails( filename );
var r = await Internal.GetFileDetails( filename );
if ( !r.HasValue )
{
@ -266,7 +266,7 @@ public static string CommandLine
get
{
var sb = SteamNative.Helpers.TakeStringBuilder();
var len = steamapps.GetLaunchCommandLine( sb, sb.Capacity );
var len = Internal.GetLaunchCommandLine( sb, sb.Capacity );
return sb.ToString();
}
}

View File

@ -13,7 +13,7 @@ namespace Steamworks
public static class Music
{
static Internal.ISteamMusic _internal;
internal static Internal.ISteamMusic music
internal static Internal.ISteamMusic Internal
{
get
{
@ -43,40 +43,40 @@ internal static void InstallEvents()
/// <summary>
/// Checks if Steam Music is enabled
/// </summary>
public static bool IsEnabled => music.BIsEnabled();
public static bool IsEnabled => Internal.BIsEnabled();
/// <summary>
/// true if a song is currently playing, paused, or queued up to play; otherwise false.
/// </summary>
public static bool IsPlaying => music.BIsPlaying();
public static bool IsPlaying => Internal.BIsPlaying();
/// <summary>
/// Gets the current status of the Steam Music player
/// </summary>
public static AudioPlayback_Status Status => music.GetPlaybackStatus();
public static AudioPlayback_Status Status => Internal.GetPlaybackStatus();
public static void Play() => music.Play();
public static void Play() => Internal.Play();
public static void Pause() => music.Pause();
public static void Pause() => Internal.Pause();
/// <summary>
/// Have the Steam Music player play the previous song.
/// </summary>
public static void PlayPrevious() => music.PlayPrevious();
public static void PlayPrevious() => Internal.PlayPrevious();
/// <summary>
/// Have the Steam Music player skip to the next song
/// </summary>
public static void PlayNext() => music.PlayNext();
public static void PlayNext() => Internal.PlayNext();
/// <summary>
/// Gets/Sets the current volume of the Steam Music player
/// </summary>
public static float Volume
{
get => music.GetVolume();
set => music.SetVolume( value );
get => Internal.GetVolume();
set => Internal.SetVolume( value );
}
}
}

View File

@ -13,7 +13,7 @@ namespace Steamworks
public static class Parental
{
static Internal.ISteamParentalSettings _internal;
internal static Internal.ISteamParentalSettings parentalsettings
internal static Internal.ISteamParentalSettings Internal
{
get
{
@ -38,31 +38,31 @@ internal static void InstallEvents()
/// <summary>
///
/// </summary>
public static bool IsParentalLockEnabled => parentalsettings.BIsParentalLockEnabled();
public static bool IsParentalLockEnabled => Internal.BIsParentalLockEnabled();
/// <summary>
///
/// </summary>
public static bool IsParentalLockLocked => parentalsettings.BIsParentalLockLocked();
public static bool IsParentalLockLocked => Internal.BIsParentalLockLocked();
/// <summary>
///
/// </summary>
public static bool IsAppBlocked( AppId app ) => parentalsettings.BIsAppBlocked( app.Value );
public static bool IsAppBlocked( AppId app ) => Internal.BIsAppBlocked( app.Value );
/// <summary>
///
/// </summary>
public static bool BIsAppInBlockList( AppId app ) => parentalsettings.BIsAppInBlockList( app.Value );
public static bool BIsAppInBlockList( AppId app ) => Internal.BIsAppInBlockList( app.Value );
/// <summary>
///
/// </summary>
public static bool IsFeatureBlocked( ParentalFeature feature ) => parentalsettings.BIsFeatureBlocked( feature );
public static bool IsFeatureBlocked( ParentalFeature feature ) => Internal.BIsFeatureBlocked( feature );
/// <summary>
///
/// </summary>
public static bool BIsFeatureInBlockList( ParentalFeature feature ) => parentalsettings.BIsFeatureInBlockList( feature );
public static bool BIsFeatureInBlockList( ParentalFeature feature ) => Internal.BIsFeatureInBlockList( feature );
}
}

View File

@ -13,7 +13,7 @@ namespace Steamworks
public static class Utils
{
static Internal.ISteamUtils _internal;
internal static Internal.ISteamUtils steamutils
internal static Internal.ISteamUtils Internal
{
get
{
@ -56,26 +56,26 @@ internal static void InstallEvents()
/// <summary>
/// Returns the number of seconds since the application was active
/// </summary>
public static uint SecondsSinceAppActive => steamutils.GetSecondsSinceAppActive();
public static uint SecondsSinceAppActive => Internal.GetSecondsSinceAppActive();
/// <summary>
/// Returns the number of seconds since the user last moved the mouse etc
/// </summary>
public static uint SecondsSinceComputerActive => steamutils.GetSecondsSinceComputerActive();
public static uint SecondsSinceComputerActive => Internal.GetSecondsSinceComputerActive();
// the universe this client is connecting to
public static Universe ConnectedUniverse => steamutils.GetConnectedUniverse();
public static Universe ConnectedUniverse => Internal.GetConnectedUniverse();
/// <summary>
/// Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)
/// </summary>
public static DateTime SteamServerTime => Facepunch.Steamworks.Utility.Epoch.ToDateTime( steamutils.GetServerRealTime() );
public static DateTime SteamServerTime => Facepunch.Steamworks.Utility.Epoch.ToDateTime( Internal.GetServerRealTime() );
/// <summary>
/// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
/// e.g "US" or "UK".
/// </summary>
public static string IpCountry => steamutils.GetIPCountry();
public static string IpCountry => Internal.GetIPCountry();
/// <summary>
/// returns true if the image exists, and the buffer was successfully filled out
@ -86,7 +86,7 @@ public static bool GetImageSize( int image, out uint width, out uint height )
{
width = 0;
height = 0;
return steamutils.GetImageSize( image, ref width, ref height );
return Internal.GetImageSize( image, ref width, ref height );
}
/// <summary>
@ -100,7 +100,7 @@ public static byte[] GetImageRGBA( int image )
var size = w * h * 4 * sizeof( char );
var data = new byte[size];
if ( !steamutils.GetImageRGBA( image, data, data.Length ) )
if ( !Internal.GetImageRGBA( image, data, data.Length ) )
return null;
return data;
@ -109,17 +109,17 @@ public static byte[] GetImageRGBA( int image )
/// <summary>
/// Returns true if we're using a battery (ie, a laptop not plugged in)
/// </summary>
public static bool UsingBatteryPower => steamutils.GetCurrentBatteryPower() != 255;
public static bool UsingBatteryPower => Internal.GetCurrentBatteryPower() != 255;
/// <summary>
/// Returns battery power [0-1]
/// </summary>
public static float CurrentBatteryPower => Math.Min( steamutils.GetCurrentBatteryPower() / 100, 1.0f );
public static float CurrentBatteryPower => Math.Min( Internal.GetCurrentBatteryPower() / 100, 1.0f );
/// <summary>
/// returns the appID of the current process
/// </summary>
public static AppId AppId => steamutils.GetAppID();
public static AppId AppId => Internal.GetAppID();
static NotificationPosition overlayNotificationPosition = NotificationPosition.BottomRight;
@ -134,7 +134,7 @@ public static NotificationPosition OverlayNotificationPosition
set
{
overlayNotificationPosition = value;
steamutils.SetOverlayNotificationPosition( value );
Internal.SetOverlayNotificationPosition( value );
}
}
@ -142,7 +142,7 @@ public static NotificationPosition OverlayNotificationPosition
/// Returns true if the overlay is running and the user can access it. The overlay process could take a few seconds to
/// start and hook the game process, so this function will initially return false while the overlay is loading.
/// </summary>
public static bool IsOverlayEnabled => steamutils.IsOverlayEnabled();
public static bool IsOverlayEnabled => Internal.IsOverlayEnabled();
/// <summary>
/// Normally this call is unneeded if your game has a constantly running frame loop that calls the
@ -155,7 +155,7 @@ public static NotificationPosition OverlayNotificationPosition
/// in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you
/// refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.
/// </summary>
public static bool DoesOverlayNeedPresent => steamutils.BOverlayNeedsPresent();
public static bool DoesOverlayNeedPresent => Internal.BOverlayNeedsPresent();
/// <summary>
/// Asynchronous call to check if an executable file has been signed using the public key set on the signing tab
@ -163,7 +163,7 @@ public static NotificationPosition OverlayNotificationPosition
/// </summary>
public static async Task<CheckFileSignature> CheckFileSignature( string filename )
{
var r = await steamutils.CheckFileSignature( filename );
var r = await Internal.CheckFileSignature( filename );
if ( !r.HasValue )
{
@ -178,7 +178,7 @@ public static async Task<CheckFileSignature> CheckFileSignature( string filename
/// </summary>
public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, GamepadTextInputLineMode lineInputMode, string description, int maxChars, string existingText = "" )
{
return steamutils.ShowGamepadTextInput( inputMode, lineInputMode, description, (uint)maxChars, existingText );
return Internal.ShowGamepadTextInput( inputMode, lineInputMode, description, (uint)maxChars, existingText );
}
/// <summary>
@ -186,11 +186,11 @@ public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, Gamepad
/// </summary>
public static string GetEnteredGamepadText()
{
var len = steamutils.GetEnteredGamepadTextLength();
var len = Internal.GetEnteredGamepadTextLength();
if ( len == 0 ) return string.Empty;
var sb = Helpers.TakeStringBuilder();
if ( !steamutils.GetEnteredGamepadTextInput( sb, len ) )
if ( !Internal.GetEnteredGamepadTextInput( sb, len ) )
return string.Empty;
return sb.ToString();
@ -200,19 +200,19 @@ public static string GetEnteredGamepadText()
/// returns the language the steam client is running in, you probably want
/// Apps.CurrentGameLanguage instead, this is for very special usage cases
/// </summary>
public static string SteamUILanguage => steamutils.GetSteamUILanguage();
public static string SteamUILanguage => Internal.GetSteamUILanguage();
/// <summary>
/// returns true if Steam itself is running in VR mode
/// </summary>
public static bool IsSteamRunningInVR => steamutils.IsSteamRunningInVR();
public static bool IsSteamRunningInVR => Internal.IsSteamRunningInVR();
/// <summary>
/// Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition
/// </summary>
public static void SetOverlayNotificationInset( int x, int y )
{
steamutils.SetOverlayNotificationInset( x, y );
Internal.SetOverlayNotificationInset( x, y );
}
/// <summary>
@ -220,13 +220,13 @@ public static void SetOverlayNotificationInset( int x, int y )
/// Games much be launched through the Steam client to enable the Big Picture overlay. During development,
/// a game can be added as a non-steam game to the developers library to test this feature
/// </summary>
public static bool IsSteamInBigPictureMode => steamutils.IsSteamInBigPictureMode();
public static bool IsSteamInBigPictureMode => Internal.IsSteamInBigPictureMode();
/// <summary>
/// ask SteamUI to create and render its OpenVR dashboard
/// </summary>
public static void StartVRDashboard() => steamutils.StartVRDashboard();
public static void StartVRDashboard() => Internal.StartVRDashboard();
/// <summary>
/// Set whether the HMD content will be streamed via Steam In-Home Streaming
@ -237,11 +237,11 @@ public static void SetOverlayNotificationInset( int x, int y )
/// </summary>
public static bool VrHeadsetStreaming
{
get => steamutils.IsVRHeadsetStreamingEnabled();
get => Internal.IsVRHeadsetStreamingEnabled();
set
{
steamutils.SetVRHeadsetStreamingEnabled( value );
Internal.SetVRHeadsetStreamingEnabled( value );
}
}
@ -249,7 +249,7 @@ public static bool VrHeadsetStreaming
internal static bool IsCallComplete( SteamAPICall_t call, out bool failed )
{
failed = false;
return steamutils.IsAPICallCompleted( call, ref failed );
return Internal.IsAPICallCompleted( call, ref failed );
}
internal static T? GetResult<T>( SteamAPICall_t call ) where T : struct, ISteamCallback
@ -263,7 +263,7 @@ internal static bool IsCallComplete( SteamAPICall_t call, out bool failed )
{
bool failed = false;
if ( !steamutils.GetAPICallResult( call, ptr, size, t.GetCallbackId(), ref failed ) )
if ( !Internal.GetAPICallResult( call, ptr, size, t.GetCallbackId(), ref failed ) )
return null;
if ( failed )