Skip to content

Commit 6eadb32

Browse files
Updated remaining 'totk-editor' user facing text to say 'TKVSC'
1 parent 3de6b09 commit 6eadb32

11 files changed

Lines changed: 76 additions & 47 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ To demonstrate with a direct comparison, modifying the defense of every level of
108108

109109
### Python troubleshooting
110110

111-
**`python3` works in CMD but the extension cannot find Python?** Cursor and VS Code are often launched without your full user PATH (unlike a terminal you opened yourself). Fix:
111+
**`python3` works in CMD but the extension cannot find Python?** VSCode is often launched without your full user PATH (unlike a terminal you opened yourself). Fix:
112112

113113
1. **TKVSC: Select Python (from detected installs)** - scans `where python3`, common install folders, and `py`.
114114
2. **TKVSC: Browse for python.exe** - point at the real interpreter (e.g. `%LocalAppData%\Programs\Python\Python312\python.exe`).

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@
723723
"configuration": {
724724
"title": "TKVSC",
725725
"properties": {
726-
"totk-editor.logLevel": {
726+
"TKVSC.logLevel": {
727727
"type": "string",
728728
"enum": [
729729
"Debug",
@@ -734,32 +734,32 @@
734734
"default": "Info",
735735
"markdownDescription": "Determine the verbosity of logs written to the Output Channel."
736736
},
737-
"totk-editor.enableToastNotifications": {
737+
"TKVSC.enableToastNotifications": {
738738
"type": "boolean",
739739
"default": true,
740740
"markdownDescription": "Enable pop-up toast notifications in VS Code for Warnings and Errors."
741741
},
742-
"totk-editor.pythonPath": {
742+
"TKVSC.pythonPath": {
743743
"type": "string",
744744
"default": "",
745-
"markdownDescription": "Full path to **python.exe** (Python 3.10+). Use this when `python3` works in CMD but the extension says Python was not found - Cursor/VS Code often start with a shorter PATH than your terminal. Run **TKVSC: Browse for python.exe** or **TKVSC: Select Python** to set this automatically."
745+
"markdownDescription": "Full path to **python.exe** (Python 3.10+). Use this when `python3` works in CMD but the extension says Python was not found - Run **TKVSC: Browse for python.exe** or **TKVSC: Select Python** to set this automatically."
746746
},
747-
"totk-editor.projectsPath": {
747+
"TKVSC.projectsPath": {
748748
"type": "string",
749749
"default": "",
750750
"markdownDescription": "Default path where new projects will be created."
751751
},
752-
"totk-editor.romfsPath": {
752+
"TKVSC.romfsPath": {
753753
"type": "string",
754754
"default": "",
755755
"markdownDescription": "Path to your extracted game **RomFS** (game dump) folder. Must contain `Pack/ZsDic.pack.zs`. **Required** to open or save any `.zs` file (`.pack.zs`, `.byml.zs`, `.bcett.byml.zs`, etc.)."
756756
},
757-
"totk-editor.createRomfsOnImport": {
757+
"TKVSC.createRomfsOnImport": {
758758
"type": "boolean",
759759
"default": true,
760760
"markdownDescription": "Automatically create a `romfs` folder when importing a project if there is no `romfs` or `exefs` folder next to the `.tkproj`."
761761
},
762-
"totk-editor.tagProductFormat": {
762+
"TKVSC.tagProductFormat": {
763763
"type": "string",
764764
"enum": [
765765
"json",
@@ -768,33 +768,33 @@
768768
"default": "yaml",
769769
"markdownDescription": "Format to use for displaying Tag.Product.rstbl.byml files (JSON or YAML)."
770770
},
771-
"totk-editor.bymlInlineContainerMaxCount": {
771+
"TKVSC.bymlInlineContainerMaxCount": {
772772
"type": "integer",
773773
"default": 1,
774774
"markdownDescription": "The maximum number of child nodes allowed in a list/array or map/hash for it to still be formatted as an inline container (e.g. `[1]` or `{a: 1}`)."
775775
},
776-
"totk-editor.extraAampExtensions": {
776+
"TKVSC.extraAampExtensions": {
777777
"type": "array",
778778
"items": {
779779
"type": "string"
780780
},
781781
"default": [],
782782
"markdownDescription": "Additional file extensions (without dot) treated as **AAMP** parameter files, e.g. `bcustom`. See `aamp-extensions.json` in the extension folder for the built-in list."
783783
},
784-
"totk-editor.enableCanonicalSavePropagation": {
784+
"TKVSC.enableCanonicalSavePropagation": {
785785
"type": "boolean",
786786
"default": true,
787787
"markdownDescription": "When enabled, saving a file inside an archive updates all matching canonical-path instances across project archives. Missing matching archives are copied from the configured game dump first."
788788
},
789-
"totk-editor.canonicalSyncBlacklistPrefixes": {
789+
"TKVSC.canonicalSyncBlacklistPrefixes": {
790790
"type": "array",
791791
"items": {
792792
"type": "string"
793793
},
794794
"default": [],
795795
"markdownDescription": "Canonical path folder prefixes excluded from synchronized save propagation. Matching is case-insensitive and checks full canonical path prefixes. This is NOT the RomFS path!"
796796
},
797-
"totk-editor.canonicalSyncArchiveTypeBlacklist": {
797+
"TKVSC.canonicalSyncArchiveTypeBlacklist": {
798798
"type": "array",
799799
"items": {
800800
"type": "string"
@@ -805,7 +805,7 @@
805805
],
806806
"markdownDescription": "Archive file extensions that disable canonical synchronized edits for paths inside those archive types (for example nested `.sarc`/`.blarc`). Matching is case-insensitive."
807807
},
808-
"totk-editor.canonicalSyncFileExtensionBlacklist": {
808+
"TKVSC.canonicalSyncFileExtensionBlacklist": {
809809
"type": "array",
810810
"items": {
811811
"type": "string"
@@ -958,4 +958,4 @@
958958
"opentype.js": "^2.0.0",
959959
"sql.js": "^1.14.1"
960960
}
961-
}
961+
}

replace.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
function walk(dir) {
4+
let results = [];
5+
const list = fs.readdirSync(dir);
6+
list.forEach(file => {
7+
file = path.join(dir, file);
8+
const stat = fs.statSync(file);
9+
if (stat && stat.isDirectory()) {
10+
results = results.concat(walk(file));
11+
} else if (file.endsWith('.ts')) {
12+
results.push(file);
13+
}
14+
});
15+
return results;
16+
}
17+
const files = walk('src');
18+
let count = 0;
19+
files.forEach(file => {
20+
let content = fs.readFileSync(file, 'utf8');
21+
let newContent = content.replace(/getConfiguration\('totk-editor'\)/g, "getConfiguration('TKVSC')");
22+
newContent = newContent.replace(/affectsConfiguration\('totk-editor\./g, "affectsConfiguration('TKVSC.");
23+
if (content !== newContent) {
24+
fs.writeFileSync(file, newContent, 'utf8');
25+
console.log('Updated ' + file);
26+
count++;
27+
}
28+
});
29+
console.log('Updated ' + count + ' files');

src/aampExtensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function extensionName(filePath: string): string {
2222
export function getAampExtensions(): Set<string> {
2323
const base = baseExtensions ?? new Set<string>();
2424
const extra = vscode.workspace
25-
.getConfiguration('totk-editor')
25+
.getConfiguration('TKVSC')
2626
.get<string[]>('extraAampExtensions', [])
2727
.map((ext) => ext.toLowerCase().replace(/^\./, ''));
2828
return new Set([...base, ...extra]);

src/archiveTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export class ArchiveTreeProvider implements vscode.TreeDataProvider<ArchiveTreeI
210210
}
211211

212212
private async ensureRomfsFolder(rootUri: vscode.Uri): Promise<void> {
213-
const createRomfs = vscode.workspace.getConfiguration('totk-editor').get<boolean>('createRomfsOnImport', true);
213+
const createRomfs = vscode.workspace.getConfiguration('TKVSC').get<boolean>('createRomfsOnImport', true);
214214
if (!createRomfs) {
215215
return;
216216
}

src/dumpTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ export function registerGameDumpTree(
567567

568568
context.subscriptions.push(
569569
vscode.workspace.onDidChangeConfiguration((event) => {
570-
if (event.affectsConfiguration('totk-editor.romfsPath')) {
570+
if (event.affectsConfiguration('TKVSC.romfsPath')) {
571571
provider.onRomfsPathChanged();
572572
}
573573
}),

src/extension.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function isLikelyBinaryBuffer(data: Uint8Array): boolean {
100100
}
101101

102102
function getBridgeEnv(): NodeJS.ProcessEnv {
103-
const config = vscode.workspace.getConfiguration('totk-editor');
103+
const config = vscode.workspace.getConfiguration('TKVSC');
104104
const romfsPath = resolveRomfsPath();
105105
const extraAamp = config.get<string[]>('extraAampExtensions', []);
106106
return {
@@ -746,9 +746,9 @@ export async function activate(context: vscode.ExtensionContext) {
746746
}
747747
}),
748748
vscode.commands.registerCommand('totk-editor.runSetup', async () => {
749-
await context.globalState.update('totk-editor.hasPromptedRomfsPath', false);
750-
await context.globalState.update('totk-editor.hasPromptedProjectsPath', false);
751-
await context.globalState.update('totk-editor.hasPromptedTKMMImport', false);
749+
await context.globalState.update('TKVSC.hasPromptedRomfsPath', false);
750+
await context.globalState.update('TKVSC.hasPromptedProjectsPath', false);
751+
await context.globalState.update('TKVSC.hasPromptedTKMMImport', false);
752752
void runFirstTimeSetup(context);
753753
}),
754754
vscode.commands.registerCommand('totk-editor.pickPython', () => pickDetectedPython(context)),
@@ -815,19 +815,19 @@ export async function activate(context: vscode.ExtensionContext) {
815815
let archiveTree: ReturnType<typeof registerArchiveTree> | undefined;
816816

817817
const shouldPropagateCanonicalSaves = (): boolean => {
818-
const config = vscode.workspace.getConfiguration('totk-editor');
818+
const config = vscode.workspace.getConfiguration('TKVSC');
819819
return config.get<boolean>('enableCanonicalSavePropagation', true);
820820
};
821821
const getCanonicalBlacklistPrefixes = (): string[] => {
822-
const config = vscode.workspace.getConfiguration('totk-editor');
822+
const config = vscode.workspace.getConfiguration('TKVSC');
823823
return config.get<string[]>('canonicalSyncBlacklistPrefixes', ['Mals', 'UI']);
824824
};
825825
const getCanonicalArchiveTypeBlacklist = (): string[] => {
826-
const config = vscode.workspace.getConfiguration('totk-editor');
826+
const config = vscode.workspace.getConfiguration('TKVSC');
827827
return config.get<string[]>('canonicalSyncArchiveTypeBlacklist', ['.sarc', '.blarc']);
828828
};
829829
const getCanonicalFileExtensionBlacklist = (): string[] => {
830-
const config = vscode.workspace.getConfiguration('totk-editor');
830+
const config = vscode.workspace.getConfiguration('TKVSC');
831831
return config.get<string[]>('canonicalSyncFileExtensionBlacklist', []);
832832
};
833833

@@ -1138,12 +1138,12 @@ export async function activate(context: vscode.ExtensionContext) {
11381138
void vscode.window.showInformationMessage('TKVSC: Canonical path index rebuilt.');
11391139
}),
11401140
vscode.commands.registerCommand('totk-editor.canonicalSyncOn', async () => {
1141-
const config = vscode.workspace.getConfiguration('totk-editor');
1141+
const config = vscode.workspace.getConfiguration('TKVSC');
11421142
await config.update('enableCanonicalSavePropagation', false, vscode.ConfigurationTarget.Global);
11431143
void vscode.window.showInformationMessage('TKVSC: Canonical sync disabled.');
11441144
}),
11451145
vscode.commands.registerCommand('totk-editor.canonicalSyncOff', async () => {
1146-
const config = vscode.workspace.getConfiguration('totk-editor');
1146+
const config = vscode.workspace.getConfiguration('TKVSC');
11471147
await config.update('enableCanonicalSavePropagation', true, vscode.ConfigurationTarget.Global);
11481148
void vscode.window.showInformationMessage('TKVSC: Canonical sync enabled.');
11491149
}),
@@ -1328,7 +1328,7 @@ export async function activate(context: vscode.ExtensionContext) {
13281328

13291329
context.subscriptions.push(
13301330
vscode.workspace.onDidChangeConfiguration((event) => {
1331-
if (event.affectsConfiguration('totk-editor.romfsPath')) {
1331+
if (event.affectsConfiguration('TKVSC.romfsPath')) {
13321332
void buildRomfsIndex();
13331333
void buildCanonicalIndex();
13341334
invalidateCanonicalPathIndex();
@@ -1505,7 +1505,7 @@ export async function activate(context: vscode.ExtensionContext) {
15051505
}
15061506

15071507
async function runFirstTimeSetup(context: vscode.ExtensionContext): Promise<void> {
1508-
const romfsPathPrompted = context.globalState.get<boolean>('totk-editor.hasPromptedRomfsPath');
1508+
const romfsPathPrompted = context.globalState.get<boolean>('TKVSC.hasPromptedRomfsPath');
15091509
if (!romfsPathPrompted) {
15101510
let validRomfsSelected = false;
15111511
while (!validRomfsSelected) {
@@ -1526,7 +1526,7 @@ async function runFirstTimeSetup(context: vscode.ExtensionContext): Promise<void
15261526
const folderName = path.basename(fsPath).toLowerCase();
15271527

15281528
if (folderName === 'romfs') {
1529-
const config = vscode.workspace.getConfiguration('totk-editor');
1529+
const config = vscode.workspace.getConfiguration('TKVSC');
15301530
await config.update('romfsPath', fsPath, vscode.ConfigurationTarget.Global);
15311531
void vscode.window.showInformationMessage(`TKVSC: RomFS path set to ${fsPath}`);
15321532
validRomfsSelected = true;
@@ -1536,7 +1536,7 @@ async function runFirstTimeSetup(context: vscode.ExtensionContext): Promise<void
15361536
const hasRomfs = entries.some(([name, type]) => type === vscode.FileType.Directory && name.toLowerCase() === 'romfs');
15371537
if (hasRomfs) {
15381538
const newPath = path.join(fsPath, 'romfs');
1539-
const config = vscode.workspace.getConfiguration('totk-editor');
1539+
const config = vscode.workspace.getConfiguration('TKVSC');
15401540
await config.update('romfsPath', newPath, vscode.ConfigurationTarget.Global);
15411541
void vscode.window.showInformationMessage(`TKVSC: RomFS path set to ${newPath}`);
15421542
validRomfsSelected = true;
@@ -1555,12 +1555,12 @@ async function runFirstTimeSetup(context: vscode.ExtensionContext): Promise<void
15551555
break;
15561556
}
15571557
}
1558-
void context.globalState.update('totk-editor.hasPromptedRomfsPath', true);
1558+
void context.globalState.update('TKVSC.hasPromptedRomfsPath', true);
15591559
}
15601560

1561-
const projectsPathPrompted = context.globalState.get<boolean>('totk-editor.hasPromptedProjectsPath');
1561+
const projectsPathPrompted = context.globalState.get<boolean>('TKVSC.hasPromptedProjectsPath');
15621562
if (!projectsPathPrompted) {
1563-
void context.globalState.update('totk-editor.hasPromptedProjectsPath', true);
1563+
void context.globalState.update('TKVSC.hasPromptedProjectsPath', true);
15641564
const pathChoice = await vscode.window.showInformationMessage(
15651565
'TKVSC: Please select a default directory where new projects will be saved.',
15661566
'Browse',
@@ -1574,16 +1574,16 @@ async function runFirstTimeSetup(context: vscode.ExtensionContext): Promise<void
15741574
openLabel: 'Select Default Project Folder'
15751575
});
15761576
if (folderUri && folderUri.length > 0) {
1577-
const config = vscode.workspace.getConfiguration('totk-editor');
1577+
const config = vscode.workspace.getConfiguration('TKVSC');
15781578
await config.update('projectsPath', folderUri[0].fsPath, vscode.ConfigurationTarget.Global);
15791579
void vscode.window.showInformationMessage(`TKVSC: Default project folder set to ${folderUri[0].fsPath}`);
15801580
}
15811581
}
15821582
}
15831583

1584-
const tkmmPrompted = context.globalState.get<boolean>('totk-editor.hasPromptedTKMMImport');
1584+
const tkmmPrompted = context.globalState.get<boolean>('TKVSC.hasPromptedTKMMImport');
15851585
if (!tkmmPrompted) {
1586-
void context.globalState.update('totk-editor.hasPromptedTKMMImport', true);
1586+
void context.globalState.update('TKVSC.hasPromptedTKMMImport', true);
15871587
const tkmmPath = await getTkmmRecentJsonPath();
15881588
if (tkmmPath) {
15891589
void vscode.window.showInformationMessage(

src/filteringRules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ async function updateGlobalConfigArray(
236236
settingName: string,
237237
updater: (current: string[]) => string[]
238238
): Promise<void> {
239-
const config = vscode.workspace.getConfiguration('totk-editor');
239+
const config = vscode.workspace.getConfiguration('TKVSC');
240240
const inspection = config.inspect<string[]>(settingName);
241241
const currentList = inspection?.globalValue ?? inspection?.defaultValue ?? [];
242242
const updatedList = updater(currentList);

src/logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ExtensionLogger {
2424

2525
private getLogLevel(): LogLevel {
2626
try {
27-
const config = vscode.workspace.getConfiguration('totk-editor');
27+
const config = vscode.workspace.getConfiguration('TKVSC');
2828
const levelStr = config.get<string>('logLevel', 'Info');
2929
switch (levelStr) {
3030
case 'Debug': return LogLevel.Debug;
@@ -40,7 +40,7 @@ class ExtensionLogger {
4040

4141
private shouldShowToast(): boolean {
4242
try {
43-
const config = vscode.workspace.getConfiguration('totk-editor');
43+
const config = vscode.workspace.getConfiguration('TKVSC');
4444
return config.get<boolean>('enableToastNotifications', true);
4545
} catch {
4646
return true;

src/pythonEnv.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export function getSystemPythonCandidates(): PythonLauncher[] {
239239
candidates.push(launcher);
240240
};
241241

242-
const configured = vscode.workspace.getConfiguration('totk-editor').get<string>('pythonPath', '').trim();
242+
const configured = vscode.workspace.getConfiguration('TKVSC').get<string>('pythonPath', '').trim();
243243
if (configured) {
244244
add({ executable: configured, prefixArgs: [] });
245245
}
@@ -322,7 +322,7 @@ export async function configurePythonPath(
322322
executable: string,
323323
): Promise<boolean> {
324324
logger.info(`Configuring manual pythonPath: ${executable}`);
325-
const config = vscode.workspace.getConfiguration('totk-editor');
325+
const config = vscode.workspace.getConfiguration('TKVSC');
326326
await config.update('pythonPath', executable, vscode.ConfigurationTarget.Global);
327327
const python = await ensurePythonEnvironment(context, true);
328328
if (python) {
@@ -362,7 +362,7 @@ export async function pickDetectedPython(context: vscode.ExtensionContext): Prom
362362

363363
const choice = await vscode.window.showQuickPick(supported, {
364364
title: 'Select Python for TKVSC',
365-
placeHolder: 'CMD may list python3 on PATH even when Cursor cannot see it - pick the full path below.',
365+
placeHolder: 'CMD may list python3 on PATH even when VSCode cannot see it - pick the full path below.',
366366
});
367367
if (!choice) {
368368
return;
@@ -533,7 +533,7 @@ export function ensurePythonEnvironment(
533533

534534
export async function promptPythonSetup(context: vscode.ExtensionContext): Promise<void> {
535535
const choice = await vscode.window.showErrorMessage(
536-
'TKVSC could not find Python 3.10+. Cursor/VS Code often use a different PATH than CMD - set the full path to python.exe, or pick from detected installs.',
536+
'TKVSC could not find Python 3.10+. VSCode often uses a different PATH than CMD - set the full path to python.exe, or pick from detected installs.',
537537
'Pick Python',
538538
'Browse for python.exe',
539539
'Retry Setup',

0 commit comments

Comments
 (0)