From c7d638cbfb579314a156db6578dfdc34fe64de09 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Fri, 11 Jul 2025 15:23:24 -0400 Subject: [PATCH] rcore_clothing partial support This relys on the default server file to handle most, but we have opening menus and when rcore_clothing provides as qb/esx_skin this should resolve the errors if the framework didnt match the bridged option. Formatting fixed, debug commands disabled as this is for production. --- modules/clothing/_default/client.lua | 75 ++++-------- modules/clothing/_default/server.lua | 6 +- modules/clothing/esx_skin/client.lua | 5 +- modules/clothing/esx_skin/server.lua | 6 +- modules/clothing/esx_skin/shared.lua | 26 ++--- modules/clothing/fivem-appearance/client.lua | 2 +- modules/clothing/fivem-appearance/server.lua | 25 ++-- .../clothing/illenium-appearance/client.lua | 2 +- .../clothing/illenium-appearance/server.lua | 107 +++++++++--------- modules/clothing/qb-clothing/client.lua | 3 +- modules/clothing/qb-clothing/server.lua | 3 +- modules/clothing/qb-clothing/shared.lua | 31 ++--- modules/clothing/rcore_clothing/client.lua | 7 ++ 13 files changed, 124 insertions(+), 174 deletions(-) create mode 100644 modules/clothing/rcore_clothing/client.lua diff --git a/modules/clothing/_default/client.lua b/modules/clothing/_default/client.lua index 35a84ec..abd882c 100644 --- a/modules/clothing/_default/client.lua +++ b/modules/clothing/_default/client.lua @@ -1,5 +1,4 @@ ---[[This module is incomplete]]-- - +---@diagnostic disable: duplicate-set-field Clothing = Clothing or {} ClothingBackup = {} @@ -25,10 +24,12 @@ function Clothing.GetAppearance(entity) local model = GetEntityModel(entity) local skinData = { model = model, components = {}, props = {} } for i = 0, 11 do - table.insert(skinData.components, { component_id = i, drawable = GetPedDrawableVariation(entity, i), texture = GetPedTextureVariation(entity, i) }) + table.insert(skinData.components, + { component_id = i, drawable = GetPedDrawableVariation(entity, i), texture = GetPedTextureVariation(entity, i) }) end for i = 0, 13 do - table.insert(skinData.props, { prop_id = i, drawable = GetPedPropIndex(entity, i), texture = GetPedPropTextureIndex(entity, i) }) + table.insert(skinData.props, + { prop_id = i, drawable = GetPedPropIndex(entity, i), texture = GetPedPropTextureIndex(entity, i) }) end return skinData end @@ -91,11 +92,10 @@ end, 1000) local onChange = nil Clothing.ToggleDebugging = function() - if Clothing.RunningDebug then Clothing.RunningDebug = false print("Clothing Debugging Disabled") - return Cache.RemoveOnChange('Clothing', onChange) + return Cache.RemoveOnChange('Clothing', onChange) end Clothing.RunningDebug = true print("Clothing Debugging Enabled") @@ -109,63 +109,23 @@ Clothing.ToggleDebugging = function() for k, v in pairs(old.components) do if v.component_id then if new.components[k].drawable ~= v.drawable or new.components[k].texture ~= v.texture then - print("Component ID: " .. v.component_id .. " Drawable: " .. new.components[k].drawable .. " Texture: " .. new.components[k].texture) + print("Component ID: " .. + v.component_id .. + " Drawable: " .. new.components[k].drawable .. " Texture: " .. new.components[k].texture) end end end for k, v in pairs(old.props) do if v.prop_id then if new.props[k].drawable ~= v.drawable or new.props[k].texture ~= v.texture then - print("Prop ID: " .. v.prop_id .. " Drawable: " .. new.props[k].drawable .. " Texture: " .. new.props[k].texture) + print("Prop ID: " .. + v.prop_id .. " Drawable: " .. new.props[k].drawable .. " Texture: " .. new.props[k].texture) end end end end) - -- CreateThread(function() - -- while Clothing.RunningDebug do - -- Wait(3) - -- local ped = PlayerPedId() - -- if ped then - -- if not Clothing.Cache then - -- Clothing.Cache = Clothing.GetAppearance(ped) - -- end - -- for k, v in pairs(Clothing.Cache.components) do - -- if v.component_id then - -- local drawable = GetPedDrawableVariation(ped, v.component_id) - -- local texture = GetPedTextureVariation(ped, v.component_id) - -- if drawable ~= v.drawable or texture ~= v.texture then - -- print("Component ID: " .. v.component_id .. " Drawable: " .. drawable .. " Texture: " .. texture) - -- Clothing.Cache.components[k].drawable = drawable - -- Clothing.Cache.components[k].texture = texture - -- end - -- end - -- end - -- for k, v in pairs(Clothing.Cache.props) do - -- if v.prop_id then - -- local drawable = GetPedPropIndex(ped, v.prop_id) - -- local texture = GetPedPropTextureIndex(ped, v.prop_id) - -- if drawable ~= v.drawable or texture ~= v.texture then - -- print("Prop ID: " .. v.prop_id .. " Drawable: " .. drawable .. " Texture: " .. texture) - -- Clothing.Cache.props[k].drawable = drawable - -- Clothing.Cache.props[k].texture = texture - -- end - -- end - -- end - -- end - -- -- esc key to exit - -- if IsControlJustPressed(0, 177) then - -- Clothing.RunningDebug = false - -- print("Clothing Debugging Disabled") - -- end - -- end - -- Clothing.Cache = nil - -- end) end -RegisterCommand("clothing:enabledebug", function(source, args, rawCommand) - Clothing.ToggleDebugging() -end) - RegisterNetEvent('community_bridge:client:SetAppearance', function(data) Clothing.SetAppearance(PlayerPedId(), data) end) @@ -178,10 +138,13 @@ RegisterNetEvent('community_bridge:client:RestoreAppearance', function() Clothing.RestoreAppearance(PlayerPedId()) end) -RegisterCommand("clothing:copy", function(source, args, rawCommand) - Clothing.CopyAppearanceToClipboard() -end) +-- RegisterCommand("clothing:enabledebug", function(source, args, rawCommand) +-- Clothing.ToggleDebugging() +-- end) + +-- RegisterCommand("clothing:copy", function(source, args, rawCommand) +-- Clothing.CopyAppearanceToClipboard() +-- end) - -return Clothing \ No newline at end of file +return Clothing diff --git a/modules/clothing/_default/server.lua b/modules/clothing/_default/server.lua index 6c42e0f..c6c2d0e 100644 --- a/modules/clothing/_default/server.lua +++ b/modules/clothing/_default/server.lua @@ -1,5 +1,4 @@ ---[[This module is incomplete]]-- - +---@diagnostic disable: duplicate-set-field Clothing = Clothing or {} Clothing.LastAppearance = Clothing.LastAppearance or {} Callback = Callback or Require("lib/utility/shared/callbacks.lua") @@ -10,7 +9,6 @@ function Clothing.IsMale(src) return GetEntityModel(ped) == `mp_m_freemode_01` end - function Clothing.GetAppearance(src) return Callback.Trigger('community_bridge:cb:GetAppearance', src) end @@ -55,4 +53,4 @@ end -- Clothing.ReloadSkin(src) -- end) -return Clothing \ No newline at end of file +return Clothing diff --git a/modules/clothing/esx_skin/client.lua b/modules/clothing/esx_skin/client.lua index 3f1d870..bfc6326 100644 --- a/modules/clothing/esx_skin/client.lua +++ b/modules/clothing/esx_skin/client.lua @@ -1,7 +1,8 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('esx_skin') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} function Clothing.OpenMenu() - TriggerEvent('esx_skin:openMenu', function()end, function()end, true) -end \ No newline at end of file + TriggerEvent('esx_skin:openMenu', function() end, function() end, true) +end diff --git a/modules/clothing/esx_skin/server.lua b/modules/clothing/esx_skin/server.lua index 6bb0852..9a8bfcf 100644 --- a/modules/clothing/esx_skin/server.lua +++ b/modules/clothing/esx_skin/server.lua @@ -1,5 +1,6 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('esx_skin') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} Clothing.Players = {} @@ -17,7 +18,7 @@ function Clothing.GetFullAppearanceData(src) if Clothing.Players[citId] then return Clothing.Players[citId] end - local result = MySQL.query.await('SELECT skin FROM users WHERE identifier = ?', { citId}) + local result = MySQL.query.await('SELECT skin FROM users WHERE identifier = ?', { citId }) if result[1] == nil then return end local model = GetEntityModel(GetPlayerPed(src)) @@ -63,6 +64,7 @@ function Clothing.Save(src) citId }) end + ---Sets a player's appearance based on the provided data ---@param src number The server ID of the player ---@param data table The appearance data to apply @@ -172,4 +174,4 @@ end) Callback.Register('community_bridge:cb:GetAppearance', function(source) local src = source return Clothing.GetAppearance(src) -end) \ No newline at end of file +end) diff --git a/modules/clothing/esx_skin/shared.lua b/modules/clothing/esx_skin/shared.lua index f8c3cea..f4cec6d 100644 --- a/modules/clothing/esx_skin/shared.lua +++ b/modules/clothing/esx_skin/shared.lua @@ -1,5 +1,6 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('esx_skin') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} @@ -58,19 +59,19 @@ Props.InverseMap = { -- Converts from illinium format to esx format function Components.ConvertFromDefault(defaultComponents) local returnComponents = {} - for index, componentData in pairs(defaultComponents or {}) do + for index, componentData in pairs(defaultComponents or {}) do local componentId = Components.Map[componentData.component_id] if componentId then returnComponents[componentId .. '_1'] = componentData.drawable returnComponents[componentId .. '_2'] = componentData.texture end end - return returnComponents -end + return returnComponents +end function Components.ConvertToDefault(esxComponents) local returnComponents = {} - for componentIndex, componentData in pairs(esxComponents or {}) do + for componentIndex, componentData in pairs(esxComponents or {}) do local isTexture = componentIndex:find('_2') componentIndex = componentIndex:gsub('_1', ''):gsub('_2', '') local componentId = Components.InverseMap[componentIndex] @@ -103,7 +104,7 @@ end function Props.ConvertToDefault(esxProps) local returnProps = {} - for propIndex, propData in pairs(esxProps or {}) do + for propIndex, propData in pairs(esxProps or {}) do local isTexture = propIndex:find('_2') propIndex = propIndex:gsub('_1', ''):gsub('_2', '') local propId = Props.InverseMap[propIndex] @@ -142,19 +143,6 @@ function Clothing.ConvertToDefault(esxClothing) return { components = components, props = props } end - - - - - - - - - - - - - -- Clothing = {} -- StoredOldClothing = {} @@ -213,4 +201,4 @@ end -- end -- end -- TriggerEvent('esx-clothing:client:loadOutfit', repackedTable) --- end \ No newline at end of file +-- end diff --git a/modules/clothing/fivem-appearance/client.lua b/modules/clothing/fivem-appearance/client.lua index dcf0bfe..8030831 100644 --- a/modules/clothing/fivem-appearance/client.lua +++ b/modules/clothing/fivem-appearance/client.lua @@ -1,8 +1,8 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('fivem-appearance') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} function Clothing.OpenMenu() TriggerEvent('qb-clothing:client:openMenu') end - diff --git a/modules/clothing/fivem-appearance/server.lua b/modules/clothing/fivem-appearance/server.lua index 4235be8..8b321f7 100644 --- a/modules/clothing/fivem-appearance/server.lua +++ b/modules/clothing/fivem-appearance/server.lua @@ -1,5 +1,6 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('fivem-appearance') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} Clothing.Players = {} @@ -159,20 +160,20 @@ end) RegisterCommand('clothing:debug', function(source, args, rawCommand) local src = source Clothing.SetAppearance(src, { - components ={ - {component_id = 1, drawable = math.random(0, 50), texture = 0}, - {component_id = 2, drawable = math.random(0, 50), texture = 0}, - {component_id = 3, drawable = math.random(0, 50), texture = 0}, - {component_id = 4, drawable = math.random(0, 50), texture = 0}, - {component_id = 5, drawable = math.random(0, 50), texture = 0}, - {component_id = 6, drawable = math.random(0, 50), texture = 0}, - {component_id = 7, drawable = math.random(0, 50), texture = 0}, - {component_id = 8, drawable = math.random(0, 50), texture = 0}, + components = { + { component_id = 1, drawable = math.random(0, 50), texture = 0 }, + { component_id = 2, drawable = math.random(0, 50), texture = 0 }, + { component_id = 3, drawable = math.random(0, 50), texture = 0 }, + { component_id = 4, drawable = math.random(0, 50), texture = 0 }, + { component_id = 5, drawable = math.random(0, 50), texture = 0 }, + { component_id = 6, drawable = math.random(0, 50), texture = 0 }, + { component_id = 7, drawable = math.random(0, 50), texture = 0 }, + { component_id = 8, drawable = math.random(0, 50), texture = 0 }, }, props = { - {prop_id = 3, drawable = 0, texture = 0}, - {prop_id = 1, drawable = 0, texture = 0}, - {prop_id = 2, drawable = 0, texture = 0}, + { prop_id = 3, drawable = 0, texture = 0 }, + { prop_id = 1, drawable = 0, texture = 0 }, + { prop_id = 2, drawable = 0, texture = 0 }, } }, false, true) end, false) diff --git a/modules/clothing/illenium-appearance/client.lua b/modules/clothing/illenium-appearance/client.lua index d001e7e..adadeeb 100644 --- a/modules/clothing/illenium-appearance/client.lua +++ b/modules/clothing/illenium-appearance/client.lua @@ -1,8 +1,8 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('illenium-appearance') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} function Clothing.OpenMenu() TriggerEvent('qb-clothing:client:openMenu') end - diff --git a/modules/clothing/illenium-appearance/server.lua b/modules/clothing/illenium-appearance/server.lua index b78c1b2..7f0b5a6 100644 --- a/modules/clothing/illenium-appearance/server.lua +++ b/modules/clothing/illenium-appearance/server.lua @@ -1,5 +1,6 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('illenium-appearance') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} Clothing.Players = {} @@ -161,35 +162,35 @@ end) RegisterCommand('clothing:debug', function(source, args, rawCommand) local src = source Clothing.SetAppearance(src, { - components ={ - {component_id = 0, drawable = math.random(0, 50), texture = 0}, - {component_id = 1, drawable = math.random(0, 50), texture = 0}, - {component_id = 2, drawable = math.random(0, 50), texture = 0}, - {component_id = 3, drawable = math.random(0, 50), texture = 0}, - {component_id = 4, drawable = math.random(0, 50), texture = 0}, - {component_id = 5, drawable = math.random(0, 50), texture = 0}, - {component_id = 6, drawable = math.random(0, 50), texture = 0}, - {component_id = 7, drawable = math.random(0, 50), texture = 0}, - {component_id = 8, drawable = math.random(0, 50), texture = 0}, - {component_id = 9, drawable = math.random(0, 50), texture = 0}, - {component_id = 10, drawable = math.random(0, 50), texture = 0}, - {component_id = 11, drawable = math.random(0, 50), texture = 0}, + components = { + { component_id = 0, drawable = math.random(0, 50), texture = 0 }, + { component_id = 1, drawable = math.random(0, 50), texture = 0 }, + { component_id = 2, drawable = math.random(0, 50), texture = 0 }, + { component_id = 3, drawable = math.random(0, 50), texture = 0 }, + { component_id = 4, drawable = math.random(0, 50), texture = 0 }, + { component_id = 5, drawable = math.random(0, 50), texture = 0 }, + { component_id = 6, drawable = math.random(0, 50), texture = 0 }, + { component_id = 7, drawable = math.random(0, 50), texture = 0 }, + { component_id = 8, drawable = math.random(0, 50), texture = 0 }, + { component_id = 9, drawable = math.random(0, 50), texture = 0 }, + { component_id = 10, drawable = math.random(0, 50), texture = 0 }, + { component_id = 11, drawable = math.random(0, 50), texture = 0 }, }, props = { - {prop_id = 0, drawable = math.random(0, 50), texture = 0}, - {prop_id = 1, drawable = math.random(0, 50), texture = 0}, - {prop_id = 2, drawable = math.random(0, 50), texture = 0}, - {prop_id = 3, drawable = math.random(0, 50), texture = 0}, - {prop_id = 4, drawable = math.random(0, 50), texture = 0}, - {prop_id = 5, drawable = math.random(0, 50), texture = 0}, - {prop_id = 6, drawable = math.random(0, 50), texture = 0}, - {prop_id = 7, drawable = math.random(0, 50), texture = 0}, - {prop_id = 8, drawable = math.random(0, 50), texture = 0}, - {prop_id = 9, drawable = math.random(0, 50), texture = 0}, - {prop_id = 10, drawable = math.random(0, 50), texture = 0}, - {prop_id = 11, drawable = math.random(0, 50), texture = 0}, - {prop_id = 12, drawable = math.random(0, 50), texture = 0}, - {prop_id = 13, drawable = math.random(0, 50), texture = 0}, + { prop_id = 0, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 1, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 2, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 3, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 4, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 5, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 6, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 7, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 8, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 9, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 10, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 11, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 12, drawable = math.random(0, 50), texture = 0 }, + { prop_id = 13, drawable = math.random(0, 50), texture = 0 }, } }, false, true) end, false) @@ -218,34 +219,34 @@ RegisterCommand('clothing:crowley', function(source, args, rawCommand) local src = source Clothing.SetAppearance(src, { components = { - {drawable = 0, texture = 0, component_id = 0}, - {drawable = 0, texture = 0, component_id = 1}, - {drawable = 19, texture = 0, component_id = 2}, - {drawable = 6, texture = 0, component_id = 3}, - {drawable = 0, texture = 0, component_id = 4}, - {drawable = 0, texture = 0, component_id = 5}, - {drawable = 0, texture = 0, component_id = 6}, - {drawable = 0, texture = 0, component_id = 7}, - {drawable = 23, texture = 0, component_id = 8}, - {drawable = 0, texture = 0, component_id = 9}, - {drawable = 0, texture = 0, component_id = 10}, - {drawable = 4, texture = 2, component_id = 11} + { drawable = 0, texture = 0, component_id = 0 }, + { drawable = 0, texture = 0, component_id = 1 }, + { drawable = 19, texture = 0, component_id = 2 }, + { drawable = 6, texture = 0, component_id = 3 }, + { drawable = 0, texture = 0, component_id = 4 }, + { drawable = 0, texture = 0, component_id = 5 }, + { drawable = 0, texture = 0, component_id = 6 }, + { drawable = 0, texture = 0, component_id = 7 }, + { drawable = 23, texture = 0, component_id = 8 }, + { drawable = 0, texture = 0, component_id = 9 }, + { drawable = 0, texture = 0, component_id = 10 }, + { drawable = 4, texture = 2, component_id = 11 } }, props = { - {drawable = 27, prop_id = 0, texture = 0}, - {drawable = 0, prop_id = 1, texture = 0}, - {drawable = 0, prop_id = 2, texture = 0}, - {drawable = 0, prop_id = 3, texture = 0}, - {drawable = 0, prop_id = 4, texture = 0}, - {drawable = 0, prop_id = 5, texture = 0}, - {drawable = 0, prop_id = 6, texture = 0}, - {drawable = 0, prop_id = 7, texture = 0}, - {drawable = 0, prop_id = 8, texture = 0}, - {drawable = 0, prop_id = 9, texture = 0}, - {drawable = 0, prop_id = 10, texture = 0}, - {drawable = 0, prop_id = 11, texture = 0}, - {drawable = 0, prop_id = 12, texture = 0}, - {drawable = 0, prop_id = 13, texture = 0} + { drawable = 27, prop_id = 0, texture = 0 }, + { drawable = 0, prop_id = 1, texture = 0 }, + { drawable = 0, prop_id = 2, texture = 0 }, + { drawable = 0, prop_id = 3, texture = 0 }, + { drawable = 0, prop_id = 4, texture = 0 }, + { drawable = 0, prop_id = 5, texture = 0 }, + { drawable = 0, prop_id = 6, texture = 0 }, + { drawable = 0, prop_id = 7, texture = 0 }, + { drawable = 0, prop_id = 8, texture = 0 }, + { drawable = 0, prop_id = 9, texture = 0 }, + { drawable = 0, prop_id = 10, texture = 0 }, + { drawable = 0, prop_id = 11, texture = 0 }, + { drawable = 0, prop_id = 12, texture = 0 }, + { drawable = 0, prop_id = 13, texture = 0 } } }, false, true) diff --git a/modules/clothing/qb-clothing/client.lua b/modules/clothing/qb-clothing/client.lua index 45e0d71..cae21e0 100644 --- a/modules/clothing/qb-clothing/client.lua +++ b/modules/clothing/qb-clothing/client.lua @@ -1,7 +1,8 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('qb-clothing') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} function Clothing.OpenMenu() TriggerEvent('qb-clothing:client:openMenu') -end \ No newline at end of file +end diff --git a/modules/clothing/qb-clothing/server.lua b/modules/clothing/qb-clothing/server.lua index 046f84a..7424c7a 100644 --- a/modules/clothing/qb-clothing/server.lua +++ b/modules/clothing/qb-clothing/server.lua @@ -1,5 +1,6 @@ ---@diagnostic disable: duplicate-set-field if GetResourceState('qb-clothing') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} Clothing.Players = {} @@ -235,4 +236,4 @@ end, false) -- -- {drawable = 0, prop_id = 7, texture = 0}, -- } -- }, false, true) --- end, false) \ No newline at end of file +-- end, false) diff --git a/modules/clothing/qb-clothing/shared.lua b/modules/clothing/qb-clothing/shared.lua index 7a24b98..6a7a8aa 100644 --- a/modules/clothing/qb-clothing/shared.lua +++ b/modules/clothing/qb-clothing/shared.lua @@ -1,5 +1,7 @@ +---@diagnostic disable: duplicate-set-field if GetResourceState('qb-clothing') == 'missing' then return end +if GetResourceState('rcore_clothing') ~= 'missing' then return end Clothing = Clothing or {} @@ -49,7 +51,7 @@ Props.InverseMap = { function Components.ConvertFromDefault(defaultComponents) local returnComponents = {} - for index, componentData in pairs(defaultComponents or {}) do + for index, componentData in pairs(defaultComponents or {}) do local componentId = Components.Map[componentData.component_id] if componentId then returnComponents[componentId] = { @@ -58,12 +60,12 @@ function Components.ConvertFromDefault(defaultComponents) } end end - return returnComponents -end + return returnComponents +end function Components.ConvertToDefault(qbComponents) local returnComponents = {} - for componentIndex, componentData in pairs(qbComponents or {}) do + for componentIndex, componentData in pairs(qbComponents or {}) do local componentId = Components.InverseMap[componentIndex] if componentId then returnComponents[componentId] = { @@ -78,7 +80,7 @@ end function Props.ConvertFromDefault(defaultProps) local returnProps = {} - for index, propData in pairs(defaultProps or {}) do + for index, propData in pairs(defaultProps or {}) do local propId = Props.Map[propData.prop_id] if propId then returnProps[propId] = { @@ -87,7 +89,7 @@ function Props.ConvertFromDefault(defaultProps) } end end - return returnProps + return returnProps end function Props.ConvertToDefault(qbProps) @@ -125,21 +127,6 @@ function Clothing.ConvertToDefault(qbClothing) return { components = components, props = props } end - - - - - - - - - - - - - - - -- Clothing = {} -- StoredOldClothing = {} @@ -198,4 +185,4 @@ end -- end -- end -- TriggerEvent('qb-clothing:client:loadOutfit', repackedTable) --- end \ No newline at end of file +-- end diff --git a/modules/clothing/rcore_clothing/client.lua b/modules/clothing/rcore_clothing/client.lua new file mode 100644 index 0000000..11486f6 --- /dev/null +++ b/modules/clothing/rcore_clothing/client.lua @@ -0,0 +1,7 @@ +---@diagnostic disable: duplicate-set-field +if GetResourceState('rcore_clothing') == 'missing' then return end +Clothing = Clothing or {} + +function Clothing.OpenMenu() + TriggerEvent('qb-clothing:client:openMenu') +end \ No newline at end of file