Beispiel #1
0
        public async Task loadGameContentAsync(string paksFolderPath)
        {
            var pakIndex = await loadPakIndex(paksFolderPath);

            if (pakIndex == null)
            {
                throw new NullReferenceException($"PakIndex is null. Cannot Continue.");
            }
            var pakImageResolver = new PakImageResolver(pakIndex !, paksFolderPath);
            await pakImageResolver.loadPakFilesAsync(preloadBitmaps : false);

            instance          = pakImageResolver;
            gameContentLoaded = true;

            RegistryTools.SaveSetting(Constants.APPLICATION_NAME, Constants.PAK_FILE_LOCATION_REGISTRY_KEY, paksFolderPath !);
        }
Beispiel #2
0
        private void saveRecentFilesList()
        {
            // Delete the saved entries.
            for (int i = 0; i < Constants.MAX_RECENT_FILES; i++)
            {
                RegistryTools.DeleteSetting(Constants.APPLICATION_NAME, "FilePath" + i.ToString());
            }

            // Save the current entries.
            int index = 0;

            foreach (FileInfo file_info in _recentFilesInfos)
            {
                RegistryTools.SaveSetting(Constants.APPLICATION_NAME,
                                          "FilePath" + index.ToString(), file_info.FullName);
                index++;
            }
        }
Beispiel #3
0
        private async void loadGameContentAsync(string paksFolderPath)
        {
            showBusyIndicator();
            try
            {
                await _model.loadGameContentAsync(paksFolderPath);
            }
            catch (Exception e)
            {
                MessageBox.Show($"{e.Message}\n{e.StackTrace}", R.ERROR);
                this.Shutdown();
                return;
            }
            await preloadImages();

            RegistryTools.SaveSetting(Constants.APPLICATION_NAME, Constants.PAK_FILE_LOCATION_REGISTRY_KEY, paksFolderPath);
            showMainWindow();
        }