diff --git a/HUD/ForceCloseTextInputBox.md b/HUD/ForceCloseTextInputBox.md index 590404fe4..0144adc07 100644 --- a/HUD/ForceCloseTextInputBox.md +++ b/HUD/ForceCloseTextInputBox.md @@ -1,12 +1,10 @@ --- ns: HUD -aliases: ["0x8817605C2BA76200"] +aliases: ["0x8817605C2BA76200", "_FORCE_CLOSE_TEXT_INPUT_BOX"] --- -## _FORCE_CLOSE_TEXT_INPUT_BOX +## FORCE_CLOSE_TEXT_INPUT_BOX ```c // 0x8817605C2BA76200 -void _FORCE_CLOSE_TEXT_INPUT_BOX(); +void FORCE_CLOSE_TEXT_INPUT_BOX(); ``` - - diff --git a/HUD/N_0x1185a8087587322c.md b/HUD/N_0x1185a8087587322c.md deleted file mode 100644 index c00cd189a..000000000 --- a/HUD/N_0x1185a8087587322c.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -ns: HUD ---- -## _0x1185A8087587322C - -```c -// 0x1185A8087587322C -void _0x1185A8087587322C(BOOL p0); -``` - -``` -SET_TEXT_??? - Used in golf and golf_mp -``` - -## Parameters -* **p0**: - diff --git a/HUD/N_0x577599cced639ca2.md b/HUD/N_0x577599cced639ca2.md deleted file mode 100644 index e51153455..000000000 --- a/HUD/N_0x577599cced639ca2.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -ns: HUD ---- -## _0x577599CCED639CA2 - -```c -// 0x577599CCED639CA2 -void _0x577599CCED639CA2(Any p0); -``` - - -## Parameters -* **p0**: - diff --git a/HUD/SetAllowCommaOnTextInput.md b/HUD/SetAllowCommaOnTextInput.md new file mode 100644 index 000000000..b5955e85d --- /dev/null +++ b/HUD/SetAllowCommaOnTextInput.md @@ -0,0 +1,16 @@ +--- +ns: HUD +aliases: ["0x577599CCED639CA2"] +--- +## SET_ALLOW_COMMA_ON_TEXT_INPUT + +```c +// 0x577599CCED639CA2 +void SET_ALLOW_COMMA_ON_TEXT_INPUT(cs_type(Any) BOOL allow); +``` + +**NOTE:** This must be called before you open the text input box. + +## Parameters +* **allow**: Toggles if the comma can be used in conjuction with the `filename` text input box type. + diff --git a/HUD/SetTextInputBoxEnabled.md b/HUD/SetTextInputBoxEnabled.md new file mode 100644 index 000000000..ccaab6614 --- /dev/null +++ b/HUD/SetTextInputBoxEnabled.md @@ -0,0 +1,16 @@ +--- +ns: HUD +aliases: ["0x1185A8087587322C"] +--- +## SET_TEXT_INPUT_BOX_ENABLED + +```c +// 0x1185A8087587322C +void SET_TEXT_INPUT_BOX_ENABLED(BOOL state); +``` + +Toggles if the text input box can be opened with [`DISPLAY_ONSCREEN_KEYBOARD`](#_0x00DC833F2568DBF6). + +## Parameters +* **state**: + diff --git a/MISC/CancelOnscreenKeyboard.md b/MISC/CancelOnscreenKeyboard.md index 2f39885a5..2126cf604 100644 --- a/MISC/CancelOnscreenKeyboard.md +++ b/MISC/CancelOnscreenKeyboard.md @@ -1,16 +1,15 @@ --- ns: MISC -aliases: ["0x58A39BE597CE99CD"] +aliases: ["0x58A39BE597CE99CD", "_CANCEL_ONSCREEN_KEYBOARD"] --- -## _CANCEL_ONSCREEN_KEYBOARD +## CANCEL_ONSCREEN_KEYBOARD ```c // 0x58A39BE597CE99CD 0x196444BB -void _CANCEL_ONSCREEN_KEYBOARD(); +void CANCEL_ONSCREEN_KEYBOARD(); ``` -``` -DO NOT use this as it doesn't clean up the text input box properly and your script will get stuck in the UPDATE_ONSCREEN_KEYBOARD() loop. -Use _FORCE_CLOSE_TEXT_INPUT_BOX instead. -CANCEL_* -``` +Closes the onscreen keyboard on console versions of the game. + +**NOTE:** Do not use this native in FiveM/PC, because [`UPDATE_ONSCREEN_KEYBOARD`](#_0x0CF2B696BBF945AE) value doesn't get cleaned up and stays as `0`. +You should use [`FORCE_CLOSE_TEXT_INPUT_BOX`](#_0x8817605C2BA76200) instead. diff --git a/MISC/DisplayOnscreenKeyboard.md b/MISC/DisplayOnscreenKeyboard.md index 0957e9511..c0f9d4992 100644 --- a/MISC/DisplayOnscreenKeyboard.md +++ b/MISC/DisplayOnscreenKeyboard.md @@ -5,45 +5,53 @@ ns: MISC ```c // 0x00DC833F2568DBF6 0xAD99F2CE -void DISPLAY_ONSCREEN_KEYBOARD(int p0, char* windowTitle, char* p2, char* defaultText, char* defaultConcat1, char* defaultConcat2, char* defaultConcat3, int maxInputLength); +void DISPLAY_ONSCREEN_KEYBOARD(int keyboardType, char* windowTitle, char* description, char* defaultText, char* defaultConcat1, char* defaultConcat2, char* defaultConcat3, int maxInputLength); ``` +Displays a text input box. + ``` -windowTitle's ------------------ -CELL_EMAIL_BOD = "Enter your Eyefind message" -CELL_EMAIL_BODE = "Message too long. Try again" -CELL_EMAIL_BODF = "Forbidden message. Try again" -CELL_EMAIL_SOD = "Enter your Eyefind subject" -CELL_EMAIL_SODE = "Subject too long. Try again" -CELL_EMAIL_SODF = "Forbidden text. Try again" -CELL_EMASH_BOD = "Enter your Eyefind message" -CELL_EMASH_BODE = "Message too long. Try again" -CELL_EMASH_BODF = "Forbidden message. Try again" -CELL_EMASH_SOD = "Enter your Eyefind subject" -CELL_EMASH_SODE = "Subject too long. Try again" -CELL_EMASH_SODF = "Forbidden Text. Try again" -FMMC_KEY_TIP10 = "Enter Synopsis" -FMMC_KEY_TIP12 = "Enter Custom Team Name" -FMMC_KEY_TIP12F = "Forbidden Text. Try again" -FMMC_KEY_TIP12N = "Custom Team Name" -FMMC_KEY_TIP8 = "Enter Message" -FMMC_KEY_TIP8F = "Forbidden Text. Try again" -FMMC_KEY_TIP8FS = "Invalid Message. Try again" -FMMC_KEY_TIP8S = "Enter Message" -FMMC_KEY_TIP9 = "Enter Outfit Name" -FMMC_KEY_TIP9F = "Invalid Outfit Name. Try again" -FMMC_KEY_TIP9N = "Outfit Name" -PM_NAME_CHALL = "Enter Challenge Name" +enum eKeyboardType +{ + ONSCREEN_KEYBOARD_ENGLISH = 0, + ONSCREEN_KEYBOARD_LOCALISED = 1, + ONSCREEN_KEYBOARD_PASSWORD = 2, + ONSCREEN_KEYBOARD_GAMERTAG = 3, + ONSCREEN_KEYBOARD_EMAIL = 4, + ONSCREEN_KEYBOARD_BASIC_ENGLISH = 5, + ONSCREEN_KEYBOARD_FILENAME = 6 +}; ``` ## Parameters -* **p0**: -* **windowTitle**: -* **p2**: -* **defaultText**: +* **keyboardType**: See the list above. Default is `0`. +* **windowTitle**: Text label for the title of the box. +* **description**: Has no use on PC. +* **defaultText**: Default text that is written in the input field. * **defaultConcat1**: * **defaultConcat2**: * **defaultConcat3**: -* **maxInputLength**: +* **maxInputLength**: Max number of characters that can be typed (2 - 256). + + +## Examples +```lua +AddTextEntry("my_input_title", "Enter something cool:") + +DisplayOnscreenKeyboard(0, "my_input_title", "", "", "", "", "", 30) -- Show the text input box +while UpdateOnscreenKeyboard() == 0 do Wait(0) end -- Wait for the user to stop editing + +-- This block of code is reached after the user is done editing + +local inputUpdate = UpdateOnscreenKeyboard() + +if inputUpdate == 1 then -- User hit OK in the text input box + local result = GetOnscreenKeyboardResult() + print("You wrote this in the input box:", result) +elseif inputUpdate == 2 then + print("You canceled the input!") +else -- -1 or 3 + print("An error has occurred") +end +``` diff --git a/MISC/DisplayOnscreenKeyboardWithLongerInitialString.md b/MISC/DisplayOnscreenKeyboardWithLongerInitialString.md index 3db380641..d289e661c 100644 --- a/MISC/DisplayOnscreenKeyboardWithLongerInitialString.md +++ b/MISC/DisplayOnscreenKeyboardWithLongerInitialString.md @@ -6,14 +6,16 @@ aliases: ["0xCA78CFA0366592FE","_DISPLAY_ONSCREEN_KEYBOARD_2"] ```c // 0xCA78CFA0366592FE 0xD2688412 -void DISPLAY_ONSCREEN_KEYBOARD_WITH_LONGER_INITIAL_STRING(int p0, char* windowTitle, Any* p2, char* defaultText, char* defaultConcat1, char* defaultConcat2, char* defaultConcat3, char* defaultConcat4, char* defaultConcat5, char* defaultConcat6, char* defaultConcat7, int maxInputLength); +void DISPLAY_ONSCREEN_KEYBOARD_WITH_LONGER_INITIAL_STRING(int keyboardType, char* windowTitle, cs_type(AnyPtr) char* description, char* defaultText, char* defaultConcat1, char* defaultConcat2, char* defaultConcat3, char* defaultConcat4, char* defaultConcat5, char* defaultConcat6, char* defaultConcat7, int maxInputLength); ``` +Displays the text input box with support for input with 500 characters. + ## Parameters -* **p0**: -* **windowTitle**: -* **p2**: -* **defaultText**: +* **keyboardType**: See [`DISPLAY_ONSCREEN_KEYBOARD`](#_0x00DC833F2568DBF6) +* **windowTitle**: Text label of the window title. +* **description**: Unused on PC. +* **defaultText**: Default text that is written in the input field. * **defaultConcat1**: * **defaultConcat2**: * **defaultConcat3**: @@ -21,5 +23,5 @@ void DISPLAY_ONSCREEN_KEYBOARD_WITH_LONGER_INITIAL_STRING(int p0, char* windowTi * **defaultConcat5**: * **defaultConcat6**: * **defaultConcat7**: -* **maxInputLength**: +* **maxInputLength**: Value between 2 - 500. diff --git a/MISC/NextOnscreenKeyboardResultWillDisplayUsingTheseFonts.md b/MISC/NextOnscreenKeyboardResultWillDisplayUsingTheseFonts.md index 29d308114..5476bf464 100644 --- a/MISC/NextOnscreenKeyboardResultWillDisplayUsingTheseFonts.md +++ b/MISC/NextOnscreenKeyboardResultWillDisplayUsingTheseFonts.md @@ -6,14 +6,24 @@ aliases: ["0x3ED1438C1F5C6612"] ```c // 0x3ED1438C1F5C6612 0x3301EA47 -void NEXT_ONSCREEN_KEYBOARD_RESULT_WILL_DISPLAY_USING_THESE_FONTS(int p0); +void NEXT_ONSCREEN_KEYBOARD_RESULT_WILL_DISPLAY_USING_THESE_FONTS(int fontBitField); ``` ``` -p0 was always 2 in R* scripts. -Called before calling DISPLAY_ONSCREEN_KEYBOARD if the input needs to be saved. +enum eFontBitField +{ + FONT_BIT_STANDARD = 1, + FONT_BIT_CURSIVE = 2, + FONT_BIT_ROCKSTAR_TAG = 4 + FONT_BIT_LEADERBOARD = 8 + FONT_BIT_CONDENSED = 16 + FONT_BIT_FIXED_WIDTH_NUMBERS = 32 + FONT_BIT_CONDENSED_NOT_GAMERNAME = 64 + FONT_BIT_PRICEDOWN = 128 +}; ``` ## Parameters -* **p0**: +* **fontBitField**: See the list above. + diff --git a/MISC/UpdateOnscreenKeyboard.md b/MISC/UpdateOnscreenKeyboard.md index fc55261f2..b18228e8c 100644 --- a/MISC/UpdateOnscreenKeyboard.md +++ b/MISC/UpdateOnscreenKeyboard.md @@ -8,13 +8,18 @@ ns: MISC int UPDATE_ONSCREEN_KEYBOARD(); ``` +Returns the current state of the text input box. + ``` -Returns the current status of the onscreen keyboard, and updates the output. -Status Codes: --1: Keyboard isn't active -0: User still editing -1: User has finished editing -2: User has canceled editing +enum eOSKStatus +{ + OSK_INVALID = -1, + OSK_PENDING = 0, + OSK_SUCCESS = 1, + OSK_CANCELLED = 2, + OSK_FAILED = 3 +}; ``` ## Return value +Returns a value from the list above.