Update to Resource generator plugin
SHE GETS TO LIVE CHRISTINA!!!! YOU DONT GET TO KILL HER TODAY!!!
This commit is contained in:
parent
b384da9837
commit
fbb704ff4e
Binary file not shown.
Binary file not shown.
12
extension.js
12
extension.js
|
|
@ -139,21 +139,19 @@ function getGeneratedFolder(url) {
|
|||
|
||||
|
||||
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.folders) {
|
||||
var fold = folder.folders[key]
|
||||
mkdirSync(url + "/" + folder.url + fold.url)
|
||||
var subFolder = folder.folders[key];
|
||||
var subFolderPath = url + "/" + key;
|
||||
mkdirSync(subFolderPath);
|
||||
|
||||
writeFolder(url + "/" + folder.url + fold.url, fold)
|
||||
writeFolder(subFolderPath, subFolder); // Recursive call for each subfolder
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"name": "CSTM-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",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0",
|
||||
"engines": {
|
||||
"vscode": "^1.59.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
Reference in New Issue