|
1 |
| -import { checkbox, input, select, Separator } from '@inquirer/prompts'; |
2 |
| -import { file, write } from 'bun'; |
| 1 | +import { checkbox, editor, input, select, Separator } from '@inquirer/prompts'; |
| 2 | +import { file, spawnSync, write } from 'bun'; |
3 | 3 | import { Database } from 'bun:sqlite';
|
4 | 4 | import { stringify, parse } from 'ini';
|
5 | 5 | import { checkIfProcessIsRunning, getGamePaths, exit } from './utils';
|
@@ -293,16 +293,21 @@ async function optimizeGraphics(tweakPath: string) {
|
293 | 293 | console.log('Found [SystemSettings] section in Engine.ini...');
|
294 | 294 | }
|
295 | 295 | for (let tweak of tweakChoices) {
|
296 |
| - console.log('Applying', tweak); |
297 | 296 | config = { ...config, ...tweaks[tweak - 1] };
|
298 |
| - console.log(config); |
299 | 297 | }
|
300 | 298 |
|
301 | 299 | tweakData = tweakData.split('[SystemSettings]')[0] + '\n[SystemSettings]\n' + stringify(config);
|
302 |
| - console.log(tweakData); |
303 | 300 | await write(tweakPath, tweakData).catch(async (e) => {
|
304 | 301 | console.log('Error:', e.name.startsWith('EPERM') ? 'Permission Denied. Remove read-only attribute\n(You can always add it back afterwards)' : e);
|
305 |
| - await exit(); |
| 302 | + console.log('Executing Manual Edit Mode\n\n'); |
| 303 | + |
| 304 | + await editor({ |
| 305 | + message: 'This is your new Engine.ini. Copy the whole file and paste them in the notepad window that opens after closing this window. Press Enter (2x) to continue.', |
| 306 | + postfix: '.ini', |
| 307 | + default: tweakData |
| 308 | + }); |
| 309 | + console.log('\n\nOpening notepad with Engine.ini for you to manually edit...'); |
| 310 | + spawnSync(['notepad', tweakPath]); |
306 | 311 | });
|
307 | 312 | }
|
308 | 313 |
|
|
0 commit comments