
[INCLUDE: common/navigators.ini]
[NAVIGATOR_0 : Navigator_StyleSygic]
ACTIVE = $" read('csp/version', 0) >= 1564 "
Meshes = main_LCD1
@ = Navigator_Size, Resolution = "2048, 1024", Offset = "0, 0", Size = "2048, 1024", Scale = 0.35
Brightness = 0.7
RESOLUTION_LIMIT = 2048, 1024
DYNAMIC_OPACITY = 0  ; disabling component from the start, relying on scriptable display to activate it when needed

[NAVIGATOR_0]
; Slightly alter template to remove dark bar on the left
@ = Navigator_Size, Resolution = "2048, 1024", Offset = "0, 0", Size = "2048, 1024", Scale = 0.35
@ = Navigator_Component, ComponentID = CURRENT_TRACK
@ = Navigator_FadingComponent, Up
@ = Navigator_ComponentLayout, Left = 100, Right = 40, Top = 0, Height = 120,\
	Padding = "92, 10, 20", Align = "0, 0.5", IconCenter = "48, 50%", IconSize = 40
TIME_SIZE = 0, 0
BTN_PHONE_ENABLED = 0
MAP_POS = 0, 0
MAP_SIZE = 2048, 1024

[SCRIPTABLE_DISPLAY_...]
; Example of scriptable display
MESHES = main_LCD1
KEEP_BACKGROUND = 1 ; Stop CSP from painting original texture as background to get stereo and navigator 
  ; to work. Script will need to reset background manually or things will leave trails.
INTERACTIVE = 1 ; Keep track of mouse position over the display (adds extra cost, especially on high poly meshes)
FORCE_UPDATE_AFTER = NAVIGATOR_0
SCRIPT = `

local inMainMenu = false

function update(dt)

  if inMainMenu then -- если в главном меню

    -- очищаешь фон
    display.image{ image = "car::m5_navigation.dds.dds", pos = vec2(),size = vec2(2048, 1024) }

    -- рисуешь кнопку
    if display.button{ image = "car::m5_navigation.dds.dds", pos = vec2(),size = vec2("1016, 537")} then
      -- нажата, включаем навигатор
      inMainMenu = false
      ac.setDynamicTextureShift("NAVIGATOR_0", 1)
    end

  else -- если не в главном меню

    -- рисуешь кнопку поверх навигатора
    if display.button{image = "car::m5_navigation.dds.dds", pos = vec2(),size = vec2("1016, 537")} then
      -- нажата, выключаем навигатор
      inMainMenu = true
      ac.setDynamicTextureShift("NAVIGATOR_0", 0)
    end

  end
  
end


