]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/common/ZeldaIcon.js
tech title icons
[alttp.git] / resources / js / components / common / ZeldaIcon.js
index c53f4fd68def288ae2f231e11dc65b486796237f..9194cde7fc2f58b250f2e021a58c47e59bde9910 100644 (file)
@@ -27,6 +27,7 @@ const getIconURL = name => {
                case 'ether':
                case 'fairy':
                case 'fighter-shield':
+               case 'fighter-sword':
                case 'fire-rod':
                case 'fire-shield':
                case 'flippers':
@@ -59,6 +60,24 @@ const getIconURL = name => {
                case 'small-key':
                case 'somaria':
                        return `/item/${name}.png`;
+               case 'dungeon-ct':
+               case 'dungeon-dp':
+               case 'dungeon-ep':
+               case 'dungeon-gt':
+               case 'dungeon-hc':
+               case 'dungeon-ip':
+               case 'dungeon-mm':
+               case 'dungeon-pd':
+               case 'dungeon-sp':
+               case 'dungeon-sw':
+               case 'dungeon-th':
+               case 'dungeon-tr':
+               case 'dungeon-tt':
+                       return `/dungeon/${name.substr(8)}.png`;
+               case 'crystal-switch':
+               case 'crystal-switch-blue':
+               case 'crystal-switch-red':
+                       return `/icon/${name}.png`;
                default:
                        return '';
        }
@@ -69,14 +88,17 @@ const ZeldaIcon = ({ name }) => {
 
        const invert = name.startsWith('not-');
        const strippedName = invert ? name.substr(4) : name;
+       const src = getIconURL(strippedName);
        const title = t(`icon.zelda.${name}`);
 
        return <span className="zelda-icon">
-               <img
-                       alt={title}
-                       src={getIconURL(strippedName)}
-                       title={title}
-               />
+               {src ?
+                       <img
+                               alt={title}
+                               src={src}
+                               title={title}
+                       />
+               : null}
                {invert ?
                        <span className="strike">
                                <Icon.SLASH title="" />