mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 23:36:36 +00:00
Don't show error when cancelling assets loading.
This commit is contained in:
parent
1e26f4380d
commit
178cbb9b6d
@ -34,7 +34,7 @@ class RoarAssetsWindow(GuiMiniFrame):
|
|||||||
if self.lastDir != None:
|
if self.lastDir != None:
|
||||||
dialog.SetDirectory(self.lastDir)
|
dialog.SetDirectory(self.lastDir)
|
||||||
if dialog.ShowModal() == wx.ID_CANCEL:
|
if dialog.ShowModal() == wx.ID_CANCEL:
|
||||||
resultList += [[False, "(cancelled)", None, None, None, None]]
|
resultList += [[None, "(cancelled)", None, None, None, None]]
|
||||||
else:
|
else:
|
||||||
for pathName in dialog.GetPaths():
|
for pathName in dialog.GetPaths():
|
||||||
resultList += [self._import(f, pathName)]
|
resultList += [self._import(f, pathName)]
|
||||||
@ -222,7 +222,7 @@ class RoarAssetsWindow(GuiMiniFrame):
|
|||||||
rc, error = canvas.importStore.importTextFile(pathName)
|
rc, error = canvas.importStore.importTextFile(pathName)
|
||||||
return (rc, error, canvas.importStore.outMap, pathName, canvas.importStore.inSize)
|
return (rc, error, canvas.importStore.outMap, pathName, canvas.importStore.inSize)
|
||||||
for rc, error, canvas, newMap, newPathName, newSize in self._importFiles(importmIRC, "mIRC art files (*.txt)|*.txt|All Files (*.*)|*.*"):
|
for rc, error, canvas, newMap, newPathName, newSize in self._importFiles(importmIRC, "mIRC art files (*.txt)|*.txt|All Files (*.*)|*.*"):
|
||||||
if rc:
|
if rc == True:
|
||||||
self.currentIndex = self.listView.GetItemCount()
|
self.currentIndex = self.listView.GetItemCount()
|
||||||
self.canvasList[self.currentIndex] = [canvas, newPathName]
|
self.canvasList[self.currentIndex] = [canvas, newPathName]
|
||||||
self.listView.InsertItem(self.currentIndex, "")
|
self.listView.InsertItem(self.currentIndex, "")
|
||||||
@ -237,7 +237,7 @@ class RoarAssetsWindow(GuiMiniFrame):
|
|||||||
self.listView.SetFocus()
|
self.listView.SetFocus()
|
||||||
[self.listView.SetItem(self.currentIndex, col, label) for col, label in zip((0, 1), (os.path.basename(newPathName), "{}x{}".format(*newSize)))]
|
[self.listView.SetItem(self.currentIndex, col, label) for col, label in zip((0, 1), (os.path.basename(newPathName), "{}x{}".format(*newSize)))]
|
||||||
[self.listView.SetColumnWidth(col, wx.LIST_AUTOSIZE) for col in (0, 1)]
|
[self.listView.SetColumnWidth(col, wx.LIST_AUTOSIZE) for col in (0, 1)]
|
||||||
else:
|
elif rc == False:
|
||||||
with wx.MessageDialog(self, "Error: {}".format(error), "", wx.CANCEL | wx.OK | wx.OK_DEFAULT) as dialog:
|
with wx.MessageDialog(self, "Error: {}".format(error), "", wx.CANCEL | wx.OK | wx.OK_DEFAULT) as dialog:
|
||||||
dialogChoice = dialog.ShowModal()
|
dialogChoice = dialog.ShowModal()
|
||||||
if dialogChoice == wx.ID_CANCEL:
|
if dialogChoice == wx.ID_CANCEL:
|
||||||
|
Loading…
Reference in New Issue
Block a user