Money color and formatting in inventory

This commit is contained in:
ElPumpo
2018-11-17 12:37:17 +01:00
parent a4152db8c3
commit d804fb316f
10 changed files with 25 additions and 13 deletions
+7 -3
View File
@@ -997,8 +997,10 @@ ESX.ShowInventory = function()
local elements = {}
if ESX.PlayerData.money > 0 then
local formattedMoney = _U('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.money))
table.insert(elements, {
label = _U('cash', ESX.PlayerData.money),
label = ('%s: <span style="color:green;">%s</span>'):format(_U('cash'), formattedMoney),
count = ESX.PlayerData.money,
type = 'item_money',
value = 'money',
@@ -1010,8 +1012,10 @@ ESX.ShowInventory = function()
for i=1, #ESX.PlayerData.accounts, 1 do
if ESX.PlayerData.accounts[i].money > 0 then
local formattedMoney = _U('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money))
table.insert(elements, {
label = ESX.PlayerData.accounts[i].label .. ' $' .. ESX.PlayerData.accounts[i].money,
label = ('%s: <span style="color:green;">%s</span>'):format(ESX.PlayerData.accounts[i].label, formattedMoney),
count = ESX.PlayerData.accounts[i].money,
type = 'item_account',
value = ESX.PlayerData.accounts[i].name,
@@ -1042,7 +1046,7 @@ ESX.ShowInventory = function()
if HasPedGotWeapon(playerPed, weaponHash, false) and Config.Weapons[i].name ~= 'WEAPON_UNARMED' then
local ammo = GetAmmoInPedWeapon(playerPed, weaponHash)
table.insert(elements, {
label = Config.Weapons[i].label .. ' x1 [' .. ammo .. ']',
label = Config.Weapons[i].label .. ' [' .. ammo .. ']',
count = 1,
type = 'item_weapon',
value = Config.Weapons[i].name,
+2 -2
View File
@@ -32,7 +32,7 @@ AddEventHandler('esx:playerLoaded', function(xPlayer)
})
ESX.UI.HUD.UpdateElement('account_' .. xPlayer.accounts[i].name, {
money = xPlayer.accounts[i].money
money = ESX.Math.GroupDigits(xPlayer.accounts[i].money)
})
end
@@ -166,7 +166,7 @@ AddEventHandler('esx:setAccountMoney', function(account)
if Config.EnableHud then
ESX.UI.HUD.UpdateElement('account_' .. account.name, {
money = account.money
money = ESX.Math.GroupDigits(account.money)
})
end
end)
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['br'] = {
-- Inventory
['cash'] = 'efectivo $%s',
['cash'] = 'efectivo',
['inventory'] = 'inventario',
['use'] = 'usar',
['give'] = 'dar',
@@ -70,6 +70,7 @@ Locales['br'] = {
['chat_clear_all'] = 'clear the chat for everyone',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'faca',
['weapon_nightstick'] = 'cacetete',
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['cs'] = {
-- Inventory
['cash'] = 'hotovost $%s',
['cash'] = 'hotovost',
['inventory'] = 'inventář',
['use'] = 'použít',
['give'] = 'dát',
@@ -74,6 +74,7 @@ Locales['cs'] = {
['chat_clear_all'] = 'vyčistit chat pro všechny',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'knife',
['weapon_nightstick'] = 'nightstick',
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['de'] = {
-- Inventory
['cash'] = 'kontanter $%s',
['cash'] = 'kontanter',
['inventory'] = 'inventar',
['use'] = 'benutzen',
['give'] = 'geben',
@@ -64,6 +64,7 @@ Locales['de'] = {
['chat_clear_all'] = 'clear the chat for everyone',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'Messer',
['weapon_nightstick'] = 'Schlagstock',
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['en'] = {
-- Inventory
['cash'] = 'cash $%s',
['cash'] = 'cash',
['inventory'] = 'inventory',
['use'] = 'use',
['give'] = 'give',
@@ -74,6 +74,7 @@ Locales['en'] = {
['chat_clear_all'] = 'clear the chat for everyone',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'knife',
['weapon_nightstick'] = 'nightstick',
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['fi'] = {
-- Inventory
['cash'] = 'käteinen $%s',
['cash'] = 'käteinen',
['inventory'] = 'reppu',
['use'] = 'käytä',
['give'] = 'anna',
@@ -74,6 +74,7 @@ Locales['fi'] = {
['chat_clear_all'] = 'tyhjennä chatti kaikilta',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'veitsi',
['weapon_nightstick'] = 'pamppu',
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['fr'] = {
-- Inventory
['cash'] = 'espèces $%s',
['cash'] = 'espèces',
['inventory'] = 'inventaire',
['use'] = 'utiliser',
['give'] = 'donner',
@@ -71,6 +71,7 @@ Locales['fr'] = {
['chat_clear_all'] = 'clear the chat for everyone',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'couteau',
['weapon_nightstick'] = 'matraque',
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['pl'] = {
-- Inventory
['cash'] = 'gotówka $%s',
['cash'] = 'gotówka',
['inventory'] = 'ekwipunek',
['use'] = 'użyj',
['give'] = 'daj',
@@ -71,6 +71,7 @@ Locales['pl'] = {
['disconnect'] = 'odłącz się od serwera',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'nóż',
['weapon_nightstick'] = 'pałka',
+2 -1
View File
@@ -1,6 +1,6 @@
Locales['sv'] = {
-- Inventory
['cash'] = 'kontanter %s SEK',
['cash'] = 'kontanter',
['inventory'] = 'mitt förråd',
['use'] = 'använd',
['give'] = 'ge',
@@ -74,6 +74,7 @@ Locales['sv'] = {
['chat_clear_all'] = 'töm chatten för alla',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '%s SEK',
-- Weapons
['weapon_knife'] = 'kniv',
['weapon_nightstick'] = 'batong',