Struct 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