Remove cache and batch event libraries, update locales
Deleted the cache and batch event libraries from the codebase, including all related client, server, and shared files. Removed server-side particle library and associated client event handlers. Updated utility and clothing modules to remove cache dependencies. Improved utility logging and deprecated point functions with notices. Updated all locales to use a consistent 'PurchasedItem' message format and added Bulgarian (bg) translation. Bumped version to 0.13.1 in fxmanifest.
This commit is contained in:
1 parent
5fd0744ca5
commit
48f8122197
76 files changed
+488
-875
No files matched your search
@@ -4,7 +4,7 @@ Shops = Shops or {}
|
||||
local registeredShops = {}
|
||||
|
||||
local Language = Language or Require("modules/locales/shared.lua")
|
||||
local locales = Language.Locale
|
||||
local locale = Language.Locale
|
||||
|
||||
---This can open a shop for the client
|
||||
---@param src number
|
||||
@@ -51,23 +51,23 @@ Shops.CompleteCheckout = function(src, shopName, item, amount, account)
|
||||
end
|
||||
end
|
||||
if not itemData or not itemData.price then return print("community_bridge Player ID "..src.." attempted to purchase invalid item from shop: "..shopName) end
|
||||
if itemData.count and itemData.count <= 0 then return Notify.SendNotify(src, locales('Shops.NotEnoughStock'), "error", 5000) end
|
||||
if itemData.count and itemData.count <= 0 then return Notify.SendNotify(src, locale('Shops.NotEnoughStock'), "error", 5000) end
|
||||
local totalCost = tonumber(itemData.price) * amount
|
||||
local balance = Framework.GetAccountBalance(src, account)
|
||||
if not balance then return end
|
||||
if balance <= 0 then return Notify.SendNotify(src, locales('Shops.NotEnoughMoney'), "error", 5000) end
|
||||
if balance < totalCost then return Notify.SendNotify(src, locales('Shops.NotEnoughMoney'), "error", 5000) end
|
||||
if balance <= 0 then return Notify.SendNotify(src, locale('Shops.NotEnoughMoney'), "error", 5000) end
|
||||
if balance < totalCost then return Notify.SendNotify(src, locale('Shops.NotEnoughMoney'), "error", 5000) end
|
||||
|
||||
if not Framework.RemoveAccountBalance(src, account, totalCost) then return end
|
||||
|
||||
local success = Inventory.AddItem(src, itemData.name, amount)
|
||||
if not success then
|
||||
Framework.AddAccountBalance(src, account, totalCost)
|
||||
return Notify.SendNotify(src, locales('Shops.PurchaseFailed'), "error", 5000)
|
||||
return Notify.SendNotify(src, locale('Shops.PurchaseFailed'), "error", 5000)
|
||||
end
|
||||
|
||||
local itemLabel = Inventory.GetItemInfo(itemData.name).label or itemData.name
|
||||
Notify.SendNotify(src, locales('Shops.PurchasedItem', itemLabel), "success", 5000)
|
||||
Notify.SendNotify(src, locale('Shops.PurchasedItem', amount, itemLabel), "success", 5000)
|
||||
end
|
||||
|
||||
---This is an internal event to complete a checkout, complete with multiple validations. Please do not use this event directly.
|
||||
|
||||
Reference in new issue
Block a user