Skip to content

Commit 43334c1

Browse files
Merge pull request #641 from MrNewb/main
Refactor inventory messages and animations
2 parents 2bdea9b + b7334b4 commit 43334c1

10 files changed

Lines changed: 127 additions & 98 deletions

File tree

client/drops.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RegisterNetEvent('qb-inventory:client:setupDropTarget', function(dropId)
4646
exports['qb-target']:AddTargetEntity(bag, {
4747
options = {
4848
{
49-
icon = 'fas fa-backpack',
49+
icon = 'fa-solid fa-suitcase',
5050
label = Lang:t('menu.o_bag'),
5151
action = function()
5252
TriggerServerEvent('qb-inventory:server:openDrop', newDropId)
@@ -55,13 +55,13 @@ RegisterNetEvent('qb-inventory:client:setupDropTarget', function(dropId)
5555
},
5656
{
5757
icon = 'fas fa-hand-pointer',
58-
label = 'Pick up bag',
58+
label = Lang:t('menu.p_bag'),
5959
action = function()
6060
if IsPedArmed(PlayerPedId(), 4) then
61-
return QBCore.Functions.Notify("You can not be holding a Gun and a Bag!", "error", 5500)
61+
return QBCore.Functions.Notify(Lang:t('notify.nogunbag'), "error", 5500)
6262
end
6363
if HoldingDrop then
64-
return QBCore.Functions.Notify("Your already holding a bag, Go Drop it!", "error", 5500)
64+
return QBCore.Functions.Notify(Lang:t('notify.hasbag'), "error", 5500)
6565
end
6666
AttachEntityToEntity(
6767
bag,
@@ -78,7 +78,7 @@ RegisterNetEvent('qb-inventory:client:setupDropTarget', function(dropId)
7878
bagObject = bag
7979
HoldingDrop = true
8080
heldDrop = newDropId
81-
exports['qb-core']:DrawText('Press [G] to drop the bag')
81+
exports['qb-core']:DrawText(Lang:t('interaction.drop_bag'))
8282
end,
8383
}
8484
},

client/main.lua

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ end)
3131

3232
-- Functions
3333

34-
function LoadAnimDict(dict)
35-
if HasAnimDictLoaded(dict) then return end
36-
37-
RequestAnimDict(dict)
38-
while not HasAnimDictLoaded(dict) do
39-
Wait(10)
40-
end
41-
end
42-
4334
local function FormatWeaponAttachments(itemdata)
4435
if not itemdata.info or not itemdata.info.attachments or #itemdata.info.attachments == 0 then
4536
return {}
@@ -180,8 +171,9 @@ end)
180171

181172
RegisterNetEvent('qb-inventory:client:giveAnim', function()
182173
if IsPedInAnyVehicle(PlayerPedId(), false) then return end
183-
LoadAnimDict('mp_common')
184-
TaskPlayAnim(PlayerPedId(), 'mp_common', 'givetake1_b', 8.0, 1.0, -1, 16, 0, false, false, false)
174+
local animDict = 'mp_common'
175+
QBCore.Functions.RequestAnimDict(animDict)
176+
TaskPlayAnim(PlayerPedId(), animDict, 'givetake1_b', 8.0, 1.0, -1, 16, 0, false, false, false)
185177
end)
186178

187179
-- NUI Callbacks

client/vehicles.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ local function IsBackEngine(vehModel)
55
end
66

77
local function OpenTrunk(vehicle)
8-
LoadAnimDict('amb@prop_human_bum_bin@idle_b')
9-
TaskPlayAnim(PlayerPedId(), 'amb@prop_human_bum_bin@idle_b', 'idle_d', 4.0, 4.0, -1, 50, 0, false, false, false)
8+
local animDict = 'amb@prop_human_bum_bin@idle_b'
9+
QBCore.Functions.RequestAnimDict(animDict)
10+
TaskPlayAnim(PlayerPedId(), animDict, 'idle_d', 4.0, 4.0, -1, 50, 0, false, false, false)
1011
if IsBackEngine(GetEntityModel(vehicle)) then
1112
SetVehicleDoorOpen(vehicle, 4, false, false)
1213
else
@@ -17,8 +18,9 @@ end
1718
function CloseTrunk()
1819
local vehicle, distance = QBCore.Functions.GetClosestVehicle()
1920
if vehicle == 0 or distance > 5 then return end
20-
LoadAnimDict('amb@prop_human_bum_bin@idle_b')
21-
TaskPlayAnim(PlayerPedId(), 'amb@prop_human_bum_bin@idle_b', 'exit', 4.0, 4.0, -1, 50, 0, false, false, false)
21+
local animDict = 'amb@prop_human_bum_bin@idle_b'
22+
QBCore.Functions.RequestAnimDict(animDict)
23+
TaskPlayAnim(PlayerPedId(), animDict, 'exit', 4.0, 4.0, -1, 50, 0, false, false, false)
2224
if IsBackEngine(GetEntityModel(vehicle)) then
2325
SetVehicleDoorShut(vehicle, 4, false)
2426
else

locales/cs.lua

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,57 @@
11
local Translations = {
22
progress = {
3-
['snowballs'] = 'Sbíráš sněhové koule..',
3+
['snowballs'] = 'Sbíráš sněhové koule..',
44
},
55
notify = {
66
['failed'] = 'Nepovedlo se',
7-
['canceled'] = 'Zrušeno',
8-
['vlocked'] = 'Vozidlo uzamčeno',
9-
['notowned'] = 'Tento předmět nevlastníš!',
10-
['missitem'] = 'Nemáš tento předmět!',
11-
['nonb'] = 'Nikdo v okolí není!',
12-
['noaccess'] = 'Nepřístupné',
13-
['nosell'] = 'Tento předmět nemůžeš prodat.',
14-
['itemexist'] = 'Předmět neexistuje',
15-
['notencash'] = 'Nemáš dost hotovosti..',
16-
['noitem'] = 'Nemáš správné předměty..',
17-
['gsitem'] = 'Nemůžeš si dát předmět sám sobě?',
18-
['tftgitem'] = 'Jsi příliš daleko na to, aby sis dal předmět!',
19-
['infound'] = 'Předmět, který se snažíš dát, nebyl nalezen!',
20-
['iifound'] = 'Nalezen nesprávný předmět, zkus to znovu!',
7+
['canceled'] = 'Zrušeno',
8+
['vlocked'] = 'Vozidlo uzamčeno',
9+
['notowned'] = 'Tento předmět nevlastníš!',
10+
['missitem'] = 'Nemáš tento předmět!',
11+
['nonb'] = 'Nikdo v okolí není!',
12+
['noaccess'] = 'Nepřístupné',
13+
['nosell'] = 'Tento předmět nemůžeš prodat.',
14+
['itemexist'] = 'Předmět neexistuje',
15+
['notencash'] = 'Nemáš dost hotovosti..',
16+
['noitem'] = 'Nemáš správné předměty..',
17+
['gsitem'] = 'Nemůžeš si dát předmět sám sobě?',
18+
['tftgitem'] = 'Jsi příliš daleko na to, aby sis dal předmět!',
19+
['infound'] = 'Předmět, který se snažíš dát, nebyl nalezen!',
20+
['iifound'] = 'Nalezen nesprávný předmět, zkus to znovu!',
2121
['gitemrec'] = 'Dostal jsi ',
2222
['gitemfrom'] = ' Od ',
2323
['gitemyg'] = 'Dal jsi ',
24-
['gitinvfull'] = 'Inventář druhého hráče je plný!',
25-
['giymif'] = 'Tvůj inventář je plný!',
26-
['gitydhei'] = 'Nemáš dost tohoto předmětu',
27-
['gitydhitt'] = 'Nemáš dost předmětů na přenos',
28-
['navt'] = 'Neplatný typ..',
29-
['anfoc'] = 'Argumenty nejsou správně vyplněny..',
24+
['gitinvfull'] = 'Inventář druhého hráče je plný!',
25+
['giymif'] = 'Tvůj inventář je plný!',
26+
['gitydhei'] = 'Nemáš dost tohoto předmětu',
27+
['gitydhitt'] = 'Nemáš dost předmětů na přenos',
28+
['navt'] = 'Neplatný typ..',
29+
['anfoc'] = 'Argumenty nejsou správně vyplněny..',
3030
['yhg'] = 'Dal jsi ',
31-
['cgitem'] = 'Nelze dát předmět!',
32-
['idne'] = 'Předmět neexistuje',
33-
['pdne'] = 'Hráč není online',
31+
['cgitem'] = 'Nelze dát předmět!',
32+
['idne'] = 'Předmět neexistuje',
33+
['pdne'] = 'Hráč není online',
34+
['nogunbag'] = 'Nemůžeš držet zbraň a tašku zároveň!',
35+
['hasbag'] = 'Už držíš tašku, jdi ji odhodit!',
36+
['invinuse'] = 'Tento inventář se právě používá',
37+
['notenoughstock'] = 'Nelze koupit větší množství, než je aktuálně skladem',
38+
['canthold'] = 'Tento předmět neuneseš',
3439
},
3540
inf_mapping = {
36-
['opn_inv'] = 'Otevři inventář',
37-
['tog_slots'] = 'Přepíná sloty klávesových zkratek',
38-
['use_item'] = 'Používá předmět ve slotu ',
41+
['opn_inv'] = 'Otevři inventář',
42+
['tog_slots'] = 'Přepíná sloty klávesových zkratek',
43+
['use_item'] = 'Používá předmět ve slotu ',
3944
},
4045
menu = {
4146
['vending'] = 'Automat',
42-
['bin'] = 'Otevři kontejner',
43-
['craft'] = 'Craft',
47+
['bin'] = 'Otevři kontejner',
48+
['craft'] = 'Řemeslo',
4449
['o_bag'] = 'Otevři tašku',
50+
['p_bag'] = 'Vyzvednout tašku',
4551
},
4652
interaction = {
47-
['craft'] = '~g~E~w~ - Craft',
53+
['craft'] = '~g~E~w~ - Řemeslo',
54+
['drop_bag'] = 'Stisknutím [G] vak upustíte',
4855
},
4956
}
5057

@@ -54,4 +61,4 @@ if GetConvar('qb_locale', 'en') == 'cs' then
5461
warnOnMissing = true,
5562
fallbackLang = Lang,
5663
})
57-
end
64+
end

locales/de.lua

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
local Translations = {
22
progress = {
3-
['snowballs'] = 'Schneebälle sammeln..',
3+
['snowballs'] = 'Schneebälle sammeln..',
44
},
55
notify = {
66
['failed'] = 'Fehlgeschlagen',
77
['canceled'] = 'Abgebrochen',
88
['vlocked'] = 'Fahrzeug verriegelt',
99
['notowned'] = 'Du besitzt diesen Gegenstand nicht!',
1010
['missitem'] = 'Du hast diesen Gegenstand nicht!',
11-
['nonb'] = 'Niemand in der Nähe!',
12-
['noaccess'] = 'Nicht zugänglich',
11+
['nonb'] = 'Niemand in der Nähe!',
12+
['noaccess'] = 'Nicht zugänglich',
1313
['nosell'] = 'Du kannst diesen Gegenstand nicht verkaufen..',
1414
['itemexist'] = 'Der Gegenstand existiert nicht',
1515
['notencash'] = 'Du hast nicht genug Bargeld..',
16-
['noitem'] = 'Du hast nicht die richtigen Gegenstände..',
16+
['noitem'] = 'Du hast nicht die richtigen Gegenstände..',
1717
['gsitem'] = 'Du kannst dir keinen Gegenstand geben?',
18-
['tftgitem'] = 'Du bist zu weit weg, um Gegenstände zu geben!',
18+
['tftgitem'] = 'Du bist zu weit weg, um Gegenstände zu geben!',
1919
['infound'] = 'Der Gegenstand, den du geben wolltest, wurde nicht gefunden!',
2020
['iifound'] = 'Falscher Gegenstand gefunden, versuche es erneut!',
2121
['gitemrec'] = 'Du hast erhalten ',
@@ -24,27 +24,34 @@ local Translations = {
2424
['gitinvfull'] = 'Das Inventar des anderen Spielers ist voll!',
2525
['giymif'] = 'Dein Inventar ist voll!',
2626
['gitydhei'] = 'Du hast nicht genug von dem Gegenstand',
27-
['gitydhitt'] = 'Du hast nicht genug Gegenstände zum Übertragen',
28-
['navt'] = 'Ungültiger Typ..',
29-
['anfoc'] = 'Argumente nicht korrekt ausgefüllt..',
27+
['gitydhitt'] = 'Du hast nicht genug Gegenstände zum Übertragen',
28+
['navt'] = 'Ungültiger Typ..',
29+
['anfoc'] = 'Argumente nicht korrekt ausgefüllt..',
3030
['yhg'] = 'Du hast gegeben ',
3131
['cgitem'] = 'Kann den Gegenstand nicht geben!',
3232
['idne'] = 'Gegenstand existiert nicht',
3333
['pdne'] = 'Spieler ist nicht online',
34+
['nogunbag'] = 'Du kannst nicht gleichzeitig eine Waffe und eine Tasche halten!',
35+
['hasbag'] = 'Du hältst bereits eine Tasche, leg sie erst ab!',
36+
['invinuse'] = 'Dieses Inventar wird derzeit verwendet',
37+
['notenoughstock'] = 'Du kannst nicht mehr kaufen als aktuell auf Lager ist',
38+
['canthold'] = 'Du kannst diesen Gegenstand nicht tragen',
3439
},
3540
inf_mapping = {
36-
['opn_inv'] = 'Inventar öffnen',
41+
['opn_inv'] = 'Inventar öffnen',
3742
['tog_slots'] = 'Schaltet die belegten Slots um',
3843
['use_item'] = 'Verwendet den Gegenstand im Slot ',
3944
},
4045
menu = {
4146
['vending'] = 'Verkaufsautomat',
42-
['bin'] = 'Müllcontainer öffnen',
47+
['bin'] = 'Müllcontainer öffnen',
4348
['craft'] = 'Herstellen',
4449
['o_bag'] = 'Tasche öffnen',
50+
['p_bag'] = 'Tasche abholen',
4551
},
4652
interaction = {
4753
['craft'] = '~g~E~w~ - Herstellen',
54+
['drop_bag'] = 'Drücken Sie [G], um die Tasche fallen zu lassen',
4855
},
4956
}
5057

locales/en.lua

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
local Translations = {
22
progress = {
3-
['snowballs'] = 'Collecting snowballs..',
3+
['snowballs'] = 'Collecting snowballs...',
44
},
55
notify = {
66
['failed'] = 'Failed',
77
['canceled'] = 'Canceled',
8-
['vlocked'] = 'Vehicle Locked',
8+
['vlocked'] = 'Vehicle locked',
99
['notowned'] = 'You do not own this item!',
1010
['missitem'] = 'You don\'t have this item!',
1111
['nonb'] = 'No one nearby!',
12-
['noaccess'] = 'Not Accessible',
13-
['nosell'] = 'You can\'t sell this item..',
14-
['itemexist'] = 'Item doesn\'t exist',
15-
['notencash'] = 'You don\'t have enough cash..',
16-
['noitem'] = 'You don\'t have the right items..',
12+
['noaccess'] = 'Not accessible',
13+
['nosell'] = 'You can\'t sell this item.',
14+
['itemexist'] = 'This item doesn\'t exist.',
15+
['notencash'] = 'You don\'t have enough cash.',
16+
['noitem'] = 'You don\'t have the right items.',
1717
['gsitem'] = 'You can\'t give yourself an item?',
1818
['tftgitem'] = 'You are too far away to give items!',
1919
['infound'] = 'Item you tried giving not found!',
20-
['iifound'] = 'Incorrect item found try again!',
21-
['gitemrec'] = 'You Received ',
22-
['gitemfrom'] = ' From ',
20+
['iifound'] = 'Incorrect item found, try again!',
21+
['gitemrec'] = 'You received ',
22+
['gitemfrom'] = ' from ',
2323
['gitemyg'] = 'You gave ',
24-
['gitinvfull'] = 'The other players inventory is full!',
24+
['gitinvfull'] = 'The other player\'s inventory is full!',
2525
['giymif'] = 'Your inventory is full!',
2626
['gitydhei'] = 'You do not have enough of the item',
2727
['gitydhitt'] = 'You do not have enough items to transfer',
28-
['navt'] = 'Not a valid type..',
29-
['anfoc'] = 'Arguments not filled out correctly..',
30-
['yhg'] = 'You Have Given ',
28+
['navt'] = 'Not a valid type.',
29+
['anfoc'] = 'Arguments not filled out correctly.',
30+
['yhg'] = 'You have given ',
3131
['cgitem'] = 'Can\'t give item!',
32-
['idne'] = 'Item Does Not Exist',
33-
['pdne'] = 'Player Is Not Online',
32+
['idne'] = 'Item does not exist',
33+
['pdne'] = 'Player is not online',
34+
['nogunbag'] = 'You cannot be holding a gun and a bag!',
35+
['hasbag'] = 'You\'re already holding a bag, go drop it!',
36+
['invinuse'] = 'This inventory is currently in use',
37+
['notenoughstock'] = 'You cannot purchase more than is currently in stock',
38+
['canthold'] = 'You cannot carry this item',
3439
},
3540
inf_mapping = {
3641
['opn_inv'] = 'Open Inventory',
@@ -42,9 +47,11 @@ local Translations = {
4247
['bin'] = 'Open Dumpster',
4348
['craft'] = 'Craft',
4449
['o_bag'] = 'Open Bag',
50+
['p_bag'] = 'Pick up bag',
4551
},
4652
interaction = {
4753
['craft'] = '~g~E~w~ - Craft',
54+
['drop_bag'] = 'Press [G] to drop the bag',
4855
},
4956
}
5057

locales/es.lua

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,53 @@ local Translations = {
55
notify = {
66
['failed'] = 'Fallido',
77
['canceled'] = 'Cancelado',
8-
['vlocked'] = 'Vehículo Bloqueado',
9-
['notowned'] = '¡No posees este objeto!',
10-
['missitem'] = '¡No tienes este objeto!',
11-
['nonb'] = '¡No hay nadie cerca!',
8+
['vlocked'] = 'Vehículo Bloqueado',
9+
['notowned'] = '¡No posees este objeto!',
10+
['missitem'] = '¡No tienes este objeto!',
11+
['nonb'] = '¡No hay nadie cerca!',
1212
['noaccess'] = 'No Accesible',
1313
['nosell'] = 'No puedes vender este objeto..',
1414
['itemexist'] = 'El objeto no existe',
1515
['notencash'] = 'No tienes suficiente dinero..',
1616
['noitem'] = 'No tienes los objetos adecuados..',
17-
['gsitem'] = '¿No puedes darte un objeto a ti mismo?',
18-
['tftgitem'] = '¡Estás demasiado lejos para dar objetos!',
19-
['infound'] = '¡Objeto que intentaste dar no encontrado!',
20-
['iifound'] = '¡Objeto incorrecto encontrado, intenta de nuevo!',
17+
['gsitem'] = '¿No puedes darte un objeto a ti mismo?',
18+
['tftgitem'] = '¡Estás demasiado lejos para dar objetos!',
19+
['infound'] = '¡Objeto que intentaste dar no encontrado!',
20+
['iifound'] = '¡Objeto incorrecto encontrado, intenta de nuevo!',
2121
['gitemrec'] = 'Recibiste ',
2222
['gitemfrom'] = ' De ',
2323
['gitemyg'] = 'Diste ',
24-
['gitinvfull'] = '¡El inventario del otro jugador está lleno!',
25-
['giymif'] = '¡Tu inventario está lleno!',
24+
['gitinvfull'] = '¡El inventario del otro jugador está lleno!',
25+
['giymif'] = '¡Tu inventario está lleno!',
2626
['gitydhei'] = 'No tienes suficiente del objeto',
2727
['gitydhitt'] = 'No tienes suficientes objetos para transferir',
28-
['navt'] = 'No es un tipo válido..',
28+
['navt'] = 'No es un tipo válido..',
2929
['anfoc'] = 'Argumentos no rellenados correctamente..',
3030
['yhg'] = 'Has Dado ',
31-
['cgitem'] = '¡No se puede dar el objeto!',
31+
['cgitem'] = '¡No se puede dar el objeto!',
3232
['idne'] = 'El Objeto No Existe',
33-
['pdne'] = 'El Jugador No Está En Línea',
33+
['pdne'] = 'El Jugador No Está En Línea',
34+
['nogunbag'] = '¡No puedes llevar un arma y una bolsa al mismo tiempo!',
35+
['hasbag'] = '¡Ya llevas una bolsa, ve a soltarla!',
36+
['invinuse'] = 'Este inventario está en uso',
37+
['notenoughstock'] = 'No puedes comprar más de lo que hay en stock actualmente',
38+
['canthold'] = 'No puedes llevar este objeto',
3439
},
3540
inf_mapping = {
3641
['opn_inv'] = 'Abrir Inventario',
3742
['tog_slots'] = 'Alterna ranuras de teclas',
3843
['use_item'] = 'Usa el objeto en la ranura',
3944
},
4045
menu = {
41-
['vending'] = 'Máquina Expendedora',
46+
['vending'] = 'Máquina Expendedora',
4247
['bin'] = 'Abrir Contenedor de Basura',
4348
['craft'] = 'Crear',
44-
['o_bag'] = 'Abrir Bolsa',
49+
['o_bag'] = 'Bolsa abierta',
50+
['p_bag'] = 'recoger bolsa',
4551
},
4652
interaction = {
4753
['craft'] = '~g~E~w~ - Fabricar',
54+
['drop_bag'] = 'Presione [G] para soltar la bolsa.',
4855
},
4956
}
5057

0 commit comments

Comments
 (0)