Update to Resource generator plugin

SHE GETS TO LIVE CHRISTINA!!!!  YOU DONT GET TO KILL HER TODAY!!!
This commit is contained in:
Chase Eller 2023-07-09 18:06:21 -04:00
parent b384da9837
commit fbb704ff4e
5 changed files with 49 additions and 13 deletions

Binary file not shown.

Binary file not shown.

View File

@ -139,21 +139,19 @@ function getGeneratedFolder(url) {
function writeFolder(url, folder) { function writeFolder(url, folder) {
url = url;
url = url for (const key in folder.files) {
writeFileSync(url + "/" + key, folder.files[key], { encoding: 'utf-8' });
}
for (const key in folder.files) { for (const key in folder.folders) {
writeFileSync(url + "/"+ key, folder.files[key], {encoding : 'utf-8'}); var subFolder = folder.folders[key];
} var subFolderPath = url + "/" + key;
mkdirSync(subFolderPath);
for (const key in folder.folders) {
var fold = folder.folders[key]
mkdirSync(url + "/" + folder.url + fold.url)
writeFolder(url + "/" + folder.url + fold.url, fold)
}
writeFolder(subFolderPath, subFolder); // Recursive call for each subfolder
}
} }

View File

@ -3,7 +3,7 @@
"name": "CSTM-RESOURCE-GENERATOR", "name": "CSTM-RESOURCE-GENERATOR",
"displayName": "CSTM Five Alive Resource Generator", "displayName": "CSTM Five Alive Resource Generator",
"description": "This is an internal tool to help you in creating a new basic lua resource for FiveAlive", "description": "This is an internal tool to help you in creating a new basic lua resource for FiveAlive",
"version": "0.3.0", "version": "0.4.0",
"engines": { "engines": {
"vscode": "^1.59.0" "vscode": "^1.59.0"
}, },

38
template/client/nui.lua Normal file
View File

@ -0,0 +1,38 @@
local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_code", 0)
local SPLASH_IMG = GetResourceMetadata(GetCurrentResourceName(), "SPLASH_IMG", 0)
--Setup the splash image on script load
Citizen.CreateThread(function()
print("Setting Up LoadSplash")
SendNUIMessage({
type = "setIMG",
value = SPLASH_IMG,
})
end)
-- Show and hide the splash without spinner
function displaySplash(bool)
SendNUIMessage({
type = "showSplash",
status = bool,
})
end
RegisterNetEvent(RESOURCE_CODE..':ShowStaticSplash')
AddEventHandler(RESOURCE_CODE..':ShowStaticSplash', function(bool)
displaySplash(bool)
end)
-- Show and hide the splash with spinner
function displayLoadSplash(bool)
SendNUIMessage({
type = "showLoadingSplash",
status = bool,
})
end
RegisterNetEvent(RESOURCE_CODE..':ShowLoadingSplash')
AddEventHandler(RESOURCE_CODE..':ShowLoadingSplash', function(bool)
displayLoadSplash(bool)
end)