Merge resource loading

This commit is contained in:
Sardelka 2022-07-11 11:10:43 +08:00
commit ad0368b4c0

View File

@ -82,9 +82,9 @@ namespace RageCoop.Client.Scripting
/// <summary> /// <summary>
/// Load all resources from the server /// Load all resources from the server
/// </summary> /// </summary>
public void Load(string path,string[] zips) /// <param name="path">The path to the directory containing all resources to load.</param>
public void Load(string path)
{ {
Unload();
foreach (var zip in zips) foreach (var zip in zips)
{ {
var zipPath=Path.Combine(path, zip); var zipPath=Path.Combine(path, zip);
@ -98,7 +98,7 @@ namespace RageCoop.Client.Scripting
StopAll(); StopAll();
if (LoadedResources.Count > 0) if (LoadedResources.Count > 0)
{ {
Util.Reload(); API.QueueAction(()=>Util.Reload());
} }
LoadedResources.Clear(); LoadedResources.Clear();
} }