private async void OpenResources_Click(object sender, RoutedEventArgs e) { await CreateAssetsManagerAndLoader(); string gamePath = await GameFileHelper.FindHollowKnightPath(this); if (gamePath == null) { return; } string resourcesPath = GameFileHelper.FindGameFilePath(gamePath, "resources.assets"); LoadFsm(resourcesPath); }
private async void OpenSceneList_Click(object sender, RoutedEventArgs e) { await CreateAssetsManagerAndLoader(); string gamePath = await GameFileHelper.FindHollowKnightPath(this); if (gamePath == null) { return; } //gog and mac could have multiple folders that match, so find the one with a valid assets file (?) string resourcesPath = GameFileHelper.FindGameFilePath(gamePath, "resources.assets"); string dataPath = System.IO.Path.GetDirectoryName(resourcesPath); List <SceneInfo> sceneList = fsmLoader.LoadSceneList(dataPath); SceneSelectionDialog selector = new SceneSelectionDialog(sceneList); await selector.ShowDialog(this); long selectedId = selector.selectedID; bool selectedLevelFile = selector.selectedLevel; if (selectedId == -1) { return; } string format; if (selectedLevelFile) { format = "level{0}"; } else { format = "sharedassets{0}.assets"; } string assetsName = string.Format(format, selectedId); string fullAssetsPath = System.IO.Path.Combine(dataPath, assetsName); lastFileName = fullAssetsPath; openLast.IsEnabled = true; LoadFsm(fullAssetsPath); }