diff --git a/CSTM-RESOURCE-GENERATOR-0.3.0.vsix b/CSTM-RESOURCE-GENERATOR-0.3.0.vsix index 7bbd526..02cf41e 100644 Binary files a/CSTM-RESOURCE-GENERATOR-0.3.0.vsix and b/CSTM-RESOURCE-GENERATOR-0.3.0.vsix differ diff --git a/CSTM-RESOURCE-GENERATOR-0.4.0.vsix b/CSTM-RESOURCE-GENERATOR-0.4.0.vsix new file mode 100644 index 0000000..ff50d72 Binary files /dev/null and b/CSTM-RESOURCE-GENERATOR-0.4.0.vsix differ diff --git a/extension.js b/extension.js index 6662f10..320bb79 100644 --- a/extension.js +++ b/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.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) - - writeFolder(url + "/" + folder.url + fold.url, fold) - } + for (const key in folder.folders) { + var subFolder = folder.folders[key]; + var subFolderPath = url + "/" + key; + mkdirSync(subFolderPath); + writeFolder(subFolderPath, subFolder); // Recursive call for each subfolder + } } diff --git a/package.json b/package.json index 5504313..09de029 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/template/client/nui.lua b/template/client/nui.lua new file mode 100644 index 0000000..74e95d3 --- /dev/null +++ b/template/client/nui.lua @@ -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) +