diff options
| author | Matthew Collins <[email protected]> | 2018-02-24 12:52:45 +0000 |
|---|---|---|
| committer | Matthew Collins <[email protected]> | 2018-02-24 12:52:45 +0000 |
| commit | dfbbc13d91a77a2052c8ad02c559e08d86bb7ebf (patch) | |
| tree | f7e35082d58bf89ae5c1751b99e22d366742d8da /src | |
| parent | Initial work on lobbies + A clean up (diff) | |
| download | steamworks-rs-dfbbc13d91a77a2052c8ad02c559e08d86bb7ebf.tar.xz steamworks-rs-dfbbc13d91a77a2052c8ad02c559e08d86bb7ebf.zip | |
Add a way to move notifications
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs index 2ad34f1..aa19d46 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -7,6 +7,13 @@ pub struct Utils { pub(crate) _client: Arc<ClientInner>, } +pub enum NotificationPosition { + TopLeft, + TopRight, + BottomLeft, + BottomRight, +} + impl Utils { /// Returns the app ID of the current process pub fn app_id(&self) -> AppId { @@ -26,4 +33,18 @@ impl Utils { lang.to_string_lossy() } } + + /// Sets the position on the screen where popups from the steam overlay + /// should appear and display themselves in. + pub fn set_overlay_notification_position(&self, position: NotificationPosition) { + unsafe { + let position = match position { + NotificationPosition::TopLeft => sys::NotificationPosition::TopLeft, + NotificationPosition::TopRight => sys::NotificationPosition::TopRight, + NotificationPosition::BottomLeft => sys::NotificationPosition::BottomLeft, + NotificationPosition::BottomRight => sys::NotificationPosition::BottomRight, + }; + sys::SteamAPI_ISteamUtils_SetOverlayNotificationPosition(self.utils, position); + } + } }
\ No newline at end of file |