Added map size indicator to map quality setting
This commit is contained in:
parent
249d1d2492
commit
067e672d55
@ -42,6 +42,17 @@ function MapSettings({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMapSize() {
|
||||||
|
let size = 0;
|
||||||
|
if (map.quality === "original") {
|
||||||
|
size = map.file.length;
|
||||||
|
} else {
|
||||||
|
size = map.resolutions[map.quality].file.length;
|
||||||
|
}
|
||||||
|
size /= 1000000; // Bytes to Megabytes
|
||||||
|
return `${size.toFixed(2)}MB`;
|
||||||
|
}
|
||||||
|
|
||||||
const mapEmpty = !map || isEmpty(map);
|
const mapEmpty = !map || isEmpty(map);
|
||||||
const mapStateEmpty = !mapState || isEmpty(mapState);
|
const mapStateEmpty = !mapState || isEmpty(mapState);
|
||||||
|
|
||||||
@ -135,7 +146,7 @@ function MapSettings({
|
|||||||
</Select>
|
</Select>
|
||||||
</Box>
|
</Box>
|
||||||
<Label sx={{ width: "50%" }} ml={2}>
|
<Label sx={{ width: "50%" }} ml={2}>
|
||||||
Size: XX
|
Size: {getMapSize()}
|
||||||
</Label>
|
</Label>
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user