diff options
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 |