working on getting the settings page started

This commit is contained in:
trippjoe 2022-03-28 10:49:39 -04:00
parent 438cc164de
commit c7da99dad5
5 changed files with 27 additions and 2 deletions

0
src/html/config.html Normal file
View file

17
src/html/settings.html Normal file
View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Settings</title>
</head>
<body>
<div>
HELLO WORLD THIS IS THE SETTINGS WINDOW
</div>
</body>
</html>

View file

@ -63,6 +63,7 @@ app.on('activate', () => {
// IPC STUFF HERE
ipcMain.on('getISO', isoSeries);
// github jak-project updates
ipcMain.handle('checkUpdates', async () => {
let response = await fetchLatestCommit();
return response;
@ -79,4 +80,11 @@ app.on('status', (value) => {
// handle console messages
app.on('console', (value) => {
mainWindow.webContents.send('console', value);
});
// opening the settings page in a child window
ipcMain.on('settings', () => {
let settingsWindow = new BrowserWindow({ parent: mainWindow, resizable: false, modal: true, title: "Settings", autoHideMenuBar: true });
settingsWindow.loadFile(path.join(__dirname, '/html/settings.html'));
settingsWindow.show();
});

View file

@ -3,7 +3,7 @@ const { contextBridge, ipcRenderer } = require("electron");
// Expose protected methods that allow the renderer process to use
contextBridge.exposeInMainWorld("electronAPI", {
send: (command) => {
let validCommands = ['getISO', 'checkUpdates', 'launch', 'build'];
let validCommands = ['getISO', 'checkUpdates', 'launch', 'build', 'settings'];
if (validCommands.includes(command)) {
ipcRenderer.send(command);
}

View file

@ -33,7 +33,7 @@ function closeNav() {
function navBarClick(target) {
closeNav();
if (target.includes("settings")) {
console.log(target);
send('settings');
} else {
changeGame(target);
}