diff --git a/src/css/templates/index.scss b/src/css/templates/index.scss index 00f92a360..987f78f4e 100644 --- a/src/css/templates/index.scss +++ b/src/css/templates/index.scss @@ -10,6 +10,7 @@ All rights reserved. @import 'feedback'; @import 'inventory'; @import 'item_page'; +@import 'mod'; @import 'mod_pack'; @import 'recipe'; @import 'stack'; diff --git a/src/css/templates/mod.scss b/src/css/templates/mod.scss new file mode 100644 index 000000000..2f380c661 --- /dev/null +++ b/src/css/templates/mod.scss @@ -0,0 +1,35 @@ +/* +Crafting Table - mod.scss + +Copyright (c) 2014-2015 by Redwood Labs +All rights reserved. +*/ + +.view__mod { + position: relative; width: 100%; + padding: 1em; + + div, p { + display: inline-block; + } + + .version { + position: relative; width: 10em; + margin-right: 1em; + } + + .name { + position: relative; width: 15em; + margin-right: 1em; + + p { + font-family: $font-family-normal; + font-size: $font-size-normal; +// text-decoration: underline; + } + } + + &.disabled { + p { color: $color-gray-light; } + } +} diff --git a/src/css/templates/mod_pack.scss b/src/css/templates/mod_pack.scss index 7004d72a2..761eda5f3 100644 --- a/src/css/templates/mod_pack.scss +++ b/src/css/templates/mod_pack.scss @@ -7,21 +7,12 @@ All rights reserved. .view__mod_pack { - input { border: 0; font-size: 1.5em; width: 90%; } + input { + border: 0; font-size: 1.5em; width: 90%; + } - table { - margin: 0 auto; - width: 100%; - - td { - position: relative; height: 2 * $font-size-normal; - padding: 0 1em; - vertical-align: middle; - } - - td:nth-child(1) { width: 5%; } - td:nth-child(2) { width: 30%; } - td:nth-child(3) { width: 65%; border-left: 0.1em solid $color-brick-light; } + .mods { + position: relative; width: 100%; } .panel { @@ -29,13 +20,13 @@ All rights reserved. } .toolbar { - position: relative; width: 35%; + position: relative; width: 100%; margin-top: 1em; padding: 1em 1em; - text-align: center; + text-align: left; button { - position: relative; width: 66%; + position: relative; width: 20em; } } } diff --git a/src/marketing/forum-posts.txt b/src/marketing/forum-posts.txt index 6010da74e..d731d48d6 100644 --- a/src/marketing/forum-posts.txt +++ b/src/marketing/forum-posts.txt @@ -28,3 +28,10 @@ If you've seen it before, go look again. There's a whole new site now, which sup * You can now make many different items at once (e.g., a whole NanoSuit) [crafting-guide.com](http://crafting-guide.com) + +######################################################################################################################## + +A few more updates to report! First, now your preferences for which mods are active and whether tools are included +will be remembered between visits. Second, I've finished adding support for Thermal Expansion 4. The crafting algorithm +doesn't yet taken into account the ore-doubling/tripling machinery, but all the recipes for the entire mod are present +and functional. I'll work on using the machines in a future update. Next up: IC2 Experimental! \ No newline at end of file diff --git a/src/scripts/constants.coffee b/src/scripts/constants.coffee index eb5ea1894..683f3c9cf 100644 --- a/src/scripts/constants.coffee +++ b/src/scripts/constants.coffee @@ -52,7 +52,8 @@ ModelState.failed = 'failed' exports.Url = Url = {} Url.itemIcon = _.template "/data/<%= modSlug %>/<%= modVersion %>/images/<%= slug %>.png" Url.item = _.template "/item/<%= slug %>" -Url.mod = _.template "/data/<%= modSlug %>/mod.cg" +Url.mod = _.template "/mod/<%= modSlug %>" +Url.modData = _.template "/data/<%= modSlug %>/mod.cg" Url.modVersion = _.template "/data/<%= modSlug %>/<%= modVersion %>/mod-version.cg" exports.UrlParam = UrlParam = {} diff --git a/src/scripts/controllers/mod_controller.coffee b/src/scripts/controllers/mod_controller.coffee index 2d8657219..a8f230323 100644 --- a/src/scripts/controllers/mod_controller.coffee +++ b/src/scripts/controllers/mod_controller.coffee @@ -9,6 +9,7 @@ BaseController = require './base_controller' {Event} = require '../constants' Mod = require '../models/mod' {RequiredMods} = require '../constants' +{Url} = require '../constants' ######################################################################################################################## @@ -25,38 +26,44 @@ module.exports = class ModController extends BaseController # Event Methods ################################################################################ - onEnabledChanged: -> - return unless @rendered - enabled = @$(':checked').length > 0 - if enabled - @model.activeVersion = Mod.Version.Latest - else - @model.activeVersion = Mod.Version.None - @_plan.removeUncraftableItems() + onVersionChanged: -> + @model.activeVersion = @$version.val() # BaseController Overrides ##################################################################### onDidRender: -> - @$enabled = @$('td:nth-child(1) input') - @$name = @$('td:nth-child(2) p') - @$description = @$('td:nth-child(3) p') + @$version = @$('.version') + @$nameLink = @$('.name a') + @$nameText = @$('.name p') + @$description = @$('.description p') super refresh: -> - if @model.slug in RequiredMods - @$enabled.attr 'checked', 'checked' - @$enabled.attr 'disabled', 'disabled' + if @model.activeVersion is Mod.Version.None + @$el.addClass 'disabled' else - @$enabled.removeAttr 'disabled' - if @model.activeVersion is Mod.Version.None - @$enabled.removeAttr 'checked' - else - @$enabled.attr 'checked', 'checked' + @$el.removeClass 'disabled' - @$name.html "#{@model.name}" - @$description.html "#{@model.description}" + @$version.empty() + + if not (@model.slug in RequiredMods) + option = $("") + if @model.activeVersion is Mod.Version.None + option.attr 'selected', 'selected' + @$version.append option + + @model.eachModVersion (modVersion)=> + option = $("") + if modVersion is @model.activeModVersion + option.attr 'selected', 'selected' + @$version.append option + + # @$nameLink.attr 'href', Url.mod modSlug:@model.slug + @$nameText.html @model.name + + @$description.html @model.description # Backbone.View Overrides ###################################################################### events: - 'change input[type="checkbox"]': 'onEnabledChanged' + 'change .version': 'onVersionChanged' diff --git a/src/scripts/controllers/mod_pack_controller.coffee b/src/scripts/controllers/mod_pack_controller.coffee index d9eb97dd9..7bc278e9a 100644 --- a/src/scripts/controllers/mod_pack_controller.coffee +++ b/src/scripts/controllers/mod_pack_controller.coffee @@ -34,7 +34,7 @@ module.exports = class ModPackController extends BaseController # BaseController Overrides ##################################################################### onDidRender: -> - @$table = @$('table') + @$mods = @$('.mods') @$toolbar = @$('.toolbar') super @@ -56,7 +56,8 @@ module.exports = class ModPackController extends BaseController controller.render() @_controllers.push controller controller.$el.hide duration:0 - @$table.append controller.$el + + @$mods.append controller.$el controller.$el.slideDown duration:Duration.normal index++ diff --git a/src/scripts/models/mod.coffee b/src/scripts/models/mod.coffee index 061379db9..858c33e93 100644 --- a/src/scripts/models/mod.coffee +++ b/src/scripts/models/mod.coffee @@ -130,7 +130,7 @@ module.exports = class Mod extends BaseModel return null # prevent calling `set` url: -> - return Url.mod modSlug:@slug + return Url.modData modSlug:@slug # Private Methods ############################################################################## diff --git a/src/templates/mod.jade b/src/templates/mod.jade index 0754aa94d..a97624c4b 100644 --- a/src/templates/mod.jade +++ b/src/templates/mod.jade @@ -5,7 +5,9 @@ //- All rights reserved. //- -tr - td: input(type="checkbox") - td: p - td: p +.view__mod + select.version + option(value="none") None + .name + a: p + .description: p diff --git a/src/templates/mod_pack.jade b/src/templates/mod_pack.jade index 2023e1041..d20504f93 100644 --- a/src/templates/mod_pack.jade +++ b/src/templates/mod_pack.jade @@ -11,10 +11,6 @@ p Mod Pack .panel - table - tr - td   - td   - + .mods .toolbar button(name="suggestMod") suggest a mod \ No newline at end of file