Skip to content

Commit

Permalink
Merge pull request #1250 from Armored-Dragon/feature/notificationCore…
Browse files Browse the repository at this point in the history
…_sounds_on_chat_message

Added sounds to all incoming chat messages
  • Loading branch information
daleglass authored Nov 23, 2024
2 parents 4e5eda5 + 600b8a4 commit 48564f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/communityScripts/notificationCore/notificationCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ var DEFAULT_OFFSET = 10;
var FLOOF_NOTIFICATION_CHANNEL = "Floof-Notif";
var MAIN_CHAT_APP_CHANNEL = "Chat";
var ARROW_REGEX = /\</gi;

var notificationSound = SoundCache.getSound(Script.resolvePath("resources/click.wav"));
var soundInjectorOptions = {
localOnly: true,
position: MyAvatar.position,
volume: 0.04
};

var offset = DEFAULT_OFFSET;

Expand All @@ -48,6 +53,7 @@ function messageReceived(channel, message, sender, local) {
}
} else {
notificationCore.add(cmd.text, cmd.sender, cmd.colour);
playSound();
}
}
}
Expand Down Expand Up @@ -113,6 +119,10 @@ function cleanUp() {
});
}

function playSound() {
Audio.playSound(notificationSound, soundInjectorOptions);
}

function notif(text, colour) {

var noti = {
Expand Down
Binary file not shown.

0 comments on commit 48564f2

Please sign in to comment.