fixed up clientscript

This commit is contained in:
Bitl 2020-03-16 13:02:36 -07:00
parent 66a1163192
commit 4ff7bf0755
5 changed files with 31 additions and 13 deletions

View File

@ -197,7 +197,9 @@ namespace NovetusCMD
GlobalVars.RegisterClient2 = lines[4];
GlobalVars.SelectedClient = GlobalVars.DefaultClient;
GlobalVars.Map = GlobalVars.DefaultMap;
Console.Title = "Novetus " + version + " CMD";
GlobalVars.MapPath = GlobalVars.MapsDir + @"\\" + GlobalVars.DefaultMap;
GlobalVars.MapPathSnip = GlobalVars.MapsDirBase + @"\\" + GlobalVars.DefaultMap;
Console.Title = "Novetus " + version + " CMD";
ConsolePrint("NovetusCMD version " + version + " loaded.", 1);
GlobalVars.Version = version;

View File

@ -192,7 +192,7 @@ public class ClientScript
.Replace("%extraws%", GlobalVars.WebServer_ExtraDir + GlobalVars.Custom_Extra)
.Replace("%hat4ws%", GlobalVars.WebServer_HatDir + GlobalVars.Custom_Extra)
.Replace("%bodycolors%", GlobalVars.WebServer_BodyColors)
.Replace("%mapfiled%", GlobalVars.MapPath)
.Replace("%mapfiled%", GlobalVars.MapGameDir + GlobalVars.MapPathSnip.Replace(@"\\", @"\"))
.Replace("%tripcode%", GlobalVars.PlayerTripcode)
.Replace("%addonscriptpath%", GlobalVars.AddonScriptPath);
return compiled;

View File

@ -27,11 +27,13 @@ public static class GlobalVars
{
public static readonly string RootPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
public static readonly string BasePath = RootPath.Replace(@"\", @"\\");
public static readonly string DataPath = BasePath + "\\shareddata";
public static readonly string ConfigDir = BasePath + "\\config";
public static readonly string ClientDir = BasePath + "\\clients";
public static readonly string MapsDir = BasePath + "\\maps";
public static string MapPath = MapsDir + "\\" + DefaultMap;
public static readonly string DataPath = BasePath + @"\\shareddata";
public static readonly string ConfigDir = BasePath + @"\\config";
public static readonly string ClientDir = BasePath + @"\\clients";
public static readonly string MapsDir = BasePath + @"\\maps";
public static readonly string MapsDirBase = "maps";
public static string MapPath = "";
public static string MapPathSnip = "";
public static readonly string BaseGameDir = "rbxasset://../../../";
public static readonly string SharedDataGameDir = BaseGameDir + "shareddata/";
public static readonly string MapGameDir = BaseGameDir + "maps/";

View File

@ -32,7 +32,7 @@ public class LauncherFuncs
public static void ReadConfigValues(string cfgpath)
{
string Decryptline1, Decryptline2, Decryptline3, Decryptline4, Decryptline5, Decryptline6, Decryptline7, Decryptline9, Decryptline10, Decryptline11, Decryptline12, Decryptline13, Decryptline14;
string Decryptline1, Decryptline2, Decryptline3, Decryptline4, Decryptline5, Decryptline6, Decryptline7, Decryptline9, Decryptline10, Decryptline11, Decryptline12, Decryptline13, Decryptline14, Decryptline15;
IniFile ini = new IniFile(cfgpath);
@ -124,9 +124,17 @@ public class LauncherFuncs
Decryptline14 = ini.IniReadValue(section, "MapPath");
if (string.IsNullOrWhiteSpace(Decryptline13)) {
if (string.IsNullOrWhiteSpace(Decryptline14)) {
ini.IniWriteValue(section, "MapPath", GlobalVars.MapPath.ToString());
Decryptline13 = ini.IniReadValue(section, "MapPath");
Decryptline14 = ini.IniReadValue(section, "MapPath");
}
Decryptline15 = ini.IniReadValue(section, "MapPathSnip");
if (string.IsNullOrWhiteSpace(Decryptline15))
{
ini.IniWriteValue(section, "MapPathSnip", GlobalVars.MapPathSnip.ToString());
Decryptline15 = ini.IniReadValue(section, "MapPathSnip");
}
bool bline1 = Convert.ToBoolean(Decryptline1);
@ -179,6 +187,7 @@ public class LauncherFuncs
GlobalVars.DiscordPresence = bline13;
GlobalVars.MapPath = Decryptline14;
GlobalVars.MapPathSnip = Decryptline15;
ReadCustomizationValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization);
}
@ -202,6 +211,7 @@ public class LauncherFuncs
ini.IniWriteValue(section, "PlayerTripcode", SecurityFuncs.Base64Encode(GlobalVars.PlayerTripcode.ToString()));
ini.IniWriteValue(section, "DiscordRichPresence", GlobalVars.DiscordPresence.ToString());
ini.IniWriteValue(section, "MapPath", GlobalVars.MapPath.ToString());
ini.IniWriteValue(section, "MapPathSnip", GlobalVars.MapPathSnip.ToString());
WriteCustomizationValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization);
}
@ -219,7 +229,8 @@ public class LauncherFuncs
GlobalVars.UPnP = false;
GlobalVars.DisabledHelp = false;
GlobalVars.DiscordPresence = true;
GlobalVars.MapPath = GlobalVars.MapsDir + "\\" + GlobalVars.DefaultMap;
GlobalVars.MapPath = GlobalVars.MapsDir + @"\\" + GlobalVars.DefaultMap;
GlobalVars.MapPathSnip = GlobalVars.MapsDirBase + @"\\" + GlobalVars.DefaultMap;
ResetCustomizationValues();
}

View File

@ -367,7 +367,9 @@ namespace NovetusLauncher
GlobalVars.RegisterClient2 = lines[4];
GlobalVars.SelectedClient = GlobalVars.DefaultClient;
GlobalVars.Map = GlobalVars.DefaultMap;
this.Text = "Novetus " + version;
GlobalVars.MapPath = GlobalVars.MapsDir + @"\\" + GlobalVars.DefaultMap;
GlobalVars.MapPathSnip = GlobalVars.MapsDirBase + @"\\" + GlobalVars.DefaultMap;
this.Text = "Novetus " + version;
ConsolePrint("Novetus version " + version + " loaded. Initializing config.", 4);
if (File.Exists("changelog.txt"))
{
@ -1497,7 +1499,8 @@ namespace NovetusLauncher
if (treeView1.SelectedNode.Nodes.Count == 0)
{
GlobalVars.Map = treeView1.SelectedNode.Text.ToString();
GlobalVars.MapPath = GlobalVars.BasePath + @"\\" + treeView1.SelectedNode.FullPath.ToString().Replace(@"\", @"\\");
GlobalVars.MapPathSnip = treeView1.SelectedNode.FullPath.ToString().Replace(@"\", @"\\");
GlobalVars.MapPath = GlobalVars.BasePath + @"\\" + GlobalVars.MapPathSnip;
label28.Text = GlobalVars.Map;
if (File.Exists(GlobalVars.RootPath + @"\\" + treeView1.SelectedNode.FullPath.ToString().Replace(".rbxl", "") + "_desc.txt"))