Commit Graph
25 Commits
Author SHA1 Message Date
Andrew Miner aa42053c6e Optimize perf. of crafting algo. (55% savings) 2015-02-22 23:19:12 -08:00
Andrew Miner 9f0d19d9e4 Adjust animations, fix bugs, and tweak a few algos
* Adjust page change animations to slide the page closed and then
  open again.
* Add Railcraft to the standard set of mods
* Change every controller which uses an `ImageLoader` to only accept
  it from a parent controller (with the router creating the one
  shared instance).
* Fix several places where controllers need to refresh when the mod
  pack changes
* Fix a few places which should be using the `ImageLoader` but were
  not.
* Remove a number of animations which caused performance issues (esp.
  animating individual items in item group views).
* Fix a bug where changing the current version of a mod didn't cause
  the current crafting plan to be re-evaluated
* Simplify the name finder to allow regular expressions instead of
  the current algorithm
2015-02-22 21:31:48 -08:00
Andrew Miner 2d330eedcd Fix various minor bugs
* Fix "update" recipes in IC2 classic to use the new "update" command
* Remove the crafting plan model from the item detail page as it isn't
  being used there right now and can be slow for complex items
* Update the `Recipe.compareFor` method to be able to work without an
  item slug as a reference
2015-02-19 10:51:52 -08:00
Andrew Miner e3486540cb Fix bugs in reformat script from recent refactor 2015-02-19 10:19:10 -08:00
Andrew Miner b1a6637005 Major updates to the crafting algo.
* Update crafting algo. to favor highest output recipes for making
  items, and to be more flexible about trying a variety of recipes if
  some one recipe doesn't work.
* Modify crafting algo. to allow crafting of "gatherable" items.
* Update logger to support indent/outdent for clearer formatting
* Convert IC2 Forge Hammer / Cutter recipes to treat them as tools
2015-02-18 21:29:21 -08:00
Andrew Miner aab3baec1a Fix misc. bugs caused by refactoring 2015-02-18 16:11:17 -08:00
Andrew Miner e88821d449 Convert codebase to using ItemSlug
* Flesh out the formerly incomplete ItemSlug class
* Convert all uses of text item slugs to use ItemSlug
* Move the ItemSlug class under models where it properly belongs
* Avoid the use of `slug` as a local variable or item attribute
  wherever possible to avoid confusion between various kinds of slugs
* Merge the InventoryParser class into the Inventory class as it is
  unlikely to need to support multiple versions
* Simplify the ModPack/Mod/ModVersion interfaces by replacing the use
  of various "helper" methods with equivalent use of more generic
  methods
* Update the various methods of ModPack/Mod/ModVersion to be able to
  work with qualified or unqualified ItemSlugs
* Remove the unused BaseCollection class
* Add tests for ItemSlug and update all other tests to reflect
  all the other changes
2015-02-18 10:30:53 -08:00
Andrew Miner 8804605d99 Make Recipe a child of ModVersion, not Item 2015-02-15 19:01:16 -08:00
Andrew Miner 380a78ef61 Qualify all item slugs to the mod which adds them #53
* Change default item URL to fall under /mod/<mod slug>/<item slug>
  but kept the old URL pattern around with the old behavior (i.e.,
  find the first item with that slug)
* Update Item to have a `qualifiedSlug` property which combines the
  item's own slug with its Mod's slug.  Updated a lot of code all
  over to use this in preference to the plain slug.
* Add a `localizeTo` method to Inventory to allow non-qualified slugs
  to be converted into qualified slugs within the inventory's stacks
* Update ModPack to work with either qualified or unqualified slugs
  for relevant methods
* Fix model state changes to happen before related events are
  triggered
* Add a debounce to the CraftingPlan object when triggering a recraft
  due to changes in related objects (esp. its inventories)
* Update the Inventory's sort to keep items sorted by mod before name
  with the Minecraft items sorted to the top
* Fix `ModPack.findItemByName` to actually recursively use the Mod's
  method instead of slugifying the given name and looking for the
  slug (since this won't necessarily work anymore).
* Ensure each Mod is assigned a reference to its containing ModPack
* Fix NameFinder to only consider an item non-gatherable if it is
  also craftable
* Update ModVersionParserV1 to assign qualified slugs to recipes
  for any items which are in the same mod (leaving any other slugs
  unqualified)
* Add Underscore mixins for composing and decomposing slugs
* Update old tests for the use of qualified slugs, and some new tests
  for the new methods added
2015-02-10 17:56:02 -08:00
Andrew Miner 7ee0b55411 Add tests for the Recipe model 2015-01-28 09:59:35 -08:00
Andrew Miner 164c0d4892 Add nascent version of the mod detail page
* Create a nascent version of the mod detail page
* Make the slug mandatory for Mod instead of name, and load the name
  from the data file
* Make the Feedback view universal on all pages
* Refactor the use of mod pack to have a single global object at the
  router level which is shared between pages. Further, make this one
  object load itself immediately and have it automatically load any
  activated mod version
* Refactor the use of Storage related to mod pack versions into the
  router as well.
* Add trace logging back in for events, but allow individual classes
  to suppress it (as opposed to actually supressing the events)
* Fix a bug in ModVersion.eachItem where it would suggest so-called
  items which are merely registered slugs without associated items
2015-01-20 10:55:38 -08:00
Andrew Miner 83868e2760 Massive refactoring to clean up models
* Tweak style of quantity label in output box to be more visible
* Move data files for all mods under a directory for the specific
  version of the mod
* Add a `silent` property to the base model to prevent models which
  shouldn't be observed from emitting events
* Change the term "itemSlug" to just "slug" across the board
* Change all models so that they don't require their parent in their
  constructors and so that they don't automatically add themselves to
  their parents lists
* Remove a bunch of unnecessary event triggering
* Tighten up access to various lists of children across all models
* Refactor the guts of the V2 parser into an abstract base class so
  it can be used for other parsers in the future
* Remove a number of unused methods
2015-01-17 11:49:07 -08:00
Andrew Miner 89a8e2b539 Add V2 file format 2015-01-14 15:19:02 -08:00
Andrew Miner a784f275ff Add back the "include tools" option
* Rewrite the crafting algorithm to recursively find all the steps
  involved and then resolve how many times each needs to be run.
* Update the base controller to debounce calls to refresh
* Fix a few erroneous recipes for IC2-Classic
2015-01-11 16:01:51 -08:00
Andrew Miner f5681a84aa Fix default patterns to not be recorded 2015-01-10 02:16:38 -08:00
Andrew Miner b8d60ac245 Add shaped crafing and recipes for MC 1.7.10 2015-01-08 22:01:02 -08:00
Andrew Miner fb3db0f393 Add in next/prev buttons for crafting table 2015-01-08 12:34:33 -08:00
Andrew Miner 9424af9d84 Initial version of the new crafting table 2015-01-08 11:03:43 -08:00
Andrew Miner 206973e304 Update header comments 2015-01-05 06:42:05 -08:00
Andrew Miner 0d25ac723d Complete refactoring to move Recipes into Items
* Changed "version" to "dataVersion" in data format
* Changed the "modName" and "modVersion" fields on the ModVersion
  class to remove the "mod" prefix and changed the data format to
  match
* Change the Stack class to use the itemSlug instead of the item
  itself
* Update the ModVersion and ModPack classes to include methods for
  recording a correspondence between slugs and names. Update code
  which displays items from stacks to use these methods to determine
  display names.
* Add a reference from Recipe back to the item it creates
2015-01-03 20:08:11 -08:00
Andrew Miner b642c51486 wip 2015-01-02 23:03:06 -08:00
Andrew Miner a265383630 Update Minecraft recipebook with more recipes 2015-01-01 11:06:25 -08:00
Andrew Miner 1a84ce2e28 Complete basic crafting functionality 2014-12-24 19:17:37 -08:00
Andrew Miner 95c15abe10 Added CraftingTable* components and UI 2014-12-23 20:26:36 -08:00
Andrew Miner 16832e02dd Step 1 in converting to a Backbone-based website 2014-12-22 16:36:04 -08:00