mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Made reset festure could be canceled
This commit is contained in:
parent
33eda44d11
commit
78942f54ae
@ -248,7 +248,9 @@ class LevelEditorBase(DirectObject):
|
|||||||
reply = wx.MessageBox("Do you want to save current scene?", "Save?",
|
reply = wx.MessageBox("Do you want to save current scene?", "Save?",
|
||||||
wx.YES_NO | wx.ICON_QUESTION)
|
wx.YES_NO | wx.ICON_QUESTION)
|
||||||
if reply == wx.YES:
|
if reply == wx.YES:
|
||||||
self.ui.onSave()
|
result = self.ui.onSave()
|
||||||
|
if result == False:
|
||||||
|
return
|
||||||
|
|
||||||
base.direct.deselectAll()
|
base.direct.deselectAll()
|
||||||
self.objectMgr.reset()
|
self.objectMgr.reset()
|
||||||
|
@ -363,15 +363,19 @@ class LevelEditorUIBase(WxAppShell):
|
|||||||
|
|
||||||
def onSave(self, evt=None):
|
def onSave(self, evt=None):
|
||||||
if self.editor.currentFile is None:
|
if self.editor.currentFile is None:
|
||||||
self.onSaveAs(evt)
|
return self.onSaveAs(evt)
|
||||||
else:
|
else:
|
||||||
self.editor.save()
|
self.editor.save()
|
||||||
|
|
||||||
def onSaveAs(self, evt):
|
def onSaveAs(self, evt):
|
||||||
dialog = wx.FileDialog(None, "Choose a file", os.getcwd(), "", "*.py", wx.SAVE)
|
dialog = wx.FileDialog(None, "Choose a file", os.getcwd(), "", "*.py", wx.SAVE)
|
||||||
|
result = True
|
||||||
if dialog.ShowModal() == wx.ID_OK:
|
if dialog.ShowModal() == wx.ID_OK:
|
||||||
self.editor.saveAs(dialog.GetPath())
|
self.editor.saveAs(dialog.GetPath())
|
||||||
|
else:
|
||||||
|
result = False
|
||||||
dialog.Destroy()
|
dialog.Destroy()
|
||||||
|
return result
|
||||||
|
|
||||||
def onDuplicate(self, evt):
|
def onDuplicate(self, evt):
|
||||||
self.editor.objectMgr.duplicateSelected()
|
self.editor.objectMgr.duplicateSelected()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user