dofile(LockOn_Options.common_script_path.."devices_defs.lua")
dofile(LockOn_Options.script_path.."materials.lua")
dofile(LockOn_Options.common_script_path.."ViewportHandling.lua")

update_screenspace_diplacement(SelfWidth/SelfHeight,false)

indicator_type = indicator_types.COMMON
purposes 	   = {render_purpose.GENERAL, render_purpose.HUD_ONLY_VIEW, render_purpose.SCREENSPACE_INSIDE_COCKPIT}
used_render_mask = 	LockOn_Options.script_path.."Resources/MPCD/MPCD_VIDEO_MASK.dds" --default mask for TV
--used_render_mask = 	"Litening_interleave.bmp" --default mask for TV

if monitorpos == 'R' then
	try_find_assigned_viewport("RIGHT_MFCD")
else 
	try_find_assigned_viewport("LEFT_MFCD")
end

-- Pages Definition
MPCD_MENU		= 0
MPCD_FLIR		= 1
MPCD_EHSD		= 2
MPCD_DMT		= 3
MPCD_STRS		= 4
MPCD_HUD		= 5
MPCD_BIT		= 6
MPCD_VRST		= 8
MPCD_ENG		= 11
MPCD_CONF		= 12
MPCD_TPOD		= 13
MPCD_IFF		= 14
MPCD_EW			= 15
MPCD_CARD		= 16
MPCD_CAS		= 17
MPCD_EPCD		= 18
MPCD_SDAT		= 19
MPCD_COMM		= 20

-- Subpages Definitions
-- NAVFLIR Subpages
MPCD_FLIR_NAV		= 30
MPCD_FLIR_BRS		= 31

-- EHSD Subpages
MPCD_EHSD_STR		= 40
MPCD_EHSD_DATA		= 42
MPCD_EHSD_DATA_GPS	= 43
MPCD_EHSD_ALIGN		= 44
MPCD_EHSD_TEST		= 46
MPCD_EHSD_INS_OFF	= 47
MPCD_EHSD_NOINS		= 48
MPCD_EHSD_ALIGN_DAT	= 49
MPCD_EHSD_JDAM		= 55
MPCD_EHSD_CHART		= 56


-- DMT Subpages (NONE)

-- STRS Subpages
MPCD_STRS_BASE		= 50
MPCD_STRS_LSM		= 51
MPCD_STRS_IRM		= 52
MPCD_STRS_IRM_VIDEO	= 53
MPCD_STRS_DMGD		= 54
MPCD_STRS_JDAM		= 57

-- HUD Subpages
MPCD_HUD_BASE		= 60
MPCD_HUD_PG1		= 61

-- BIT Subpages
MPCD_BIT_1			= 70
MPCD_BIT_2			= 71
MPCD_BIT_SMS		= 72
MPCD_BIT_FBST		= 73

-- VRST Subpages
MPCD_VRST_BSC		= 80
MPCD_VRST_VTO		= 81
MPCD_VRST_STO		= 82
MPCD_VRST_CRS		= 83
MPCD_VRST_BNG		= 84

-- ENG Subpages
MPCD_ENG_EMS		= 90
MPCD_ENG_PHOV		= 91

-- CONF Subpages
MPCD_CONF_1			= 95
MPCD_CONF_2			= 96
MPCD_CONF_3			= 97

--TPOD Subpages
MPCD_TPOD_CCD_PR	= 100
MPCD_TPOD_CCD_DT	= 101
MPCD_TPOD_FLIR_PR	= 102
MPCD_TPOD_FLIR_DT	= 103
MPCD_TPOD_NAV_PR	= 104
MPCD_TPOD_NAV_DT	= 105
MPCD_TPOD_VCR_DSPLY	= 106

-- EW Subpages
MPCD_EW_RWR			= 120
MPCD_EW_CMD_PRG		= 121

-- CARD Subpages

-- CAS Subpages
MPCD_CAS_PAGE		= 130
MPCD_CAS_LIST		= 131

-- EPCD Subpages
MPCD_EPCD_MENU		= 140

-- SDAT Subpages


-- Page Sources
SRC_MPCD_BASE	= 0
SRC_MPCD_FLIR	= 1
SRC_MPCD_EHSD	= 2
SRC_MPCD_DMT	= 3
SRC_MPCD_STRS	= 4
SRC_MPCD_HUD	= 5
SRC_MPCD_BIT	= 6
SRC_MPCD_VRST	= 8
SRC_MPCD_ENG	= 11
SRC_MPCD_CONF	= 12
SRC_MPCD_TPOD	= 13
SRC_MPCD_IFF	= 14
SRC_MPCD_EW		= 15
SRC_MPCD_CARD	= 16
SRC_MPCD_CAS	= 17
SRC_MPCD_EPCD	= 18
SRC_MPCD_SDAT	= 19
SRC_MPCD_COMM	= 20
SRC_MPCD_MENU	= 99

SRC_FLIR_NAV			= 100
SRC_FLIR_BRS			= 101

SRC_EHSD_NAV			= 110
SRC_EHSD_DATA			= 111
SRC_EHSD_ALIGN			= 112
SRC_EHSD_TEST			= 114
SRC_EHSD_NOINS			= 115
SRC_EHSD_DATA_GPS		= 116
SRC_EHSD_NAV_AG			= 117
SRC_EHSD_INS_OFF		= 118
SRC_EHSD_ALIGN_DATA		= 119
SRC_EHSD_JDAM			= 124
SRC_EHSD_CHART			= 125

SRC_DMT_VIDEO			= 120
SRC_DMT_INS_WPT			= 121
SRC_DMT_INS_TGT			= 122
SRC_DMT_AG_INS_TD		= 123

SRC_STRS_LSM			= 130
SRC_STRS_IRM			= 131
SRC_STRS_IRM_VIDEO		= 132
SRC_STRS_DMGD			= 133
SRC_STRS_JDAM			= 134

SRC_MPCD_BIT_1			= 140
SRC_MPCD_BIT_2			= 141
SRC_MPCD_BIT_SMS		= 142
SRC_MPCD_BIT_FBST		= 143

SRC_VRST_BSC			= 150
SRC_VRST_VTO			= 151
SRC_VRST_STO			= 152
SRC_VRST_CRS			= 153
SRC_VRST_BNG			= 154

SRC_MPCD_ENG_EMS		= 160
SRC_MPCD_ENG_PHOV		= 161

SRC_MPCD_CONF_1			= 165
SRC_MPCD_CONF_2			= 166
SRC_MPCD_CONF_3			= 167

SRC_TPOD_CCD_PR			= 170
SRC_TPOD_CCD_DT			= 171
SRC_TPOD_FLIR_PR		= 172
SRC_TPOD_FLIR_DT		= 173
SRC_TPOD_NAV_PR			= 174
SRC_TPOD_NAV_DT			= 175
SRC_TPOD_VCR_DSPLY		= 176

SRC_EW_RWR				= 180
SRC_EW_CMD_PRG			= 181

SRC_CAS_PAGE			= 190
SRC_CAS_LIST			= 191

SRC_EPCD_MENU			= 200

local mpcd_path = LockOn_Options.script_path.."MPCD/indicator/"

page_subsets = {
	[SRC_MPCD_BASE]				= mpcd_path.."MPCD_base.lua",
	[SRC_MPCD_MENU]				= mpcd_path.."MENU/MENU_Page_0.lua",
	-- FLIR
	[SRC_FLIR_NAV]				= mpcd_path.."FLIR/FLIR_Page_00.lua",
	-- EHSD
	[SRC_EHSD_NAV]				= mpcd_path.."EHSD/NAV/EHSD_NAV_DSPLY.lua",
	[SRC_EHSD_JDAM]				= mpcd_path.."EHSD/NAV/EHSD_JDAM_DTA_DSPLY.lua",
	[SRC_EHSD_DATA]				= mpcd_path.."EHSD/DATA/EHSD_DAT_DSPLY.lua",
	[SRC_EHSD_DATA_GPS]			= mpcd_path.."EHSD/DATA/EHSD_DAT_GPS.lua",
	[SRC_EHSD_ALIGN]			= mpcd_path.."EHSD/ALGN/EHSD_ALN_DSPLY.lua",
	[SRC_EHSD_TEST]				= mpcd_path.."EHSD/EHSD_TST_DSPLY.lua",
	[SRC_EHSD_NOINS]			= mpcd_path.."EHSD/EHSD_NO_INS.lua",
	[SRC_EHSD_INS_OFF]			= mpcd_path.."EHSD/EHSD_OFF_DSPLY.lua",
	[SRC_EHSD_CHART]			= mpcd_path.."EHSD/EHSD_CHART_DSPLY.lua",
	-- DMT
	[SRC_MPCD_DMT]				= mpcd_path.."DMT/DMT_Page_00.lua",
	-- STRS
	[SRC_MPCD_STRS]				= mpcd_path.."STRS/STRS_Page_00.lua",
	[SRC_STRS_LSM]				= mpcd_path.."STRS/STRS_Page_10.lua",
	[SRC_STRS_IRM]				= mpcd_path.."STRS/STRS_Page_20.lua",
	[SRC_STRS_IRM_VIDEO]		= mpcd_path.."STRS/STRS_Page_IRMV.lua",
	[SRC_STRS_DMGD]				= mpcd_path.."STRS/STRS_Page_DMGD.lua",
	[SRC_STRS_JDAM]				= mpcd_path.."STRS/STRS_Page_JDAM.lua",
	-- HUD
	[SRC_MPCD_HUD]				= mpcd_path.."HUD/MPCD_HUD_Base.lua",
	-- VRST
	[SRC_VRST_BSC]				= mpcd_path.."VRST/VRST_BASIC.lua",
	[SRC_VRST_VTO]				= mpcd_path.."VRST/VRST_VLTO.lua",
	[SRC_VRST_STO]				= mpcd_path.."VRST/VRST_STO.lua",
	[SRC_VRST_CRS]				= mpcd_path.."VRST/VRST_CRUS.lua",
	[SRC_VRST_BNG]				= mpcd_path.."VRST/VRST_BINGO.lua",
	-- BIT
	[SRC_MPCD_BIT_1]			= mpcd_path.."BIT/BIT_Page_0.lua",
	[SRC_MPCD_BIT_2]			= mpcd_path.."BIT/BIT_Page_1.lua",
	[SRC_MPCD_BIT_SMS]			= mpcd_path.."BIT/BIT_Page_SMS.lua",
	[SRC_MPCD_BIT_FBST]			= mpcd_path.."FLIR/FLIR_Page_10.lua",
	-- ENG
	[SRC_MPCD_ENG]				= mpcd_path.."ENG/ENG_Page_0.lua",
	[SRC_MPCD_ENG_PHOV]			= mpcd_path.."ENG/ENG_Page_2.lua",
	-- CONF
	[SRC_MPCD_CONF_1]			= mpcd_path.."CONF/CONF_Page_0.lua",
	[SRC_MPCD_CONF_2]			= mpcd_path.."CONF/CONF_Page_1.lua",
	[SRC_MPCD_CONF_3]			= mpcd_path.."CONF/CONF_Page_2.lua",
	--TPOD
	[SRC_TPOD_CCD_PR]			= mpcd_path.."TPOD/TPOD_PRI_DISPY.lua",
	[SRC_TPOD_CCD_DT]			= mpcd_path.."TPOD/TPOD_DTA_DISPY.lua",
	[SRC_TPOD_FLIR_PR]			= mpcd_path.."TPOD/TPOD_PRI_DISPY.lua",
	[SRC_TPOD_FLIR_DT]			= mpcd_path.."TPOD/TPOD_DTA_DISPY.lua",
	[SRC_TPOD_NAV_PR]			= mpcd_path.."TPOD/TPOD_NAV_PRI.lua",
	[SRC_TPOD_NAV_DT]			= mpcd_path.."TPOD/TPOD_NAV_DAT.lua",
	[SRC_TPOD_VCR_DSPLY]		= mpcd_path.."TPOD/TPOD_VCR_DSPLY.lua",
	-- EW
	[SRC_EW_RWR]				= mpcd_path.."EW/EW_Page_00.lua",
	[SRC_EW_CMD_PRG]			= mpcd_path.."EW/EW_Page_01.lua",
	-- CARD
	[SRC_MPCD_CARD]				= mpcd_path.."CARD/CARD_PAGE.lua",
	-- CAS
	[SRC_CAS_PAGE]				= mpcd_path.."CAS/CAS_PAGE.lua",
	[SRC_CAS_LIST]				= mpcd_path.."CAS/CAS_LST.lua",
	-- EPCD
	[SRC_EPCD_MENU]				= mpcd_path.."EPCD/EPCD_BASE.lua",
	-- SDAT
	[SRC_MPCD_SDAT]				= mpcd_path.."SDAT/SDAT_PAGE.lua",
	-- COMM
	[SRC_MPCD_COMM]				= mpcd_path.."COMM/COMM_PAGE_1.lua",
}

----------------------
pages = {
	[MPCD_MENU]				= {SRC_MPCD_BASE, SRC_MPCD_MENU},
	-- FLIR
	[MPCD_FLIR]				= {SRC_MPCD_BASE, SRC_FLIR_NAV},
	-- EHSD
	[MPCD_EHSD_STR]			= {SRC_MPCD_BASE, SRC_EHSD_NAV},
	[MPCD_EHSD_DATA]		= {SRC_MPCD_BASE, SRC_EHSD_DATA},
	[MPCD_EHSD_DATA_GPS]	= {SRC_MPCD_BASE, SRC_EHSD_DATA_GPS},
	[MPCD_EHSD_ALIGN]		= {SRC_MPCD_BASE, SRC_EHSD_ALIGN},
	[MPCD_EHSD_TEST]		= {SRC_MPCD_BASE, SRC_EHSD_TEST},
	[MPCD_EHSD_INS_OFF]		= {SRC_MPCD_BASE, SRC_EHSD_INS_OFF},
	[MPCD_EHSD_NOINS]		= {SRC_MPCD_BASE, SRC_EHSD_NOINS},
	[MPCD_EHSD_JDAM]		= {SRC_MPCD_BASE, SRC_EHSD_JDAM},
	[MPCD_EHSD_CHART]		= {SRC_MPCD_BASE, SRC_EHSD_CHART},
	-- DMT
	[MPCD_DMT]				= {SRC_MPCD_BASE, SRC_MPCD_DMT},
	-- STORES
	[MPCD_STRS_BASE]		= {SRC_MPCD_BASE, SRC_MPCD_STRS},
	[MPCD_STRS_LSM]			= {SRC_MPCD_BASE, SRC_STRS_LSM},
	[MPCD_STRS_IRM]			= {SRC_MPCD_BASE, SRC_STRS_IRM},
	[MPCD_STRS_IRM_VIDEO]	= {SRC_MPCD_BASE, SRC_STRS_IRM_VIDEO},
	[MPCD_STRS_DMGD]		= {SRC_MPCD_BASE, SRC_STRS_DMGD},
	[MPCD_STRS_JDAM]		= {SRC_MPCD_BASE, SRC_STRS_JDAM},
	-- HUD
	[MPCD_HUD_BASE]			= {SRC_MPCD_BASE, SRC_MPCD_HUD},
	-- VRST
	[MPCD_VRST_BSC]			= {SRC_MPCD_BASE, SRC_VRST_BSC},
	[MPCD_VRST_VTO]			= {SRC_MPCD_BASE, SRC_VRST_VTO},
	[MPCD_VRST_STO]			= {SRC_MPCD_BASE, SRC_VRST_STO},
	[MPCD_VRST_CRS]			= {SRC_MPCD_BASE, SRC_VRST_CRS},
	[MPCD_VRST_BNG]			= {SRC_MPCD_BASE, SRC_VRST_BNG},
	-- BIT
	[MPCD_BIT_1]			= {SRC_MPCD_BASE, SRC_MPCD_BIT_1},
	[MPCD_BIT_2]			= {SRC_MPCD_BASE, SRC_MPCD_BIT_2},
	[MPCD_BIT_SMS]			= {SRC_MPCD_BASE, SRC_MPCD_BIT_SMS},
	[MPCD_BIT_FBST]			= {SRC_MPCD_BASE, SRC_MPCD_BIT_FBST},
	-- ENG
	[MPCD_ENG]				= {SRC_MPCD_BASE, SRC_MPCD_ENG},
	[MPCD_ENG_PHOV]			= {SRC_MPCD_BASE, SRC_MPCD_ENG_PHOV},
	-- CONF
	[MPCD_CONF_1]			= {SRC_MPCD_BASE, SRC_MPCD_CONF_1},
	[MPCD_CONF_2]			= {SRC_MPCD_BASE, SRC_MPCD_CONF_2},
	[MPCD_CONF_3]			= {SRC_MPCD_BASE, SRC_MPCD_CONF_3},
	-- TPOD
	[MPCD_TPOD_CCD_PR]		= {SRC_MPCD_BASE, SRC_TPOD_CCD_PR},
	[MPCD_TPOD_CCD_DT]		= {SRC_MPCD_BASE, SRC_TPOD_CCD_DT},
	[MPCD_TPOD_FLIR_PR]		= {SRC_MPCD_BASE, SRC_TPOD_FLIR_PR},
	[MPCD_TPOD_FLIR_DT]		= {SRC_MPCD_BASE, SRC_TPOD_FLIR_DT},
	[MPCD_TPOD_NAV_PR]		= {SRC_MPCD_BASE, SRC_TPOD_NAV_PR},
	[MPCD_TPOD_NAV_DT]		= {SRC_MPCD_BASE, SRC_TPOD_NAV_DT},
	[MPCD_TPOD_VCR_DSPLY]	= {SRC_MPCD_BASE, SRC_TPOD_VCR_DSPLY},
	-- EW
	[MPCD_EW_RWR]			= {SRC_MPCD_BASE, SRC_EW_RWR},
	[MPCD_EW_CMD_PRG]		= {SRC_MPCD_BASE, SRC_EW_CMD_PRG},
	-- CARD
	[MPCD_CARD]				= {SRC_MPCD_BASE, SRC_MPCD_CARD},
	-- CAS
	[MPCD_CAS_PAGE]			= {SRC_MPCD_BASE, SRC_CAS_PAGE},
	[MPCD_CAS_LIST]			= {SRC_MPCD_BASE, SRC_CAS_LIST},
	-- EPCD
	[MPCD_EPCD_MENU]		= {SRC_MPCD_BASE, SRC_EPCD_MENU},
	-- SDAT
	[MPCD_SDAT]				= {SRC_MPCD_BASE, SRC_MPCD_SDAT},
	-- COMM
	[MPCD_COMM]				= {SRC_MPCD_BASE, SRC_MPCD_COMM},
}

init_pageID			= MPCD_MENU

-- MPCD Colors
day_color    = {122/255, 240/255, 41/255, 255/255}
night_color  = {112/255, 200/255, 60/255, 255/255}
day_white    = {255/255, 255/255, 255/255, 255/255}
dark_green   = {0/255, 0/255, 0/255, 255/255}
