size = { 2048, 2048 }

-- window size issue for panels
defineProperty("closeImage", loadImage("close.png"))  -- close image
defineProperty("window_height",globalPropertyi("sim/graphics/view/window_height"))
defineProperty("window_width",globalPropertyi("sim/graphics/view/window_width"))

createProp("sim/custom/xap/wave_limit_n", "int"); -- wave limit value

createProp("sim/custom/xap/avionics_night_light", "float"); -- avionics night light
createProp("sim/custom/xap/post_effect", "int");
createProp("sim/custom/xap/post_effect_trans", "float");
createProp("sim/custom/xap/position_saving", "int"); 
createProp("sim/custom/xap/hood_broke", "int");
createProp("sim/custom/xap/prop_broke", "int");
createProp("sim/custom/xap/fwd_door_broke", "int");
createProp("sim/custom/xap/flag_deg", "float");


local coef = get(window_height) / 1024
if coef > 1 then coef = 1 end

-- add post effect subpanel
vinet = subpanel {
	position = { 0, 0, get(window_width), get(window_height)};
	noBackground = true;
	noClose = true;
	noResize = true;
	movable = false;
	noVisible = true;
	clickable = false;
	components = {
		 vinet { 
         position = { 0, 0, get(window_width), get(window_height)},
         };
     };
}

-- add swithes panel

switches_menu = subpanel {
    position = { (get(window_width) / 2) - (615 * coef) , get(window_height) - (960 * coef) , 1230 * coef, 142 * coef };
    noBackground = true;
    noClose = true;
    movable = true;
    clickable = true;
    noResize = false;
    components = {
		 switches_panel { 
         position = { 0, 0, 1230 * coef, 142 * coef },
         };
		 textureLit {
		 position = {1210 * coef, 122 * coef, 22 * coef, 22 * coef},
		 image = get(closeImage),
		 };
	};
}
components = {

-- aircraft logic of systems and failures
   aircraft_logic {}, 
-- position saving function
   save_position {},
   -- logic of panels
   panel_logic {
	panel_2 = switches_menu,
	panel_3 = vinet,
 },    
}

