File diff suppressed because one or more lines are too long
@@ -152,6 +152,7 @@ CM.ConfigData.ToolWarnBon = {type: 'bool', group: 'Calculation', label: ['Calcul
|
|||||||
|
|
||||||
// Notification
|
// Notification
|
||||||
CM.ConfigData.Title = {type: 'bool', group: 'NotificationGeneral', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true};
|
CM.ConfigData.Title = {type: 'bool', group: 'NotificationGeneral', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true};
|
||||||
|
CM.ConfigData.GeneralSound = {type: 'bool', group: 'NotificationGeneral', label: ['Consider Game Volume Setting OFF', 'Consider Game Volume Setting ON'], desc: 'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down', toggle: true};
|
||||||
CM.ConfigData.GCNotification = {type: 'bool', group: 'NotificationGC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Golden Cookie spawns', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.GCNotification);}};
|
CM.ConfigData.GCNotification = {type: 'bool', group: 'NotificationGC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Golden Cookie spawns', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.GCNotification);}};
|
||||||
CM.ConfigData.GCFlash = {type: 'bool', group: 'NotificationGC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie', toggle: true};
|
CM.ConfigData.GCFlash = {type: 'bool', group: 'NotificationGC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie', toggle: true};
|
||||||
CM.ConfigData.GCSound = {type: 'bool', group: 'NotificationGC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Golden Cookie', toggle: true};
|
CM.ConfigData.GCSound = {type: 'bool', group: 'NotificationGC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Golden Cookie', toggle: true};
|
||||||
@@ -263,6 +264,8 @@ CM.Data.ConfigDefault = {
|
|||||||
AvgCPSHist: 3,
|
AvgCPSHist: 3,
|
||||||
AvgClicksHist: 0,
|
AvgClicksHist: 0,
|
||||||
ToolWarnBon: 0,
|
ToolWarnBon: 0,
|
||||||
|
Title: 1,
|
||||||
|
GeneralSound: 1,
|
||||||
GCNotification: 0,
|
GCNotification: 0,
|
||||||
GCFlash: 1,
|
GCFlash: 1,
|
||||||
GCSound: 1,
|
GCSound: 1,
|
||||||
@@ -297,7 +300,6 @@ CM.Data.ConfigDefault = {
|
|||||||
WrinklerMaxSound: 1,
|
WrinklerMaxSound: 1,
|
||||||
WrinklerMaxVolume: 100,
|
WrinklerMaxVolume: 100,
|
||||||
WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
||||||
Title: 1,
|
|
||||||
TooltipBuildUpgrade: 1,
|
TooltipBuildUpgrade: 1,
|
||||||
TooltipAmor: 0,
|
TooltipAmor: 0,
|
||||||
ToolWarnLucky: 1,
|
ToolWarnLucky: 1,
|
||||||
|
|||||||
@@ -992,7 +992,7 @@ CM.Disp.CreateWhiteScreen = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Disp.Flash = function(mode, config) {
|
CM.Disp.Flash = function(mode, config) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if ((CM.Options[config] == 1 && mode == 3 && CM.Disp.Flash.caller.caller.caller.caller == null) || mode == 1) {
|
if ((CM.Options[config] == 1 && mode == 3 && CM.Footer.isInitzializing === false) || mode == 1) {
|
||||||
CM.Disp.WhiteScreen.style.opacity = '0.5';
|
CM.Disp.WhiteScreen.style.opacity = '0.5';
|
||||||
if (mode == 3) {
|
if (mode == 3) {
|
||||||
CM.Disp.WhiteScreen.style.display = 'inline';
|
CM.Disp.WhiteScreen.style.display = 'inline';
|
||||||
@@ -1018,9 +1018,10 @@ CM.Disp.Flash = function(mode, config) {
|
|||||||
*/
|
*/
|
||||||
CM.Disp.PlaySound = function(url, sndConfig, volConfig) {
|
CM.Disp.PlaySound = function(url, sndConfig, volConfig) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if (CM.Options[sndConfig] == 1 && CM.Disp.PlaySound.caller.caller.caller.caller == null) {
|
if (CM.Options[sndConfig] == 1 && CM.Footer.isInitzializing === false) {
|
||||||
var sound = new realAudio(url);
|
var sound = new realAudio(url);
|
||||||
sound.volume = (CM.Options[volConfig] / 100) * (Game.volume / 100);
|
if (CM.Options.GeneralSound) sound.volume = (CM.Options[volConfig] / 100) * (Game.volume / 100);
|
||||||
|
else sound.volume = (CM.Options[volConfig] / 100);
|
||||||
sound.play();
|
sound.play();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1034,7 +1035,7 @@ CM.Disp.PlaySound = function(url, sndConfig, volConfig) {
|
|||||||
*/
|
*/
|
||||||
CM.Disp.Notification = function(notifyConfig, title, message) {
|
CM.Disp.Notification = function(notifyConfig, title, message) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if (CM.Options[notifyConfig] == 1 && document.visibilityState == 'hidden' && CM.Disp.Notification.caller.caller.caller.caller == null) {
|
if (CM.Options[notifyConfig] == 1 && document.visibilityState == 'hidden' && CM.Footer.isInitzializing === false) {
|
||||||
var CookieIcon = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
var CookieIcon = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
||||||
new Notification(title, {body: message, badge: CookieIcon});
|
new Notification(title, {body: message, badge: CookieIcon});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
* It starts the further initialization of CookieMonster and registers hooks
|
* It starts the further initialization of CookieMonster and registers hooks
|
||||||
*/
|
*/
|
||||||
CM.init = function() {
|
CM.init = function() {
|
||||||
|
CM.Footer.isInitzializing = true
|
||||||
var proceed = true;
|
var proceed = true;
|
||||||
if (Game.version != CM.VersionMajor) {
|
if (Game.version != CM.VersionMajor) {
|
||||||
proceed = confirm('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' is meant for Game version ' + CM.VersionMajor + '. Loading a different version may cause errors. Do you still want to load Cookie Monster?');
|
proceed = confirm('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' is meant for Game version ' + CM.VersionMajor + '. Loading a different version may cause errors. Do you still want to load Cookie Monster?');
|
||||||
@@ -20,7 +21,7 @@ CM.init = function() {
|
|||||||
CM.DelayInit();
|
CM.DelayInit();
|
||||||
Game.registerHook('draw', CM.Disp.Draw);
|
Game.registerHook('draw', CM.Disp.Draw);
|
||||||
Game.registerHook('logic', CM.Loop);
|
Game.registerHook('logic', CM.Loop);
|
||||||
|
CM.Footer.isInitzializing = false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user