(965c31410a) Unstable v0.10.4.0
This commit is contained in:
@@ -10,34 +10,22 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// Interface which provides access to a range of miscellaneous utility functions
|
||||
/// </summary>
|
||||
public static class SteamUtils
|
||||
public class SteamUtils : SteamSharedClass<SteamUtils>
|
||||
{
|
||||
static ISteamUtils _internal;
|
||||
internal static ISteamUtils Internal
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( _internal == null )
|
||||
{
|
||||
_internal = new ISteamUtils();
|
||||
_internal.Init();
|
||||
}
|
||||
internal static ISteamUtils Internal => Interface as ISteamUtils;
|
||||
|
||||
return _internal;
|
||||
}
|
||||
internal override void InitializeInterface( bool server )
|
||||
{
|
||||
SetInterface( server, new ISteamUtils( server ) );
|
||||
InstallEvents( server );
|
||||
}
|
||||
|
||||
internal static void Shutdown()
|
||||
internal static void InstallEvents( bool server )
|
||||
{
|
||||
_internal = null;
|
||||
}
|
||||
|
||||
internal static void InstallEvents()
|
||||
{
|
||||
IPCountry_t.Install( x => OnIpCountryChanged?.Invoke() );
|
||||
LowBatteryPower_t.Install( x => OnLowBatteryPower?.Invoke( x.MinutesBatteryLeft ) );
|
||||
SteamShutdown_t.Install( x => SteamClosed() );
|
||||
GamepadTextInputDismissed_t.Install( x => OnGamepadTextInputDismissed?.Invoke( x.Submitted ) );
|
||||
Dispatch.Install<IPCountry_t>( x => OnIpCountryChanged?.Invoke(), server );
|
||||
Dispatch.Install<LowBatteryPower_t>( x => OnLowBatteryPower?.Invoke( x.MinutesBatteryLeft ), server );
|
||||
Dispatch.Install<SteamShutdown_t>( x => SteamClosed(), server );
|
||||
Dispatch.Install<GamepadTextInputDismissed_t>( x => OnGamepadTextInputDismissed?.Invoke( x.Submitted ), server );
|
||||
}
|
||||
|
||||
private static void SteamClosed()
|
||||
@@ -267,5 +255,11 @@ namespace Steamworks
|
||||
failed = false;
|
||||
return Internal.IsAPICallCompleted( call, ref failed );
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether this steam client is a Steam China specific client, vs the global client
|
||||
/// </summary>
|
||||
public static bool IsSteamChinaLauncher => Internal.IsSteamChinaLauncher();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user