浏览代码

Initial commit

Daniel Scalzi 8 年之前
当前提交
acffbec100

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+/node_modules/
+/.vs/

+ 14 - 0
app/assets/css/styles.css

@@ -0,0 +1,14 @@
+@font-face {
+    font-family: ringbearer;
+    src: url('../fonts/ringbearer.ttf');
+}
+
+body, html {
+    margin: 0px;
+    padding: 0px;
+}
+
+html {
+    background: url(../images/BrownWithWignette.jpg) no-repeat center center fixed;
+    background-size: cover;
+}

二进制
app/assets/fonts/Inconsolata-Bold.ttf


二进制
app/assets/fonts/Inconsolata-Regular.ttf


二进制
app/assets/fonts/ringbearer.ttf


二进制
app/assets/images/BrownWithWignette.jpg


二进制
app/assets/images/WCTextCream.png


二进制
app/assets/images/WesterosSealCircle.png


二进制
app/assets/images/WesterosSealSquare.png


二进制
app/assets/images/facebook.png


二进制
app/assets/images/reddit.png


二进制
app/assets/images/twitter.png


二进制
app/assets/images/westeroscraftlogo1.png


二进制
app/assets/images/westeroscraftlogo2.png


+ 8 - 0
app/assets/js/script.js

@@ -0,0 +1,8 @@
+const remote = require('electron').remote;
+
+document.addEventListener("keydown", function (e) {
+    if (e.keyCode === 123) { // F12
+        var window = remote.getCurrentWindow();
+        window.toggleDevTools();
+    }
+});

+ 13 - 0
app/index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+
+<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="utf-8" />
+    <title>Westeroscraft Launcher</title>
+    <script src="./assets/js/script.js"></script>
+    <link type="text/css" rel="stylesheet" href="./assets/css/styles.css">
+</head>
+<body>
+
+</body>
+</html>

+ 43 - 0
index.js

@@ -0,0 +1,43 @@
+const {app, BrowserWindow} = require('electron')
+const path = require('path')
+const url = require('url')
+
+// Keep a global reference of the window object, if you don't, the window will
+// be closed automatically when the JavaScript object is garbage collected.
+let win
+
+function createWindow() {
+    win = new BrowserWindow({ width: 925, height: 500 })
+
+    win.loadURL(url.format({
+        pathname: path.join(__dirname, 'app', 'index.html'),
+        protocol: 'file:',
+        slashes: true
+    }))
+
+    //Open DevTools, this will be removed on release.
+    win.webContents.openDevTools()
+    win.setMenu(null)
+
+    win.on('closed', () => {
+        win = null
+    })
+}
+
+app.on('ready', createWindow);
+
+app.on('window-all-closed', () => {
+    // On macOS it is common for applications and their menu bar
+    // to stay active until the user quits explicitly with Cmd + Q
+    if (process.platform !== 'darwin') {
+        app.quit()
+    }
+})
+
+app.on('activate', () => {
+    // On macOS it's common to re-create a window in the app when the
+    // dock icon is clicked and there are no other windows open.
+    if (win === null) {
+        createWindow()
+    }
+})

+ 23 - 0
package.json

@@ -0,0 +1,23 @@
+{
+  "name": "westeroscraftlauncher",
+  "version": "0.0.1",
+  "description": "Custom modded launcher for Westeroscraft",
+  "main": "index.js",
+  "scripts": {
+    "start": "electron index.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://gitlab.com/westeroscraft/Active-Electron-Launcher.git"
+  },
+  "author": "TheKraken7, Matan, Nightmare",
+  "license": "AGPL-3.0",
+  "bugs": {
+    "url": "https://gitlab.com/westeroscraft/Active-Electron-Launcher/issues"
+  },
+  "homepage": "https://gitlab.com/westeroscraft/Active-Electron-Launcher#README",
+  "devDependencies": {
+    "electron": "^1.6.5",
+    "mojang": "^0.4.0"
+  }
+}

+ 2 - 0
start.bat

@@ -0,0 +1,2 @@
+npm start
+pause