diff --git a/native/common.cpp b/native/common.cpp index b9d5f64..3d43b11 100644 --- a/native/common.cpp +++ b/native/common.cpp @@ -176,6 +176,11 @@ HL_PRIM bool HL_NAME(is_steam_running)(){ return SteamAPI_IsSteamRunning(); } +HL_PRIM bool HL_NAME(show_floating_gamepad_text_input)(EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight) { + if (!CheckInit()) return false; + return SteamUtils()->ShowFloatingGamepadTextInput(eKeyboardMode, nTextFieldXPosition, nTextFieldYPosition, nTextFieldWidth, nTextFieldHeight); +} + HL_PRIM vbyte *HL_NAME(get_current_game_language)(){ if (!CheckInit()) return NULL; return (vbyte*)SteamApps()->GetCurrentGameLanguage(); @@ -346,6 +351,7 @@ DEFINE_PRIM(_BOOL, boverlay_needs_present, _NO_ARG); DEFINE_PRIM(_BOOL, is_steam_in_big_picture_mode, _NO_ARG); DEFINE_PRIM(_BOOL, is_steam_running_on_steam_deck, _NO_ARG); DEFINE_PRIM(_BOOL, is_steam_running, _NO_ARG); +DEFINE_PRIM(_BOOL, show_floating_gamepad_text_input, _I32 _I32 _I32 _I32 _I32); DEFINE_PRIM(_BYTES, get_current_game_language, _NO_ARG); DEFINE_PRIM(_BYTES, get_auth_ticket, _REF(_I32) _REF(_I32)); DEFINE_PRIM(_VOID, request_encrypted_app_ticket, _BYTES _I32 _FUN(_VOID, _BYTES _I32)); diff --git a/steam/Api.hx b/steam/Api.hx index 8372399..8a12e99 100644 --- a/steam/Api.hx +++ b/steam/Api.hx @@ -18,6 +18,23 @@ enum abstract SteamNotificationPosition(Int) to Int var BottomRight = 3; } +enum abstract GamepadTextInputMode(Int) to Int { + var Normal = 0; + var Password = 1; +} + +enum abstract GamepadTextInputLineMode(Int) to Int { + var SingleLine = 0; + var MultipleLines = 1; +} + +enum abstract FloatingGamepadTextInputMode(Int) to Int { + var SingleLine = 0; + var MultipleLines = 1; + var Email = 2; + var Numeric = 3; +} + typedef ControllerHandle = Int64; typedef ControllerActionSetHandle = Int; typedef ControllerDigitalActionHandle = Int; @@ -309,6 +326,12 @@ class Api return _IsSteamRunning(); } + public static function showFloatingGamepadTextInput(mode:FloatingGamepadTextInputMode, textFieldX:Int, textFieldY:Int, textFieldWidth:Int, textFieldHeight:Int) { + if (!active) + return false; + return _ShowFloatingGamepadTextInput(mode, textFieldX, textFieldY, textFieldWidth, textFieldHeight); + } + public static function openOverlay(url:String) { if (!active) return; _OpenOverlay(@:privateAccess url.toUtf8()); @@ -537,6 +560,7 @@ class Api @:hlNative("steam","is_steam_in_big_picture_mode") private static function _IsSteamInBigPictureMode() : Bool { return false; } @:hlNative("?steam","is_steam_running_on_steam_deck") private static function _IsSteamRunningOnSteamDeck() : Bool { return false; } @:hlNative("steam","is_steam_running") private static function _IsSteamRunning() : Bool { return false; } + @:hlNative("steam", "show_floating_gamepad_text_input") private static function _ShowFloatingGamepadTextInput(mode:Int, textFieldX:Int, textFieldY:Int, textFieldWidth:Int, textFieldHeight:Int):Bool return false; @:hlNative("steam","get_current_game_language") private static function _GetCurrentGameLanguage() : hl.Bytes { return null; } @:hlNative("steam","get_auth_ticket") private static function _GetAuthTicket( size : hl.Ref, authTicket : hl.Ref ) : hl.Bytes { return null; } @:hlNative("?steam","request_encrypted_app_ticket") private static function _RequestEncryptedAppTicket( data : hl.Bytes, size : Int, encryptedAppTicket : (hl.Bytes, Int) -> Void ) : Void { return; }