issue-15 #21

Merged
sebastian merged 60 commits from issue-15 into main 2024-03-22 08:46:49 +01:00
3 changed files with 18 additions and 6 deletions
Showing only changes of commit 26ef72cac3 - Show all commits

View File

@ -54,9 +54,14 @@ class SaveProject {
}
static loadGamesystems(projectDir) {
const gamesystemDir = path.join(projectDir, "gamesystems");
const loadedGamesystems = this.loadGamesystemsRecursively(gamesystemDir);
console.log("LoadedGamesystems: ", loadedGamesystems.length);
return loadedGamesystems;
if (fs.existsSync(gamesystemDir)) {
const loadedGamesystems = this.loadGamesystemsRecursively(gamesystemDir);
console.log("LoadedGamesystems: ", loadedGamesystems.length);
return loadedGamesystems;
}
else {
return [];
}
}
static loadGamesystemsRecursively(gamesystemDir) {
let loadedGamesystems = [];

View File

@ -62,9 +62,13 @@ export class SaveProject {
static loadGamesystems(projectDir: string): LoadModel[] {
const gamesystemDir = path.join(projectDir, "gamesystems");
const loadedGamesystems = this.loadGamesystemsRecursively(gamesystemDir);
console.log("LoadedGamesystems: ", loadedGamesystems.length);
return loadedGamesystems;
if(fs.existsSync(gamesystemDir)) {
const loadedGamesystems = this.loadGamesystemsRecursively(gamesystemDir);
console.log("LoadedGamesystems: ", loadedGamesystems.length);
return loadedGamesystems;
} else {
return []
}
}
static loadGamesystemsRecursively(gamesystemDir: string): LoadModel[] {

View File

@ -42,6 +42,9 @@ export class AppComponent implements OnInit{
private dialog: MatDialog
) {
console.log('APP_CONFIG', APP_CONFIG);
if(this.gameModel == undefined) {
this.gameModel = new GameModel("Unknown GameModel")
}
if (electronService.isElectron) {
console.log(process.env);