Actually use the argument in convert

conquest_develop
bobloy 3 years ago
parent 3361885882
commit 1694dd2d34

@ -549,6 +549,12 @@ class MapMaker(ConquestMap):
return points return points
async def convert_masks(self, regions): async def convert_masks(self, regions):
if regions:
async for region in regions:
mask_path = self.masks_path() / f"{region}.png"
img: Image.Image = Image.open(mask_path).convert(MASK_MODE)
img.save(mask_path)
else:
async for mask_path in AsyncIter(self.masks_path().iterdir()): async for mask_path in AsyncIter(self.masks_path().iterdir()):
# Don't both checking if masks are in self.regions # Don't both checking if masks are in self.regions
img: Image.Image = Image.open(mask_path).convert(MASK_MODE) img: Image.Image = Image.open(mask_path).convert(MASK_MODE)

Loading…
Cancel
Save