Skip to content

Commit fcc3a78

Browse files
author
Matix-Media
committed
Major changes
1 parent 5d5c395 commit fcc3a78

File tree

8 files changed

+232
-115
lines changed

8 files changed

+232
-115
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
node_modules
33
/dist
44
/build
5+
electron-builder.yml
56

67
# local env files
78
.env.local

package.json

Lines changed: 73 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,77 @@
11
{
2-
"name": "matixs-mod-installer-rn",
3-
"version": "0.1.2",
4-
"private": true,
5-
"description": "Matix's Mod Installer is Matix's Mod Installer is the newly designed platform to install your Minecraft modpacks!",
6-
"author": {
7-
"name": "Max Heilmann",
8-
"email": "heilmann@matix-media.net",
9-
"url": "https://matix-media.net"
10-
},
11-
"scripts": {
12-
"serve": "vue-cli-service serve",
13-
"build": "vue-cli-service build",
14-
"lint": "vue-cli-service lint",
15-
"electron:build": "vue-cli-service electron:build",
16-
"electron:serve": "vue-cli-service electron:serve",
17-
"postinstall": "electron-builder install-app-deps",
18-
"postuninstall": "electron-builder install-app-deps"
19-
},
20-
"main": "background.js",
21-
"dependencies": {
22-
"@wuild/vue-titlebar": "^1.0.1",
23-
"axios": "^0.21.1",
24-
"core-js": "^3.6.5",
25-
"electron-updater": "^4.3.8",
26-
"minecraft-launcher-core": "^3.16.2",
27-
"uuid": "^8.3.2",
28-
"vue": "^2.6.11",
29-
"vue-luxon": "^0.10.0",
30-
"vue-markdown-render": "^1.1.1",
31-
"vue-meta": "^2.4.0",
32-
"vue-router": "^3.2.0"
33-
},
34-
"devDependencies": {
35-
"@typescript-eslint/eslint-plugin": "^2.33.0",
36-
"@typescript-eslint/parser": "^2.33.0",
37-
"@vue/cli-plugin-babel": "~4.5.0",
38-
"@vue/cli-plugin-eslint": "~4.5.0",
39-
"@vue/cli-plugin-router": "^4.5.12",
40-
"@vue/cli-service": "~4.5.0",
41-
"@vue/eslint-config-typescript": "^5.0.2",
42-
"babel-eslint": "^10.1.0",
43-
"electron": "9.0.0",
44-
"electron-devtools-installer": "^3.1.0",
45-
"eslint": "^6.7.2",
46-
"eslint-plugin-vue": "^6.2.2",
47-
"sass": "^1.32.5",
48-
"sass-loader": "^10.1.1",
49-
"typescript": "~4.1.5",
50-
"vue-cli-plugin-electron-builder": "^2.0.0-rc.5",
51-
"vue-template-compiler": "^2.6.11"
52-
},
53-
"eslintConfig": {
54-
"root": true,
55-
"env": {
56-
"node": true
2+
"repository": {
3+
"type": "git",
4+
"url": "https://github.com/Matix-Media/matixs-mod-installer-rn.git"
575
},
58-
"extends": [
59-
"plugin:vue/essential",
60-
"eslint:recommended",
61-
"@vue/typescript"
62-
],
63-
"parserOptions": {
64-
"parser": "@typescript-eslint/parser"
6+
"name": "matixs-mod-installer-rn",
7+
"version": "0.1.2",
8+
"private": true,
9+
"description": "Matix's Mod Installer is Matix's Mod Installer is the newly designed platform to install your Minecraft modpacks!",
10+
"author": {
11+
"name": "Max Heilmann",
12+
"email": "heilmann@matix-media.net",
13+
"url": "https://matix-media.net"
6514
},
66-
"rules": {}
67-
},
68-
"browserslist": [
69-
"> 1%",
70-
"last 2 versions",
71-
"not dead"
72-
]
15+
"scripts": {
16+
"serve": "vue-cli-service serve",
17+
"build": "vue-cli-service build",
18+
"lint": "vue-cli-service lint",
19+
"electron:build": "vue-cli-service electron:build",
20+
"electron:serve": "vue-cli-service electron:serve",
21+
"postinstall": "electron-builder install-app-deps",
22+
"postuninstall": "electron-builder install-app-deps"
23+
},
24+
"main": "background.js",
25+
"dependencies": {
26+
"@wuild/vue-titlebar": "^1.0.1",
27+
"axios": "^0.21.1",
28+
"core-js": "^3.11.1",
29+
"electron-updater": "^4.3.8",
30+
"minecraft-launcher-core": "^3.16.2",
31+
"uuid": "^8.3.2",
32+
"vue": "^2.6.12",
33+
"vue-luxon": "^0.10.0",
34+
"vue-markdown-render": "^1.1.1",
35+
"vue-meta": "^2.4.0",
36+
"vue-router": "^3.5.1"
37+
},
38+
"devDependencies": {
39+
"@typescript-eslint/eslint-plugin": "^4.22.0",
40+
"@typescript-eslint/parser": "^4.22.0",
41+
"@vue/cli-plugin-babel": "~4.5.12",
42+
"@vue/cli-plugin-eslint": "~4.5.12",
43+
"@vue/cli-plugin-router": "^4.5.12",
44+
"@vue/cli-service": "~4.5.12",
45+
"@vue/eslint-config-typescript": "^7.0.0",
46+
"babel-eslint": "^10.1.0",
47+
"electron": "12.0.6",
48+
"electron-devtools-installer": "^3.2.0",
49+
"eslint": "^7.25.0",
50+
"eslint-plugin-vue": "^7.9.0",
51+
"sass": "^1.32.12",
52+
"sass-loader": "^11.0.1",
53+
"typescript": "~4.2.4",
54+
"vue-cli-plugin-electron-builder": "^2.0.0-rc.6",
55+
"vue-template-compiler": "^2.6.12"
56+
},
57+
"eslintConfig": {
58+
"root": true,
59+
"env": {
60+
"node": true
61+
},
62+
"extends": [
63+
"plugin:vue/essential",
64+
"eslint:recommended",
65+
"@vue/typescript"
66+
],
67+
"parserOptions": {
68+
"parser": "@typescript-eslint/parser"
69+
},
70+
"rules": {}
71+
},
72+
"browserslist": [
73+
"> 1%",
74+
"last 2 versions",
75+
"not dead"
76+
]
7377
}
115 KB
Binary file not shown.
25.1 KB
Loading

src/background.js

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22

33
import { app, protocol, BrowserWindow, ipcMain } from "electron";
4+
import { autoUpdater } from "electron-updater";
45
import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
56
import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer";
67
const isDevelopment = process.env.NODE_ENV !== "production";
@@ -10,9 +11,11 @@ protocol.registerSchemesAsPrivileged([
1011
{ scheme: "app", privileges: { secure: true, standard: true } },
1112
]);
1213

14+
var win;
15+
1316
async function createWindow() {
1417
// Create the browser window.
15-
const win = new BrowserWindow({
18+
win = new BrowserWindow({
1619
width: 1420,
1720
height: 820,
1821
minWidth: 1040,
@@ -23,6 +26,7 @@ async function createWindow() {
2326
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
2427
},
2528
});
29+
2630
win.setMenuBarVisibility(false);
2731
win.setMenu(null);
2832
if (process.env.WEBPACK_DEV_SERVER_URL) {
@@ -66,10 +70,6 @@ app.on("ready", async () => {
6670
createWindow();
6771
});
6872

69-
ipcMain.on("app_version", (event) => {
70-
event.sender.send("app_version", { version: app.getVersion() });
71-
});
72-
7373
// Exit cleanly on request from parent process in development mode.
7474
if (isDevelopment) {
7575
if (process.platform === "win32") {
@@ -84,3 +84,38 @@ if (isDevelopment) {
8484
});
8585
}
8686
}
87+
88+
// IPC Remote events
89+
90+
ipcMain.on("app_version", (event) => {
91+
event.sender.send("app_version", { version: app.getVersion() });
92+
});
93+
94+
ipcMain.on("check_updates", (event) => {
95+
console.log("Checking for updates...");
96+
autoUpdater.checkForUpdatesAndNotify();
97+
if (isDevelopment) event.sender.send("update_info", { updateAvailable: false });
98+
});
99+
100+
ipcMain.on("restart_app", () => {
101+
autoUpdater.quitAndInstall();
102+
});
103+
104+
autoUpdater.on("update-available", () => {
105+
console.log("update available");
106+
win.webContents.send("update_info", { updateAvailable: true });
107+
});
108+
109+
autoUpdater.on("update-not-available", () => {
110+
console.log("no update available");
111+
win.webContents.send("update_info", { updateAvailable: false });
112+
});
113+
114+
autoUpdater.on("update-downloaded", () => {
115+
win.webContents.send("update_downloaded");
116+
});
117+
118+
autoUpdater.on("error", (error) => {
119+
win.webContents.send("update_info", { updateAvailable: false });
120+
console.error("Error while updating: " + error);
121+
});

src/views/Home.vue

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,75 @@
11
<template>
2-
<div class="home">
3-
<img alt="Vue logo" src="../assets/logo.png">
4-
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
5-
</div>
6-
</template>
2+
<div class="home">
3+
<div class="news">
4+
<h3>News</h3>
5+
<div class="content">
6+
<NewsSmall icon="https://imgur.com/eiuJs3z.png" modpack="Survival Default Kit" title="Major Update to 1.2.1 yeah i tried!" content="Finally! We are updating to 1.2.1. With this update you get the updated mods of Xaero's Minimap and much more stuff ready for you to explore. her is some random teyt to fill the space that is currently empty and to some better designing." date="2021-01-25T14:48Z" modpackTarget="/library/0" newsId="1" />
7+
8+
<NewsSmall icon="https://imgur.com/u1B1co3.png" modpack="OptiFine for Forge 1.16.4" title="Updated OptiFine" content="We updated OptiFine to HD U G6 for Minecraft 1.16.4. This fixed a lot of old bugs from the recent version HD U G5." date="2021-01-07T14:48Z" modpackTarget="/library/1" newsId="0" />
9+
</div>
10+
</div>
11+
<div class="lists">
12+
<full-list title="RECENTLY PLAYED">
13+
<div class="list-recently-played list">
14+
<modpack-small image="https://imgur.com/eiuJs3z.png" target="/library/0" />
15+
<modpack-small image="https://imgur.com/u1B1co3.png" target="/library/1" />
16+
</div>
17+
</full-list>
718

8-
<script lang="ts">
9-
import Vue from 'vue';
10-
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
19+
<full-list title="YOUR MODPACKS">
20+
<div class="list-your-modpacks list">
21+
<modpack-small image="https://imgur.com/u1B1co3.png" target="/library/1" />
22+
<modpack-small image="https://imgur.com/eiuJs3z.png" target="/library/0" />
23+
</div>
24+
</full-list>
25+
</div>
26+
</div>
27+
</template>
1128

12-
export default Vue.extend({
13-
name: 'Home',
14-
components: {
15-
HelloWorld,
16-
},
17-
});
29+
<script>
30+
import NewsSmall from '../components/NewsSmall.vue';
31+
import FullList from '../components/FullList.vue';
32+
import ModpackSmall from '../components/ModpackSmall.vue';
33+
export default {
34+
name: "Home",
35+
components: {
36+
NewsSmall,
37+
FullList,
38+
ModpackSmall
39+
}
40+
}
1841
</script>
42+
43+
<style scoped>
44+
div.home {
45+
padding-bottom: 5rem;
46+
}
47+
div.news {
48+
margin: 0 3rem 0 2rem;
49+
background-color: rgba(255, 255, 255, 0.19);
50+
border-bottom-left-radius: 4px;
51+
border-bottom-right-radius: 4px;
52+
backdrop-filter: blur(15px);
53+
padding: .5rem;
54+
box-shadow: 1px 4px 9px -1px rgba(0,0,0,0.05);
55+
overflow: hidden;
56+
}
57+
div.news h3 {
58+
margin-bottom: .3rem;
59+
}
60+
div.news div.content,
61+
div.list {
62+
display: flex;
63+
align-content: top;
64+
flex-direction: row;
65+
}
66+
div.news div.content div.news-small {
67+
margin-right: 1.5rem;
68+
}
69+
div.modpack-small {
70+
margin-right: 1rem;
71+
}
72+
div.lists div.full-list {
73+
margin: 1.5rem 3rem 0 2rem;
74+
}
75+
</style>

0 commit comments

Comments
 (0)