Ejemplo n.º 1
0
def delete_theme():
    global currentIdx, currentMenu, theme_name, menu_stack

    # Load custom-theme, remove .xml extension
    theme_name = os.path.splitext(theme.CUSTOM_THEME)[0]
    # Remove .xml
    try:
        os.remove(theme.theme_file)
    except:
        pass
    # Remove .json
    json_file = os.path.splitext(theme.theme_file)[0] + '.json'
    try:
        os.remove(json_file)
    except:
        pass
    # Remove .png
    png_file = os.path.splitext(theme.theme_file)[0] + '.png'
    try:
        os.remove(png_file)
    except:
        pass
    # Go back to main menu
    del menu_stack[:]
    menu_stack = [[menus.main, '']]
    currentMenu = menus.main
    currentIdx = 0
    menus.update_naming()
    #
    redraw_board()
    graphics.drawCurrentMenu()
Ejemplo n.º 2
0
def delete_theme():
    global currentIdx, currentMenu, theme_name, menu_stack

    # Load custom-theme, remove .xml extension
    theme_name = os.path.splitext(theme.CUSTOM_THEME)[0]
    # Remove .xml
    try:
        os.remove(theme.theme_file)
    except:
        pass
    # Remove .json
    json_file = os.path.splitext(theme.theme_file)[0] + '.json'
    try:
        os.remove(json_file)
    except:
        pass
    # Remove .png
    png_file = os.path.splitext(theme.theme_file)[0] + '.png'
    try:
        os.remove(png_file)
    except:
        pass
    # Go back to main menu
    del menu_stack[:]
    menu_stack = [[menus.main, '']]
    currentMenu = menus.main
    currentIdx = 0
    menus.update_naming()
    #
    redraw_board()
    graphics.drawCurrentMenu()
Ejemplo n.º 3
0
def input_string(key):
    global tile

    tile = ''
    while key != keys['ENTER']:
        if key > 0 and key != keys['ENTER']:
            if key == keys['BACKSPACE']:
                tile = tile[:-1]
            else:
                tile += curses.keyname(key)
            redraw_board()
            graphics.drawCurrentMenu()
        key = graphics.screen.getch()
Ejemplo n.º 4
0
def input_string(key):
    global tile

    tile = ''
    while key != keys['ENTER']:
        if key > 0 and key != keys['ENTER']:
            if key == keys['BACKSPACE']:
                tile = tile[:-1]
            else:
                tile += curses.keyname(key)
            redraw_board()
            graphics.drawCurrentMenu()
        key = graphics.screen.getch()
Ejemplo n.º 5
0
def start():
    init()

    while True:
        controls.update()
        graphics.drawCurrentMenu()