Skip to content

Commit

Permalink
[#3441] Removed leading / on css url() and on icon in config.mjs
Browse files Browse the repository at this point in the history
There was an issue where a leading slash (/) was causing the url() css to use a absolute url path instead of a relative path. This worked without a routePrefix because the url path was the same if for both absolute and relative, however with a routePrefix we need to preserve the prefix, this was done by removing the leading slash for icons paths and in the case of a less defined url a leading ../../ was added to remove the /systems/dnd5e/ that would be added to the relative path.
Closes #3441
  • Loading branch information
Hoppyhob committed May 18, 2024
1 parent 9218e49 commit 12dbf51
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion less/v2/character.less
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/* ---------------------------------- */

&.minimized {
background: url("/ui/denim075.png");
background: url("../../ui/denim075.png");
border: unset;

> header {
Expand Down
2 changes: 1 addition & 1 deletion less/v2/dark/character.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
&:not(.minimized) { background: none; }

.window-content {
background: var(--dnd5e-color-dark-gray) url("/ui/denim075.png");
background: var(--dnd5e-color-dark-gray) url("../../ui/denim075.png");

&::before {
content: "";
Expand Down
2 changes: 1 addition & 1 deletion module/applications/actor/character-sheet-2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export default class ActorSheet5eCharacter2 extends ActorSheet5eCharacter {
// Character Background
context.creatureType = {
class: details.type.value === "custom" ? "none" : "",
icon: CONFIG.DND5E.creatureTypes[details.type.value]?.icon ?? "/icons/svg/mystery-man.svg",
icon: CONFIG.DND5E.creatureTypes[details.type.value]?.icon ?? "icons/svg/mystery-man.svg",
title: details.type.value === "custom"
? details.type.custom
: CONFIG.DND5E.creatureTypes[details.type.value]?.label,
Expand Down
28 changes: 14 additions & 14 deletions module/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -709,90 +709,90 @@ DND5E.creatureTypes = {
aberration: {
label: "DND5E.CreatureAberration",
plural: "DND5E.CreatureAberrationPl",
icon: "/icons/creatures/tentacles/tentacle-eyes-yellow-pink.webp",
icon: "icons/creatures/tentacles/tentacle-eyes-yellow-pink.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.yy50qVC1JhPHt4LC",
detectAlignment: true
},
beast: {
label: "DND5E.CreatureBeast",
plural: "DND5E.CreatureBeastPl",
icon: "/icons/creatures/claws/claw-bear-paw-swipe-red.webp",
icon: "icons/creatures/claws/claw-bear-paw-swipe-red.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.6bTHn7pZek9YX2tv"
},
celestial: {
label: "DND5E.CreatureCelestial",
plural: "DND5E.CreatureCelestialPl",
icon: "/icons/creatures/abilities/wings-birdlike-blue.webp",
icon: "icons/creatures/abilities/wings-birdlike-blue.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.T5CJwxjhBbi6oqaM",
detectAlignment: true
},
construct: {
label: "DND5E.CreatureConstruct",
plural: "DND5E.CreatureConstructPl",
icon: "/icons/creatures/magical/construct-stone-earth-gray.webp",
icon: "icons/creatures/magical/construct-stone-earth-gray.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.jQGAJZBZTqDFod8d"
},
dragon: {
label: "DND5E.CreatureDragon",
plural: "DND5E.CreatureDragonPl",
icon: "/icons/creatures/abilities/dragon-fire-breath-orange.webp",
icon: "icons/creatures/abilities/dragon-fire-breath-orange.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.k2IRXZwGk9W0PM2S"
},
elemental: {
label: "DND5E.CreatureElemental",
plural: "DND5E.CreatureElementalPl",
icon: "/icons/creatures/magical/spirit-fire-orange.webp",
icon: "icons/creatures/magical/spirit-fire-orange.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.7z1LXGGkXpHuzkFh",
detectAlignment: true
},
fey: {
label: "DND5E.CreatureFey",
plural: "DND5E.CreatureFeyPl",
icon: "/icons/creatures/magical/fae-fairy-winged-glowing-green.webp",
icon: "icons/creatures/magical/fae-fairy-winged-glowing-green.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.OFsRUt3pWljgm8VC",
detectAlignment: true
},
fiend: {
label: "DND5E.CreatureFiend",
plural: "DND5E.CreatureFiendPl",
icon: "/icons/magic/death/skull-horned-goat-pentagram-red.webp",
icon: "icons/magic/death/skull-horned-goat-pentagram-red.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.ElHKBJeiJPC7gj6k",
detectAlignment: true
},
giant: {
label: "DND5E.CreatureGiant",
plural: "DND5E.CreatureGiantPl",
icon: "/icons/creatures/magical/humanoid-giant-forest-blue.webp",
icon: "icons/creatures/magical/humanoid-giant-forest-blue.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.AOXn3Mv5vPZwo0Uf"
},
humanoid: {
label: "DND5E.CreatureHumanoid",
plural: "DND5E.CreatureHumanoidPl",
icon: "/icons/magic/unholy/strike-body-explode-disintegrate.webp",
icon: "icons/magic/unholy/strike-body-explode-disintegrate.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.iFzQs4AenN8ALRvw"
},
monstrosity: {
label: "DND5E.CreatureMonstrosity",
plural: "DND5E.CreatureMonstrosityPl",
icon: "/icons/creatures/abilities/mouth-teeth-rows-red.webp",
icon: "icons/creatures/abilities/mouth-teeth-rows-red.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.TX0yPEFTn79AMZ8P"
},
ooze: {
label: "DND5E.CreatureOoze",
plural: "DND5E.CreatureOozePl",
icon: "/icons/creatures/slimes/slime-movement-pseudopods-green.webp",
icon: "icons/creatures/slimes/slime-movement-pseudopods-green.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.cgzIC1ecG03D97Fg"
},
plant: {
label: "DND5E.CreaturePlant",
plural: "DND5E.CreaturePlantPl",
icon: "/icons/magic/nature/tree-animated-strike.webp",
icon: "icons/magic/nature/tree-animated-strike.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.1oT7t6tHE4kZuSN1"
},
undead: {
label: "DND5E.CreatureUndead",
plural: "DND5E.CreatureUndeadPl",
icon: "/icons/magic/death/skull-horned-worn-fire-blue.webp",
icon: "icons/magic/death/skull-horned-worn-fire-blue.webp",
reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.D2BdqS1GeD5rcZ6q",
detectAlignment: true
}
Expand Down

0 comments on commit 12dbf51

Please sign in to comment.