zeel01 / monarch

A Foundry VTT card UI fit for royalty
MIT License
12 stars 6 forks source link

Card images in Hand break for non-local paths #19

Closed chgrimmett closed 2 years ago

chgrimmett commented 2 years ago

Card images that come from web urls do not display in Hands.

Steps to Reproduce

  1. Create a new Hand, Deck and a Card in that deck, all with the Monarch sheet type.
  2. Set the back image of the card to a url that leads to an image file and save.
  3. Add the card to the hand. Expected: The image will show normally in the hand. Actual: The card in hand is a blank box, opening the Card itself shows the image as normal.

Cause

In templates/monarch-hand.hbs '/' is prepended to the url of the card image. Removing that breaks it for local file paths. <div class="card" data-card-id="{{card.id}}" style="--card-image: url(/{{card.img}})">