diff --git a/out/bad-thoughts-explode.js b/out/bad-thoughts-explode.js index 14544a5..5d31215 100644 --- a/out/bad-thoughts-explode.js +++ b/out/bad-thoughts-explode.js @@ -1,5 +1,6 @@ "use strict"; var isBadThoughtsExplodePluginEnabled = false; +var areExplodeMessagesDisabled = false; var explodedCount = 0; var badThoughts = [ "cant_afford_ride", @@ -80,7 +81,7 @@ var togglePluginWindow = function () { classification: "bad_thoughts_explode", title: "Bad Thoughts Explode", width: 200, - height: 65, + height: 90, widgets: [ { type: "checkbox", @@ -95,11 +96,25 @@ var togglePluginWindow = function () { isBadThoughtsExplodePluginEnabled = isChecked; }, }, + { + type: "checkbox", + name: "disable_messages", + x: 10, + y: 40, + width: 280, + height: 20, + text: "Disable messages", + tooltip: "Disable showing messages when guests are marked to be exploded. This is just to reduce spam.", + isChecked: areExplodeMessagesDisabled, + onChange: function (isChecked) { + areExplodeMessagesDisabled = isChecked; + }, + }, { type: "label", name: "exploded_count", x: 10, - y: 40, + y: 70, width: 280, height: 20, text: "Exploded guests: ".concat(explodedCount), @@ -132,7 +147,9 @@ var getGuestsWithBadThoughts = function () { var badThoughts_1 = getBadThoughtsFromGuest(guest); if (badThoughts_1.length > 0 && guest.id) { unhappyGuests.push(guest); - park.postMessage({ text: "".concat(guest.name, " will explode for thinking ").concat(badThoughts_1[0].toString()), type: "peep", subject: guest.id }); + if (!areExplodeMessagesDisabled) { + park.postMessage({ text: "".concat(guest.name, " will explode for thinking ").concat(badThoughts_1[0].toString()), type: "peep", subject: guest.id }); + } } } } diff --git a/src/index.ts b/src/index.ts index fc7f62b..6c69927 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ let isBadThoughtsExplodePluginEnabled = false; +let areExplodeMessagesDisabled = false; let explodedCount = 0; @@ -82,7 +83,7 @@ const togglePluginWindow = (): void => { classification: "bad_thoughts_explode", title: "Bad Thoughts Explode", width: 200, - height: 65, + height: 90, widgets: [ { type: "checkbox", @@ -97,11 +98,25 @@ const togglePluginWindow = (): void => { isBadThoughtsExplodePluginEnabled = isChecked; }, }, + { + type: "checkbox", + name: "disable_messages", + x: 10, + y: 40, + width: 280, + height: 20, + text: "Disable messages", + tooltip: "Disable showing messages when guests are marked to be exploded. This is just to reduce spam.", + isChecked: areExplodeMessagesDisabled, + onChange(isChecked) { + areExplodeMessagesDisabled = isChecked; + }, + }, { type: "label", name: "exploded_count", x: 10, - y: 40, + y: 70, width: 280, height: 20, text: `Exploded guests: ${explodedCount}`, @@ -145,7 +160,9 @@ const getGuestsWithBadThoughts = (): Guest[] => { if (badThoughts.length > 0 && guest.id) { unhappyGuests.push(guest); - park.postMessage({ text: `${guest.name} will explode for thinking ${badThoughts[0].toString()}`, type: "peep", subject: guest.id }); + if (!areExplodeMessagesDisabled) { + park.postMessage({ text: `${guest.name} will explode for thinking ${badThoughts[0].toString()}`, type: "peep", subject: guest.id }); + } } } }