From bd8d9415e07d3eedd3fdec94d38772f4bbcd904d Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 25 Sep 2015 17:53:43 -0500 Subject: [PATCH] Move hatching potion tranform to helpers --- common/script/src/content/hatching-potions.js | 14 ++------------ common/script/src/content/helpers.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/common/script/src/content/hatching-potions.js b/common/script/src/content/hatching-potions.js index bbdab5e872..c230028e6a 100644 --- a/common/script/src/content/hatching-potions.js +++ b/common/script/src/content/hatching-potions.js @@ -1,5 +1,4 @@ -import {each, defaults} from 'lodash'; -import {translator as t} from './helpers'; +import {setHatchingPotionDefaults} from './helpers'; let hatchingPotions = { Base: { @@ -34,15 +33,6 @@ let hatchingPotions = { } }; -each(hatchingPotions, function(potion, key) { - defaults(potion, { - key: key, - value: 2, - text: t(`hatchingPotion${key}`), - notes: t('hatchingPotionNotes', { - potText: potion.text - }), - }); -}); +setHatchingPotionDefaults(hatchingPotions); export default hatchingPotions; diff --git a/common/script/src/content/helpers.js b/common/script/src/content/helpers.js index 4f56ae8daf..794530eab1 100644 --- a/common/script/src/content/helpers.js +++ b/common/script/src/content/helpers.js @@ -171,3 +171,21 @@ export function generateEggs(set, options={}) { return eggs; } + +//---------------------------------------- +// Hatching Potion Helpers +//---------------------------------------- + +export function setHatchingPotionDefaults(hatchingPotions) { + each(hatchingPotions, (potion, key) => { + let text = translator(`hatchingPotion${key}`); + defaults(potion, { + key: key, + value: 2, + text: text, + notes: translator('hatchingPotionNotes', { + potText: text + }), + }); + }); +}