dofile(LockOn_Options.script_path.."ABRIS\\ABRIS_usefull_definitions.lua")
new_delta = (2*y_size -  3*y_pos_delta - 2*y_render_size)/10


AddButtons("ПОИСК","НА","ИНФО","ИМЯ","НАВ")
AddMode("ПОИСК")
AddSignalsBorder()
AddMap()
---------------------------------------------------------------------------------------
up_line                 = CreateElement "ceTexPoly"
up_line.name		    = "up_line"
SetLine(up_line)   
up_line.init_pos	    = {0,y_center_render + y_render_size,0}
Add(up_line)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
middle_line             = CreateElement "ceTexPoly"
middle_line.name		= "middle_line"
SetLine(middle_line)
middle_line.init_pos	= {0,y_center_render - y_render_size,0}
Add(middle_line)
---------------------------------------------------------------------------------------
middle_line2             = CreateElement "ceTexPoly"
middle_line2.name		= "middle_line2"
SetLine(middle_line2)
middle_line2.init_pos	    = {0,-new_delta,0}
middle_line2.parent_element = "middle_line"
Add(middle_line2)
---------------------------------------------------------------------------------------
for i =1,2 do
local middle_line_3                = Copy(middle_line2)
	  middle_line_3.init_pos	   = {0,-i*3*new_delta,0}
	  middle_line_3.parent_element = "middle_line2"
	  Add(middle_line_3)
end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
left_line             = CreateElement "ceTexPoly"
left_line.name		= "left_line"
SetLineSized(left_line ,0,9*new_delta)
left_line.init_rot  = {-90,0,0}
left_line.init_pos	= {-0.99*x_size + new_delta,y_center_render - y_render_size - new_delta,0}
Add(left_line)
---------------------------------------------------------------------------------------
right_line          = Copy(left_line)
right_line.init_pos	= {0.99*x_size - 5*new_delta,y_center_render - y_render_size - new_delta,0}
Add(right_line)
---------------------------------------------------------------------------------------

txt_1			   	  = CreateElement "ceStringPoly"
txt_1.name            = "txt_1"
txt_1.material        = "font_Ka-50_ABRIS_WHITE"
txt_1.init_pos		  = {-0.99*x_size,0.15*new_delta,0}
txt_1.alignment       = "LeftBottom"
txt_1.stringdefs      = abris_font[3]
txt_1.parent_element  = "middle_line2"
txt_1.value           = "/\\\\/"
Add(txt_1)
use_mipfilter(txt_1)

txt_2                 = Copy(txt_1)
txt_2.init_pos		  = {0,0.15*new_delta,0}
txt_2.value           = "NEAREST"
txt_2.alignment       = "CenterBottom"
Add(txt_2)

stencil_return                  = CreateElement "ceMeshPoly"
stencil_return.primitivetype    = "triangles" 
stencil_return.vertices         =  render_map.vertices	
stencil_return.indices          =  render_map.indices
stencil_return.name			    = "stencil_return"
stencil_return.material         = "GREEN"
stencil_return.isvisible        = false
stencil_return.isdraw           = true
stencil_return.parent_element   = "screen"
stencil_return.h_clip_relation  = h_clip_relations.REWRITE_LEVEL
stencil_return.level            = DEFAULT_LEVEL + 3
Add(stencil_return)
---------------------------
plane_symbol                = CreateElement "ceTexPoly"
plane_symbol.name           = "plane_symbol"
plane_symbol.vertices       = {{-plane_size_x/scale_2, plane_size_y/scale_2},
							   { plane_size_x/scale_2, plane_size_y/scale_2},
							   { plane_size_x/scale_2,-plane_size_y/scale_2},
							   {-plane_size_x/scale_2,-plane_size_y/scale_2}}
plane_symbol.indices        = box_ind
plane_symbol.material       = "INDICATION_ABRIS_RED"
plane_symbol.tex_params		= {plane_center_x,plane_center_y,scale_2,scale_2}
plane_symbol.parent_element = "screen"
plane_symbol.controllers	= {{"self_map_orient",x_size,x_size,-1}}
SetDefaultClipWithLevel(plane_symbol,3)
Add(plane_symbol)
use_mipfilter(plane_symbol)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cursor_symbol                = CreateElement "ceTexPoly"
cursor_symbol.name           = "cursor_symbol"
cursor_symbol.vertices       = {{-cursor_size/scale_2, cursor_size/scale_2},
							   {  cursor_size/scale_2, cursor_size/scale_2},
							   {  cursor_size/scale_2,-cursor_size/scale_2},
							   { -cursor_size/scale_2,-cursor_size/scale_2}}
cursor_symbol.indices        = box_ind
cursor_symbol.material       = "INDICATION_ABRIS_RED"
cursor_symbol.tex_params	 = {cursor_center_x,cursor_center_y,scale_2,scale_2}
cursor_symbol.controllers    = {{"cursor_position",x_size*GetScale(),x_size*GetScale()}}
cursor_symbol.parent_element = "screen"
SetDefaultClipWithLevel(cursor_symbol,3)
Add(cursor_symbol)
use_mipfilter(cursor_symbol)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------


