import PY_VTS.gui.colours as Colour
from PY_VTS.gui.VG import *


class VG_SteeringWheelSensor(Object):

    def __init__(self, name, mid): #Colour 1, Colour 2
        super().__init__(name, mid)
        self.base_gui_l = [gui.SUBLIST]
        self.mid = mid

        self.points.append(Point(0, 0))
        self.points.append(Point(-112, 0))
        self.points.append(Point( 112, 0))
        self.points.append(Point( 0, 112))


        #
        # Screws
        #
        # self.points.append(Point( -10,  0))
        # self.points.append(Point(  -6,  8))
        # self.points.append(Point(   6,  8))
        # self.points.append(Point(  10,  0))
        # self.points.append(Point(  -6, -8))
        # self.points.append(Point(   6, -8))

        self.add_line([self.points[0],self.points[1]],16,Colour.BLACK)
        self.add_line([self.points[0],self.points[2]])
        self.add_line([self.points[0],self.points[3]])

        # self.add_line([self.points[4],self.points[4]],2,Colour.LGT_GREY)
        # self.add_line([self.points[5],self.points[5]])
        # self.add_line([self.points[6],self.points[6]])
        # self.add_line([self.points[7],self.points[7]])
        # self.add_line([self.points[8],self.points[8]])
        # self.add_line([self.points[9],self.points[9]])


        self.base_gui_l.append([gui.DL_BEGIN(gui.PRIM_POINTS)])
        self.base_gui_l.append([Colour.BLACK])
        self.base_gui_l.append([gui.DL_POINT_SIZE(130)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([Colour.WHITE])
        self.base_gui_l.append([gui.DL_POINT_SIZE(105)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([gui.DL_END()])

        self.base_gui_l.append([gui.DL_BEGIN(gui.PRIM_LINES)])
        self.base_gui_l.append([Colour.LGT_GREY])
        self.base_gui_l.append([gui.DL_LINE_WIDTH(15)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x - 38,self.mid.y - 68)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x - 38,self.mid.y + 68)])
        self.base_gui_l.append([Colour.METAL_BLUE])
        self.base_gui_l.append([gui.DL_LINE_WIDTH(10)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x - 15,self.mid.y - 45)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x + 15,self.mid.y - 45)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x - 15,self.mid.y - 40)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x + 15,self.mid.y - 40)])
        self.base_gui_l.append([gui.DL_END()])

        self.base_gui_l.append([gui.DL_BEGIN(gui.PRIM_POINTS)])
        self.base_gui_l.append([Colour.METAL_BLUE])      # racelogic shiny blue
        self.base_gui_l.append([gui.DL_POINT_SIZE(50)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([Colour.BLACK])
        self.base_gui_l.append([gui.DL_POINT_SIZE(33)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([Colour.METAL_BLUE])      # racelogic shiny blu
        self.base_gui_l.append([gui.DL_POINT_SIZE(31)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([Colour.BLACK])
        self.base_gui_l.append([gui.DL_POINT_SIZE(20)])
        self.base_gui_l.append([gui.DL_VERTEX2F(self.mid.x,self.mid.y)])
        self.base_gui_l.append([gui.DL_END()])


        self.gui_l.insert(1,self.base_gui_l)
