Disable quality settings that aren't available and change map quality

This commit is contained in:
Mitchell McCaffrey 2020-07-15 17:35:36 +10:00
parent e4b3897ac4
commit 57c1d01fc7
2 changed files with 10 additions and 4 deletions

View File

@ -120,7 +120,13 @@ function MapSettings({
onChange={(e) => onSettingsChange("quality", e.target.value)}
>
{qualitySettings.map((quality) => (
<option key={quality.id} value={quality.id}>
<option
key={quality.id}
value={quality.id}
disabled={
quality.id !== "original" && !map.resolutions[quality.id]
}
>
{quality.name}
</option>
))}

View File

@ -25,9 +25,9 @@ const defaultMapProps = {
};
const mapResolutions = [
{ size: 512, quality: 0.25, id: "low" },
{ size: 1024, quality: 0.5, id: "medium" },
{ size: 2048, quality: 0.75, id: "high" },
{ size: 512, quality: 0.5, id: "low" },
{ size: 1024, quality: 0.6, id: "medium" },
{ size: 2048, quality: 0.7, id: "high" },
{ size: 4096, quality: 0.8, id: "ultra" },
];