Add basic Electron window
This commit is contained in:
parent
d9d1a10e78
commit
202e97ac5a
30
main.js
Normal file
30
main.js
Normal file
@ -0,0 +1,30 @@
|
||||
const path = require("node:path");
|
||||
const child_process = require("node:child_process");
|
||||
|
||||
const electron = require("electron");
|
||||
|
||||
electron.app.on("ready", function () {
|
||||
window = new electron.BrowserWindow({
|
||||
"width": 960,
|
||||
"height": 560,
|
||||
"webPreferences": {
|
||||
"nodeIntegration": true,
|
||||
"contextIsolation": true,
|
||||
"preload": path.join(__dirname, "preload.js")
|
||||
},
|
||||
"title": "OpenModLauncher",
|
||||
"icon": path.join(__dirname, "res", "img", "logo.png"),
|
||||
"frame": true,
|
||||
"transparent": true,
|
||||
"resizable": false,
|
||||
"show": false
|
||||
});
|
||||
|
||||
window.loadFile(path.join(__dirname, "views", "main.html"));
|
||||
|
||||
window.on("ready-to-show", window.show);
|
||||
});
|
||||
|
||||
electron.app.on("window-all-closed", function () {
|
||||
electron.app.quit();
|
||||
});
|
5
meta.json
Normal file
5
meta.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"minecraft": {
|
||||
"version": "${MINECRAFT_VERSION}"
|
||||
}
|
||||
}
|
13
package.json
Normal file
13
package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "openmodlauncher",
|
||||
"version": "0.0.1",
|
||||
"description": "A small Minecraft launcher codebase",
|
||||
"main": "main.js",
|
||||
"repository": "https://gitea.x3f200c.net/X3F200C/OpenModLauncher-Base.git",
|
||||
"author": "X3F200C <x3f200c@x3f200c.net>",
|
||||
"license": "GNU-GPLv3",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"start": "electron ."
|
||||
}
|
||||
}
|
0
preload.js
Normal file
0
preload.js
Normal file
5
sources.json
Normal file
5
sources.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"minecraft": {
|
||||
"versions_manifest": "https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"
|
||||
}
|
||||
}
|
12
views/main.html
Normal file
12
views/main.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OpenModLauncher</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="titlebar">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user