Skip to content

Commit 6b9dc3d

Browse files
authored
Update safety_tools_alert.js (Roll20#1408)
Added GM feedback to config changes.
1 parent ff55c07 commit 6b9dc3d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

SafetyToolsAlert/safety_tools_alert.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var SafetyToolsAlert = (function() {
22
'use strict';
3-
var version = 0.5,
3+
var version = 0.51,
44
author = 'James C. (Chuz)',
55
lastUpdated = 'Sep 16 2021';
66

@@ -20,6 +20,7 @@ var SafetyToolsAlert = (function() {
2020
}
2121

2222
log('-=> SafetyToolAlerts v'+version+' loaded <=-');
23+
sendChat('Safety Card Alerts', '/w GM **Safety Card Alerts v'+version+' loaded.**');
2324
};
2425

2526
// Handler for when a graphic is added to the table
@@ -94,19 +95,23 @@ var SafetyToolsAlert = (function() {
9495
if (args.indexOf('-deckname') === 0) {
9596
config.deckname = args.replace('-deckname', '').trim();
9697
state.safety_tools_alert.deckname = config.deckname;
98+
sendChat('Safety Card Alerts', '/w GM Deck name set to "'+config.deckname+'".');
9799
} else if (args.indexOf('-cardname_prefix') === 0) {
98100
config.cardname_prefix = args.replace('-cardname_prefix', '').trim();
99101
state.safety_tools_alert.cardname_prefix = config.cardname_prefix;
102+
sendChat('Safety Card Alerts', '/w GM Card name prefix set to "'+config.cardname_prefix+'".');
100103
} else if (args.indexOf('-play_sound') === 0) {
101104
var sound = args.replace('-play_sound', '').trim();
102105
if(sound) {
103106
var track = findObjs({type: 'jukeboxtrack', title: sound})[0] || '';
104107
if(track) {
105108
config.alert_sound = sound;
106109
config.play_sound = true;
110+
sendChat('Safety Card Alerts', '/w GM Alert sound set to "'+config.alert_sound+'". Sound playing enabled.');
107111
} else {
108112
config.alert_sound = '';
109113
config.play_sound = false;
114+
sendChat('Safety Card Alerts', '/w GM Alert sound unset. Sound playing disabled.');
110115
}
111116
state.safety_tools_alert.alert_sound = config.alert_sound;
112117
state.safety_tools_alert.play_sound = config.play_sound;

0 commit comments

Comments
 (0)