Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ActiveEffect support #1215

Open
20 of 35 tasks
wrycu opened this issue Mar 6, 2023 · 5 comments
Open
20 of 35 tasks

Enable ActiveEffect support #1215

wrycu opened this issue Mar 6, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@wrycu
Copy link
Collaborator

wrycu commented Mar 6, 2023

The system was designed and built well before ActiveEffects were added to Foundry.

Investigate undoing the custom stuff that's been built and replacing it with ActiveEffects.

I'm not entirely sure what benefits this will bring to the system except that it should simplify the code. This should also be investigated, I suppose.


Updated todo list for support:

  • basic support for:
    • species
    • itemattachments
    • itemmodifiers
    • weapons
    • armor
    • ship weapons
    • ship attachments
    • talents
    • specializations
    • force powers
    • gear
    • ability?
    • signature ability
    • critical damage
    • critical injury
  • Re-introduce restrictions for selected types
  • Re-add broken encumbrance and other rule checks
  • Update all items to use new UI style for editing embedded items
  • Enable support for editing embedded AEs/items
  • Resolve TODOs
  • Remove console.log()'s
  • Improve error handling and user notification
  • Refactor new UI to use localization
  • Validate that code operates when not set to English
  • Refactor to move AE logic into a shared location (e.g. config)
  • Look into token status-based AEs
  • Handle world migration
  • Fix unintentional XSS in new tooltips
  • Update chat message to include new information
  • Remove new, temporarily-introduced test_itemattachment and test_itemmodifier item types
  • Update modifier_type selection to not be dumb on a bunch of items
  • Add roll mods?
  • Update templates:
    • Ship weapons cannot have attachments
@wrycu wrycu added the enhancement New feature or request label Mar 6, 2023
@wrycu wrycu self-assigned this Mar 6, 2023
@wrycu
Copy link
Collaborator Author

wrycu commented Mar 10, 2023

okay, so far I've got a mod which can contain system-level active effects (VERY WIP UI - basically just enough to let me test functionality)

image

and I'm playing around with transferring those items to an attachment

image

next up is:

  • modify mods going onto attachments to create a mod note, with a list of effects per mod (instead of only transferring the effects)
  • permit creating mods directly from the attachment
  • work on creating active effects on items when attachments get dropped on them
  • permit defining active effects directly on items

Once these items are done, I'll need to review mods/attachments and see if this is a case where active effects should be pre-defined or custom-defined; how flexible the UI needs to be, etc. After that I'll make a decision around if this is something I can handle or not.

@wrycu
Copy link
Collaborator Author

wrycu commented Mar 15, 2023

so, it turns out that step one of my lovely bullet list above is harder than I thought - getFormData or whatever simply returns an array of objects from the form, making it impossible to determine which effects are a part of which mod. I'll think on it some more (likely will need to embed the ID in each input field and customize the function)

wrycu added a commit that referenced this issue Apr 19, 2023
* this commit contains two major changes
* change 1 - it converts the "species" item type over to use ActiveEffects exclusively (and makes underlying changes to use these ActiveEffects on the PC Actor type)
* change 2 - it removes deep item embeds from mods and attachments (in other words, adding a mod to an attachment now creates a copy of the mod item, not a pointer to the original item)
    * this change is in prep for converting mods and attachments over to active effects
    * additionally, it begins to move away from the outdated, antipattern of deep item embeds (items linking to items linking to items)

#1215
wrycu added a commit that referenced this issue May 9, 2023
* adds basic, WIP AE support for weapons
* changes the data structure for embedding item attachments on weapons, item mods on attachments, and modifiers on mods
* changes the display for item attachments on weapons
* changes the edit UI for item attachments on weapons

#1215
@wrycu
Copy link
Collaborator Author

wrycu commented May 9, 2023

The above commits modifies how attachments are viewed when they're embedded onto a weapon. There are two views. First is a summary view (opened by hovering over the attachment):

image

and second is a detailed view (opened by hovering over the newly-added question mark on the attachment)

image

Since this data is now directly embedded onto the weapon, we can no longer easily use the old edit view wherein you click it and it opens the normal attachment window. Instead, clicking the attachment opens a new window:

image

Saving this submits the data back to the weapon and updates any appropriate ActiveEffects.

NOTE that this functionality is very basic. I made essentially no effort to skin it to look pretty (e.g. the description is a plaintext box instead of a rich text editor) - making it more than barebones functional is a thing for the future.

@wrycu wrycu changed the title Investigate the usage of ActiveEffects Enable ActiveEffect support May 9, 2023
wrycu added a commit that referenced this issue May 11, 2023
* extends WIP active effect implementation and direct item embedding for weapon qualities

#1215
wrycu added a commit that referenced this issue May 14, 2023
* extends WIP active effect implementation and direct item embedding for armor

#1215
wrycu added a commit that referenced this issue May 14, 2023
wrycu added a commit that referenced this issue May 14, 2023
* add embedded item support for vehicle weapons and attachments

#1215
wrycu added a commit that referenced this issue May 19, 2023
* add embedded item support for specializations

#1215
wrycu added a commit that referenced this issue May 19, 2023
* add embedded item support for specializations

#1215
wrycu added a commit that referenced this issue May 19, 2023
* add embedded item support for specializations

#1215
wrycu added a commit that referenced this issue May 20, 2023
wrycu added a commit that referenced this issue May 20, 2023
* add AE support for signature abilities

#1215
wrycu added a commit that referenced this issue May 21, 2023
* create/update encumbrance AEs for gear and armor

#1215
wrycu added a commit that referenced this issue May 23, 2023
* corrected stat going up each time actor sheet with AEs is closed
* synced AEs with "active" checkbox for modifiers
* add support for reducing encumbrance of equipped items

#1215
wrycu added a commit that referenced this issue May 23, 2023
* unify display format for modifiers (which control active effects)
* correct errors when copying empty attachments to weapons

#1215
wrycu added a commit that referenced this issue May 23, 2023
* fix various embed errors for modifiers on attachments

#1215
wrycu added a commit that referenced this issue May 23, 2023
* update encumbrance for gear quantity on actor

#1215
wrycu added a commit that referenced this issue May 23, 2023
* fix updating AEs for items embedded on actors

#1215
wrycu added a commit that referenced this issue May 26, 2023
* re-implement item-based limitations on modifier selections
* remove some dead code

#1215
wrycu added a commit that referenced this issue May 26, 2023
* remove unused/test code
* minor refactors for a few TODOs

#1215
wrycu added a commit that referenced this issue Jun 7, 2023
* correct bug where modifiers could not be directly created on items anymore
* remove unused code
* fix encumbrance AE when multiple items are on an actor

#1215
wrycu added a commit that referenced this issue Jun 7, 2023
* temporarily-comment TODOs which are not mine
* remove some TODOs which are done, no longer relevant, or have specific callouts on the issue

#1215
wrycu added a commit that referenced this issue Jun 7, 2023
* correct showing and submitting embedded descriptions

#1215
wrycu added a commit that referenced this issue Jun 7, 2023
wrycu added a commit that referenced this issue Jun 7, 2023
wrycu added a commit that referenced this issue Jun 7, 2023
@wrycu
Copy link
Collaborator Author

wrycu commented Jan 13, 2025

I'm taking another shot at this. Any commits after this are a new branch of code, unrelated to the above.

TODO:

  • Figure out what modTypeToModMap (in ffg-modifiers.js) should look like
  • the mod type "all" should probably actually include all choices, not just... slightly more choices
  • setting the mod type to "armor" or "vehicle" seems to generate an error, likely the config is incorrect
  • Correct known issues (documented on item-editor.js)
  • Review mandar theme edit, which has a fixed height
  • Correct width on modifications tab
  • Add vertical ownership to modifications in modifications tab
  • Figure out where the new view should go on weapons (it's currently in the secondary tab)
  • Add expand/collapse all button
  • Mod / attachment description click selector is too broad and works on force powers

wrycu added a commit that referenced this issue Jan 13, 2025
* actually gets item attachments working when they are on items
* actually gets mods working when they are on items

#1215
wrycu added a commit that referenced this issue Jan 13, 2025
* port changes to armor

#1215
wrycu added a commit that referenced this issue Jan 13, 2025
* port changes to vehicle stuff

#1215
wrycu added a commit that referenced this issue Jan 13, 2025
* port changes to attachments

#1215
wrycu added a commit that referenced this issue Jan 13, 2025
* port changes to specializations

#1215
wrycu added a commit that referenced this issue Jan 14, 2025
* add vertical ownership
* correct width of modifications tab

#1215
wrycu added a commit that referenced this issue Jan 14, 2025
* update the "configuration" tab icon so it doesn't overlap with "modification" tab
* correct issue where you can't add mods directly to attachments
* correct armor and vehicle mod values
* expand "all" mod values selection

#1215
wrycu added a commit that referenced this issue Jan 17, 2025
* make "attributes" the default tab for all sheets which have it

#1215
wrycu added a commit that referenced this issue Jan 17, 2025
* correct CSS selector for expanding quality and attachment description

#1215
wrycu added a commit that referenced this issue Jan 18, 2025
* fix missing class for qualities from attachments preventing expanding it inline

#1215
wrycu added a commit that referenced this issue Jan 18, 2025
* add a warning that changing the attachment or mod "type" will change the values of mods

#1215
wrycu added a commit that referenced this issue Jan 19, 2025
* add a note that you can drag-and-drop

#1215
wrycu added a commit that referenced this issue Jan 22, 2025
* combine qualities from on-weapon and attachments
* adjust icons
* correct talent submission bug

#1215
wrycu added a commit that referenced this issue Jan 22, 2025
* move vehicle weapon price to top row (like weapon price)

#1215
wrycu added a commit that referenced this issue Jan 22, 2025
* correct issue with new editor not updating talents
* remove legacy talent-syncing code
* correct "activation" not updating the label on specialization window

#1215
wrycu added a commit that referenced this issue Jan 22, 2025
* correct issue where changing any dropdown visually reverts previous changes in the embedded item editor

#1215
@wrycu
Copy link
Collaborator Author

wrycu commented Jan 23, 2025

Okay, this prework has been done. I'll take a shot at active effects once the work done above has been actually released and confirmed to be working (to minimize untested changes going in at once.)

@wrycu wrycu modified the milestone: 1.906 Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant