Fix launcher crashing when cancel is pressed on the dialog

This commit is contained in:
Alexey Pavlov 2022-03-21 06:50:17 -04:00
parent 71691c9b7a
commit f14dec760a
2 changed files with 5 additions and 5 deletions

View File

@ -545,11 +545,11 @@ class Planet(QMainWindow):
filename = QFileDialog.getOpenFileName(
self, "Select skin file", "/", "PNG files (*.png)"
)
if not filename == '':
with open(f"/home/{USER}/.minecraft-pi/overrides/images/mob/char.png", "w") as skin:
skin.write("quick placeholder")
with open(f"/home/{USER}/.minecraft-pi/overrides/images/mob/char.png", "w") as skin:
skin.write("quick placeholder")
Image.open(filename[0]).crop((0,0,64,32)).convert('RGBA').save(f"/home/{USER}/.minecraft-pi/overrides/images/mob/char.png")
Image.open(filename[0]).crop((0,0,64,32)).convert('RGBA').save(f"/home/{USER}/.minecraft-pi/overrides/images/mob/char.png")
def launch(self):
self.save_profile()

View File

@ -3,7 +3,7 @@ Version: 1.0.0
Architecture: all
Maintainer: mcpiscript <mcpiscript@gmail.com>
Depends: python3-pyqt5, python3:any, python3-pyqt5.qtwebkit, python3-pyqt5.qtsvg, python3-pyqt5.qtwebkit, python3-pyqt5.qtmultimedia
Replaces: mcpil, mcpil-r
Replaces: mcpil, mcpil-r, gmcpil, jmcpil
Recommends: minecraft-pi-reborn-client, minecraft-pi-reborn-server, python3-pyqtdarkmode, python3-mcpi, python3-minecraft-pi, python3-morpheus-mcpi
Section: games
Priority: optional