feat Framework.GetIsPlayerLoaded, locale tweaks
This commit is contained in:
1 parent
58ab40d14e
commit
a280606c3d
32 files changed
+526
-259
No files matched your search
@@ -11,8 +11,7 @@ local cachedItemList = nil
|
||||
Framework.ItemList = function()
|
||||
if cachedItemList then return cachedItemList end
|
||||
local items = Callback.Trigger('community_bridge:Callback:GetFrameworkItems', false)
|
||||
local fakeShared = { Items = items.Items or {} }
|
||||
cachedItemList = fakeShared
|
||||
cachedItemList = { Items = items.Items or {} }
|
||||
return cachedItemList
|
||||
end
|
||||
|
||||
@@ -22,6 +21,13 @@ Framework.GetFrameworkName = function()
|
||||
return 'es_extended'
|
||||
end
|
||||
|
||||
---This will return true if the player is loaded, false otherwise.
|
||||
---This could be useful in scripts that rely on player loaded events and offer a debug mode to hit this function.
|
||||
---@return boolean
|
||||
Framework.GetIsPlayerLoaded = function()
|
||||
return ESX.IsPlayerLoaded()
|
||||
end
|
||||
|
||||
---This will return a table of the player data, this will be in the framework format.
|
||||
---This is mainly for internal bridge use and should be avoided.
|
||||
---@return table
|
||||
|
||||
@@ -14,6 +14,13 @@ Framework.GetFrameworkName = function()
|
||||
return 'qb-core'
|
||||
end
|
||||
|
||||
---This will return true if the player is loaded, false otherwise.
|
||||
---This could be useful in scripts that rely on player loaded events and offer a debug mode to hit this function.
|
||||
---@return boolean
|
||||
Framework.GetIsPlayerLoaded = function()
|
||||
return LocalPlayer.state.isLoggedIn or false
|
||||
end
|
||||
|
||||
---This will return a table of the player data, this will be in the framework format.
|
||||
---This is mainly for internal bridge use and should be avoided.
|
||||
---@return table
|
||||
|
||||
@@ -11,6 +11,13 @@ Framework.GetFrameworkName = function()
|
||||
return 'qbx_core'
|
||||
end
|
||||
|
||||
---This will return true if the player is loaded, false otherwise.
|
||||
---This could be useful in scripts that rely on player loaded events and offer a debug mode to hit this function.
|
||||
---@return boolean
|
||||
Framework.GetIsPlayerLoaded = function()
|
||||
return LocalPlayer.state.isLoggedIn or false
|
||||
end
|
||||
|
||||
---This will return a table of the player data, this will be in the framework format.
|
||||
---This is mainly for internal bridge use and should be avoided.
|
||||
---@return table
|
||||
|
||||
@@ -15,17 +15,17 @@ Shops.FinalizeCheckOut = function(shopName, item, itemLabel, price, amount)
|
||||
local generatedID = Ids.CreateUniqueId()
|
||||
local buildMenu = {
|
||||
{
|
||||
title = locale('Shops.PayByCash').." "..tostring(mathStuff),
|
||||
description = locale('Shops.AreYouSure') .. itemLabel,
|
||||
icon = "fa-solid fa-money-bill-wave",
|
||||
title = string.format(locale('Shops.PayByCash'), tostring(mathStuff)),
|
||||
description = string.format(locale('Shops.AreYouSure'), itemLabel),
|
||||
icon = locale('Shops.CashIcon'),
|
||||
onSelect = function(_, __, ___)
|
||||
TriggerServerEvent('community_bridge:completeCheckout', shopName, item, amount, "money")
|
||||
end
|
||||
},
|
||||
{
|
||||
title = locale('Shops.PayByCard').." "..tostring(mathStuff),
|
||||
description = locale('Shops.AreYouSure') .. itemLabel,
|
||||
icon = "fa-solid fa-building-columns",
|
||||
title = string.format(locale('Shops.PayByCard'), tostring(mathStuff)),
|
||||
description = string.format(locale('Shops.AreYouSure'), itemLabel),
|
||||
icon = locale('Shops.CardIcon'),
|
||||
onSelect = function(_, __, ___)
|
||||
TriggerServerEvent('community_bridge:completeCheckout', shopName, item, amount, "bank")
|
||||
end
|
||||
@@ -67,8 +67,8 @@ Shops.OpenShop = function(title, shopData)
|
||||
local getItemName = Inventory.GetItemInfo(v.name).label
|
||||
table.insert(buildMenu, {
|
||||
title = getItemName,
|
||||
description = locale('Shops.CurrencySymbol')..tostring(v.price),
|
||||
icon = "fa-solid fa-basket-shopping",
|
||||
description = string.format(locale('Shops.CurrencySymbol'), tostring(v.price)),
|
||||
icon = locale('Shops.ShopIcon'),
|
||||
onSelect = function(selected, secondary, args)
|
||||
Shops.AmountSelect(title, v.name, getItemName, v.price)
|
||||
--Shops.FinalizeCheckOut(title, v.name, getItemName, v.price)
|
||||
|
||||
Reference in new issue
Block a user