Commit graph

20 commits

Author SHA1 Message Date
Andrew
6bf056b3d4 Tidy the worldbuilding system for 0.40 release 2020-10-19 17:34:32 -07:00
Matt Smith
8b958dd232 10: Refactor actor sheet code
- Refactored actor-sheet.js to move most of its logic into a separate
  helper.js module as static methods on a new SimpleHelper class. This
  doesn't add anything functional at the moment, but it's in
  preparation of re-using the same code for the item-sheet.js file.
2020-10-06 17:20:00 +00:00
Andrew
8a2ba78203 Ensure worldbuilding changes are working on legacy worldbuilding world and adjust attribute form styling 2020-09-28 09:21:11 -07:00
Matt Smith
f69e3841ff 10: Add attribute groups base implementation
- Added support for attribute groups
- Added rollable buttons to formula attributes
- Added additional i18n translation strings
2020-09-28 15:54:14 +00:00
Matt Smith
bac1d023c3 9: Add POC for actor templates
- This commit adds a proof-of-concept for retrieving actor template
  types. These are actors using the `worldbuilding.isTemplate` flag set
  to true. If there are multiple actors with that flag set to true,
  clicking the create actor button will pull up a prompt to choose from
  one of those types, which will then create an actor by duplicating
  the template actor's data. The flag will be unset on the new actor.
2020-08-31 02:09:21 +00:00
Matt Smith
50041d510c 12: Add resource attribute type
- Added a resource attribute type to both actors and items with the keys
  min, value, and max.
- Added translation strings for the sublabels on resources.
2020-08-22 12:49:52 -05:00
Andrew
9bb368d9e2 Merge branch '14-item-rolls' 2020-08-09 20:51:49 -07:00
Andrew
ef009146f2 Merge branch '3-fix-add-remove-attr' into 'master'
3: Fix issue with adding and removing attributes

Closes #3

See merge request foundrynet/worldbuilding!6
2020-08-10 03:47:14 +00:00
Matt Smith
a490448a15 9: Add formula (derived) attributes
- Added a new "Formula" attribute type for both actors and items.
- When iterating through attributes, formula attributes are noted in an
  array so that they can be iterated through in a second pass to
  evaluate their referenced attributes. The second iteration just
  handles attribute replacement rather than rolling the formula, that's
  deferred until the attributes are used in an actual roll formula.
- Items also have the same behavior. If an attribute isn't on the item,
  it will fall back to check the parent actor instead.
- Likely areas with issues would be formula attributes that reference
  other formula attributes, or item formula attributes that reference
  actor formula attributes.
2020-08-10 03:42:55 +00:00
Matt Smith
d0ec294164 3: Fix issue with adding and removing attributes
- Applied patch by @imposeren to handle bug with removing and adding
  attributes. This patch resolves the issue by refactoring the attribute
  creation logic to use loop to choose a safer default attribute key
  before creation.
2020-08-09 21:03:17 -05:00
Matt Smith
9ae2cce47a 14: Tweak styles, tweak roll template
- Adjusted styles of item buttons.
- Fixed an issue with item buttons when not using shorthand syntax.
- Updated the `roll.toMessage()` call to include the player/actor name
  and the item/attribute name.
2020-08-09 20:25:48 -05:00
Matt Smith
786d4095a9 8: Add rolls to items on actor sheets
- Utilized the revisions made to roll syntax to allow for rollable
  buttons on item lists on actor sheets. Rolls are evaluated using
  `@items.ITEM.KEY`, where ITEM is the item name (slugified), and KEY is
  an attribute key for a formula attribute.
2020-08-09 16:37:16 -05:00
Matt Smith
7c676b14ee 9: Add formula (derived) attributes
- Added a new "Formula" attribute type for both actors and items.
- When iterating through attributes, formula attributes are noted in an
  array so that they can be iterated through in a second pass to
  evaluate their referenced attributes. The second iteration just
  handles attribute replacement rather than rolling the formula, that's
  deferred until the attributes are used in an actual roll formula.
- Items also have the same behavior. If an attribute isn't on the item,
  it will fall back to check the parent actor instead.
- Likely areas with issues would be formula attributes that reference
  other formula attributes, or item formula attributes that reference
  actor formula attributes.
2020-08-06 23:21:15 -05:00
Andrew
d66a64b939 Update the Simple Worldbuilding system for compatibility with 0.5.6 2020-05-12 18:08:48 -07:00
Andrew
d405a18f53 Improve Simple Worldbuilding sheet layout and macro syntax 2020-04-18 16:14:51 -07:00
Andrew
57b5be22dc Update SWB system for FVTT version 0.5.2 2020-03-30 20:49:30 -07:00
Andrew
be0c47da58 Display an error if trying to save custom attributes with dot notation 2019-11-20 20:45:33 -08:00
Andrew
96b677434b Remove usage of fromEntries 2019-11-18 21:44:02 -08:00
Andrew
fc8331c13c Remove public prefix from system template paths. 2019-11-14 16:42:16 -08:00
Andrew
f8c8e8c731 Initial commit of simple worldbuilding system to standalone repo 2019-11-13 19:39:05 -08:00