fix checkbox

This commit is contained in:
HorizonCode 2023-11-24 07:26:42 +01:00
parent 58fa4a6329
commit 9307d7709c
2 changed files with 5 additions and 5 deletions

8
app.js
View File

@ -14,6 +14,7 @@ const appInfo = require('./appInfo');
const executeUtil = require("./executeUtil");
const { DownloaderHelper } = require('node-downloader-helper');
let shouldPatch = false;
let patcherLoc = undefined;
let tempOsuPath;
let osuWindowInfo;
@ -40,7 +41,7 @@ const run = () => {
//TODO: do patch
setTimeout(() => {
console.log("yes");
if (patcherLoc) {
if (shouldPatch) {
console.log("running " + patcherLoc + " in dir " + path.dirname(patcherLoc));
executeUtil.runFileDetached(path.dirname(patcherLoc), patcherLoc);
}
@ -226,10 +227,9 @@ const run = () => {
})
ipcMain.handle('launch', async (e, opts) => {
console.log(opts);
const patch = "patch" in opts && opts.patch;
shouldPatch = "patch" in opts && opts.patch;
const osuFolder = await config.get("osuPath");
if (patch) patcherLoc = path.join(osuFolder, "EZPPLauncher", "patcher.exe");
else patcherLoc = undefined;
patcherLoc = path.join(osuFolder, "EZPPLauncher", "patcher.exe");
await osuUtil.updateOsuCfg(path.join(osuFolder, "osu!.cfg"));
const osuConfig = await osuUtil.getLatestConfig(tempOsuPath);

View File

@ -48,7 +48,7 @@ window.addEventListener('DOMContentLoaded', () => {
case "up-to-date":
$("#launch-btn").attr('disabled', true);
$('#launch-btn').html('Launching...');
const result = await ipcRenderer.invoke("launch", { patch: true });
const result = await ipcRenderer.invoke("launch", { patch: $('#enablePatching').is(':checked') });
if (!result) {
Swal.fire({
title: 'Uh oh!',