MCPcopy Create free account
hub / github.com/Card-Forge/forge / getIcon

Method getIcon

forge-gui-mobile/src/forge/assets/ImageCache.java:174–182  ·  view source on GitHub ↗

retrieve an icon from the cache. returns the current skin's ICO_UNKNOWN if the icon image is not found in the cache and cannot be loaded from disk.

(IHasIcon ihi)

Source from the content-addressed store, hash-verified

172 * in the cache and cannot be loaded from disk.
173 */
174 public FImage getIcon(IHasIcon ihi) {
175 String imageKey = ihi.getIconImageKey();
176 final Texture icon;
177 if (missingIconKeys.get().contains(imageKey) || (icon = getImage(ihi.getIconImageKey(), false, true)) == null) {
178 missingIconKeys.get().add(imageKey);
179 return FSkinImage.UNKNOWN;
180 }
181 return new FTextureImage(icon);
182 }
183
184 /**
185 * checks the card image exists from the disk.

Callers

nothing calls this directly

Calls 5

getImageMethod · 0.95
getIconImageKeyMethod · 0.65
containsMethod · 0.65
getMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected