fix layout

This commit is contained in:
HorizonCode 2022-10-16 18:41:53 +02:00
parent bd7f3ddefd
commit 14201fb9cd
2 changed files with 29 additions and 8 deletions

26
app.js
View File

@ -2,6 +2,10 @@ const { app, BrowserWindow, ipcMain, dialog } = require('electron');
const { setupTitlebar, attachTitlebarToWindow } = require('custom-electron-titlebar/main');
const windowManager = require('./ui/windowManager');
const osuUtil = require('./osuUtil');
const config = require('./config');
const fs = require('fs');
let tempOsuPath;
const run = () => {
const gotTheLock = app.requestSingleInstanceLock()
@ -9,12 +13,24 @@ const run = () => {
app.quit();
return;
}
setupTitlebar();
let mainWindow;
app.whenReady().then(() => {
mainWindow = createWindow()
mainWindow = createWindow();
mainWindow.on('show', async () => {
const osuPath = await config.get("osuPath", "");
if(fs.existsSync(osuPath)){
tempOsuPath = osuPath;
const osuConfig = await osuUtil.getLatestConfig(tempOsuPath);
console.log(osuConfig);
const lastVersion = await osuConfig.get("LastVersion");
console.log(lastVersion);
//Do update check
}
})
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) mainWindow = createWindow();
})
@ -28,14 +44,18 @@ const run = () => {
if (yes.filePaths.length <= 0)
return undefined;
const folderPath = yes.filePaths[0];
return osuUtil.isValidOsuFolder(folderPath);
const validOsuDir = osuUtil.isValidOsuFolder(folderPath);
if (validOsuDir) await config.set("osuPath", folderPath);
return validOsuDir;
})
})
}
function createWindow() {
// Create the browser window.
const win = windowManager.createWindow(480, 420);
const win = windowManager.createWindow(480, 350);
win.loadFile('./html/index.html');

View File

@ -17,7 +17,7 @@
<body class="fixed-sn mdb-skin-custom" data-spy="scroll" data-target="#scrollspy" data-offset="15"
oncontextmenu="return false;">
<main style="margin-top: 2rem;">
<main style="">
<div class="noselect">
<div class="position-relative overflow-hidden p-3 p-md-5 m-md-3 text-center text-lg-end d-flex align-items-center justify-content-center"
style="border-radius: 0.5em;">
@ -28,18 +28,19 @@
<div class="card" style="border-radius: 1rem;">
<div class="row g-0">
<div class="card-body p-4 p-lg-5 text-black">
<div class="d-flex align-items-center mb-3 pb-1 text-white">
<div class="d-flex align-items-center mb-2 pb-1 text-white">
<span class="h1 fw-bold mb-0">EZPPLauncher</span>
</div>
<h5 class="fw-normal mb-3 pb-3 text-white text-start"
<h5 class="fw-lighter fs-5 mb-3 pb-3 text-white text-start"
style="letter-spacing: 1px;">
Launch osu! with connection to the EZPPFarm server
</h5>
<div class="pt-1 mb-4">
<button id="launch-btn" class="btn btn-primary btn-lg btn-block"
type="button" style="background-color:#d6016f" disabled>Launch</button>
type="button" style="background-color:#d6016f"
disabled>Launch</button>
</div>
<button class="btn btn-dark btn-sm float-start" id="folder-btn">
<button class="btn btn-dark btn-sm float-end" id="folder-btn">
set osu! directory
</button>
</div>