Пример #1
0
    def import_settings(self):
        # pug settings
        try:
            from _pug_settings import pug_settings #@UnresolvedImport
        except:
            self.pug_settings = self.create_default_pug_settings()
            self.save_pug_settings()
        else:
            self.pug_settings = self.create_default_pug_settings( pug_settings)

        # game settings
        try:
            from _project_settings import project_settings #@UnresolvedImport
        except:
            project_settings = self.create_default_project_settings()
            if not project_settings.initial_scene:
                project_settings.initial_scene = '__Editor__'
            try:
                save_project_settings( project_settings)
            except:
                if wx.GetApp():
                    show_exception_dialog()
                else:
                    raise
        else:
            project_settings = self.create_default_project_settings(
                                                            project_settings)
        self.project_settings = project_settings
Пример #2
0
    def import_settings(self):
        # pug settings
        try:
            from _pug_settings import pug_settings  #@UnresolvedImport
        except:
            self.pug_settings = self.create_default_pug_settings()
            self.save_pug_settings()
        else:
            self.pug_settings = self.create_default_pug_settings(pug_settings)

        # game settings
        try:
            from _project_settings import project_settings  #@UnresolvedImport
        except:
            project_settings = self.create_default_project_settings()
            if not project_settings.initial_scene:
                project_settings.initial_scene = '__Editor__'
            try:
                save_project_settings(project_settings)
            except:
                if wx.GetApp():
                    show_exception_dialog()
                else:
                    raise
        else:
            project_settings = self.create_default_project_settings(
                project_settings)
        self.project_settings = project_settings
Пример #3
0
 def _on_pug_quit(self):
     if getattr(self.project_settings,'save_settings_on_quit',True):
         try:
             save_project_settings( self.project_settings)
         except:
             show_exception_dialog()
     if getattr(self.pug_settings,'save_settings_on_quit',True):
         if os.name == 'nt':
             try:
                 window_pos = self.canvas.GetWindowPosition()
                 if not self.canvas.IsIconic():
                     self.pug_settings.rect_opioid_window = tuple( 
                                         self.canvas.GetWindowPosition() +\
                                         self.canvas.GetWindowSize())
             except:
                 pass
         self.save_pug_settings()
     self.Director.realquit()
     time.sleep(1)   
Пример #4
0
 def _on_pug_quit(self):
     if getattr(self.project_settings, 'save_settings_on_quit', True):
         try:
             save_project_settings(self.project_settings)
         except:
             show_exception_dialog()
     if getattr(self.pug_settings, 'save_settings_on_quit', True):
         if os.name == 'nt':
             try:
                 window_pos = self.canvas.GetWindowPosition()
                 if not self.canvas.IsIconic():
                     self.pug_settings.rect_opioid_window = tuple(
                                         self.canvas.GetWindowPosition() +\
                                         self.canvas.GetWindowSize())
             except:
                 pass
         self.save_pug_settings()
     self.Director.realquit()
     time.sleep(1)
Пример #5
0
    def execute_scene( self, doSave=True):
        """execute_scene()
        
Run the scene being editted in a new process.
"""
        try:
            if doSave and not self.Director.project_started:
                saved = self.save_using_working_scene()
                if not saved:
                    dlg = wx.MessageDialog( self.frame,
                          "The scene failed to save properly.\nExecute anyway?",
                          'Save Failed', 
                          wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
                    continue_shutdown = dlg.ShowModal()
                    if continue_shutdown == wx.ID_NO:
                        return False                               
            save_project_settings( self.project_settings)
            python_process("main.py", "__Working__")
        except:
            show_exception_dialog()
            return False
        return True
Пример #6
0
    def execute_scene(self, doSave=True):
        """execute_scene()
        
Run the scene being editted in a new process.
"""
        try:
            if doSave and not self.Director.project_started:
                saved = self.save_using_working_scene()
                if not saved:
                    dlg = wx.MessageDialog(
                        self.frame,
                        "The scene failed to save properly.\nExecute anyway?",
                        'Save Failed',
                        wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
                    continue_shutdown = dlg.ShowModal()
                    if continue_shutdown == wx.ID_NO:
                        return False
            save_project_settings(self.project_settings)
            python_process("main.py", "__Working__")
        except:
            show_exception_dialog()
            return False
        return True