Actually use the argument in convert
This commit is contained in:
parent
3361885882
commit
1694dd2d34
@ -549,10 +549,16 @@ class MapMaker(ConquestMap):
|
||||
return points
|
||||
|
||||
async def convert_masks(self, regions):
|
||||
async for mask_path in AsyncIter(self.masks_path().iterdir()):
|
||||
# Don't both checking if masks are in self.regions
|
||||
img: Image.Image = Image.open(mask_path).convert(MASK_MODE)
|
||||
img.save(mask_path, "PNG")
|
||||
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()):
|
||||
# Don't both checking if masks are in self.regions
|
||||
img: Image.Image = Image.open(mask_path).convert(MASK_MODE)
|
||||
img.save(mask_path, "PNG")
|
||||
return True
|
||||
|
||||
async def prune_masks(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user