Skip to content

Commit

Permalink
chore(shared): add deprecation warnings, item type def (#498)
Browse files Browse the repository at this point in the history
* refactor(shared): add deprecation warnings, item type def

* refactor(shared): add warning and def for locations

* style: more descriptive deprecation
  • Loading branch information
solareon committed Jun 25, 2024
1 parent 8a3a2a2 commit 500115c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
17 changes: 16 additions & 1 deletion shared/items.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
---@class Item
---@field name string
---@field label string
---@field weight number
---@field type string
---@field ammotype? string
---@field image string
---@field unique boolean
---@field useable boolean
---@field shouldClose? boolean
---@field combineable? false|table
---@field description string

---@deprecated This file is deprecated and will be removed in the future. If you are utilizing QB-Core bridge functionality you will need to populate items here for them to be available in QBCore.Shared.Items. If not please add your items directly in ox_inventory/data/items.lua file. Currently items placed in here will be converted at next server restart.
---@type table<string, Item>
return {
-- WEAPONS
-- Melee
Expand Down Expand Up @@ -384,7 +399,7 @@ return {
['dendrogyra_coral'] = {['name'] = 'dendrogyra_coral', ['label'] = 'Dendrogyra', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'dendrogyra_coral.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Its also known as pillar coral'},
['antipatharia_coral'] = {['name'] = 'antipatharia_coral', ['label'] = 'Antipatharia', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'antipatharia_coral.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Its also known as black corals or thorn corals'},
['diving_gear'] = {['name'] = 'diving_gear', ['label'] = 'Diving Gear', ['weight'] = 30000, ['type'] = 'item', ['image'] = 'diving_gear.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'An oxygen tank and a rebreather'},
['diving_fill'] = {['name'] = 'diving_fill', ['label'] = 'Diving Tube', ['weight'] = 3000, ['type'] = 'item', ['image'] = 'diving_tube.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['discription'] = 'An oxygen tube and a rebreather'},
['diving_fill'] = {['name'] = 'diving_fill', ['label'] = 'Diving Tube', ['weight'] = 3000, ['type'] = 'item', ['image'] = 'diving_tube.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'An oxygen tube and a rebreather'},

-- Other Tools
['casinochips'] = {['name'] = 'casinochips', ['label'] = 'Casino Chips', ['weight'] = 0, ['type'] = 'item', ['image'] = 'casinochips.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Chips For Casino Gambling'},
Expand Down
2 changes: 2 additions & 0 deletions shared/locations.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---@deprecated This file is deprecated and will be removed in the future.
---@return table<string, vector4>
return {
-- Unknown/Random/Vanilla
['burgershot'] = vector4(-1199.0568, -882.4495, 13.3500, 209.1105),
Expand Down
1 change: 1 addition & 0 deletions shared/weapons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
---@field ammotype? string
---@field damagereason string

---@deprecated This file is deprecated and will be removed in the future. If you are utilizing QB-Core bridge functionality you will need to populate weapons here for them to be available in QBCore.Shared.Weapons. If not please add your weapons in ox_inventory/data/weapons.lua file. Currently weapons in this file will be converted on next server start.
---@type table<number, Weapon>
return {
-- // WEAPONS
Expand Down

0 comments on commit 500115c

Please sign in to comment.