Commit graph

42 commits

Author SHA1 Message Date
Kim Mantas
0996cf810c
[#51] Fix deprecation warning when creating a new actor/item. 2023-05-16 13:22:14 +01:00
Kim Mantas
73addd7866
[#41] [#50] Fix manifest issues. Fix TYPES deprecation warning. Bump v11 compatibility. 2023-05-16 12:44:09 +01:00
Matt Smith
3343d3bf6c
Fix v10 bug for shorthand attributes (#52)
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
2022-10-20 16:39:10 +01:00
Andrew
e23893b6ca V10 compatibility with 0.7.0-alpha1 release 2022-08-23 21:23:59 -04:00
fyorl
297cce85ec
[#40] Fix issue with using non-resource type attributes for token bars. 2022-01-17 16:51:03 +00:00
fyorl
9b19f8b590
[#32] Draw available tracked resources from world actors rather than system model. 2022-01-13 15:14:37 +00:00
fyorl
db34d156af
[#27] Do not throw an error when dropping an item onto a hotbar slot. 2022-01-13 13:31:46 +00:00
fyorl
d799fb1c56
[#25] Ensure resource attribute values are clamped between their min and max. Ensure token attribute update deltas are applied correctly to resource attributes. Draw attribute bars appropriately when attribute min is non-zero. 2022-01-13 13:31:41 +00:00
Matt Smith
6eee073a24 28: Fix issue with reserved groups 2022-01-12 17:44:20 +00:00
Lich
e723598a6c 37: Fix custom attribute token bars being marked as not editable in token HUD 2022-01-05 18:42:52 +00:00
fyorl
e8aa4a462e
[#36] Fix incorrect variable reference. 2021-12-21 14:19:14 +00:00
fyorl
84562bd9c2
[#35] Use different ID attributes for sidebar documents depending on foundry version. 2021-12-13 17:16:03 +00:00
fyorl
e966775723
Update for v9 compatibility. 2021-12-13 15:45:53 +00:00
Andrew
fb0add4cbc Update Simple Worldbuilding for Foundry 0.8.x Compatibility 2021-05-23 19:35:02 -04:00
Andrew
ee8814b76a Remove outdated GPLv3 License tag from the code header 2021-05-03 10:01:22 -04:00
Matt Smith
b385af307a 22: Refactor roll attributes in helper class
- Updated `rollData` in helper.js to use actor as the data source rather
  than the object. This allows for items to reference attributes by
  assuming the parent actor is the source of truth and item attributes
  would be referenced as either `@item.attr` or `@items.ITEMNAME.attr`
- Refactored formula replacement to prevent values from being replaced
  with 0s unintentionally.
2020-10-30 10:21:58 -05:00
Andrew
5560fc24d4 Simplify macro creation for formula attributes 2020-10-19 18:30:53 -07:00
Andrew
6bf056b3d4 Tidy the worldbuilding system for 0.40 release 2020-10-19 17:34:32 -07:00
Matt Smith
8daec8bd92 Add support for Foundry 0.7.3
- Fixed an issue with the actor/item creation dialog that prevented
  it from working on Foundry 0.7.x versions.
- Removed obsolete translation string.
- Bumped minimum core version now that 0.7.3 is in beta.
2020-10-09 19:49:56 -05: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
00dfec6014 8: Refactor formula attributes
- Divided getRollData() into several helper methods to make it more
  organized.
- Cleaned up usage of shorthand checks, but haven't entirely
  consolidated them yet. There's room to improve this, but further
  consolidation would likely require a regex to handle mapping inline
  roll syntax in the formulas to use the `@attr.KEY.value` format when
  `@KEY` is detected. This seemed like a solid compromise for now.
- Refactored the _replaceData() helper method to match the Roll class'
  upcoming syntax, and added TODO comments to replace them once it's
  ready.
2020-08-09 15:30:04 -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
Matt Smith
ba02ddee4f Add customizable initiative. 2020-07-27 18:14:08 +00:00
Norman J. Harman Jr
a534ff133c System name is worldbuilding not dnd5e
Guessing the dnd5e was copy paste typo.
2020-05-26 03:07:29 -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
c3402a0acf Update the simple worldbuilding system for new manifest properties and to allow decimal initiative 2020-03-02 20:34:14 -08: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