from os import getcwd

class CONST:
    version_major = 1
    version_minor = 0
    version_revision = 1
    version_build = 1
    scr_w = 800
    scr_h = 480
    hscr_w = scr_w // 2
    path = getcwd() + '/'
    SD = None #TODO

class GV:
    image_bank = None
    font_addr = None # fill addr from memoery map

    screen_brightness = {'Day':[3], 'Night':[1]}
    led_brightness = {'Day':[3], 'Night':[2]}

    vars = {}

    # TODO ability to load images dynamicly
    # TODO pass images to load rather then hard code them here
    @classmethod
    def load_images(cls, list):   # loads into VRM forwards
        from PY_VTS.image import Image_Bank
        icons = []
        for item in list:
            icons.append((CONST.path + 'PY_VTS/_Icons/{}.png'.format(item), item))
        cls.image_bank = Image_Bank(icons)


    # TODO ability to load fonts dynamicly
    # TODO pass fonts to load rather then hard code them here
    @classmethod
    def load_fonts(cls):    # loads into VRAM backwards
        from PY_VTS.font import load_font

        start, end = load_font(CONST.path + 'PY_VTS/_Fonts/BebasNeue_0-28.rft', 7)
        start, end = load_font(CONST.path + 'PY_VTS/_Fonts/BebasNeue_0-50.rft', 8, mempos_end=start)

        cls.font_addr = start
