rootcause Posted July 5, 2020 Posted July 5, 2020 (edited) This function aims to simplify mp.game.gameplay.displayOnscreenKeyboard usage by doing all the work for you and returning a promise. Options title: Title shown on the input box. Default: empty string defaultText: Default value of the input box. Default: empty string maxLength: Obvious enough, maximum length of the input. Default: 32 showMaxLength: If true, will display max length on title. Default: false trimResult: Removes whitespace from the player's input. Default: true rejectIfEmpty: If true, empty input causes promise rejection instead of resolving with an empty string. Default: true timeout: If higher than 0, input box will close & promise will be rejected with the reason "timeout" if the player fails to write something in specified milliseconds. Default: 0 Rejection reasons empty: When the player didn't write anything, needs rejectIfEmpty option to be true. cancelled: When the player closes the input box. keyboard_not_active: No idea on this one, it was in the native description so it's supported. timeout: When the player fails to write something in the specified time, needs timeout option to be set. Download The function and example is on GitHub Gist: https://gist.github.com/root-cause/5137a2b71c922bd24534462595b84a0f Notes - Needs RAGE Multiplayer 1.1 and above since it uses GXT API. Edited July 5, 2020 by rootcause 2 1 1
enisn Posted December 26, 2020 Posted December 26, 2020 Thank you, this helps so much. Also I needed it in Client-Side C# and made something similar: [C#] GetUserInputAsync - Resources - RAGE Multiplayer Community 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now