Facepunch.Steamworks Wiki

Steamworks.SteamUtils

Interface which provides access to a range of miscellaneous utility functions

Events

static event Action<bool> OnGamepadTextInputDismissed
Big Picture gamepad text input has been closed. Parameter is true if text was submitted, false if cancelled etc.
static event Action OnIpCountryChanged
The country of the user changed
static event Action<int> OnLowBatteryPower
Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute The parameter is the number of minutes left
static event Action OnSteamShutdown
Called when Steam wants to shutdown

Properties

static Universe ConnectedUniverse { get; }
static float CurrentBatteryPower { get; }
Returns battery power [0-1]
static bool DoesOverlayNeedPresent { get; }
Normally this call is unneeded if your game has a constantly running frame loop that calls the D3D Present API, or OGL SwapBuffers API every frame. However, if you have a game that only refreshes the screen on an event driven basis then that can break the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also need to Present() to the screen any time an even needing a notification happens or when the overlay is brought up over the game by a user. You can use t..
static string IpCountry { get; }
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".
static bool IsOverlayEnabled { get; }
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.
static bool IsSteamChinaLauncher { get; }
Returns whether this steam client is a Steam China specific client, vs the global client
static bool IsSteamInBigPictureMode { get; }
returns true if Steam and the Steam Overlay are running in Big Picture mode 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
static bool IsSteamRunningInVR { get; }
returns true if Steam itself is running in VR mode
Sets the position where the overlay instance for the currently calling game should show notifications. This position is per-game and if this function is called from outside of a game context it will do nothing.
static uint SecondsSinceAppActive { get; }
Returns the number of seconds since the application was active
static uint SecondsSinceComputerActive { get; }
Returns the number of seconds since the user last moved the mouse etc
static System.DateTime SteamServerTime { get; }
Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)
static string SteamUILanguage { get; }
returns the language the steam client is running in, you probably want Apps.CurrentGameLanguage instead, this is for very special usage cases
static bool UsingBatteryPower { get; }
Returns true if we're using a battery (ie, a laptop not plugged in)
static bool VrHeadsetStreaming { get; set; }
Set whether the HMD content will be streamed via Steam In-Home Streaming If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed. If this is set to false, then the application window will be streamed instead, and remote input will be allowed. The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game. (this is useful for games that have asymmetric multiplayer gameplay)

Methods

static async Task<CheckFileSignature> CheckFileSignatureAsync( string filename )
Asynchronous call to check if an executable file has been signed using the public key set on the signing tab of the partner site, for example to refuse to load modified executable files.
static string GetEnteredGamepadText()
Returns previously entered text
static Data.Image? GetImage( int image )
returns the image in RGBA format
static bool GetImageSize( int image, uint width, uint height )
returns true if the image exists, and the buffer was successfully filled out results are returned in RGBA format the destination buffer size should be 4 * height * width * sizeof(char)
static void SetOverlayNotificationInset( int x, int y )
Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition
static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, GamepadTextInputLineMode lineInputMode, string description, int maxChars, string existingText )
Activates the Big Picture text input dialog which only supports gamepad input
static void StartVRDashboard()
ask SteamUI to create and render its OpenVR dashboard