mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-15 19:21:49 +00:00
Disable steam achievements when playing with mods
This commit is contained in:
parent
feb74420d6
commit
ab51175616
@ -345,12 +345,12 @@ ipcMain.handle("open-mods-folder", async () => {
|
|||||||
shell.openPath(modsPath);
|
shell.openPath(modsPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle("get-mods", async () => {
|
console.log("Loading mods ...");
|
||||||
|
|
||||||
|
function loadMods() {
|
||||||
if (safeMode) {
|
if (safeMode) {
|
||||||
console.log("Safe Mode enabled for mods, skipping mod search");
|
console.log("Safe Mode enabled for mods, skipping mod search");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
console.log("Loading mods from", modsPath);
|
console.log("Loading mods from", modsPath);
|
||||||
let modFiles = safeMode
|
let modFiles = safeMode
|
||||||
? []
|
? []
|
||||||
@ -365,32 +365,24 @@ ipcMain.handle("get-mods", async () => {
|
|||||||
modFiles = modFiles.concat(externalModPaths);
|
modFiles = modFiles.concat(externalModPaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modFiles.length > 0 && !isDev) {
|
return modFiles.map(filename => fs.readFileSync(filename, "utf8"));
|
||||||
let confirmed = false;
|
|
||||||
while (!confirmed) {
|
|
||||||
const response = await dialog.showMessageBox(win, {
|
|
||||||
message:
|
|
||||||
"You have installed one or more mods for shapez.io. Please confirm that you are aware of the risks and install mods only from trusted sources.",
|
|
||||||
buttons: ["Exit Game", "Continue"],
|
|
||||||
type: "warning",
|
|
||||||
defaultId: 0,
|
|
||||||
cancelId: 0,
|
|
||||||
});
|
|
||||||
if (response.response === 1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (response.response === 0) {
|
|
||||||
process.exit(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return modFiles.map(filename => fs.readFileSync(filename, "utf8"));
|
let mods = [];
|
||||||
|
try {
|
||||||
|
mods = loadMods();
|
||||||
|
console.log("Loaded", mods.length, "mods");
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
throw new Error(ex);
|
console.error("Failed ot load mods");
|
||||||
|
dialog.showErrorBox("Failed to load mods:", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipcMain.handle("get-mods", async () => {
|
||||||
|
return mods;
|
||||||
});
|
});
|
||||||
|
|
||||||
steam.init(isDev);
|
steam.init(isDev);
|
||||||
|
|
||||||
|
if (mods) {
|
||||||
steam.listen();
|
steam.listen();
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user