feat: icônes SVG art-déco pour tous les types d'item + icônes par défaut
- aspect.svg : diamant à facettes avec coupe brillant et reflet - equipment.svg : clé vintage ornée avec tête circulaire et dents géométriques - preCreateItem hook : définit img par défaut par type d'item Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
39
assets/icons/aspect.svg
Normal file
39
assets/icons/aspect.svg
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||||
|
<!-- Fond -->
|
||||||
|
<rect width="100" height="100" rx="10" fill="#1b3828"/>
|
||||||
|
<rect x="2.5" y="2.5" width="95" height="95" rx="8" fill="none" stroke="#c49a1a" stroke-width="1.5"/>
|
||||||
|
|
||||||
|
<!-- Grand diamant principal -->
|
||||||
|
<polygon points="50,8 84,50 50,92 16,50" fill="#0d1f14" stroke="#ddb84a" stroke-width="2"/>
|
||||||
|
|
||||||
|
<!-- Facette table (centre) -->
|
||||||
|
<polygon points="50,24 68,50 50,76 32,50" fill="#1b3828" stroke="#c49a1a" stroke-width="1.2"/>
|
||||||
|
|
||||||
|
<!-- Lignes de facettes — coupe brillant -->
|
||||||
|
<!-- Facettes supérieures gauche / droite -->
|
||||||
|
<line x1="50" y1="8" x2="32" y2="50" stroke="#c49a1a" stroke-width="1"/>
|
||||||
|
<line x1="50" y1="8" x2="68" y2="50" stroke="#c49a1a" stroke-width="1"/>
|
||||||
|
<!-- Facettes inférieures -->
|
||||||
|
<line x1="50" y1="92" x2="32" y2="50" stroke="#c49a1a" stroke-width="1"/>
|
||||||
|
<line x1="50" y1="92" x2="68" y2="50" stroke="#c49a1a" stroke-width="1"/>
|
||||||
|
<!-- Facettes latérales -->
|
||||||
|
<line x1="16" y1="50" x2="32" y2="50" stroke="#ddb84a" stroke-width="0.8"/>
|
||||||
|
<line x1="84" y1="50" x2="68" y2="50" stroke="#ddb84a" stroke-width="0.8"/>
|
||||||
|
<!-- Arêtes intermédiaires sup -->
|
||||||
|
<line x1="50" y1="8" x2="16" y2="50" stroke="#ddb84a" stroke-width="0.8" opacity="0.6"/>
|
||||||
|
<line x1="50" y1="8" x2="84" y2="50" stroke="#ddb84a" stroke-width="0.8" opacity="0.6"/>
|
||||||
|
<!-- Arêtes intermédiaires inf -->
|
||||||
|
<line x1="50" y1="92" x2="16" y2="50" stroke="#ddb84a" stroke-width="0.8" opacity="0.6"/>
|
||||||
|
<line x1="50" y1="92" x2="84" y2="50" stroke="#ddb84a" stroke-width="0.8" opacity="0.6"/>
|
||||||
|
|
||||||
|
<!-- Reflet lumineux (facette haute gauche) -->
|
||||||
|
<polygon points="50,8 32,50 41,29" fill="#ddb84a" opacity="0.35"/>
|
||||||
|
|
||||||
|
<!-- Petites étoiles déco aux 4 coins -->
|
||||||
|
<g fill="#c49a1a" opacity="0.6">
|
||||||
|
<polygon points="8,8 10,11 8,14 6,11" />
|
||||||
|
<polygon points="92,8 94,11 92,14 90,11"/>
|
||||||
|
<polygon points="8,92 10,89 8,86 6,89" />
|
||||||
|
<polygon points="92,92 94,89 92,86 90,89"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
39
assets/icons/equipment.svg
Normal file
39
assets/icons/equipment.svg
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||||
|
<!-- Fond -->
|
||||||
|
<rect width="100" height="100" rx="10" fill="#1b3828"/>
|
||||||
|
<rect x="2.5" y="2.5" width="95" height="95" rx="8" fill="none" stroke="#c49a1a" stroke-width="1.5"/>
|
||||||
|
|
||||||
|
<!-- Tête de clé — anneau circulaire extérieur -->
|
||||||
|
<circle cx="38" cy="33" r="22" fill="#0d1f14" stroke="#c49a1a" stroke-width="2"/>
|
||||||
|
<!-- Évidement intérieur -->
|
||||||
|
<circle cx="38" cy="33" r="13" fill="#1b3828" stroke="#c49a1a" stroke-width="1.2"/>
|
||||||
|
<!-- Détails art-déco sur la tête (petits traits rayonnants) -->
|
||||||
|
<g stroke="#ddb84a" stroke-width="1" opacity="0.6">
|
||||||
|
<line x1="38" y1="12" x2="38" y2="16"/>
|
||||||
|
<line x1="38" y1="50" x2="38" y2="54"/>
|
||||||
|
<line x1="17" y1="33" x2="21" y2="33"/>
|
||||||
|
<line x1="55" y1="33" x2="59" y2="33"/>
|
||||||
|
<line x1="23" y1="18" x2="26" y2="21"/>
|
||||||
|
<line x1="53" y1="18" x2="50" y2="21"/>
|
||||||
|
<line x1="23" y1="48" x2="26" y2="45"/>
|
||||||
|
<line x1="53" y1="48" x2="50" y2="45"/>
|
||||||
|
</g>
|
||||||
|
<!-- Ornement central dans l'évidement (losange) -->
|
||||||
|
<polygon points="38,26 43,33 38,40 33,33" fill="none" stroke="#c49a1a" stroke-width="1"/>
|
||||||
|
<circle cx="38" cy="33" r="3" fill="#ddb84a"/>
|
||||||
|
|
||||||
|
<!-- Tige de la clé -->
|
||||||
|
<rect x="34" y="53" width="8" height="38" rx="2" fill="#c49a1a"/>
|
||||||
|
<!-- Séparations décoratives sur la tige -->
|
||||||
|
<line x1="34" y1="63" x2="42" y2="63" stroke="#1b3828" stroke-width="1.2"/>
|
||||||
|
<line x1="34" y1="73" x2="42" y2="73" stroke="#1b3828" stroke-width="1.2"/>
|
||||||
|
|
||||||
|
<!-- Panneton — dents géométriques art-déco -->
|
||||||
|
<rect x="42" y="65" width="10" height="5" rx="1" fill="#c49a1a"/>
|
||||||
|
<rect x="42" y="75" width="14" height="5" rx="1" fill="#c49a1a"/>
|
||||||
|
<rect x="42" y="85" width="8" height="5" rx="1" fill="#c49a1a"/>
|
||||||
|
|
||||||
|
<!-- Petits ornements symétriques sur le côté gauche de la tige -->
|
||||||
|
<rect x="24" y="65" width="10" height="4" rx="1" fill="#c49a1a" opacity="0.6"/>
|
||||||
|
<rect x="24" y="76" width="10" height="4" rx="1" fill="#c49a1a" opacity="0.6"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -330,8 +330,21 @@ Hooks.on("preCreateItem", (item, data) => {
|
|||||||
aspect: () => game.i18n.localize("TYPES.Item.aspect"),
|
aspect: () => game.i18n.localize("TYPES.Item.aspect"),
|
||||||
equipment: () => game.i18n.localize("TYPES.Item.equipment"),
|
equipment: () => game.i18n.localize("TYPES.Item.equipment"),
|
||||||
}
|
}
|
||||||
|
const defaultIcons = {
|
||||||
|
weapon: "systems/fvtt-celestopol/assets/icons/weapon.svg",
|
||||||
|
armure: "systems/fvtt-celestopol/assets/icons/armure.svg",
|
||||||
|
anomaly: "systems/fvtt-celestopol/assets/icons/anomaly.svg",
|
||||||
|
aspect: "systems/fvtt-celestopol/assets/icons/aspect.svg",
|
||||||
|
equipment: "systems/fvtt-celestopol/assets/icons/equipment.svg",
|
||||||
|
}
|
||||||
|
const updates = {}
|
||||||
const fn = defaultNames[item.type]
|
const fn = defaultNames[item.type]
|
||||||
if (fn && (!data.name || data.name === "New Item" || data.name === item.type)) {
|
if (fn && (!data.name || data.name === "New Item" || data.name === item.type)) {
|
||||||
item.updateSource({ name: fn() })
|
updates.name = fn()
|
||||||
}
|
}
|
||||||
|
const defaultIcon = defaultIcons[item.type]
|
||||||
|
if (defaultIcon && (!data.img || data.img === "icons/svg/item-bag.svg")) {
|
||||||
|
updates.img = defaultIcon
|
||||||
|
}
|
||||||
|
if (Object.keys(updates).length) item.updateSource(updates)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user