This commit is contained in:
Bitl 2020-07-12 13:52:06 -07:00
parent 287e48053d
commit c2db84d6d1
4 changed files with 33 additions and 30 deletions

View File

@ -23,7 +23,6 @@ namespace Novetus.ClientScriptTester
OutputBox.AppendText(str + LocalVars.DoubleSpacedNewLine); OutputBox.AppendText(str + LocalVars.DoubleSpacedNewLine);
} }
OutputBox.Text.TrimEnd();
OutputBox.SelectionStart = 0; OutputBox.SelectionStart = 0;
OutputBox.ScrollToCaret(); OutputBox.ScrollToCaret();
} }

View File

@ -469,22 +469,21 @@ public class GlobalFuncs
} }
} }
public static bool CopyMapToRBXAsset() public static void FixedFileCopy(string src, string dest, bool overwrite)
{
if (File.Exists(dest))
{
File.SetAttributes(dest, FileAttributes.Normal);
}
File.Copy(src, dest, overwrite);
}
public static string CopyMapToRBXAsset()
{ {
bool success;
string clientcontentpath = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\temp.rbxl"; string clientcontentpath = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\temp.rbxl";
FixedFileCopy(GlobalVars.UserConfiguration.MapPath, clientcontentpath, true);
try return GlobalPaths.AltBaseGameDir + "temp.rbxl";
{
File.Copy(GlobalVars.UserConfiguration.MapPath, clientcontentpath, true);
success = true;
}
catch (Exception)
{
success = false;
}
return success;
} }
public static void LoadClientValues(string clientpath) public static void LoadClientValues(string clientpath)
@ -541,7 +540,7 @@ public class GlobalFuncs
if (!File.Exists(fullpath)) if (!File.Exists(fullpath))
{ {
File.Copy(GlobalPaths.ConfigDir + "\\ReShade_default.ini", fullpath, true); File.Copy(GlobalPaths.ConfigDir + "\\ReShade_default.ini", fullpath);
ReShadeValues(fullpath, write, true); ReShadeValues(fullpath, write, true);
} }
else else
@ -555,28 +554,32 @@ public class GlobalFuncs
foreach (DirectoryInfo dir in Dirs) foreach (DirectoryInfo dir in Dirs)
{ {
string fulldirpath = dir.FullName + @"\" + cfgname; string fulldirpath = dir.FullName + @"\" + cfgname;
if (!File.Exists(fulldirpath))
{
File.Copy(fullpath, fulldirpath, true);
ReShadeValues(fulldirpath, write, false);
}
else
{
ReShadeValues(fulldirpath, write, false);
}
string fulldllpath = dir.FullName + @"\opengl32.dll"; string fulldllpath = dir.FullName + @"\opengl32.dll";
if (GlobalVars.UserConfiguration.ReShade) if (GlobalVars.UserConfiguration.ReShade)
{ {
if (!File.Exists(fulldirpath))
{
File.Copy(fullpath, fulldirpath);
ReShadeValues(fulldirpath, write, false);
}
else
{
ReShadeValues(fulldirpath, write, false);
}
if (!File.Exists(fulldllpath)) if (!File.Exists(fulldllpath))
{ {
File.Copy(GlobalPaths.ConfigDirData + "\\opengl32.dll", fulldllpath, true); File.Copy(GlobalPaths.ConfigDirData + "\\opengl32.dll", fulldllpath);
} }
} }
else else
{ {
if (File.Exists(fulldirpath))
{
File.Delete(fulldirpath);
}
if (File.Exists(fulldllpath)) if (File.Exists(fulldllpath))
{ {
File.Delete(fulldllpath); File.Delete(fulldllpath);

View File

@ -341,8 +341,8 @@ public class ScriptFuncs
.Replace("%hat3ws%", GlobalPaths.WebServer_HatDir + GlobalVars.UserCustomization.Hat3) .Replace("%hat3ws%", GlobalPaths.WebServer_HatDir + GlobalVars.UserCustomization.Hat3)
.Replace("%extraws%", GlobalPaths.WebServer_ExtraDir + GlobalVars.UserCustomization.Extra) .Replace("%extraws%", GlobalPaths.WebServer_ExtraDir + GlobalVars.UserCustomization.Extra)
.Replace("%hat4ws%", GlobalPaths.WebServer_HatDir + GlobalVars.UserCustomization.Extra) .Replace("%hat4ws%", GlobalPaths.WebServer_HatDir + GlobalVars.UserCustomization.Extra)
.Replace("%mapfiled%", GlobalPaths.BaseGameDir + GlobalVars.UserConfiguration.MapPathSnip.Replace(@"\\", @"\")) .Replace("%mapfiled%", GlobalPaths.BaseGameDir + GlobalVars.UserConfiguration.MapPathSnip.Replace(@"\\", @"\").Replace(@"/", @"\"))
.Replace("%mapfilec%", GlobalFuncs.CopyMapToRBXAsset() ? GlobalPaths.AltBaseGameDir + "temp.rbxl" : "") .Replace("%mapfilec%", GlobalFuncs.CopyMapToRBXAsset())
.Replace("%tripcode%", GlobalVars.UserConfiguration.PlayerTripcode) .Replace("%tripcode%", GlobalVars.UserConfiguration.PlayerTripcode)
.Replace("%scripttype%", Generator.GetNameForType(type)) .Replace("%scripttype%", Generator.GetNameForType(type))
.Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath); .Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath);

View File

@ -110,6 +110,7 @@ del /s /q Novetus\clients\ClientScriptTester\ReShade.ini
del /s /q Novetus\clients\ClientScriptTester\OPENGL32.log del /s /q Novetus\clients\ClientScriptTester\OPENGL32.log
del /s /q Novetus\clients\ClientScriptTester\opengl32.dll del /s /q Novetus\clients\ClientScriptTester\opengl32.dll
del /s /q Novetus\clients\ClientScriptTester\DefaultPreset.ini del /s /q Novetus\clients\ClientScriptTester\DefaultPreset.ini
del /s /q Novetus\clients\ClientScriptTester\content\temp.rbxl
del /s /q Novetus\config\servers.txt del /s /q Novetus\config\servers.txt
del /s /q Novetus\config\ports.txt del /s /q Novetus\config\ports.txt