mirror of
https://github.com/open-goal/launcher.git
synced 2024-10-20 04:57:38 -04:00
working on getting the settings page started
This commit is contained in:
parent
438cc164de
commit
c7da99dad5
0
src/html/config.html
Normal file
0
src/html/config.html
Normal file
17
src/html/settings.html
Normal file
17
src/html/settings.html
Normal 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>
|
|
@ -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();
|
||||
});
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ function closeNav() {
|
|||
function navBarClick(target) {
|
||||
closeNav();
|
||||
if (target.includes("settings")) {
|
||||
console.log(target);
|
||||
send('settings');
|
||||
} else {
|
||||
changeGame(target);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue