decomp: fix issues for var renamer

This commit is contained in:
Tyler Wilding 2023-03-08 22:29:08 -05:00
parent 93ffeac991
commit 412cad9dfe
No known key found for this signature in database
GPG key ID: 77CB07796494137E
4 changed files with 14 additions and 28 deletions

View file

@ -205,18 +205,12 @@
"description": "File path to the type searcher executable" "description": "File path to the type searcher executable"
}, },
"opengoal.decompilerJak1ConfigVersion": { "opengoal.decompilerJak1ConfigVersion": {
"type": [ "type": "string",
"string",
"null"
],
"default": "ntsc_v1", "default": "ntsc_v1",
"description": "Config version to use for decompiling jak 1 related files" "description": "Config version to use for decompiling jak 1 related files"
}, },
"opengoal.decompilerJak2ConfigVersion": { "opengoal.decompilerJak2ConfigVersion": {
"type": [ "type": "string",
"string",
"null"
],
"default": "ntsc_v1", "default": "ntsc_v1",
"description": "Config version to use for decompiling jak 2 related files" "description": "Config version to use for decompiling jak 2 related files"
} }

View file

@ -16,10 +16,12 @@ export function getConfig() {
decompilerPath: configOptions.get<string>("decompilerPath"), decompilerPath: configOptions.get<string>("decompilerPath"),
typeSearcherPath: configOptions.get<string>("typeSearcherPath"), typeSearcherPath: configOptions.get<string>("typeSearcherPath"),
jak1DecompConfigVersion: configOptions.get<string>( jak1DecompConfigVersion: configOptions.get<string>(
"decompilerJak1ConfigVersion" "decompilerJak1ConfigVersion",
"ntsc_v1"
), ),
jak2DecompConfigVersion: configOptions.get<string>( jak2DecompConfigVersion: configOptions.get<string>(
"decompilerJak2ConfigVersion" "decompilerJak2ConfigVersion",
"ntsc_v1"
), ),
colorsGoalGlobals: configOptions.get<string>("colors.goal.entity.global"), colorsGoalGlobals: configOptions.get<string>("colors.goal.entity.global"),
colorsGoalStorageControl: configOptions.get<string>( colorsGoalStorageControl: configOptions.get<string>(

View file

@ -40,18 +40,6 @@ export function getCastFileData(
return parse(readFileSync(castFilePath).toString(), undefined, true); return parse(readFileSync(castFilePath).toString(), undefined, true);
} }
async function promptUserToSelectConfigDirectory(
projectRoot: vscode.Uri
): Promise<string | undefined> {
// Get all `.jsonc` files in ./decompiler/config
const dirs = await getDirectoriesInDir(
vscode.Uri.joinPath(projectRoot, "decompiler/config").fsPath
);
return await vscode.window.showQuickPick(dirs, {
title: "Config?",
});
}
export function getDecompilerConfigDirectory( export function getDecompilerConfigDirectory(
activeFile: vscode.Uri activeFile: vscode.Uri
): string | undefined { ): string | undefined {
@ -68,12 +56,14 @@ export function getDecompilerConfigDirectory(
if (gameName == GameName.Jak1) { if (gameName == GameName.Jak1) {
decompConfigPath = vscode.Uri.joinPath( decompConfigPath = vscode.Uri.joinPath(
projectRoot, projectRoot,
`decompiler/config/jak1/` `decompiler/config/jak1/`,
getConfig().jak1DecompConfigVersion
).fsPath; ).fsPath;
} else if (gameName == GameName.Jak2) { } else if (gameName == GameName.Jak2) {
decompConfigPath = vscode.Uri.joinPath( decompConfigPath = vscode.Uri.joinPath(
projectRoot, projectRoot,
`decompiler/config/jak2/` `decompiler/config/jak2/`,
getConfig().jak1DecompConfigVersion
).fsPath; ).fsPath;
} }
if (decompConfigPath === undefined || !existsSync(decompConfigPath)) { if (decompConfigPath === undefined || !existsSync(decompConfigPath)) {

View file

@ -102,10 +102,10 @@
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91"
integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==
"@types/vscode@^1.74.0": "@types/vscode@^1.76.0":
version "1.74.0" version "1.76.0"
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.74.0.tgz#4adc21b4e7f527b893de3418c21a91f1e503bdcd" resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.76.0.tgz#967c0fbe09921818bbf201f1cbcb81b981c6249c"
integrity sha512-LyeCIU3jb9d38w0MXFwta9r0Jx23ugujkAxdwLTNCyspdZTKUc43t7ppPbCiPoQ/Ivd/pnDFZrb4hWd45wrsgA== integrity sha512-CQcY3+Fe5hNewHnOEAVYj4dd1do/QHliXaknAEYSXx2KEHUzFibDZSKptCon+HPgK55xx20pR+PBJjf0MomnBA==
"@typescript-eslint/eslint-plugin@^5.54.0": "@typescript-eslint/eslint-plugin@^5.54.0":
version "5.54.0" version "5.54.0"