import bge


def check_idle():
    dict = bge.logic.globalDict
    dict['menu_idle_timer'] +=1
    idle = 0
    if dict['aBut'] or dict['bBut'] or dict['xBut'] or dict['yBut'] or dict['ddPad'] or dict['udPad'] or dict['ldPad'] or dict['rdPad'] or (dict['lUD'] > .02 or dict['lUD'] < -.02) or (dict['lLR'] > .02 or dict['lLR'] < -.02) or (dict['rUD'] > .02 or dict['rUD'] < -.02) or (dict['rLR'] > .02 or dict['rLR'] < -.02):
        dict['menu_idle_timer'] = 0
    #print('idtime', dict['menu_idle_timer']) 
    if dict['menu_idle_timer'] > 500:
        idle =1
    return idle                        

def update_text(cont):
    own = cont.owner
    scene = bge.logic.getCurrentScene()
    dict = bge.logic.globalDict
    if dict['pause_menu_text'] == '':
        scene.objects['menu_text'].text = 'menu > fuck' 
    else:
        if 'menu_text' in scene.objects: 
            scene.objects['menu_text'].text = dict['pause_menu_text']   
        if 'menu_text.001' in scene.objects: 
            scene.objects['menu_text.001'].text = dict['pause_menu_text']               

#    scene = bge.logic.getCurrentScene()
    for object in scene.objects:
        if isinstance(object, bge.types.KX_FontObject):
            object.resolution = 16     
                    
    info = ('Music > ' + dict['mu_artist'] + ' - ' + dict['mu_title'])
    #print(info)
    try:
        scene.objects['music_info_txt'].text = info                       
    except:
        pass    
                    
                    
def main(cont):
    update_text(cont)  
    check_idle()      

#active selection list        
#selected_item_index