Allow each mod to have a default version

When a visitor arrives at the site for the first time, this will
ensure they have a certain set of mods on/off. Right now, that means
IC2-Classic is off by default, and everything else is on.
This commit is contained in:
Andrew Miner
2015-03-10 09:57:23 -07:00
parent b1cfe9221e
commit ee75415729
8 changed files with 29 additions and 187 deletions
+2 -2
View File
@@ -49,10 +49,10 @@ module.exports = class CraftingGuideRouter extends Backbone.Router
makeResponder = (m)-> return ->
m.activeModVersion.fetch() if m.activeModVersion?
for modSlug in DefaultMods
for modSlug, modData of DefaultMods
mod = new Mod slug:modSlug
mod.on Event.change + ':activeModVersion', makeResponder mod
@storage.register "mod:#{mod.slug}", mod, 'activeVersion'
@storage.register "mod:#{mod.slug}", mod, 'activeVersion', modData.defaultVersion
mod.fetch()
@modPack.addMod mod