Compare commits

...

2 Commits

Author SHA1 Message Date
84c13331d2 add launch button folder choose if not set 2022-10-27 15:42:45 +02:00
e77cb22028 increase height of window 2022-10-27 15:42:29 +02:00
3 changed files with 25 additions and 4 deletions

2
app.js
View File

@ -318,7 +318,7 @@ async function doUpdateCheck(window) {
function createWindow() { function createWindow() {
// Create the browser window. // Create the browser window.
const win = windowManager.createWindow(700, 420); const win = windowManager.createWindow(700, 460);
win.loadFile('./html/index.html'); win.loadFile('./html/index.html');

View File

@ -57,7 +57,7 @@
} }
.folder-section { .folder-section {
margin-top: 13px; margin-top: 50px;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
justify-content: center; justify-content: center;

View File

@ -16,7 +16,6 @@ window.addEventListener('DOMContentLoaded', () => {
titlebar.updateTitle(`${appInfo.appName} ${appInfo.appVersion}`); titlebar.updateTitle(`${appInfo.appName} ${appInfo.appVersion}`);
const $ = require('jquery'); const $ = require('jquery');
const axios = require('axios').default;
const Swal = require('sweetalert2'); const Swal = require('sweetalert2');
$('#account-action').on('click', () => { $('#account-action').on('click', () => {
@ -69,6 +68,28 @@ window.addEventListener('DOMContentLoaded', () => {
$('#launch-btn').html('Updating...'); $('#launch-btn').html('Updating...');
ipcRenderer.send("do-update"); ipcRenderer.send("do-update");
break; break;
case "missing-folder":
const responseData = await ipcRenderer.invoke('set-osu-dir');
if (!responseData)
return;
if (responseData.validOsuDir) {
Swal.fire({
title: 'Success!',
text: 'osu! folder set.',
icon: 'success',
confirmButtonText: 'Cool'
})
$('#currentOsuPath').text(responseData.folderPath);
ipcRenderer.send("do-update-check");
} else {
Swal.fire({
title: 'Uh oh!',
text: 'The selected folder is not a osu! directory.',
icon: 'error',
confirmButtonText: 'Oops.. my bad!'
})
}
break;
} }
}); });
@ -157,7 +178,7 @@ window.addEventListener('DOMContentLoaded', () => {
currentState = status.type; currentState = status.type;
break; break;
case "missing-folder": case "missing-folder":
$("#launch-btn").attr('disabled', true); $("#launch-btn").attr('disabled', false);
$('#launch-btn').html('set your osu! folder'); $('#launch-btn').html('set your osu! folder');
currentState = status.type; currentState = status.type;
break; break;