예제 #1
0
            pos = pygame.mouse.get_pos()

            if active_screen == home:
                for button in home_men.elements:
                    if button.clicked(pos):
                        if  button.id == 1:
                            print_message(message_input_random,help_msg_rect,home)
                            param_lst = button.executeAction()
                            if param_lst[0]<0 or param_lst[1]<0:
                                print_message(["parametros incorrectos"], error_msg_rect, active_screen,(255,0,0))
                                break
                            sim.random_list(param_lst[0])
                            sim.add_random_pf(param_lst[1]+2)
                        elif button.id == 2:
                            print_message(message_input_hand,help_msg_rect,home)
                            sim.requirements = button.executeAction()
                        elif button.id == 3:
                            print_message(message_input_file,help_msg_rect,home)
                            file_name = active_screen.get_element('InputBox').ask(False)
                            sim.requirements = load_file(file_name)
                            if (sim.requirements == None):
                                print_message(["No se pudo abrir el archivo. Revise permisos y/o ubicacion"],error_msg_rect,active_screen,(255,0,0))
                                break
                        elif button.id == 4:
                            print_message(message_input_pos,help_msg_rect,active_screen)
                            num = active_screen.get_element('InputBox').ask(False)
                            sim.init_pos = int(num)
                            if sim.init_pos<0 or sim.init_pos>511:
                                print_message(["parametros incorrectos"], error_msg_rect,active_screen,(255,0,0))
                                break
                        elif button.id == 5: