aboutsummaryrefslogtreecommitdiff
path: root/src/win.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-06-20 00:11:19 +0200
committerGitHub <noreply@github.com>2024-06-20 00:11:19 +0200
commit25adf3d3369526ad393d4086ad2c82963bc02345 (patch)
treefb9b95a174b1490fd60689160f88732b746da2bb /src/win.js
parent0f40ecfdf1d351762e6b0bc525b3d716756c5643 (diff)
parent6c2df3103bca1b782101601b088f550f2662ee99 (diff)
downloadViper-25adf3d3369526ad393d4086ad2c82963bc02345.tar.gz
Viper-25adf3d3369526ad393d4086ad2c82963bc02345.zip
Merge branch 'main' into gamepad-support
Diffstat (limited to 'src/win.js')
-rw-r--r--src/win.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/win.js b/src/win.js
index 9bec3c9..91ef93a 100644
--- a/src/win.js
+++ b/src/win.js
@@ -25,6 +25,11 @@ alert = async (msg) => {
})
}
+// sends an toast to the renderer
+toast = (properties) => {
+ win.send("toast", properties);
+}
+
// this increments for every confirm alert that's created, the ID is
// used to keep track of popups being opened or closed.
let confirm_id = 0;
@@ -48,9 +53,10 @@ confirm = async (msg) => {
let win = {
send: () => {},
- log: log,
- alert: alert,
- confirm: confirm
+ log: log,
+ toast: toast,
+ alert: alert,
+ confirm: confirm
}
let func = () => {
@@ -60,9 +66,10 @@ let func = () => {
func.set = (main_window) => {
win = main_window;
- win.log = log;
- win.alert = alert;
- win.confirm = confirm;
+ win.log = log;
+ win.toast = toast;
+ win.alert = alert;
+ win.confirm = confirm;
}
module.exports = func;