From 22c9309709e7b0f9be2b4d59c2257dffbe3d4226 Mon Sep 17 00:00:00 2001 From: Bitl Date: Wed, 13 Nov 2019 10:39:56 -0700 Subject: [PATCH] Added script support. --- NovetusLauncher/NovetusFuncs/GlobalVars.cs | 10 ++++++ .../NovetusFuncs/RobloxXMLLocalizer.cs | 33 +++++++++++++++++++ .../NovetusLauncher/AssetLocalizer.cs | 5 +++ 3 files changed, 48 insertions(+) diff --git a/NovetusLauncher/NovetusFuncs/GlobalVars.cs b/NovetusLauncher/NovetusFuncs/GlobalVars.cs index 323a034..7246de0 100644 --- a/NovetusLauncher/NovetusFuncs/GlobalVars.cs +++ b/NovetusLauncher/NovetusFuncs/GlobalVars.cs @@ -34,10 +34,12 @@ public static class GlobalVars public static readonly string DirFonts = "\\fonts"; public static readonly string DirSounds = "\\sounds"; public static readonly string DirTextures = "\\textures"; + public static readonly string DirScripts = "\\scripts"; public static readonly string FontsGameDir = "fonts/"; public static readonly string SoundsGameDir = "sounds/"; public static readonly string TexturesGameDir = "textures/"; + public static readonly string ScriptsGameDir = "scripts/"; //customization public static readonly string CustomPlayerDir = DataPath + "\\charcustom"; public static readonly string hatdir = CustomPlayerDir + "\\hats"; @@ -61,6 +63,7 @@ public static class GlobalVars public static readonly string hatdirFonts = hatdir + DirFonts; public static readonly string hatdirTextures = hatdir + DirTextures; public static readonly string hatdirSounds = hatdir + DirSounds; + public static readonly string hatdirScripts = hatdir + DirScripts; public static readonly string facedirTextures = facedir + DirTextures; public static readonly string headdirFonts = headdir + DirFonts; public static readonly string headdirTextures = headdir + DirTextures; @@ -71,6 +74,7 @@ public static class GlobalVars public static readonly string hatGameDirFonts = hatGameDir + FontsGameDir; public static readonly string hatGameDirTextures = hatGameDir + TexturesGameDir; public static readonly string hatGameDirSounds = hatGameDir + SoundsGameDir; + public static readonly string hatGameDirScripts = hatGameDir + ScriptsGameDir; public static readonly string faceGameDirTextures = faceGameDir + TexturesGameDir; public static readonly string headGameDirFonts = headGameDir + FontsGameDir; public static readonly string headGameDirTextures = headGameDir + TexturesGameDir; @@ -85,6 +89,7 @@ public static class GlobalVars public static readonly string AssetCacheDirSounds = AssetCacheDir + DirSounds; public static readonly string AssetCacheDirTextures = AssetCacheDir + DirTextures; public static readonly string AssetCacheDirTexturesGUI = AssetCacheDirTextures + "\\gui"; + public static readonly string AssetCacheDirScripts = AssetCacheDir + DirScripts; public static readonly string AssetCacheGameDir = SharedDataGameDir + "assetcache/"; public static readonly string AssetCacheFontsGameDir = AssetCacheGameDir + FontsGameDir; @@ -92,6 +97,7 @@ public static class GlobalVars public static readonly string AssetCacheSoundsGameDir = AssetCacheGameDir + SoundsGameDir; public static readonly string AssetCacheTexturesGameDir = AssetCacheGameDir + TexturesGameDir; public static readonly string AssetCacheTexturesGUIGameDir = AssetCacheTexturesGameDir + "gui/"; + public static readonly string AssetCacheScriptsGameDir = AssetCacheGameDir + ScriptsGameDir; //defs public static AssetCacheDef Fonts { get { return new AssetCacheDef("SpecialMesh", new string[] { "MeshId", "TextureId" }, new string[] { ".mesh", ".png" }, new string[] { AssetCacheDirFonts, AssetCacheDirTextures }, new string[] { AssetCacheFontsGameDir, AssetCacheTexturesGameDir }); } } @@ -105,9 +111,13 @@ public static class GlobalVars public static AssetCacheDef Shirt { get { return new AssetCacheDef("Shirt", new string[] { "ShirtTemplate" }, new string[] { ".png" }, new string[] { AssetCacheDirTextures }, new string[] { AssetCacheTexturesGameDir }); } } public static AssetCacheDef ShirtGraphic { get { return new AssetCacheDef("ShirtGraphic", new string[] { "Graphic" }, new string[] { ".png" }, new string[] { AssetCacheDirTextures }, new string[] { AssetCacheTexturesGameDir }); } } public static AssetCacheDef Pants { get { return new AssetCacheDef("Pants", new string[] { "PantsTemplate" }, new string[] { ".png" }, new string[] { AssetCacheDirTextures }, new string[] { AssetCacheTexturesGameDir }); } } + public static AssetCacheDef Script { get { return new AssetCacheDef("Script", new string[] { "LinkedSource" }, new string[] { ".lua" }, new string[] { AssetCacheDirScripts }, new string[] { AssetCacheScriptsGameDir }); } } + public static AssetCacheDef LocalScript { get { return new AssetCacheDef("LocalScript", new string[] { "LinkedSource" }, new string[] { ".lua" }, new string[] { AssetCacheDirScripts }, new string[] { AssetCacheScriptsGameDir }); } } //item defs below public static AssetCacheDef ItemHatFonts { get { return new AssetCacheDef("SpecialMesh", new string[] { "MeshId", "TextureId" }, new string[] { ".mesh", ".png" }, new string[] { hatdirFonts, hatdirTextures }, new string[] { hatGameDirFonts, hatGameDirTextures }); } } public static AssetCacheDef ItemHatSound { get { return new AssetCacheDef("Sound", new string[] { "SoundId" }, new string[] { ".wav" }, new string[] { hatdirSounds }, new string[] { hatGameDirSounds }); } } + public static AssetCacheDef ItemHatScript { get { return new AssetCacheDef("Script", new string[] { "LinkedSource" }, new string[] { ".lua" }, new string[] { hatdirScripts }, new string[] { hatGameDirScripts }); } } + public static AssetCacheDef ItemHatLocalScript { get { return new AssetCacheDef("LocalScript", new string[] { "LinkedSource" }, new string[] { ".lua" }, new string[] { hatdirScripts }, new string[] { hatGameDirScripts }); } } public static AssetCacheDef ItemHeadFonts { get { return new AssetCacheDef("SpecialMesh", new string[] { "MeshId", "TextureId" }, new string[] { ".mesh", ".png" }, new string[] { headdirFonts, headdirTextures }, new string[] { headGameDirFonts, headGameDirTextures }); } } public static AssetCacheDef ItemFaceTexture { get { return new AssetCacheDef("Decal", new string[] { "Texture" }, new string[] { ".png" }, new string[] { facedirTextures }, new string[] { faceGameDirTextures }); } } public static AssetCacheDef ItemShirtTexture { get { return new AssetCacheDef("Shirt", new string[] { "ShirtTemplate" }, new string[] { ".png" }, new string[] { shirtdirTextures }, new string[] { shirtGameDirTextures }); } } diff --git a/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs b/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs index 70a022b..39cd912 100644 --- a/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs +++ b/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs @@ -126,6 +126,17 @@ public static class RobloxXMLLocalizer stringToUpdate = "Downloading RBXL Pants Textures..."; } DownloadFromNodes(path, GlobalVars.Pants); + //scripts + if (!string.IsNullOrWhiteSpace(stringToUpdate)) + { + stringToUpdate = "Downloading RBXL Linked Scripts..."; + } + DownloadFromNodes(path, GlobalVars.Script); + if (!string.IsNullOrWhiteSpace(stringToUpdate)) + { + stringToUpdate = "Downloading RBXL Linked LocalScripts..."; + } + DownloadFromNodes(path, GlobalVars.LocalScript); goto default; case DLType.RBXM: //meshes @@ -197,6 +208,17 @@ public static class RobloxXMLLocalizer stringToUpdate = "Downloading RBXM Pants Textures..."; } DownloadFromNodes(path, GlobalVars.Pants); + //scripts + if (!string.IsNullOrWhiteSpace(stringToUpdate)) + { + stringToUpdate = "Downloading RBXM Linked Scripts..."; + } + DownloadFromNodes(path, GlobalVars.Script); + if (!string.IsNullOrWhiteSpace(stringToUpdate)) + { + stringToUpdate = "Downloading RBXM Linked LocalScripts..."; + } + DownloadFromNodes(path, GlobalVars.LocalScript); goto default; case DLType.Hat: //meshes @@ -211,6 +233,17 @@ public static class RobloxXMLLocalizer stringToUpdate = "Downloading Hat Sounds..."; } DownloadFromNodes(path, GlobalVars.ItemHatSound); + //scripts + if (!string.IsNullOrWhiteSpace(stringToUpdate)) + { + stringToUpdate = "Downloading Hat Linked Scripts..."; + } + DownloadFromNodes(path, GlobalVars.Script); + if (!string.IsNullOrWhiteSpace(stringToUpdate)) + { + stringToUpdate = "Downloading Hat Linked LocalScripts..."; + } + DownloadFromNodes(path, GlobalVars.LocalScript); goto default; case DLType.Head: //meshes diff --git a/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs b/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs index 7c1ee69..aefee82 100644 --- a/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs +++ b/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs @@ -90,6 +90,11 @@ namespace NovetusLauncher { System.IO.Directory.CreateDirectory(GlobalVars.AssetCacheDirTexturesGUI); } + + if (!System.IO.Directory.Exists(GlobalVars.AssetCacheDirScripts)) + { + System.IO.Directory.CreateDirectory(GlobalVars.AssetCacheDirScripts); + } } } }