From 7cd9fa040fdad1c0641035c13e0d58b190cfbbda Mon Sep 17 00:00:00 2001 From: nodigit Date: Sat, 25 May 2024 22:04:53 -0400 Subject: [PATCH] Added in-game menu --- PoopingPeeps.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/PoopingPeeps.js b/PoopingPeeps.js index 2b4ead7..18fd130 100644 --- a/PoopingPeeps.js +++ b/PoopingPeeps.js @@ -1,8 +1,9 @@ var currentMonth = date.month; var incidents = 0; +var pluginEnabled = false; var checkPoopLevel = function() { - if (date.ticksElapsed % 40 === 0){ + if ((date.ticksElapsed % 40 === 0) && (pluginEnabled)){ var allGuests = map.getAllEntities("guest"); @@ -32,7 +33,7 @@ var checkPoopLevel = function() { } var poopReport = function() { - if (date.month !== currentMonth){ + if ((date.month !== currentMonth) && (pluginEnabled)){ //Alerts you if there's too many guests defecating if (incidents >= (park.guests*0.5)+1){ @@ -45,6 +46,17 @@ var poopReport = function() { } } +var pluginState = function() +{ + pluginEnabled = !pluginEnabled; + + var msg = {type: "blank", text: "Pooping Peeps enabled"}; + if (!pluginEnabled) { + msg = {type: "blank", text: "Pooping Peeps disabled"}; + } + park.postMessage(msg); + +} var main = function() { @@ -57,11 +69,13 @@ var main = function() { } ); + ui.registerMenuItem("Pooping Peeps", pluginState); + }; registerPlugin({ name: "Pooping Peeps", - version: "1.1", + version: "1.2", authors: ["nodigit"], type: "local", licence: "MIT",