import pygame
import pygameMenu
from game_logic import helper


class SettingsMenu(object):

    def __init__(self, screen):
        # Settings menu
        self.__settings_menu = pygameMenu.Menu(
            screen,
            bgfun=lambda: screen.fill(helper.WHITE),
            color_selected=helper.BLACK,
            font=pygameMenu.font.FONT_HELVETICA,
            font_color=helper.BLACK,
            font_size=15,
            font_size_title=35,
            menu_alpha=100,
            menu_color=helper.WHITE,
            menu_height=int(helper.HEIGHT * 0.85),
            menu_width=int(helper.WIDTH * 0.9),
            # onclose=pygameMenu.events.DISABLE_CLOSE,
            title='Settings',
            widget_alignment=pygameMenu.locals.ALIGN_LEFT,
            window_height=helper.HEIGHT,
            window_width=helper.WIDTH
        )

        self.__settings_menu.add_text_input(
            'Trials: ',
            default=10000,
            maxchar=6,
            textinput_id='trials',
            input_type=pygameMenu.locals.INPUT_INT,
            enable_selection=False)

        # Create selector with 3 difficulty options
        self.__settings_menu.add_selector(
            'Select Oponent: ',
            [('Computer', 'COMPUTER'),
             ('Human', 'HUMAN')],
            selector_id='oponent',
            default=0)

        # Create selector with 3 difficulty options
        self.__settings_menu.add_selector(
            'Choose Player:',
            [('O', 'O'),
             ('X', 'X')],
            selector_id='player'
            default=0)

        self.__settings_menu.add_option(
            'Back', pygameMenu.events.CLOSE,
            align=pygameMenu.locals.ALIGN_CENTER)

    def __call__(self):
        # Loop until back button is pressed
        self.__settings_menu.mainloop(disable_loop=False)
        print('Settings data:')
        data = self.__settings_menu.get_input_data()
        for k in data.keys():
            print(u'\t{0}\t=>\t{1}'.format(k, data[k]))

@@ -845,32 +845,53 @@
       )%0A%0A       
+ self.__trials_widg =
  self.__settings
@@ -912,16 +912,16 @@
 _input(%0A
-
         
@@ -1161,32 +1161,54 @@
  options%0A       
+ self.__oponent_widg =
  self.__settings
@@ -1442,32 +1442,53 @@
  options%0A       
+ self.__player_widg =
  self.__settings
@@ -1620,16 +1620,17 @@
 'player'
+,
 %0A       
@@ -1912,24 +1912,26 @@
 lse)%0A       
+ #
  print('Sett
@@ -1950,16 +1950,18 @@
 %0A       
+ #
  data = 
@@ -2005,16 +2005,18 @@
 %0A       
+ #
  for k i
@@ -2033,24 +2033,26 @@
 s():%0A       
+ #
      print(u
@@ -2088,8 +2088,265 @@
 ta%5Bk%5D))%0A
+        return self.__settings_menu.get_input_data()%0A%0A    def load_settings(self, settings):%0A        self.__trials_widg.set_value(settings.trials)%0A        self.__oponent_widg.set_value(settings.oponent)%0A        self.__player_widg.set_value(settings.player)%0A

Load and return settings