Only show SVG glitch messages if SVGs are on

It's confusing to see a message that says "instead we're showing a PNG" if you don't have hi-res mode on and actually everything is PNG anyway!
This commit is contained in:
Emi Matchu 2021-11-27 19:57:49 -08:00
parent 19f1ec092e
commit 3642e4c32a

View file

@ -7,10 +7,11 @@ import getVisibleLayers from "../../shared/getVisibleLayers";
import { useLocalStorage } from "../util"; import { useLocalStorage } from "../util";
function OutfitKnownGlitchesBadge({ appearance }) { function OutfitKnownGlitchesBadge({ appearance }) {
const glitchMessages = []; const [hiResMode] = useLocalStorage("DTIHiResMode", false);
const { petAppearance, items } = appearance; const { petAppearance, items } = appearance;
const glitchMessages = [];
// Look for UC/Invisible/etc incompatibilities that we hid, that we should // Look for UC/Invisible/etc incompatibilities that we hid, that we should
// just mark Incompatible someday instead; or with correctly partially-hidden // just mark Incompatible someday instead; or with correctly partially-hidden
// art. // art.
@ -236,19 +237,21 @@ function OutfitKnownGlitchesBadge({ appearance }) {
} }
// Look for pet layers with the OFFICIAL_SVG_IS_INCORRECT glitch. // Look for pet layers with the OFFICIAL_SVG_IS_INCORRECT glitch.
for (const layer of petLayers) { if (hiResMode) {
const layerHasOfficialSvgIsIncorrect = (layer.knownGlitches || []).includes( for (const layer of petLayers) {
"OFFICIAL_SVG_IS_INCORRECT" const layerHasOfficialSvgIsIncorrect = (
); layer.knownGlitches || []
if (layerHasOfficialSvgIsIncorrect) { ).includes("OFFICIAL_SVG_IS_INCORRECT");
glitchMessages.push( if (layerHasOfficialSvgIsIncorrect) {
<Box key={`official-svg-is-incorrect-for-pet-layer-${layer.id}`}> glitchMessages.push(
There's a glitch in the art for this pet's <i>{layer.zone.label}</i>{" "} <Box key={`official-svg-is-incorrect-for-pet-layer-${layer.id}`}>
zone that prevents us from showing the full-scale SVG version of the There's a glitch in the art for this pet's <i>{layer.zone.label}</i>{" "}
image. Instead, we're showing a PNG, which might look a bit blurry on zone that prevents us from showing the full-scale SVG version of the
larger screens. image. Instead, we're showing a PNG, which might look a bit blurry
</Box> on larger screens.
); </Box>
);
}
} }
} }