aboutsummaryrefslogtreecommitdiff
path: root/src/app/js
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/js
parent7f011d34a2d5e13ba312b44ce6871e48a495ea8f (diff)
downloadViper-a8e0f5f0435ed6cedb4ff389ee31c210dab26100.tar.gz
Viper-a8e0f5f0435ed6cedb4ff389ee31c210dab26100.zip
convert js/mods.js to a CommonJS module
Diffstat (limited to 'src/app/js')
-rw-r--r--src/app/js/mods.js13
1 files changed, 11 insertions, 2 deletions
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;