diff options
| author | Matthew Collins <[email protected]> | 2017-09-06 15:51:08 +0100 |
|---|---|---|
| committer | Matthew Collins <[email protected]> | 2017-09-06 15:51:08 +0100 |
| commit | d1be508a5fbee5535593ca246de389f40f1f7b34 (patch) | |
| tree | 70c3235f9db852097b6ec50b7d532342e8d30287 /src/utils.rs | |
| download | steamworks-rs-d1be508a5fbee5535593ca246de389f40f1f7b34.tar.xz steamworks-rs-d1be508a5fbee5535593ca246de389f40f1f7b34.zip | |
Initial commit
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs new file mode 100644 index 0000000..416b9ee --- /dev/null +++ b/src/utils.rs @@ -0,0 +1,23 @@ + +use super::*; + +pub struct Utils { + pub(crate) utils: *mut sys::ISteamUtils, + pub(crate) _client: Rc<ClientInner>, +} + +impl Utils { + pub fn app_id(&self) -> AppId { + unsafe { + AppId(sys::SteamAPI_ISteamUtils_GetAppID(self.utils)) + } + } + + pub fn ui_language(&self) -> Cow<str> { + unsafe { + let lang = sys::SteamAPI_ISteamUtils_GetSteamUILanguage(self.utils); + let lang = CStr::from_ptr(lang); + lang.to_string_lossy() + } + } +}
\ No newline at end of file |