aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-06-08 18:12:13 +0200
committer0neGal <mail@0negal.com>2024-06-08 18:14:15 +0200
commita8e0f5f0435ed6cedb4ff389ee31c210dab26100 (patch)
tree3e526a21ee55b0ffa2d848c5898ec042da823f1c /src/app
parent7f011d34a2d5e13ba312b44ce6871e48a495ea8f (diff)
downloadViper-a8e0f5f0435ed6cedb4ff389ee31c210dab26100.tar.gz
Viper-a8e0f5f0435ed6cedb4ff389ee31c210dab26100.zip
convert js/mods.js to a CommonJS module
Diffstat (limited to 'src/app')
-rw-r--r--src/app/index.html1
-rw-r--r--src/app/js/mods.js13
-rw-r--r--src/app/main.js1
3 files changed, 12 insertions, 3 deletions
diff --git a/src/app/index.html b/src/app/index.html
index 1297d0a..4b89999 100644
--- a/src/app/index.html
+++ b/src/app/index.html
@@ -333,7 +333,6 @@
</div>
<script src="main.js"></script>
- <script src="js/mods.js"></script>
<script src="js/toast.js"></script>
<script src="js/popups.js"></script>
<script src="js/tooltip.js"></script>
diff --git a/src/app/js/mods.js b/src/app/js/mods.js
index e105c7c..caa66a7 100644
--- a/src/app/js/mods.js
+++ b/src/app/js/mods.js
@@ -1,3 +1,10 @@
+const ipcRenderer = require("electron").ipcRenderer;
+
+const lang = require("../../lang");
+
+const version = require("./version");
+const set_buttons = require("./set_buttons");
+
let mods = {};
let mods_list = {
@@ -15,7 +22,7 @@ mods.load = (mods_obj) => {
modcount.innerHTML = `${lang("gui.mods.count")} ${mods_obj.all.length}`;
let normalized_names = [];
-
+
let set_mod = (mod) => {
let name = mod.name;
if (mod.package) {
@@ -185,7 +192,7 @@ mods.load = (mods_obj) => {
mods.toggle(mod_versions[mod].local_name);
}
})
-
+
mod_els[i].remove();
modsdiv.querySelector(".line").after(mod_el);
} else {
@@ -303,3 +310,5 @@ ipcRenderer.on("mods", (event, mods_obj) => {
mods.load(mods_obj);
})
+
+module.exports = mods;
diff --git a/src/app/main.js b/src/app/main.js
index 11f5853..fa4ec86 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -27,6 +27,7 @@ ipcRenderer.on("unknown-error", (event, err) => {
const json = require("../modules/json");
const kill = require("./js/kill");
+const mods = require("./js/mods");
const update = require("./js/update");
const events = require("./js/events");
const launch = require("./js/launch");