Commit Graph
9 Commits
Author SHA1 Message Date
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 ea86e17d31 Change test description to isolate files better 2015-01-28 10:27:28 -08:00
Andrew Miner d1621bb9f6 Refactor ModVersion into Mod and ModVersion
* Remove V1 of the mod version parser and shift V2 up to be V1
* Add a parser for mod.cg files, and refactor the the mod-version.cg
  files to push the appropriate content up to the mod.cg
* Remove the concept of "silent" from BaseModel along with logging
  each event as they are fired (which is what really prompted the
  need for it in the first place)
* Move use of the Storage class to be completely the province of the
  controllers most closely related to models affected
* Convert the ModVersionController to the ModController and have it
  take on responsibility for choosing the mod version
* Update BaseModel to support simple accessors for the current state
* Update CraftingPlan to be able to remove uncraftable items
* Implement the Mod model
2015-01-18 10:48:12 -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 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 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