foundryvtt-dcc / dcc

Foundry Tabletop System for Dungeon Crawl Classics RPG
MIT License
32 stars 20 forks source link

d20-black.svg does not respect routePrefix in Foundry Config #204

Closed algnc closed 3 years ago

algnc commented 3 years ago

A user is using routePrefix in order to run his Foundry on a reverse proxy in a directory instead of at the root of his web server. i.e.:

https://www.gameserver.com/game1

Everything works except he gets a 404 for d20-black.svg, which shows up in CSS: dcc.css: background-image: url("/icons/svg/d20-black.svg"); dcc.css: background-image: url("/icons/svg/d20-black.svg"); dcc.css: background-image: url("/icons/svg/d20-black.svg"); dcc.scss: background-image: url("/icons/svg/d20-black.svg"); dcc.scss: background-image: url("/icons/svg/d20-black.svg"); dcc.scss: background-image: url("/icons/svg/d20-black.svg");

Foundry core will display all his images, and it seems like all his other images display OK from our module, but d20-black.svg 404s with:

https://my.game.server/icons/svg/d20-black.svg

cyface commented 3 years ago

I did some testing, and if we change the stylesheet to:

../../../icons/svg/d20-black.svg

It seems to work, and not require anything too fancy.

Looking at the Foundry Core Stylesheets, that's how they are doing it:

.dice-tooltip .dice-rolls .roll.d20 {
  background-image: url("../icons/svg/d20-grey.svg");
}

(we have to add a couple extra .. since we're running in a module)

algnc commented 3 years ago

user tested Tim's fix and it worked.

cyface commented 3 years ago

I pushed this fix into developer-.024

futurekill commented 3 years ago

Awesome! Thanks guys!