Struct bevy_steamworks::Utils
source · pub struct Utils<Manager> { /* private fields */ }
Expand description
Access to the steam utils interface
Implementations§
source§impl<Manager> Utils<Manager>
impl<Manager> Utils<Manager>
sourcepub fn ip_country(&self) -> String
pub fn ip_country(&self) -> String
Returns the country code of the current user based on their IP
sourcepub fn ui_language(&self) -> String
pub fn ui_language(&self) -> String
Returns the language the steam client is currently running in.
Generally you want Apps::current_game_language
instead of this
sourcepub fn get_server_real_time(&self) -> u32
pub fn get_server_real_time(&self) -> u32
Returns the current real time on the Steam servers in Unix epoch format (seconds since 1970/1/1 UTC).
sourcepub fn set_overlay_notification_position(&self, position: NotificationPosition)
pub fn set_overlay_notification_position(&self, position: NotificationPosition)
Sets the position on the screen where popups from the steam overlay should appear and display themselves in.
sourcepub fn set_warning_callback<F>(&self, cb: F)
pub fn set_warning_callback<F>(&self, cb: F)
Sets the Steam warning callback, which is called to emit warning messages.
The passed-in function takes two arguments: a severity level (0 = info, 1 = warning) and the message itself.
See Steamwork’s debugging page for more info.
sourcepub fn get_entered_gamepad_text_input(
&self,
dismissed_data: &GamepadTextInputDismissed
) -> Option<String>
pub fn get_entered_gamepad_text_input( &self, dismissed_data: &GamepadTextInputDismissed ) -> Option<String>
Gets the gamepad text input from the Big Picture overlay.
This must be called within the show_gamepad_text_input
callback. Returns Some(String)
if user submitted the
text, and None
otherwise
sourcepub fn is_steam_running_on_steam_deck(&self) -> bool
pub fn is_steam_running_on_steam_deck(&self) -> bool
Checks if Steam is running on a Steam Deck device.
sourcepub fn show_gamepad_text_input<F>(
&self,
input_mode: GamepadTextInputMode,
input_line_mode: GamepadTextInputLineMode,
description: &str,
max_characters: u32,
existing_text: Option<&str>,
dismissed_cb: F
) -> bool
pub fn show_gamepad_text_input<F>( &self, input_mode: GamepadTextInputMode, input_line_mode: GamepadTextInputLineMode, description: &str, max_characters: u32, existing_text: Option<&str>, dismissed_cb: F ) -> bool
Activates the Big Picture text input dialog which only supports gamepad input.
sourcepub fn show_floating_gamepad_text_input<F>(
&self,
keyboard_mode: FloatingGamepadTextInputMode,
x: i32,
y: i32,
width: i32,
height: i32,
dismissed_cb: F
) -> bool
pub fn show_floating_gamepad_text_input<F>( &self, keyboard_mode: FloatingGamepadTextInputMode, x: i32, y: i32, width: i32, height: i32, dismissed_cb: F ) -> bool
Opens a floating keyboard over the game content and sends OS keyboard keys directly to the game.
The text field position is specified in pixels relative the origin of the game window and is used to position the floating keyboard in a way that doesn’t cover the text field.
Callback is triggered when user dismisses the text input
Auto Trait Implementations§
impl<Manager> RefUnwindSafe for Utils<Manager>where
Manager: RefUnwindSafe,
impl<Manager> !Send for Utils<Manager>
impl<Manager> !Sync for Utils<Manager>
impl<Manager> Unpin for Utils<Manager>
impl<Manager> UnwindSafe for Utils<Manager>where
Manager: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.