Skip to content

Commit

Permalink
remove node modules from vsignore. Allow users to select what version…
Browse files Browse the repository at this point in the history
… of bg3 to run in setting default vulkan.
  • Loading branch information
ghostboats committed Sep 5, 2024
1 parent 571295f commit 8c5952d
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 54 deletions.
3 changes: 1 addition & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ vsc-extension-quickstart.md
**/jsconfig.json
**/*.map
**/.eslintrc.json
**/update_notes.txt
node_modules/**
**/update_notes.txt
6 changes: 4 additions & 2 deletions commands/launchGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ const { getConfig } = require('../support_files/config');


const launchGameCommand = vscode.commands.registerCommand('bg3-mod-helper.launchGame', function () {
const { launchContinueGame, gameInstallLocation } = getConfig();
const { launchContinueGame, gameInstallLocation, laucherAPI } = getConfig();
if (!gameInstallLocation || gameInstallLocation === "") {
vscode.window.showErrorMessage('Game installation location is not set. Please configure it correctly in settings.');
return; // Stop execution if the path is not set
}

const executableName = laucherAPI === 'DirectX' ? 'bg3_dx11.exe' : 'bg3.exe';

// Construct the path to the executable
const binLocation = path.join(gameInstallLocation, 'bin');
const gamePath = path.join(binLocation, "bg3.exe");
const gamePath = path.join(binLocation, executableName);
const args = launchContinueGame ? ["-continueGame"] : [];

const game = spawn(gamePath, args, { cwd: binLocation });
Expand Down
7 changes: 4 additions & 3 deletions commands/packMod.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,15 @@ function handleGameRunning() {
resolve(false); // Assuming game is not running in case of error
return;
}
const { autoCloseBG3, laucherAPI } = getConfig();
const exeName = laucherAPI === 'DirectX' ? 'bg3_dx11.exe' : 'bg3.exe';

// Check if BG3 is running (add Linux check if necessary)
const isRunning = stdout.toLowerCase().includes('bg3.exe');
const isRunning = stdout.toLowerCase().includes(exeName);

if (isRunning) {
const { autoCloseBG3 } = getConfig();
if (autoCloseBG3) {
exec('taskkill /F /IM bg3.exe', (killError, killStdout, killStderr) => {
exec(`taskkill /F /IM ${exeName}`, (killError, killStdout, killStderr) => {
if (killError || killStderr) {
bg3mh_logger.error("Error closing Baldur's Gate 3: " + (killError || killStderr));
resolve(false); // Return false if there was an error closing the game
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "bg3_mod_helper",
"publisher": "ghostboats",
"description": "This extension is designed to help you make mods in Baldur's Gate 3 by creating UUIDs and handles for you, as well as updating your .loca.xml files as well should they exist. And more to come in the future.",
"version": "2.2.56",
"version": "2.2.58",
"icon": "media/marketplace_icon.png",
"engines": {
"vscode": "^1.86.0"
Expand Down Expand Up @@ -301,6 +301,12 @@
"type": "boolean",
"default": false,
"description": "Automatically close Baldur's Gate 3 if it is running before packing a mod."
},
"bg3ModHelper.laucherAPI": {
"type": "string",
"default": "DirectX",
"enum": ["DirectX", "Vulkan"],
"description": "Lauch using directx or vulkan"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion support_files/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ function getConfig() {
modName: config.get('modName'),
excludeHidden: config.get('excludeHidden'),
packingPriority: config.get('packingPriority'),
autoCloseBG3: config.get('autoCloseBG3')
autoCloseBG3: config.get('autoCloseBG3'),
laucherAPI: config.get('laucherAPI')
};
}

Expand Down
45 changes: 2 additions & 43 deletions support_files/release_notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,65 +65,24 @@ function generateReleaseNotes(version) {
{
title: "Mod Setting Changes [IMPORTANT]",
details: [
"Modname Setting Added. This value should be autoset on launch as long as you only have one folder in your rootmodpath's Mods folder. If you have multiple it will need to be set!",
"Configuration Options Data Provider complete, see below",
"Conversion exclusion list UI changes to show difference between this and packing exclusion list",
"Exclude Hidden (implemented but requires new lslib which is unreleased atm) setting added, possible remove as setting and make it always check files for .",
"Auto Launch Game and Zip options removed as settings. This is now handled via the dropdown data provider, the 'Pack and Play' and 'Pack and Zip' options respectivly.",
"Remove hover enabled setting to remvoe dead setting",
"Choose to launch via directx or vulkan in the settings",
"Setting added to close the existing bg3 instance when you pack and play for quicker launch if you forgot to close. By default it is off.",
"If you have a unique mod destination path, the prompt will now only appear one time per session to avoid having to confirm each time on pack"
]
},
{
title: "Configuration Options Data Provider",
details: [
"Contains several quick actions revolving around modSetting which are accessed from the data provider:",
"Reload Window: Will refresh the current vscode window, allowing for new settings to take effect (For example, if you change things like lslib path, you should reload)",
"Extension Setting: Opens the settings page, filtering the bg3 mod helper settings for quick access",
"Update Settings: (todo, overwrites workspace, need to confirm with beans this is the desired effect)"
]
},
{
title: "Code Organization via Data Provider",
details: [
"Allows sorting of data files alphabetically (data values sorted for entries, not sorting the entries themselves but that will be added in the future)",
"LSX tab formatting (todo)"
]
},
{
title: "Symlink Fixes",
details: [
"SYMLINKER DISABLED DUE TO CATASTROPHIC FAILURE. IF YOU USED IT BEFORE WITHOUT PROBLEMS, LET ME KNOW AND I CAN GIVE A VERSION THAT HAS IT ENABLED.",
"Symlink will no longer create 'random' folders when linking/unlinking (seems to be working, will leave in development tag for now while users test. No errors when personally testing, please send paths/screenshots/info/etc if you have any issues)"
]
},
{
title: "Zipping Fixes",
details: [
"Will now correctly zip .pak in a .zip folder (which Nexus accepts) instead of a .gz folder (which Nexus does not accept)",
"Zipping files is now done thru the data provider menu, expand the dropdown for packing and select Pack and Zip",
"Zipped files appear in correct location now",
"Zipped files appear in correct location now (your set mod destination)",
"Pak file is deleted now if zip is made"
]
},
{
title: "BBCode/Markdown Previewer Added",
details: [
"Test out how your mod page will look using a built-in BBCode/Markdown previewer via the Data Provider (needs more work)"
]
},
{
title: "Minor Changes",
details: [
"",
"Extension confirmed to work on Linux (ty satan!)",
"Check if game is lauched for linus in packing(todo)",
"Shortcut to PlayerProfiles Folder added in folder shortcuts",
"Atlas Fix if .lsx file doenst exist yet",
"Generate and Replace Handle option added when highlighting a handle and rightclicking",
"Generate Handle will now correctly save the xml files it adds it to",
"Disable button (scrapped, vscode doesnt have a way to disable via api i guess?)"
]
},
{
Expand Down

0 comments on commit 8c5952d

Please sign in to comment.