Aligned folder names with table names for most parts. Temporarily removed unfinished ox_core compatibility. Added missing tables to init.lua, updated manifest to reflect new folder names, and incremented version number.
This commit is contained in:
MrNewb committed 2025-01-09 03:55:10 -05:00
1 parent 24431d1bf4
commit 92f6d42555
51 files changed
+225 -161

No files matched your search

+24 -22
View File
@@ -3,12 +3,12 @@ game 'gta5'
lua54 'yes'
author 'The Order of the Sacred Framework'
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
version '0.0.9'
version '0.0.10'
shared_scripts {
'settings/sharedConfig.lua',
'use/*.lua',
'modules/utilities/shared/*.lua',
'modules/Utility/shared/*.lua',
'modules/locales/*.lua',
}
@@ -16,33 +16,35 @@ server_scripts {
'@oxmysql/lib/MySQL.lua',
'settings/serverConfig.lua',
'modules/locales/shared.lua',
'modules/utilities/server/*.lua',
'modules/framework/**/server.lua',
'modules/inventory/**/server.lua',
'modules/stashes/server.lua',
'modules/phones/**/server.lua',
'modules/managment/**/server.lua',
'modules/notify/server.lua',
'modules/Utility/server/*.lua',
'modules/Framework/**/server.lua',
'modules/Inventory/**/server.lua',
'modules/Doorlock/**/server.lua',
'modules/Phone/**/server.lua',
'modules/Notify/server.lua',
'modules/Managment/**/server.lua',
'init.lua',
}
client_scripts {
'settings/clientConfig.lua',
'modules/locales/shared.lua',
'modules/input/client.lua',
'modules/utilities/client/*.lua',
'modules/framework/**/client.lua',
'modules/inventory/**/client.lua',
'modules/keys/**/client.lua',
'modules/fuel/**/client.lua',
'modules/target/**/client.lua',
'modules/menu/client.lua',
'modules/notify/client.lua',
'modules/dispatch/**/client.lua',
'modules/progressbars/**/client.lua',
'modules/clothing/**/client.lua',
'modules/weather/**/client.lua',
'modules/Utility/client/*.lua',
'modules/Framework/**/client.lua',
'modules/Inventory/**/client.lua',
'modules/Doorlock/**/client.lua',
'modules/Phone/**/client.lua',
'modules/Notify/client.lua',
'modules/Weather/**/client.lua',
'modules/VehicleKey/**/client.lua',
'modules/Fuel/**/client.lua',
'modules/Target/**/client.lua',
'modules/Dispatch/**/client.lua',
'modules/Progressbar/**/client.lua',
'modules/Clothing/**/client.lua',
'modules/Input/client.lua',
'modules/math/*.lua',
'modules/menu/client.lua',
'init.lua',
}
+4 -2
View File
@@ -11,22 +11,24 @@ PlayerJobGradeLevel = nil
Bridge.Inventory = Inventory
Bridge.Menu = Menu
Bridge.Language = Language
Bridge.Debugger = Debugger
Bridge.Framework = Framework
Bridge.Doorlock = Doorlock
Bridge.Phone = Phone
Bridge.Notify = Notify
Bridge.Vehicle = Vehicle
Bridge.Fuel = Fuel
Bridge.Dispatch = Dispatch
Bridge.Weather = Weather
Bridge.Target = Target
Bridge.Table = Table
Bridge.Input = Input
Bridge.Managment = Managment
Bridge.Math = Math
Bridge.VehicleKey = VehicleKey
Bridge.Clothing = Clothing
Bridge.Progressbar = Progressbar
Bridge.Utility = Utility
Bridge.Prints = Prints
Bridge.Table = Table
CreateThread(function()
+11
View File
@@ -0,0 +1,11 @@
Fuel = Fuel or {}
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return GetVehicleFuelLevel(vehicle)
end
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
return SetVehicleFuelLevel(vehicle, fuel)
end
+9
View File
@@ -0,0 +1,9 @@
Inventory = Inventory or {}
Inventory.GetItemInfo = function(item)
return Framework.GetItemInfo(item)
end
Inventory.GetImagePath = function(item)
return "https://avatars.githubusercontent.com/u/47620135"
end
+33
View File
@@ -0,0 +1,33 @@
Inventory = Inventory or {}
Inventory.AddItem = function(src, item, count, slot, metadata)
return Framework.AddItem(src, item, count, slot, metadata)
end
Inventory.RemoveItem = function(src, item, count, slot, metadata)
return Framework.RemoveItem(src, item, count, slot, metadata)
end
Inventory.GetItemInfo = function(item)
return false, Print.Error("This Inventory Has Not Been Bridged For An Item Info Feature.")
end
Inventory.GetItemCount = function(src, item, metadata)
return Framework.GetItemCount(src, item, metadata)
end
Inventory.GetInventoryItems = function(src)
return Framework.GetPlayerInventory(src)
end
Inventory.SetMetadata = function(src, item, slot, metadata)
return Framework.SetMetadata(src, item, slot, metadata)
end
Inventory.OpenStash = function(src, id, label, slots, weight, owner, groups, coords)
return false, Print.Error("This Inventory Has Not Been Bridged For A Stash Feature.")
end
Inventory.GetImagePath = function(item)
return "https://avatars.githubusercontent.com/u/47620135"
end
+5
View File
@@ -0,0 +1,5 @@
Phone = Phone or {}
Phone.SendEmail = function(email, title, message)
return false, Print.Error('There Is No Phone Bridged.')
end
+9
View File
@@ -0,0 +1,9 @@
Phone = Phone or {}
Phone.GetPlayerPhone = function(src)
return false, Print.Error('There Is No Phone Bridged.')
end
Phone.SendEmail = function(src, email, title, message)
return false, Print.Error('There Is No Phone Bridged.')
end
@@ -1,6 +1,6 @@
if GetResourceState('gksphone') ~= 'started' then return end
Phones = {}
Phone = {}
Phones.SendEmail = function(email, title, message)
Phone.SendEmail = function(email, title, message)
return exports["gksphone"]:SendNewMail({ sender = email, image = '/html/static/img/icons/mail.png', subject = title, message = message })
end
@@ -1,11 +1,11 @@
if GetResourceState('gksphone') ~= 'started' then return end
Phones = {}
Phone = {}
Phones.GetPlayerPhone = function(src)
Phone.GetPlayerPhone = function(src)
return exports["gksphone"]:GetPhoneBySource(src) or false
end
Phones.SendEmail = function(src, email, title, message)
Phone.SendEmail = function(src, email, title, message)
local data = {}
data.sender = email
data.image = '/html/static/img/icons/mail.png'
@@ -1,6 +1,6 @@
if GetResourceState('lb-phone') ~= 'started' then return end
Phones = {}
Phone = {}
Phones.SendEmail = function(email, title, message)
Phone.SendEmail = function(email, title, message)
TriggerServerEvent('community_bridge:Server:genericEmail', {email = email, title = title, message = message})
end
@@ -1,15 +1,15 @@
if GetResourceState('lb-phone') ~= 'started' then return end
Phones = {}
Phone = {}
Phones.GetPlayerPhone = function(src)
Phone.GetPlayerPhone = function(src)
return exports["lb-phone"]:GetEquippedPhoneNumber(src) or false
end
Phones.SendEmail = function(src, email, title, message)
Phone.SendEmail = function(src, email, title, message)
local numberNumber = exports["lb-phone"]:GetEquippedPhoneNumber(src)
if not numberNumber then return false, print("Could not Find Phone number") end
if not numberNumber then return false, Prints.Error("Could not Find Phone number") end
local playerEmail = exports["lb-phone"]:GetEmailAddress(numberNumber)
if not playerEmail then return false, print("Could not Find email") end
if not playerEmail then return false, Prints.Error("Could not Find email") end
local success, id = exports["lb-phone"]:SendMail({
to = playerEmail,
sender = email,
@@ -21,6 +21,6 @@ end
RegisterNetEvent('community_bridge:Server:genericEmail', function(data)
local src = source
print('community_bridge:Server:genericEmail Hit')
return Phones.SendEmail(src, data.email, data.title, data.message)
Prints.Debug('community_bridge:Server:genericEmail Hit')
return Phone.SendEmail(src, data.email, data.title, data.message)
end)
@@ -1,7 +1,7 @@
if GetResourceState('qs-smartphone') ~= 'started' then return end
Phones = {}
Phone = {}
Phones.SendEmail = function(email, title, message)
Phone.SendEmail = function(email, title, message)
return TriggerServerEvent('qs-smartphone:server:sendNewMail', { sender = email, subject = title, message = message, button = {} })
end
@@ -1,11 +1,11 @@
if GetResourceState('qs-smartphone') ~= 'started' then return end
Phones = {}
Phone = {}
Phones.GetPlayerPhone = function(src)
Phone.GetPlayerPhone = function(src)
return exports['qs-base']:GetPlayerPhone(src) or false
end
Phones.SendEmail = function(src, email, title, message)
Phone.SendEmail = function(src, email, title, message)
TriggerClientEvent('community_bridge:Server:genericEmail', src, { sender = email, subject = title, message = message, button = {} })
return true
end
@@ -1,16 +1,16 @@
if BridgeClientConfig.ProgressBar ~= "ox" then return end
ProgressBar = {}
Progressbar = {}
local _progBarType = BridgeClientConfig.ProgressBarStyle or "bar"
ProgressBar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction)
Progressbar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction)
local runTime = time or 10000
local textLabel = label or "Doing something"
local deadBool = whiledead or false
local cancelBool = cancancel or false
local disableKeys = disable or { move = true, sprint = true, car = true, combat = true, }
local anim = animTable or nil
local success = successAction or function() print("Success") end
local canceled = canceledAction or function() print("Cancelled") end
local success = successAction or function() Prints.Debug("Success") end
local canceled = canceledAction or function() Prints.Debug("Cancelled") end
if _progBarType == "bar" then
if exports.ox_lib:progressBar({
duration = runTime,
@@ -33,6 +33,6 @@ ProgressBar.StartProgressBar = function(time, label, whiledead, cancancel, disab
end
end
ProgressBar.IsProgressBarActive = function()
Progressbar.IsProgressBarActive = function()
return exports.ox_lib:progressActive()
end
@@ -1,5 +1,5 @@
if BridgeClientConfig.ProgressBar ~= "qb" then return end
ProgressBar = {}
Progressbar = {}
local function convertOxToQB(disabledTable, animTable)
local repackedTable = { disabled = {}, animations = {}}
@@ -28,13 +28,13 @@ local function convertOxToQB(disabledTable, animTable)
return repackedTable
end
ProgressBar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction)
Progressbar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction)
local runTime = time or 10000
local textLabel = label or "Doing something"
local deadBool = whiledead or false
local cancelBool = cancancel or false
local success = successAction or function() print("Success") end
local canceled = canceledAction or function() print("Cancelled") end
local success = successAction or function() Prints.Debug("Success") end
local canceled = canceledAction or function() Prints.Debug("Cancelled") end
local repackedTable = convertOxToQB(disable, animTable)
exports['progressbar']:Progress({
name = textLabel,
@@ -55,6 +55,6 @@ ProgressBar.StartProgressBar = function(time, label, whiledead, cancancel, disab
end)
end
ProgressBar.IsProgressBarActive = function()
Progressbar.IsProgressBarActive = function()
return exports["progressbar"]:isDoingSomething()
end
@@ -22,7 +22,7 @@ end
Utility.PlaceObject = function(object, distance, snapToGround, allowedMats, offset)
if activePlacementProp then return end
if not object then lib.print.error('no_prop_defined') end
if not object then Prints.Error('no_prop_defined') end
local propObject = type(object) == 'string' and joaat(object) or object
local heading = 0.0
@@ -7,7 +7,7 @@ lib.locale()
Utility.CreateVehicle = function(model, coords, heading, networked)
if networked == nil then networked = true end
Utility.LoadModel(model)
if not HasModelLoaded(model) then return Prints.error("Model Has Not Loaded") end
if not HasModelLoaded(model) then return Prints.Error("Model Has Not Loaded") end
local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, networked, false)
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
SetVehicleNeedsToBeHotwired(vehicle, false)
@@ -30,7 +30,7 @@ end
Utility.CreateProp = function(model, coords, heading, networked)
if networked == nil then networked = true end
Utility.LoadModel(model)
if not HasModelLoaded(model) then return Prints.error("Model Has Not Loaded") end
if not HasModelLoaded(model) then return Prints.Error("Model Has Not Loaded") end
local propEntity = CreateObject(model, coords.x, coords.y, coords.z, networked, false, false)
SetEntityHeading(propEntity, heading)
SetModelAsNoLongerNeeded(model)
@@ -78,7 +78,7 @@ end
Utility.CreatePed = function(model, coords, heading, networked, clothing)
if networked == nil then networked = true end
Utility.LoadModel(model)
if not HasModelLoaded(model) then return Prints.error("Model Has Not Loaded") end
if not HasModelLoaded(model) then return Prints.Error("Model Has Not Loaded") end
local spawnedEntity = CreatePed(0, model, coords.x, coords.y, coords.z, heading, networked, false)
if clothing then
for componentID, v in pairs(clothing) do
+38
View File
@@ -0,0 +1,38 @@
VersionCheck = {}
function VersionCheck.VersionChecker(repoPath)
local resource = repoPath:match("([^/]+)$")
if not resource then return Prints.Error('^1Invalid repository format. Expected format: "username/reponame"^0') end
local version = GetResourceMetadata(resource, "version", 0)
if not version then return Prints.Error(('^1Unable to determine current resource version for %s ^0'):format(resource)) end
version = version:match('%d+%.%d+%.%d+')
if not version then return Prints.Error(('^1Invalid version format for %s ^0'):format(resource)) end
local username, reponame = repoPath:match("([^/]+)/([^/]+)")
if not username or not reponame then return Prints.Error('^1Invalid repository format. Expected format: "username/reponame"^0') end
PerformHttpRequest(('https://api.github.com/repos/%s/%s/releases/latest'):format(username, reponame), function(status, response)
local failure = ('^1Unable locate github repo for resource %s ^0'):format(resource)
if status ~= 200 then return Prints.Error(failure) end
response = json.decode(response)
if response.prerelease then return Prints.Error(failure) end
local latest = response.tag_name:match('%d+%.%d+%.%d+')
if not latest then return Prints.Error(failure) end
if latest == version then return Prints.Error(('^2 %s is on the latest version.^0'):format(resource)) end
local currentVersion, latestVersion = version:gsub('%D', ''), latest:gsub('%D', '')
if currentVersion < latestVersion then
return Prints.Error(('^1An update is available for %s (current version: %s)\r\n - ^5Please download the latest version from the GitHub release page.^7\r\n%s'):format(resource, version, response.html_url))
end
end, 'GET')
end
AddEventHandler('onResourceStart', function(resourceName)
if GetCurrentResourceName() ~= resourceName then return end
VersionCheck.VersionChecker("The-Order-Of-The-Sacred-Framework/community_bridge")
end)
File renamed without changes.
@@ -7,18 +7,18 @@ local function printMessage(level, color, message)
print(color .. '[' .. level .. ']:', message)
end
Prints.info = function(message)
Prints.Info = function(message)
printMessage('INFO', '^5', message)
end
Prints.warn = function(message)
Prints.Warn = function(message)
printMessage('WARN', '^3', message)
end
Prints.error = function(message)
Prints.Error = function(message)
printMessage('ERROR', '^1', message)
end
Prints.debug = function(message)
Prints.Debug = function(message)
printMessage('DEBUG', '^2', message)
end
File renamed without changes.
@@ -1,15 +1,13 @@
if GetResourceState('MrNewbVehicleKeys') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end
return exports.MrNewbVehicleKeys:GiveKeys(vehicle)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
if not vehicle and not plate then return false end
if not DoesEntityExist(vehicle) then
return exports.MrNewbVehicleKeys:RemoveKeysByPlate(plate)
end
if not DoesEntityExist(vehicle) then return exports.MrNewbVehicleKeys:RemoveKeysByPlate(plate) end
return exports.MrNewbVehicleKeys:RemoveKeys(vehicle)
end
@@ -1,12 +1,12 @@
if GetResourceState('Renewed-Vehiclekeys') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end
return exports['Renewed-Vehiclekeys']:addKey(plate)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end
return exports['Renewed-Vehiclekeys']:removeKey(plate)
end
@@ -1,10 +1,10 @@
if GetResourceState('cd_garage') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
TriggerEvent('cd_garage:AddKeys', plate)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
end
@@ -1,12 +1,12 @@
if GetResourceState('mk_vehiclekeys') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end
return exports["mk_vehiclekeys"]:AddKey(vehicle)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end
return exports["mk_vehiclekeys"]:RemoveKey(vehicle)
end
+10
View File
@@ -0,0 +1,10 @@
if GetResourceState('okokGarage') ~= 'started' then return end
VehicleKey = {}
VehicleKey.GiveKeys = function(vehicle, plate)
TriggerServerEvent('okokGarage:GiveKeys', plate)
end
VehicleKey.RemoveKeys = function(vehicle, plate)
return true
end
@@ -1,11 +1,11 @@
if GetResourceState('qb-vehiclekeys') ~= 'started' then return end
if GetResourceState('qbx_vehiclekeys') == 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
return true
end
@@ -1,10 +1,10 @@
if GetResourceState('qbx_vehiclekeys') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
return true
end
@@ -1,12 +1,12 @@
if GetResourceState('qs-vehiclekeys') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
local verifiedPlate = GetVehicleNumberPlateText(vehicle)
exports['qs-vehiclekeys']:GiveKeys(verifiedPlate, model, true)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
return true
end
@@ -1,12 +1,12 @@
if GetResourceState('t1ger_keys') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end
local vehicle_display_name = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
return exports['t1ger_keys']:GiveTemporaryKeys(plate, vehicle_display_name, 'some_keys')
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
end
@@ -1,10 +1,10 @@
if GetResourceState('wasabi_carlock') ~= 'started' then return end
VehicleKeys = {}
VehicleKey = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
VehicleKey.GiveKeys = function(vehicle, plate)
exports.wasabi_carlock:GiveKey(plate)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
VehicleKey.RemoveKeys = function(vehicle, plate)
exports.wasabi_carlock:RemoveKey(plate)
end
@@ -14,7 +14,7 @@ Clothing.SetAppearance = function(clothingData)
clothing.components = exports['illenium-appearance']:getPedComponents(cache.ped)
clothing.props = exports['illenium-appearance']:getPedProps(cache.ped)
print(json.encode(clothingData, {indent = true}))
Prints.Debug(json.encode(clothingData, {indent = true}))
StoredOldClothing = clothing
exports['illenium-appearance']:setPedComponents(cache.ped, clothingData.components)
exports['illenium-appearance']:setPedProp(cache.ped, clothingData.props)
+1 -1
View File
@@ -70,6 +70,6 @@ CreateThread(function()
jobs = { 'leo' }
}
Dispatch.SendAlert(data)
print("Dispatched")
Prints.Debug("Dispatched")
end)
--]]
-1
View File
@@ -1 +0,0 @@
if GetResourceState('ox_core') ~= 'started' then return end
-1
View File
@@ -1 +0,0 @@
if GetResourceState('ox_core') ~= 'started' then return end
+2 -2
View File
@@ -179,8 +179,8 @@ end
--Open menu
function Input.Open(title, data, isQB, submitText)
if isQB then
function Input.Open(title, data, isQBFormat, submitText)
if isQBFormat then
local inputs = data.inputs
if BridgeClientConfig.InputSystem == "ox" then
return lib.inputDialog(title, QBToOxInput(inputs))
-10
View File
@@ -1,10 +0,0 @@
if GetResourceState('okokGarage') ~= 'started' then return end
VehicleKeys = {}
VehicleKeys.GiveKeys = function(vehicle, plate)
TriggerServerEvent('okokGarage:GiveKeys', plate)
end
VehicleKeys.RemoveKeys = function(vehicle, plate)
end
+6 -6
View File
@@ -21,9 +21,9 @@ Notify.SendNotify = function(message, type, time)
elseif notifyType == 'lab' then
return exports['swe-notify']:SendNotification(message, time, type)
elseif notifyType == 'custom' then
return Prints.error("You have not set up a custom notify in community_bridge")
return Prints.Error("You have not set up a custom notify in community_bridge")
else
return Prints.error("You have not configured a notify in community_bridge")
return Prints.Error("You have not configured a notify in community_bridge")
end
end
@@ -41,9 +41,9 @@ Notify.ShowHelpText = function(message, _position)
elseif helptextType == 'lab' then
return exports['lab-HintUI']:Show(message, "Hint Text")
elseif helptextType == 'custom' then
return Prints.error("You have not set up a custom ShowHelpText in community_bridge")
return Prints.Error("You have not set up a custom ShowHelpText in community_bridge")
else
return Prints.error("You have not configured a ShowHelpText in community_bridge")
return Prints.Error("You have not configured a ShowHelpText in community_bridge")
end
end
@@ -59,9 +59,9 @@ Notify.HideHelpText = function()
elseif helptextType == 'lab' then
return exports['lab-HintUI']:Hide()
elseif helptextType == 'custom' then
return Prints.error("You have not set up a custom HideHelpText in community_bridge")
return Prints.Error("You have not set up a custom HideHelpText in community_bridge")
else
return Prints.error("You have not configured a HideHelpText in community_bridge")
return Prints.Error("You have not configured a HideHelpText in community_bridge")
end
end
-3
View File
@@ -1,3 +0,0 @@
Stashes = {}
-- Needs Redone
@@ -1,38 +0,0 @@
VersionCheck = {}
function VersionCheck.VersionChecker(repoPath)
local resource = repoPath:match("([^/]+)$")
if not resource then return print('^1Invalid repository format. Expected format: "username/reponame"^0') end
local version = GetResourceMetadata(resource, "version", 0)
if not version then return print(('^1Unable to determine current resource version for %s ^0'):format(resource)) end
version = version:match('%d+%.%d+%.%d+')
if not version then return print(('^1Invalid version format for %s ^0'):format(resource)) end
local username, reponame = repoPath:match("([^/]+)/([^/]+)")
if not username or not reponame then return print('^1Invalid repository format. Expected format: "username/reponame"^0') end
PerformHttpRequest(('https://api.github.com/repos/%s/%s/releases/latest'):format(username, reponame), function(status, response)
local failure = ('^1Unable locate github repo for resource %s ^0'):format(resource)
if status ~= 200 then return print(failure) end
response = json.decode(response)
if response.prerelease then return print(failure) end
local latest = response.tag_name:match('%d+%.%d+%.%d+')
if not latest then return print(failure) end
if latest == version then return print(('^2 %s is on the latest version.^0'):format(resource)) end
local currentVersion, latestVersion = version:gsub('%D', ''), latest:gsub('%D', '')
if currentVersion < latestVersion then
return print(('^1An update is available for %s (current version: %s)\r\n - ^5Please download the latest version from the GitHub release page.^7\r\n%s'):format(resource, version, response.html_url))
end
end, 'GET')
end
AddEventHandler('onResourceStart', function(resourceName)
if GetCurrentResourceName() ~= resourceName then return end
VersionCheck.VersionChecker("The-Order-Of-The-Sacred-Framework/community_bridge")
end)
+4 -4
View File
@@ -6,19 +6,19 @@ local function printMessage(level, color, message)
print(color .. '[' .. level .. ']:', message)
end
Prints.info = function(message)
Prints.Info = function(message)
printMessage('INFO', '^5', message)
end
Prints.warn = function(message)
Prints.Warn = function(message)
printMessage('WARN', '^3', message)
end
Prints.error = function(message)
Prints.Error = function(message)
printMessage('ERROR', '^1', message)
end
Prints.debug = function(message)
Prints.Debug = function(message)
printMessage('DEBUG', '^2', message)
end