From 503d34c2897f910ea4a1e6945535b911e01885c9 Mon Sep 17 00:00:00 2001 From: Bitl Date: Sun, 6 Mar 2022 11:52:34 -0700 Subject: [PATCH] config file changes --- Novetus/NovetusCore/Classes/INIFile.cs | 13 +++--- .../StorageAndFunctions/GlobalFuncs.cs | 44 +++++++++++++------ changelog.txt | 19 +++++--- documentation.txt | 2 + .../batch/Novetus_dependency_installer.bat | 2 +- scripts/launcher/info.ini | 5 ++- scripts/launcher/splashes.txt | 3 +- 7 files changed, 61 insertions(+), 27 deletions(-) diff --git a/Novetus/NovetusCore/Classes/INIFile.cs b/Novetus/NovetusCore/Classes/INIFile.cs index b1ff7bc..14e0632 100644 --- a/Novetus/NovetusCore/Classes/INIFile.cs +++ b/Novetus/NovetusCore/Classes/INIFile.cs @@ -69,13 +69,16 @@ public class INIFile { try { - string[] lines = File.ReadAllLines(path); - - foreach(string line in lines) + if (File.Exists(path)) { - if (line.Contains(SearchString)) + string[] lines = File.ReadAllLines(path); + + foreach (string line in lines) { - return true; + if (line.Contains(SearchString)) + { + return true; + } } } diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs index 7497657..b19e9c1 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs @@ -208,6 +208,15 @@ public class GlobalFuncs public static void Config(string cfgpath, bool write, bool doubleCheck = false) { + bool forcewrite = false; + + if(!File.Exists(cfgpath)) + { + // force write mode on if the file doesn't exist. + write = true; + forcewrite = true; + } + if (write) { //WRITE @@ -240,6 +249,12 @@ public class GlobalFuncs ini.IniWriteValue(section, "NewGUI", GlobalVars.UserConfiguration.NewGUI.ToString()); ConfigUseOldValIfExists(ini, section, "ItemMakerDisableHelpMessage", "AssetSDKDisableHelpMessage", GlobalVars.UserConfiguration.DisabledAssetSDKHelp.ToString(), write); ConfigUseOldValIfExists(ini, section, "AssetLocalizerSaveBackups", "AssetSDKFixerSaveBackups", GlobalVars.UserConfiguration.AssetSDKFixerSaveBackups.ToString(), write); + + if (forcewrite) + { + // try again.... + Config(cfgpath, false, doubleCheck); + } } else { @@ -353,22 +368,25 @@ public class GlobalFuncs } } - string curval = GenerateAndReturnTripcode(); - if (!GlobalVars.PlayerTripcode.Equals(curval)) + if (!forcewrite) { - GlobalVars.PlayerTripcode = curval; - } + string curval = GenerateAndReturnTripcode(); + if (!GlobalVars.PlayerTripcode.Equals(curval)) + { + GlobalVars.PlayerTripcode = curval; + } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization)) - { - Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); - } - else - { - Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, write); - } + if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization)) + { + Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); + } + else + { + Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, write); + } - ReShade(GlobalPaths.ConfigDir, "ReShade.ini", write); + ReShade(GlobalPaths.ConfigDir, "ReShade.ini", write); + } } public static bool ResetMapIfNecessary() diff --git a/changelog.txt b/changelog.txt index 5e5419c..38d421e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,11 +1,18 @@ -1.3 v?.2022.1 -Changes from 1.3 v2.2022.1: +1.3 Snapshot v22.8100.20815 Enhancements: - Added the ability to sign scripts. - There are 2 ways to sign scripts, use the new ClientScript variables for generated join scripts, or use the File -> Sign Script Manually (For Modern Clients) option. - - New ClientScript variables: - - %signgeneratedjoinscript% - Signs the generated join script if "Generate scripts and fix map loading for 2007/2012+" is enabled. - - %usenewsignformat% - for %signgeneratedjoinscript%, uses the new client signature format found on newer clients. + - The generated key files are stored in the same path as the script file, so using the same key is viable. + +- New ClientScript variables: + - %signgeneratedjoinscript% - Signs the generated join script if "Generate scripts and fix map loading for 2007/2012+" is enabled. + - %usenewsignformat% - for %signgeneratedjoinscript%, uses the new client signature format found on newer clients. + - %useloadfile% - Uses the "loadfile" function instead of "dofile" for generated join scripts if "Generate scripts and fix map loading for 2007/2012+" is enabled. + - %userbxassetforgeneration% - When "Generate scripts and fix map loading for 2007/2012+" is enabled, use "rbxasset" as the main path we should get the file from. + +- Added better Bootstrapper error handling. + +- Made config saving more reliable on initial startup. ---------------------------------------------------------------------------- 1.3 v2.2022.1 @@ -160,6 +167,8 @@ Lite version changes: - Removed .NET Framework 2.0 dependency. - Removed the soundtrack. ---------------------------------------------------------------------------- +Post 1.3 +---------------------------------------------------------------------------- 1.3 v11.2021.1 Changes from Pre-Release 5: - The server hosting panel is closed by default in the Stylish view. You must now click "Server" if you want to edit hosting settings and launch a server. diff --git a/documentation.txt b/documentation.txt index 307a549..4f9ccf7 100644 --- a/documentation.txt +++ b/documentation.txt @@ -28,6 +28,8 @@ General: %newgui% - Returns if the 2011L interface is enabled on 2011M clients. Can be used as a toggle switch for other client-side CoreScript features. %signgeneratedjoinscript% - Signs the generated join script if "Generate scripts and fix map loading for 2007/2012+" is enabled. %usenewsignformat% - for %signgeneratedjoinscript%, uses the new client signature format found on newer clients. +%useloadfile% - Uses the "loadfile" function instead of "dofile" for generated join scripts if "Generate scripts and fix map loading for 2007/2012+" is enabled. +%userbxassetforgeneration% - When "Generate scripts and fix map loading for 2007/2012+" is enabled, use "rbxasset" as the main path we should get the file from. Server: %limit% - Max Player limit. diff --git a/scripts/batch/Novetus_dependency_installer.bat b/scripts/batch/Novetus_dependency_installer.bat index f625215..2347d03 100644 --- a/scripts/batch/Novetus_dependency_installer.bat +++ b/scripts/batch/Novetus_dependency_installer.bat @@ -41,7 +41,7 @@ ECHO 2 - Microsoft .NET Framework 4.0 (REQUIRED for the Novetus Launcher) ECHO 3 - .NET 4.0 Update (KB2468871, REQUIRED for Windows XP and Vista) ECHO 4 - Microsoft Visual C++ Redistributables 2005 (32-bit, REQUIRED for 2007) ECHO 5 - Microsoft Visual C++ Redistributables 2008 (32-bit, REQUIRED for 2008 and above) -ECHO 6 - Media Feature Pack for Windows N Editions (REQUIRED for 2011+) +ECHO 6 - Media Feature Pack for Windows 8/8.1/10/11 N Editions (REQUIRED for 2011+) ECHO 7 - Exit ECHO. SET /P M=Choose an option by typing the number corresponding to which depenency you want to install: diff --git a/scripts/launcher/info.ini b/scripts/launcher/info.ini index ee8bfc5..c775571 100644 --- a/scripts/launcher/info.ini +++ b/scripts/launcher/info.ini @@ -5,8 +5,9 @@ DefaultMap=Dev - Baseplate2048.rbxl UserAgentRegisterClient1=2007M UserAgentRegisterClient2=2010L ExtendedVersionNumber=True -ExtendedVersionEditChangelog=False -ExtendedVersionTemplate=%version% v?.2022.%extended-revision%%lite% +ExtendedVersionEditChangelog=True +//ExtendedVersionTemplate=%version% v?.2022.%extended-revision%%lite% +ExtendedVersionTemplate=%version% Snapshot v22.%build%.%revision% ExtendedVersionRevision=1 IsLite=False InitialBootup=False diff --git a/scripts/launcher/splashes.txt b/scripts/launcher/splashes.txt index 8471ab8..c8daad0 100644 --- a/scripts/launcher/splashes.txt +++ b/scripts/launcher/splashes.txt @@ -204,4 +204,5 @@ Látom. [normal]Tell me how it felt when you walked on water.|Did you get your wish? [stylish]Tell me how it felt when you walked on water. Did you get your wish? [normal]GET TO THE SHIPS! IT'S OUR ONLY CHANCE!|From the 1986 Transformers movie. -Standing here, I realize... \ No newline at end of file +Standing here, I realize... +good grief! \ No newline at end of file