def do_stop_scene(self, doRevert=True): if _DEBUG: print "stop_scene" if not getattr(self.Director, "project_started", False): return if _DEBUG: print "stop_scene 1.5" wait_for_state(None) if _DEBUG: print "stop_scene 2" self.scene.stop() if _DEBUG: print "stop_scene 3" wait_for_exit_scene() if _DEBUG: print "stop_scene 4" gamedata = get_gamedata() scene = gamedata.start_sceneclass create_gamedata() if _DEBUG: print "stop_scene 5" pug.set_default_pugview("Component", _dataPugview) if _DEBUG: print "stop_scene 6", scene.__name__ if doRevert: if self.edit_info: wx.GetApp().set_busy_state( True) Director.switch_scene = self.edit_info[0] while Director.scene != self.edit_info[0]: time.sleep(0.05) self.restore_editor() wx.CallAfter( entered_scene) else: self.set_scene(scene.__name__, True) self.edit_info = None if _DEBUG: print "stop_scene 7"
def do_stop_scene(self, doRevert=True): if _DEBUG: print "stop_scene" if not getattr(self.Director, "project_started", False): return if _DEBUG: print "stop_scene 1.5" wait_for_state(None) if _DEBUG: print "stop_scene 2" self.scene.stop() if _DEBUG: print "stop_scene 3" wait_for_exit_scene() if _DEBUG: print "stop_scene 4" gamedata = get_gamedata() scene = gamedata.start_sceneclass create_gamedata() if _DEBUG: print "stop_scene 5" pug.set_default_pugview("Component", _dataPugview) if _DEBUG: print "stop_scene 6", scene.__name__ if doRevert: if self.edit_info: wx.GetApp().set_busy_state(True) Director.switch_scene = self.edit_info[0] while Director.scene != self.edit_info[0]: time.sleep(0.05) self.restore_editor() wx.CallAfter(entered_scene) else: self.set_scene(scene.__name__, True) self.edit_info = None if _DEBUG: print "stop_scene 7"
def play_scene( self, doSave=True): """play_scene(doSave=True) start the current scene playing. doSave: save working copy first """ if _DEBUG: print "play_scene" if self.Director.project_started: # don't do anything if game started return False if doSave: saved = self.save_using_working_scene() if not saved: dlg = wx.MessageDialog( self.frame, "The scene failed to save properly.\nPlay anyway?", 'Save Failed', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) continue_shutdown = dlg.ShowModal() if continue_shutdown == wx.ID_NO: return False else: self.edit_info = None else: self.play_working_scene() else: self.edit_info = None #self.reload_scene() pug.set_default_pugview("Component", _dataMethodPugview) # app = wx.GetApp() # app.set_selection([]) (Opioid2D.Delay(0) + Opioid2D.CallFunc(start_scene)).do() return True
def play_scene(self, doSave=True): """play_scene(doSave=True) start the current scene playing. doSave: save working copy first """ if _DEBUG: print "play_scene" if self.Director.project_started: # don't do anything if game started return False if doSave: saved = self.save_using_working_scene() if not saved: dlg = wx.MessageDialog( self.frame, "The scene failed to save properly.\nPlay anyway?", 'Save Failed', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) continue_shutdown = dlg.ShowModal() if continue_shutdown == wx.ID_NO: return False else: self.edit_info = None else: self.play_working_scene() else: self.edit_info = None #self.reload_scene() pug.set_default_pugview("Component", _dataMethodPugview) # app = wx.GetApp() # app.set_selection([]) (Opioid2D.Delay(0) + Opioid2D.CallFunc(start_scene)).do() return True