New colour settings, changeable flash colour #728

This commit is contained in:
Daniël van Noord
2021-03-28 10:55:10 +02:00
parent fe8749e7b2
commit 972d4723ed
21 changed files with 183 additions and 126 deletions

View File

@@ -23,10 +23,9 @@ export class SettingStandard extends Setting {
}
/** The colour picker setting class */
export class SettingColours extends Setting {
constructor(type, group, desc, func) {
constructor(type, group, desc) {
super(type, group);
this.desc = desc;
this.func = func;
}
}

View File

@@ -13,7 +13,6 @@ import { CMOptions } from '../Config/VariablesAndData';
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
import UpdateColours from '../Disp/HelperFunctions/UpdateColours';
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
import { SimDoSims } from '../Sim/VariablesAndData';
import {
@@ -193,30 +192,50 @@ const Config = {
0,
Infinity,
),
Colours: new SettingColours(
ColourBlue: new SettingColours(
'colour',
'Colours',
{
Blue:
'Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
Green:
'Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
Yellow:
'Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels',
Orange:
'Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
Red:
'Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
Purple:
'Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels',
Gray:
'Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
Pink: 'Standard colour is pink. Used for Dragonflight bar',
Brown: 'Standard colour is brown. Used for Dragon Harvest bar',
},
function () {
UpdateColours();
},
'Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
),
ColourGreen: new SettingColours(
'colour',
'Colours',
'Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
),
ColourYellow: new SettingColours(
'colour',
'Colours',
'Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels',
),
ColourOrange: new SettingColours(
'colour',
'Colours',
'Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
),
ColourRed: new SettingColours(
'colour',
'Colours',
'Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
),
ColourPurple: new SettingColours(
'colour',
'Colours',
'Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels',
),
ColourGray: new SettingColours(
'colour',
'Colours',
'Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
),
ColourPink: new SettingColours(
'colour',
'Colours',
'Standard colour is pink. Used for Dragonflight bar',
),
ColourBrown: new SettingColours(
'colour',
'Colours',
'Standard colour is brown. Used for Dragon Harvest bar',
),
// BarsDisplay
@@ -561,6 +580,11 @@ const Config = {
'Flash screen on golden cookie',
true,
),
ColourGCFlash: new SettingColours(
'colour',
'NotificationGC',
'The colour of the GC flash, standard colour is white',
),
GCSound: new SettingStandard(
'bool',
'NotificationGC',
@@ -592,6 +616,11 @@ const Config = {
'Flash screen on fortune cookie spawn',
true,
),
ColourFortuneFlash: new SettingColours(
'colour',
'NotificationFC',
'The colour of the fortune flash, standard colour is white',
),
FortuneSound: new SettingStandard(
'bool',
'NotificationFC',
@@ -623,6 +652,11 @@ const Config = {
'Flash screen on season popup',
true,
),
ColourSeaFlash: new SettingColours(
'colour',
'NotificationSea',
'The colour of the season popup flash, standard colour is white',
),
SeaSound: new SettingStandard(
'bool',
'NotificationSea',
@@ -644,6 +678,11 @@ const Config = {
'Flash screen on garden tick',
true,
),
ColourGardFlash: new SettingColours(
'colour',
'NotificationGard',
'The colour of the garden flash, standard colour is white',
),
GardSound: new SettingStandard(
'bool',
'NotificationGard',
@@ -675,6 +714,11 @@ const Config = {
'Flash screen when magic reaches maximum',
true,
),
ColourMagicFlash: new SettingColours(
'colour',
'NotificationMagi',
'The colour of the magic flash, standard colour is white',
),
MagicSound: new SettingStandard(
'bool',
'NotificationMagi',
@@ -706,6 +750,11 @@ const Config = {
'Flash screen when a wrinkler appears',
true,
),
ColourWrinklerFlash: new SettingColours(
'colour',
'NotificationWrink',
'The colour of the wrinkler flash, standard colour is white',
),
WrinklerSound: new SettingStandard(
'bool',
'NotificationWrink',
@@ -737,6 +786,11 @@ const Config = {
'Flash screen when the maximum amount of Wrinklers has appeared',
true,
),
ColourWrinklerMaxFlash: new SettingColours(
'colour',
'NotificationWrinkMax',
'The colour of the maximum wrinkler flash, standard colour is white',
),
WrinklerMaxSound: new SettingStandard(
'bool',
'NotificationWrinkMax',

View File

@@ -16,17 +16,15 @@ const ConfigDefault = {
PPExcludeTop: 0,
PPRigidelMode: 0,
PPSecondsLowerLimit: 0,
Colours: {
Blue: '#4bb8f0',
Green: '#00ff00',
Yellow: '#ffff00',
Orange: '#ff7f00',
Red: '#ff0000',
Purple: '#ff00ff',
Gray: '#b3b3b3',
Pink: '#ff1493',
Brown: '#8b4513',
},
ColourBlue: '#4bb8f0',
ColourGreen: '#00ff00',
ColourYellow: '#ffff00',
ColourOrange: '#ff7f00',
ColourRed: '#ff0000',
ColourPurple: '#ff00ff',
ColourGray: '#b3b3b3',
ColourPink: '#ff1493',
ColourBrown: '#8b4513',
BotBar: 1,
TimerBar: 1,
TimerBarPos: 0,
@@ -66,39 +64,46 @@ const ConfigDefault = {
GeneralSound: 1,
GCNotification: 0,
GCFlash: 1,
ColourGCFlash: '#ffffff',
GCSound: 1,
GCVolume: 100,
GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
FortuneNotification: 0,
FortuneFlash: 1,
ColourFortuneFlash: '#ffffff',
FortuneSound: 1,
FortuneVolume: 100,
FortuneSoundURL:
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
SeaNotification: 0,
SeaFlash: 1,
ColourSeaFlash: '#ffffff',
SeaSound: 1,
SeaVolume: 100,
SeaSoundURL:
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
GardFlash: 1,
ColourGardFlash: '#ffffff',
GardSound: 1,
GardVolume: 100,
GardSoundURL: 'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
MagicNotification: 0,
MagicFlash: 1,
ColourMagicFlash: '#ffffff',
MagicSound: 1,
MagicVolume: 100,
MagicSoundURL:
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
WrinklerNotification: 0,
WrinklerFlash: 1,
ColourWrinklerFlash: '#ffffff',
WrinklerSound: 1,
WrinklerVolume: 100,
WrinklerSoundURL:
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
WrinklerMaxNotification: 0,
WrinklerMaxFlash: 1,
ColourWrinklerMaxFlash: '#ffffff',
WrinklerMaxSound: 1,
WrinklerMaxVolume: 100,
WrinklerMaxSoundURL: