mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -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?",
|
||||
wx.YES_NO | wx.ICON_QUESTION)
|
||||
if reply == wx.YES:
|
||||
self.ui.onSave()
|
||||
result = self.ui.onSave()
|
||||
if result == False:
|
||||
return
|
||||
|
||||
base.direct.deselectAll()
|
||||
self.objectMgr.reset()
|
||||
|
@ -363,15 +363,19 @@ class LevelEditorUIBase(WxAppShell):
|
||||
|
||||
def onSave(self, evt=None):
|
||||
if self.editor.currentFile is None:
|
||||
self.onSaveAs(evt)
|
||||
return self.onSaveAs(evt)
|
||||
else:
|
||||
self.editor.save()
|
||||
|
||||
def onSaveAs(self, evt):
|
||||
dialog = wx.FileDialog(None, "Choose a file", os.getcwd(), "", "*.py", wx.SAVE)
|
||||
result = True
|
||||
if dialog.ShowModal() == wx.ID_OK:
|
||||
self.editor.saveAs(dialog.GetPath())
|
||||
else:
|
||||
result = False
|
||||
dialog.Destroy()
|
||||
return result
|
||||
|
||||
def onDuplicate(self, evt):
|
||||
self.editor.objectMgr.duplicateSelected()
|
||||
|
Loading…
x
Reference in New Issue
Block a user