def closeChatWindow(self,button = None): # Enable the gui gui_buttons.gui_obj.enable_buttons() #print 'before size is ',self.chatWin.size,'\n' self.chatWin.close() #print self.chatWin.size self.chatWinFlag=False threades.resume_update_thread()
def closeChatWindow(self, button=None): # Enable the gui gui_buttons.gui_obj.enable_buttons() #print 'before size is ',self.chatWin.size,'\n' self.chatWin.close() #print self.chatWin.size self.chatWinFlag = False threades.resume_update_thread()
def new_level_stats(self,data_file,graphics_file,level_no=-1): #global total_update_flag global animation_obj threades.pause_update_thread() self.graphics() self.level_no=level_no self.data_file=data_file self.graphics_file=graphics_file self.run=True level_updater=threading.Thread(target=self.level_reinit,args=[]).start() pygame.display.set_caption('FoodForce2') threades.screen.fill((0,0,0)) threades.screen.blit(self.ff_logo,threades.resize_pos((40,50))) desktop_level.update() desktop_level.draw() pygame.display.update() while 1 : for e in gui.setEvents(pygame.event.get()): if e.type == pygame.QUIT: print 'in pygame.quit' safe_exit() if e.type == QUIT: print 'in quit' safe_exit() #if level_updater.is_alive()==False: # self.run=False GREAT THIS IS APPLICABLE ONLY WITH PYTHON 2.6, SO HAVE TO SEARCH SOME OTHER MEANS if self.run==False: break #print 'now reached here\n' self.ff_logo = 0 threades.initialize_facilities(True) threades.set_build_facility_placement_flag() threades.facility_placement_data_obj.clear_placement_data() #threades.current_level = proceduralFlow.storyboard_level threades.total_update_flag = True threades.resume_update_thread()
def new_level_stats(self, data_file, graphics_file, level_no=-1): #global total_update_flag global animation_obj threades.pause_update_thread() self.graphics() self.level_no = level_no self.data_file = data_file self.graphics_file = graphics_file self.run = True level_updater = threading.Thread(target=self.level_reinit, args=[]).start() pygame.display.set_caption('FoodForce2') threades.screen.fill((0, 0, 0)) threades.screen.blit(self.ff_logo, threades.resize_pos((40, 90))) desktop_level.update() desktop_level.draw() pygame.display.update() while 1: for e in gui.setEvents(pygame.event.get()): if e.type == pygame.QUIT: print 'in pygame.quit' #safe_exit() if e.type == QUIT: print 'in quit' #safe_exit() #if level_updater.is_alive()==False: # self.run=False GREAT THIS IS APPLICABLE ONLY WITH PYTHON 2.6, SO HAVE TO SEARCH SOME OTHER MEANS if self.run == False: break self.ff_logo = 0 threades.initialize_facilities(True) threades.set_build_facility_placement_flag() #threades.current_level = proceduralFlow.storyboard_level threades.total_update_flag = True model.POPULATION_FACTOR = 0.5 threades.resume_update_thread()
def new_level_stats(self, data_file, graphics_file, level_no=-1): #global total_update_flag global animation_obj threades.pause_update_thread() self.graphics() self.level_no = level_no self.data_file = data_file self.graphics_file = graphics_file self.run = True level_updater = threading.Thread(target=self.level_reinit, args=[]).start() pygame.display.set_caption('FoodForce2') threades.screen.fill((0, 0, 0)) threades.screen.blit(self.ff_logo, threades.resize_pos((40, 50))) desktop_level.update() desktop_level.draw() pygame.display.update() while 1: for e in gui.setEvents(pygame.event.get()): if e.type == pygame.QUIT: print 'in pygame.quit' safe_exit() if e.type == QUIT: print 'in quit' safe_exit() #if level_updater.is_alive()==False: # self.run=False GREAT THIS IS APPLICABLE ONLY WITH PYTHON 2.6, SO HAVE TO SEARCH SOME OTHER MEANS if self.run == False: break print 'now reached here\n' self.ff_logo = 0 threades.initialize_facilities() threades.total_update_flag = True threades.resume_update_thread()