diff --git a/changelog.md b/changelog.md index 06f497e..3ac4bba 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,6 @@ ## v2.3: Cooler and Newer Edition - 12/10/20 - Added achievement/milestone popups (thank you to Jacorb for this contribution!) - (They have to be enabled with layer features) - The changelog tab is back, and can be set in mod.js. - Layer nodes and respec buttons will not be clicked by pressing "enter". - Possible fix for flickering tooltips and strange transitions. diff --git a/docs/achievements.md b/docs/achievements.md index 52b2dda..6309855 100644 --- a/docs/achievements.md +++ b/docs/achievements.md @@ -53,4 +53,4 @@ Individual achievement can have these features: - doneTooltip: **optional, deprecated**. Appears when the achievement is hovered over and completed, overrides the basic tooltip. This can display what the player achieved (the goal), and the rewards, if any. It can also be a function that returns updating text. Can use basic HTML. -Enable achievement popups by adding `achievementsPopups: true` to the layer. +Disable achievement popups by adding `achievementsPopups: false` to the layer. diff --git a/docs/layer-features.md b/docs/layer-features.md index d0c0870..8360836 100644 --- a/docs/layer-features.md +++ b/docs/layer-features.md @@ -75,7 +75,7 @@ You can make almost any value dynamic by using a function in its place, includin - infoboxes: Displays some text in a box that can be shown or hidden. [See here for more info.](infoboxes.md) -- achievementPopups, milestonePopups: **optional**, If true, you get a popup message when you get the achievement/milestone. +- achievementPopups, milestonePopups: **optional**, If false, disables popup message when you get the achievement/milestone. True by default. ## Prestige formula features diff --git a/docs/milestones.md b/docs/milestones.md index 34f1774..bc40833 100644 --- a/docs/milestones.md +++ b/docs/milestones.md @@ -35,4 +35,4 @@ Milestone features: - id: **assigned automagically**. It's the "key" which the milestone was stored under, for convenient access. The milestone in the example's id is 0. -Enable milestone popups by adding `milestonePopups: true` to the layer. +Disaable milestone popups by adding `milestonePopups: false` to the layer. diff --git a/js/utils.js b/js/utils.js index 058a235..e33d267 100644 --- a/js/utils.js +++ b/js/utils.js @@ -727,7 +727,7 @@ function updateMilestones(layer){ for (id in layers[layer].milestones){ if (!(player[layer].milestones.includes(id)) && layers[layer].milestones[id].done()){ player[layer].milestones.push(id) - if (tmp[layer].milestonePopups) doPopup("milestone", tmp[layer].milestones[id].requirementDescription, "Milestone Gotten!", 3, tmp[layer].color); + if (tmp[layer].milestonePopups || tmp[layer].milestonePopups === undefined) doPopup("milestone", tmp[layer].milestones[id].requirementDescription, "Milestone Gotten!", 3, tmp[layer].color); } } } @@ -737,7 +737,7 @@ function updateAchievements(layer){ if (isPlainObject(layers[layer].achievements[id]) && !(player[layer].achievements.includes(id)) && layers[layer].achievements[id].done()) { player[layer].achievements.push(id) if (layers[layer].achievements[id].onComplete) layers[layer].achievements[id].onComplete() - if (tmp[layer].achievementPopups) doPopup("achievement", tmp[layer].achievements[id].name, "Achievement Gotten!", 3, tmp[layer].color); + if (tmp[layer].achievementPopups || tmp[layer].achievementPopups === undefined) doPopup("achievement", tmp[layer].achievements[id].name, "Achievement Gotten!", 3, tmp[layer].color); } } }