Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Demeter29 committed Oct 17, 2024
1 parent 8b1693b commit e18c0b4
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 36 deletions.
6 changes: 0 additions & 6 deletions build/afterCopyScript.js

This file was deleted.

5 changes: 0 additions & 5 deletions build/afterExtractScript.js

This file was deleted.

Binary file removed build/icons/icon.png
Binary file not shown.
13 changes: 4 additions & 9 deletions default_userdata/scripts/gamedata_typedefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class Character {
this.primaryTitle = data[3],
this.sheHe = data[4],
this.age = Number(data[5]),
this.gold = Number(data[6]),
this.gold = Math.floor(Number(data[6])),
this.opinionOfPlayer = Number(data[7]),
this.sexuality = removeTooltip(data[8]),
this.personality = data[9],
Expand Down Expand Up @@ -175,7 +175,7 @@ export class Character {
}

/**
* Sets the opinion modifier's value. Creates a new opinion modifier if it doesn't exist.
* Sets the opinion modifier's value. Creates a new opinion modifier if it doesn't exist. NOTE: this will also update the opinionOfPlayer property.
* @param {string} reason - The opinion modifier's reason text.
* @param {string} value - The value to set the opinion modifier.
* @returns {void}
Expand All @@ -194,19 +194,14 @@ export class Character {
value: value
})
}
}

/**
* Recalculate the opinionOfPlayer property from the opinionBreakdown array.
* @returns {number} - the new opinion value. NOTE: This will also change the opinionOfPlayer property.
*/
recalculateOpinionOfPlayer(){
//recalculate opinionOfPlayer
let sum = 0;
for(const opinionModifier of this.opinionBreakdownToPlayer){
sum += opinionModifier.value;
}
this.opinionOfPlayer = sum;
return sum;
}

}

11 changes: 2 additions & 9 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var afterExtractScript = require("./build/afterExtractScript.js");
var afterCopyScript = require("./build/afterCopyScript.js");

const path = require('path');

module.exports = {
Expand All @@ -23,13 +22,7 @@ module.exports = {
},
],
hooks: {
packageAfterExtract: (forgeConfig, buildPath, electronVersion, platform, arch) => {
afterExtractScript(forgeConfig, buildPath, electronVersion, platform, arch);
},

packageAfterCopy: (forgeConfig, buildPath, electronVersion, platform, arch) => {
afterCopyScript(forgeConfig, buildPath, electronVersion, platform, arch);
},


}

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "voices_of_the_court",
"productName": "Voices of the Court",
"version": "1.0.1",
"version": "1.1.0",
"description": "LLM integration into Crusader Kings 3",
"main": "dist/main/main.js",
"build": {
Expand All @@ -14,9 +14,8 @@
"createTypeDefs": "node ./build/createGameDataTypeDefs.js",
"build": "tsc",
"start": "npm run build && electron . --prod",
"go": "electron .",
"package": "npm run build && electron-forge package",
"make": "npm run build && electron-forge make",
"make": "npm run createTypeDefs && npm run build && electron-forge make",
"publish": "npm run build && electron-forge publish"
},
"keywords": [],
Expand Down
12 changes: 9 additions & 3 deletions src/main/userDataCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,25 @@ export async function checkUserData(){
const userDataScriptsPath= path.join(userPath, "scripts");

//actions
fs.rmdirSync(path.join(userDataScriptsPath, 'actions', 'standard'), {recursive: true});
if(fs.existsSync(path.join(userDataScriptsPath, 'actions', 'standard'))){
fs.rmdirSync(path.join(userDataScriptsPath, 'actions', 'standard'), {recursive: true});
}
fs.cp(path.join(defaultScriptsPath, 'actions', 'standard'), path.join(userDataScriptsPath, 'actions', 'standard'), {recursive: true}, (err) => {
if(err) throw err;
});

//description
fs.rmdirSync(path.join(userDataScriptsPath, 'prompts', 'description', 'standard'), {recursive: true});
if(fs.existsSync(path.join(userDataScriptsPath, 'prompts', 'description', 'standard'))){
fs.rmdirSync(path.join(userDataScriptsPath, 'prompts', 'description', 'standard'), {recursive: true});
}
fs.cp(path.join(defaultScriptsPath, 'prompts', 'description', 'standard'), path.join(userDataScriptsPath, 'prompts', 'description', 'standard'), {recursive: true}, (err) => {
if(err) throw err;
});

//example messages
fs.rmdirSync(path.join(userDataScriptsPath, 'prompts', 'example messages', 'standard'), {recursive: true});
if(fs.existsSync(path.join(userDataScriptsPath, 'prompts', 'example messages', 'standard'))){
fs.rmdirSync(path.join(userDataScriptsPath, 'prompts', 'example messages', 'standard'), {recursive: true});
}
fs.cp(path.join(defaultScriptsPath, 'prompts', 'example messages', 'standard'), path.join(userDataScriptsPath, 'prompts', 'example messages', 'standard'), {recursive: true}, (err) => {
if(err) throw err;
});
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,8 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true,
/* Skip type checking all .d.ts files. */
}
},
"exclude": [
"out"
]
}

0 comments on commit e18c0b4

Please sign in to comment.