diff --git a/assets/ability/Blank.png b/assets/ability/Blank.png new file mode 100644 index 0000000..8fd3569 Binary files /dev/null and b/assets/ability/Blank.png differ diff --git a/assets/ability/ParameterIcon^q.png b/assets/ability/ParameterIcon^q.png index f016bad..c55d7de 100644 Binary files a/assets/ability/ParameterIcon^q.png and b/assets/ability/ParameterIcon^q.png differ diff --git a/assets/mapping/ability.json b/assets/mapping/ability.json index e25cff3..2555522 100644 --- a/assets/mapping/ability.json +++ b/assets/mapping/ability.json @@ -5,7 +5,7 @@ "name": "Blank", "sub": null, "special": null, - "image": "ParameterIcon^q.png" + "image": "Blank.png" }, { "id": -1, diff --git a/equipment/equipment.js b/equipment/equipment.js index 5258209..64f4ef2 100644 --- a/equipment/equipment.js +++ b/equipment/equipment.js @@ -57,23 +57,37 @@ window.loadHeader(function(headerContainer) { const infoBox = document.querySelector('.splat-info-box'); if (infoBox) { const fetchJson = url => fetch(url).then(r => r.ok ? r.json() : []); - const [clothing, headgear, shoes, weapons] = await Promise.all([ + const [clothing, headgear, shoes, weapons, abilities] = await Promise.all([ fetchJson('/assets/mapping/clothing.json'), fetchJson('/assets/mapping/headgear.json'), fetchJson('/assets/mapping/shoes.json'), - fetchJson('/assets/mapping/weapons.json') + fetchJson('/assets/mapping/weapons.json'), + fetchJson('/assets/mapping/ability.json') ]); - const getImg = (list, id, folder) => { - if (!id) return "/assets/weapons/NotFound^w.png"; - const item = list.find(i => i.id == id); - return (item && item.image) ? `../assets/${folder}/${item.image}` : "/assets/weapons/NotFound^w.png"; + const getImg = (list, id, folder, isAbility = false) => { + const fallback = isAbility ? "../assets/ability/ParameterIcon^q.png" : "/assets/weapons/NotFound^w.png"; + if (id === undefined || id === null) return fallback; + const item = list.find(i => String(i.id) === String(id)); + return (item && item.image) ? `../assets/${folder}/${item.image}` : fallback; }; const weaponImg = getImg(weapons, equipped.weapon, 'weapons'); const headImg = getImg(headgear, equipped.Gear_Head, 'headgear'); const clothesImg = getImg(clothing, equipped.Gear_Clothes, 'clothing'); const shoesImg = getImg(shoes, equipped.Gear_Shoes, 'shoes'); + + const headMain = getImg(abilities, equipped.Gear_Head_Skill0, 'ability', true); + const headSub1 = getImg(abilities, equipped.Gear_Head_Skill1, 'ability', true); + const headSub2 = getImg(abilities, equipped.Gear_Head_Skill2, 'ability', true); + + const clothesMain = getImg(abilities, equipped.Gear_Clothes_Skill0, 'ability', true); + const clothesSub1 = getImg(abilities, equipped.Gear_Clothes_Skill1, 'ability', true); + const clothesSub2 = getImg(abilities, equipped.Gear_Clothes_Skill2, 'ability', true); + + const shoesMain = getImg(abilities, equipped.Gear_Shoes_Skill0, 'ability', true); + const shoesSub1 = getImg(abilities, equipped.Gear_Shoes_Skill1, 'ability', true); + const shoesSub2 = getImg(abilities, equipped.Gear_Shoes_Skill2, 'ability', true); await Promise.all([ preloadImage(miiImgUrl), @@ -104,21 +118,30 @@ window.loadHeader(function(headerContainer) {
+
- +
+
+ " /> +
+
- +
+
+ " /> +
+
- +
-
-
-
+
+ " /> +
`;