//ported from racesow's joki HUD

if %SHOW_STRAFE != 0
if %RACE || %MATCH_STATE == #MATCH_STATE_WARMUP
if %PMOVE_TYPE == #PMOVE_TYPE_NORMAL
//setScale #DEFAULTSCALE
setCursor 400, 300
//setScale #SCALEBYWIDTH
moveCursor 0, -16
if %STRAFEANGLE > 0
	//setScale #SCALEBYWIDTH

	//set size of arrows
	setSize 0.03 * 4500 - %STRAFEANGLE, 10
	
	//set color of arrows
	//default: white
	setColor 1, 1, 1, 0.5
	//negative acceleration: red
	if -5000 > %ACCELERATION
		setColor 1, 0, 0, 0.5
	endif
	//good strafe: green
	if 0.8 < %ACCELERATION
		setColor 0, 1, 0, 0.5
	endif

	//standard dotstrafer
	//move cursor in position and draw arrows
	moveCursor 0.03 * %DIFF_ANGLE + %STRAFEANGLE , 0
	setAlign #LEFT, #BOTTOM
	drawSubPicByName gfx/hud/strafe 1 0 0 1

	moveCursor -0.06 * %STRAFEANGLE , 0
	setAlign #RIGHT, #BOTTOM
	drawPicByName gfx/hud/strafe

	//move Cursor back to the middle
	moveCursor -0.03 * %STRAFEANGLE + %DIFF_ANGLE, 0
	moveCursor 0.06 * %STRAFEANGLE, 0

endif
//set size,color and draw "crosshair"
setAlign #CENTER, #MIDDLE
moveCursor 0, -5
setSize 2, %VIDWIDTH / 90 // (800 / 80) = 10
setColor 0, 0, 0, 1
drawPicByName gfx/ui/white

setAlign #CENTER, #MIDDLE
setSize 1, %VIDWIDTH / 95 // (800 / 80) = 10
setColor 1, 1, 1, 1
drawPicByName gfx/ui/white

//show direction of movement
if %SPEED != #NOTSET

//set vertical position of bar (height can be edited)
setScale #DEFAULTSCALE
setCursor #WIDTH / 2, 0.10 * #HEIGHT

//calculate horizontal positions
//movement forward:
if -9000 < %DIFF_ANGLE
if 9000 >= %DIFF_ANGLE
	moveCursor .00005555555555555 * #WIDTH * %DIFF_ANGLE, 0
	setColor 0, 1, 0, 1
endif
endif
//movement backward:
if -18000 < %DIFF_ANGLE
if -9000 >= %DIFF_ANGLE
	moveCursor -.00005555555555555 * #WIDTH * %DIFF_ANGLE + 18000, 0
	setColor 1, 0, 0, 1
endif
endif
if 9000 < %DIFF_ANGLE
if 18000 >= %DIFF_ANGLE
	moveCursor -.00005555555555555 * #WIDTH * %DIFF_ANGLE - 18000, 0
	setColor 1, 0, 0, 1
endif
endif

//draw bar
setScale #SCALEBYHEIGHT
setSize 4, 20
setAlign #CENTER, #TOP
drawPicByName gfx/ui/white
setScale #DEFAULTSCALE

endif //if %SPEED != #NOTSET

endif
endif
endif
