wintersleepAI / foundry-swnr

Stars Without Number: Revised for Foundry VTT
GNU Affero General Public License v3.0
31 stars 21 forks source link

Drone and Ship Fittings intermingled (dev-1.0) #33

Closed thebwt closed 1 year ago

thebwt commented 1 year ago

Howdy!

When we go to search for fittings to add to a drone sheet, we see the starship fittings as well. image

The inverse is true when adding them to ships image

It's certainly not game-breaking by any means, but figured I'd file it away.

thebwt commented 1 year ago

I'm digging into this, I've gotten the styling fixed with a simple https://github.com/thebwt/foundry-swnr/commit/d408027bc168ad2f808faa6082c929a7a2b0949f

Working through limiting the fitting types to ones that match the actor type...

thebwt commented 1 year ago

I actually now hate that fix because it'd need top be applied to every select in the table... There's got to be a more general way to do it.

thebwt commented 1 year ago

Back to the actual problem: fitting filtering we actually have a data.type already in the model. I'm trying to see if that can be passed to the search thing as a filter, but i'm kinda worried about this ominous warning

commons.js:1703 Error: You are accessing the SWNRDroneActor#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.

I'm worried because the fitting item model has a root level type of shipFitting and I'm betting we'll have a collision with the fancy subtype of drone|mech|ship

thebwt commented 1 year ago

okay think i've got this done in #34

wintersleepAI commented 1 year ago

The warning has to do with a major change in v10 of the data model. The old one is supported until v12 or v11, but it will complain a lot. Once the change is made though the system will not be compatible with v9. So waiting a little bit.

wintersleepAI commented 1 year ago

resolved in your PR!