public GuiResourceLoading(GameWindow window) { CommonResources.Load(); PluginManager.AddPlugin(new FileSystemRaw(new DirectoryInfo("Plugins\\System"))); ResourceReader.ClearCache(); ClientResources.Load(window); BoundingBoxRenderer.Load(); _background = ResourceReader.ReadTexture("System/Textures/Gui/ResourceLoadingBackground.png"); _progressBar = ResourceReader.ReadTexture("System/Textures/Gui/Progressbar.png"); _progressBarFull = ResourceReader.ReadTexture("System/Textures/Gui/ProgressbarFull.png"); Start(false); }
public static void LoadResources(Action <float, string, string> progress) { I18N.Load(t => progress(t * 0.5f, "Loading", "Translations")); progress(0.5f, "system.loading.resources.clearCache", ""); ResourceReader.ClearCache(); var part = 1f / PluginDlls.Count; var total = 0f; foreach (var plugin in PluginDlls) { progress(0.5f + total * 0.5f, "system.loading.resources.plugin", plugin.Value.PluginAttribute.Name); total += part; plugin.Value.Plugin.LoadResources(plugin.Value); } }