Skip to content

Commit

Permalink
mupdates
Browse files Browse the repository at this point in the history
  • Loading branch information
khbsd committed May 21, 2024
1 parent 76631b6 commit 6889a16
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion node_modules/.package-lock.json

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

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.

2 changes: 1 addition & 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.1.51",
"version": "3.3.0",
"icon": "media/marketplace_icon.png",
"engines": {
"vscode": "^1.86.0"
Expand Down
3 changes: 3 additions & 0 deletions support_files/conversion_junction.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ function convert(convertPath, targetExt = path.extname(getDynamicPath(convertPat
return normalizedExcludedFiles.includes(normalizedFile);
};
*/
const { rootModPath } = getConfig();
console.log(rootModPath);

if (targetExt === pak) {
prepareTempDir();

// changed these back, hope that's okay
console.log(rootModPath);
convert(rootModPath, xml);
convert(rootModPath, lsx);
processPak(rootModPath, modName_);
Expand Down
20 changes: 18 additions & 2 deletions support_files/lslib_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const converterAppDll = ['ConverterApp.dll'];
const illegalDlls = [].concat(elasticDlls, storyCompilerDlls, converterAppDll);

// the list of directories that need lsx > lsf conversion
const convertDirs = ["[PAK]", "RootTemplates", "MultiEffectInfos", "UI", "Effects", "LevelMapValues", "Localization"];
const convertDirs = ["[PAK]_UI", "[PAK]_Armor", "RootTemplates", "MultiEffectInfos", "Assets", "UI", "Effects", "LevelMapValues", "Localization"];

// excluding this because it will match to "UI" in convertDirs
const illegalFiles = ["Icons_Items.lsx"];

var DLLS = [];
var DLL_PATHS = [];
Expand Down Expand Up @@ -144,10 +147,14 @@ function LOAD_LSLIB() {
function FIND_FILES(filesPath, targetExt = getFormats().lsf, isRecursive = true) {
let filesToConvert = [];

console.log(filesPath);
console.log(targetExt);

const filesList = fs.readdirSync(filesPath, {
withFileTypes: false,
recursive: isRecursive
});
console.log(filesList);

for (let i = 0; i < filesList.length; i++) {
const temp = filesList[i].toString();
Expand Down Expand Up @@ -180,7 +187,16 @@ function FILTER_PATHS(filesPath) {
let temp_ext = path.extname(filesPath);

for (let i = 0; i < temp_path.length; i++) {
if ((!excludedFiles.includes(filesPath) && convertDirs.includes(temp_path[i])) || (temp_ext === getFormats().dll && !illegalDlls.includes(path.basename(filesPath)))) {
if (temp_ext === getFormats().dll && !illegalDlls.includes(path.basename(filesPath))) {
return filesPath;
}
else if (
(
!excludedFiles.includes(filesPath) &&
convertDirs.includes(temp_path[i]) &&
!illegalFiles.includes(path.basename(filesPath))
)
) {
return filesPath;
}
}
Expand Down
6 changes: 4 additions & 2 deletions support_files/pack_mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ const { rootModPath, modDestPath } = getConfig();
const rootParentPath = path.dirname(rootModPath);

const temp_folder = "\\temp_folder";
const temp_path = path.join(rootParentPath, temp_folder);
const temp_path = rootModPath;
// const temp_path = path.join(rootParentPath, temp_folder);




function prepareTempDir(movedPak = false) {
if (!(fs.existsSync(temp_path))) {
console.log("making temp_path");
fs.mkdirSync(temp_path, { recursive: true});
// fs.mkdirSync(temp_path, { recursive: true});
return;
}
// this is being finicky :starege:
Expand Down

0 comments on commit 6889a16

Please sign in to comment.