"""
key help display
"""


import sys

from OpenGL.GL import *
from OpenGL.GLU import *
import pygame, pygame.image
from pygame.locals import *

import texMgr
import draw_util
import gui_widgets as gw

import fsm_mgr as fsm
import tubeMgr

import levels

import voiceover


def func_play(level_name):
    fsm.popState()


bsz=256
bc1=400

br1 = 300

buttons=[gw.Button("button_keys",        bc1-bsz, br1+bsz, bc1+bsz, br1-bsz, func_play, "tutorial_1"),
         ]


class StateKeyHelp(fsm.State):
    def __init__(self):
        fsm.State.__init__(self)

    def init(self, unused_args):
        texMgr.loadTexture("data/buttons/keyhelp.png", "button_keys")

    def draw(self):
        glColor3f(1.0, 1.0, 1.0)
        pauseMenu=self.parent
        game=pauseMenu.parent
        game.draw()
        glColor4f(0.0, 0.0, 0.0, 0.7)
        
        draw_util.draw_quad(None, 0, 600, 800, 0)
        glColor3f(1.0, 1.0, 1.0)

        for b in buttons:
            b.draw()

    def handleMouseButton(self, bDown, buttonIndex):
        if not bDown:
            return True
        
        for b in buttons:
            if b.handleMouseButton(bDown, buttonIndex):
                return True

        return True
        
    def update(self, dt):
        return True
        
        
