From ffc42edefb1bf91bc0a6ea85335263a9efd33804 Mon Sep 17 00:00:00 2001 From: Freddy <33939455+freedy69@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:43:11 +0400 Subject: [PATCH] Document GetTattooShopDlcItemData (#987) * Document GetTattooShopDlcItemData Researched the struct values from shop_tattoo.meta and changed few stuff. * Update GetTattooShopDlcItemData.md Made the structure properties and character types into a table + added a LUA example. * Change the CharacterType param description * change tables to enums and structs * add suggested changes * tweak: add language tags to structs --------- Co-authored-by: Dillon Skaggs --- FILES/GetTattooShopDlcItemData.md | 94 ++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/FILES/GetTattooShopDlcItemData.md b/FILES/GetTattooShopDlcItemData.md index 426503ffc..3d8562717 100644 --- a/FILES/GetTattooShopDlcItemData.md +++ b/FILES/GetTattooShopDlcItemData.md @@ -9,51 +9,43 @@ aliases: ["0xFF56381874F82086","_GET_TATTOO_COLLECTION_DATA"] BOOL GET_TATTOO_SHOP_DLC_ITEM_DATA(int characterType, int decorationIndex, Any* outComponent); ``` +Returns data that adheres to the tattoo shop item data that is used in shop_tattoo.meta + Character types: -``` -0 = Michael, -1 = Franklin, -2 = Trevor, -3 = MPMale, -4 = MPFemale +```c +enum eTattooFaction +{ + TATTOO_SP_MICHAEL = 0, + TATTOO_SP_FRANKLIN = 1, + TATTOO_SP_TREVOR = 2, + TATTOO_MP_FM = 3, + TATTOO_MP_FM_F = 4 +} ``` -```csharp -enum TattooZoneData +Returned struct properties: +```c +struct sTattooShopItemValues { - ZONE_TORSO = 0, - ZONE_HEAD = 1, - ZONE_LEFT_ARM = 2, - ZONE_RIGHT_ARM = 3, - ZONE_LEFT_LEG = 4, - ZONE_RIGHT_LEG = 5, - ZONE_UNKNOWN = 6, - ZONE_NONE = 7, + int LockHash; // Lock hash, used with IS_CONTENT_ITEM_LOCKED + int Index; // Unique ID of this slot. It can also be 0. + int CollectionHash; // Collection hash of this tattoo + int PresetHash; // Preset hash of this tattoo + int Cost; // Cost of this tattoo in shops. + int eFacing; // Secondary placement of this tattoo. + int UpdateGroup; // Location of this tattoo on the body (for example, for torso there would be chest upper, stomach, etc) + const char* NameTextLabel; // This tattoo's name in the form of a text label. }; - -struct outComponent -{ - // these vars are suffixed with 4 bytes of padding each. - uint unk; - int unk2; - uint tattooCollectionHash; - uint tattooNameHash; - int unk3; - TattooZoneData zoneId; - uint unk4; - uint unk5; - // maybe more, not sure exactly, decompiled scripts are very vague around this part. -} ``` ## Parameters -* **characterType**: Character types 0 = Michael, 1 = Franklin, 2 = Trevor, 3 = MPMale, 4 = MPFemale. -* **decorationIndex**: Tattoo index, value between 0 and GetNumDecorations(characterType). +* **characterType**: Which character to get the tattoo data for (Refer to `eTattooFaction` above). +* **decorationIndex**: Tattoo index, value between 0 and [GET_NUM_TATTOO_SHOP_DLC_ITEMS](#_0x278F76C3B0A8F109). * **outComponent**: The referenced struct. ## Return value -A bool indicating that the tattoo data could be fetched(?) +A bool indicating that the tattoo data exists in the files. ## Examples ```js @@ -67,4 +59,40 @@ if (Citizen.invokeNative("0xFF56381874F82086", characterType, tattooIndex, struc Console.Log(JSON.stringify(structArray)); } ``` +```lua +local function TattooBlobToTable(blob) + local LockHash = string.unpack('