[INCLUDE: navigators_mixins.ini]
[INCLUDE: navigators_maps.ini]
[INCLUDE: navigators_layouts.ini]
[INCLUDE: navigators_themes.ini]

[MIXIN: Navigator_IconsDefault]
BTN_ALIGN_ICON = COMPASS
BTN_LAYERS_ICON = MAP
BTN_LOCK_ICON = GPS
BTN_PHONE_ICON = CALL_BLUETOOTH
BTN_PHONE_MESSAGE_ICON = CANCEL
BTN_SATELLITE_ICON = EARTH
BTN_ZOOM_IN_ICON = PLUS
BTN_ZOOM_OUT_ICON = MINUS
CURRENT_TRACK_ICON = MUSIC
TRAVEL_INFO_MESSAGE_ICON = CAR_FRONT

[MIXIN: Navigator_LinesDefault]
BTN_PHONE_MESSAGE = "Phone is not connected"
; GPS_LOST_MESSAGE = "GPS signal lost" ; if value is not set, no message will be shown
TRAVEL_INFO_NA_TEXT = "N/A"
TIME_LEFT_NA_TEXT = "N/A"
ARRIVAL_TIME_NA_TEXT = "N/A"
UPCOMING_TURN_TURNING_TEXT = "now"
TIME_FORMAT = "%H:%M"

[MIXIN: Navigator_ImmediateLoading]
LOADING_TIME = 0
LOADING_STYLE = 1

[MIXIN: Navigator_CameraParamsDefault]
CAMERA_OFFSET = -50, 120
CAMERA_LOOK_FWD_MULT = 0.8
CAMERA_FOV = 50
CAMERA_SPEED_MULT_MAX = 10

[MIXIN: Navigator_CameraParamsModern]
CAMERA_OFFSET = -80, 120
CAMERA_LOOK_FWD_MULT = 1
CAMERA_FOV = 50
CAMERA_SPEED_MULT_MAX = 20

[MIXIN: Navigator_CameraParamsExtreme]
CAMERA_OFFSET = -50, 60
CAMERA_LOOK_FWD_MULT = 1.5
CAMERA_FOV = 50
CAMERA_SPEED_MULT_MAX = 20

[MIXIN: Navigator_CameraParamsCompact]
CAMERA_OFFSET = -60, 120
CAMERA_LOOK_FWD_MULT = 1
CAMERA_FOV = 50

[MIXIN: Navigator_CameraParamsRacing]
CAMERA_ALIGN_WITH_CAR = 0
CAMERA_OFFSET = 0, 300
CAMERA_EXTRA_OFFSET = 0, 0
CAMERA_LOOK_FWD_MULT = 0
CAMERA_FOV = 50
CAMERA_SPEED_MULT = 0

[MIXIN: Navigator_CarMarkDefault]
CAR_MARK_SIZE = 25
CAR_MARK_SCALE_WITH_SPEED = 0
CAR_MARK_ARROW_PARAMS = 1, 0.3, 0.4, 0.6

[MIXIN: Navigator_CarMarkAndroidAuto]
CAR_MARK_SIZE = 25
CAR_MARK_SCALE_WITH_SPEED = 0
CAR_MARK_ARROW_PARAMS = 0.9, 0.2, 0.4, 1
CAR_MARK_ARROW_OUTLINE_PARAMS = 0.9, 0.2, 0.4, 1
CAR_MARK_COLOR_LEFT = "#FFF"
CAR_MARK_COLOR_RIGHT = "#FFF"
CAR_MARK_CIRCLE_COLOR = "#44BBEE"
CAR_MARK_CIRCLE_RADIUS = 40, 30

[MIXIN: Navigator_GPSDefault]
GPS_HAS_COMPASS = 0
GPS_LOST_THRESHOLD = 0.99
GPS_BAD_THRESHOLD = 0.8
GPS_ROUGH_THRESHOLD = 0.2

[MIXIN: Navigator_GPSRacing]
@GENERATOR = _Navigator_SharePosition
GPS_HAS_COMPASS = 1
GPS_LOST_THRESHOLD = 0.99
GPS_BAD_THRESHOLD = 0.8
GPS_ROUGH_THRESHOLD = 0.2

[MIXIN: Navigator_BehaviourDefault]
SPEED_REFRESH_RATE_HZ = 2
CURRENT_TRACK_SHOW_FOR = 3
TRAVEL_INFO_DISTANCE_ROUND_TO = 25
TRAVEL_INFO_REFRESH_RATE_HZ = 2
UPCOMING_TURN_DISTANCE_ROUND_TO = 25
SATELLITE_LEVEL_REFRESH_RATE_HZ = 2

[MIXIN: Navigator_BehaviourAndroidAuto]
UI_SKIP_FRAMES = 1
UI_SKIP_FRAMES_MAP = 1
MAP_OFFSET = 0.35, 0.2

[MIXIN: Navigator_LoadingIcon]
LOADING_TEXTURE_NAME = $Texture
LOADING_TEXTURE_UV_0 = $" ${Start:vec2:or=vec2()} / ${Resolution:vec2:or=vec2(1, 1)} "
LOADING_TEXTURE_UV_1 = $" ( ${Start:vec2:or=vec2()} + ${Size:vec2:or=vec2(1, 1)} ) / ${Resolution:vec2:or=vec2(1, 1)} "
LOADING_TEXTURE_BRIGHTNESS = ${Brightness:?}
LOADING_ICON_SCALE = $" (2 + ${Size:x} / ${Size:y}) / 3 ", $" (2 + ${Size:x} / ${Size:y}) / 3 * ${Size:y} / ${Size:x} "

[INCLUDE: common/materials_interior.ini]
[TEMPLATE: _Navigator_ExtraShape EXTENDS Material_DigitalScreen]
@ACTIVE = $" read('car/index', -1) == 0 "
@OUTPUT = EXTRA_SHAPE_...
MESH_NAME = __navigator_mesh_${_Navigator_Mesh}
PARENT = COCKPIT_HR
AlignPoints = 1
VERTICES_0 = $"
  local p1, p2, p3, p4 = ${P1:vec3}, ${P2:vec3}, ${P3:vec3}, ${P4:vec3}
  if ${AlignPoints:bool} then
    local d = (p4 - p3 + p1 - p2) / 4
    local i1 = (p1 + p2) / 2
    local i2 = (p3 + p4) / 2
    p1, p2 = i1 + d, i1 - d
    p3, p4 = i2 - d, i2 + d
  end
  local nm = (p4 - p1):cross(p2 - p1):normalizeSelf() * 0.001
  return { p1 + nm, p3 + nm, p2 + nm, p1 + nm, p4 + nm, p3 + nm }"
VERTICES_0_UV = 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1
ScreenScale = 240
MatrixType = TN

; Set AlignPoints to 0 to disable points alignment
[MIXIN: Navigator_ExtraShape]
_Navigator_Mesh = $" def($_Navigator_Mesh, 0) + 1 "
_Navigator_Resolution = $" ${Scale:number:or=1} * 1024 "
Meshes = __navigator_mesh_${_Navigator_Mesh}
@GENERATOR = _Navigator_ExtraShape
Resolution = $_Navigator_Resolution, $" math.ceil(${_Navigator_Resolution} * math.min(2, (${P3:vec3} - ${P2:vec3} + ${P4:vec3} - ${P1:vec3}):length() / (${P2:vec3} - ${P1:vec3} + ${P3:vec3} - ${P4:vec3}):length())) "
Size = $Resolution
Offset = 0, 0
RESOLUTION_LIMIT = 512

[MIXIN: Navigator_Size]
Resolution = $" ${Resolution:vec2} * def($Scale, 1) "
Offset = $" def2($Offset, 0, 0) * def($Scale, 1) "
Size = $" def($Size, ${Resolution:vec2} - def2($Offset, 0, 0)) * def($Scale, 1) "

[TEMPLATE: Navigator_Base]
@OUTPUT = NAVIGATOR_...
MESHES = $Meshes
RESOLUTION = $Resolution
DISPLAY_POS = $Offset
DISPLAY_SIZE = $Size
UI_BRIGHTNESS = $" def($Brightness, 0.5) "
@ = Navigator_Defaults

[MIXIN: Navigator_Defaults]
@ = Navigator_CameraParamsDefault
@ = Navigator_ComponentsDefaultValues
@ = Navigator_CarMarkDefault
@ = Navigator_GPSDefault
@ = Navigator_BehaviourDefault
@ = Navigator_IconsDefault
@ = Navigator_LinesDefault

[TEMPLATE: Navigator_Test EXTENDS Navigator_Base]
; @ = Navigator_MapDark
; @ = Navigator_MapDefault
; @ = Navigator_MapModern
; @ = Navigator_MapModernDark
; @ = Navigator_MapSygic
@ = Navigator_MapRacing

@ = Navigator_ThemeDefault
; @ = Navigator_ThemeDark
; @ = Navigator_ThemeModern
; @ = Navigator_ThemeModernDark
; @ = Navigator_ThemeSygic

@ = Navigator_LayoutDefault
; @ = Navigator_LayoutModern
; @ = Navigator_LayoutSygic

@ = Navigator_CameraParamsModern

[TEMPLATE: Navigator EXTENDS Navigator_Base]
@ = Navigator_MapDefault
@ = Navigator_ThemeDefault
@ = Navigator_LayoutDefault
@ = Navigator_CameraParamsDefault

[TEMPLATE: Navigator_StyleSimpleLight EXTENDS Navigator_Base]
@ = Navigator_MapDefault
@ = Navigator_ThemeDefault
@ = Navigator_LayoutDefault

[TEMPLATE: Navigator_StyleSimpleDark EXTENDS Navigator_Base]
@ = Navigator_MapDark
@ = Navigator_ThemeDark
@ = Navigator_LayoutDefault

[TEMPLATE: Navigator_StyleModernLight EXTENDS Navigator_Base]
@ = Navigator_MapModern
@ = Navigator_ThemeModern
@ = Navigator_LayoutModern
@ = Navigator_CameraParamsModern

[TEMPLATE: Navigator_StyleModernDark EXTENDS Navigator_Base]
@ = Navigator_MapModernDark
@ = Navigator_ThemeModernDark
@ = Navigator_LayoutModern
@ = Navigator_CameraParamsModern

[TEMPLATE: Navigator_StyleAndroidAuto EXTENDS Navigator_Base]
@ = Navigator_MapModernDark
@ = Navigator_ThemeModernDark
@ = Navigator_LayoutModern
@ = Navigator_CameraParamsModern

[TEMPLATE: Navigator_StyleSygic EXTENDS Navigator_Base]
@ = Navigator_MapSygic
@ = Navigator_ThemeSygic
@ = Navigator_LayoutSygic
@ = Navigator_CameraParamsModern

[TEMPLATE: Navigator_StyleNavitel EXTENDS Navigator_Base]
@ = Navigator_MapNavitel
@ = Navigator_ThemeNavitel
@ = Navigator_LayoutNavitel
@ = Navigator_CameraParamsExtreme

[TEMPLATE: Navigator_StyleRacing EXTENDS Navigator_Base]
@ = Navigator_MapRacing
@ = Navigator_ThemeRounded
@ = Navigator_LayoutRounded
@ = Navigator_GPSRacing
@ = Navigator_CameraParamsRacing

[TEMPLATE: Navigator_AndroidAuto EXTENDS Navigator_Base]
@ = Navigator_CarMarkAndroidAuto
@ = Navigator_BehaviourAndroidAuto
@ = Navigator_MapModernDark
@ = Navigator_ThemeModernDark
@ = Navigator_LayoutAndroidAuto
@ = Navigator_ImmediateLoading
@ = Navigator_CameraParamsModern
