_f18 = _this select 0

?!(local _f18): exit

?(_f18 isKindOf "fz_f18f_aws"): [_f18] exec "dialog_f.sqs"; exit

fzloaddialog = 1

_ok = createDialog "fz_f18e_loadout"
;;hardpoint
_empt102 = lbAdd [102, "EMPTY"]
lbSetData [102, _empt102, "EMPTY"]
;;1
_4x120102 = lbAdd [102, "4xAIM-120C"]
lbSetData [102, _4x120102, "4xAIM-120C"]
;;2
_4x82102 = lbAdd [102, "4xMk82"]
lbSetData [102, _4x82102, "4xMk82"]
;;3
_4x83102 = lbAdd [102, "4xMk83"]
lbSetData [102, _4x83102, "4xMk83"]
;;4
_4x20102 = lbAdd [102, "4xMk20"]
lbSetData [102, _4x20102, "4xMk20"]
;;5
_2x84102 = lbAdd [102, "2xMk84"]
lbSetData [102, _2x84102, "2xMk84"]
;;6
_2xgbu10102 = lbAdd [102, "2xGBU-10"]
lbSetData [102, _2xgbu10102, "2xGBU-10"]
;;7
_2xagm65102 = lbAdd [102, "2xAGM-65E"]
lbSetData [102, _2xagm65102, "2xAGM-65E"]
;;8
_2x88102 = lbAdd [102, "2xAGM-88"]
lbSetData [102, _2x88102, "2xAGM-88"]
;;9
_4x330102 = lbAdd [102, "2x480GAL"]
lbSetData [102, _4x330102, "2x480GAL"]
;;10
_2xjsow102 = lbAdd [102, "2xAGM-154A"]
lbSetData [102, _2xjsow102, "2xAGM-154A"]
;;11
_4xcbu78102 = lbAdd [102, "4xCBU-78"]
lbSetData [102, _4xcbu78102, "4xCBU-78"]
;;12
_index = lbAdd [102, "4xGBU-12"]
lbSetData [102, _index, "4xGBU-12"]
;;13
_index = lbAdd [102, "4xGBU-16"]
lbSetData [102, _index, "4xGBU-16"]
;;14
_index = lbAdd [102, "2xAGM-84D"]
lbSetData [102, _index, "2xAGM-84D"]
;;15
_index = lbAdd [102, "2xAGM-84H"]
lbSetData [102, _index, "2xAGM-84H"]
;;hardpoint
_index = lbAdd [103, "EMPTY"]
lbSetData [103, _index, "EMPTY"]
;;1
_index = lbAdd [103, "4xAIM-120C"]
lbSetData [103, _index, "4xAIM-120C"]
;;2
_index = lbAdd [103, "2xAIM-7M"]
lbSetData [103, _index, "2xAIM-7M"]
;;3
_index = lbAdd [103, "4xMk82"]
lbSetData [103, _index, "4xMk82"]
;;4
_index = lbAdd [103, "4xMk83"]
lbSetData [103, _index, "4xMk83"]
;;5
_index = lbAdd [103, "4xMk20"]
lbSetData [103, _index, "4xMk20"]
;;6
_index = lbAdd [103, "2xMk84"]
lbSetData [103, _index, "2xMk84"]
;;7
_index = lbAdd [103, "2xGBU-10"]
lbSetData [103, _index, "2xGBU-10"]
;;8
_index = lbAdd [103, "2xAGM-65E"]
lbSetData [103, _index, "2xAGM-65E"]
;;9
_index = lbAdd [103, "2xAGM-88"]
lbSetData [103, _index, "2xAGM-88"]
;;10
_index = lbAdd [103, "2xAGM-154A"]
lbSetData [103, _index, "2xAGM-154A"]
;;11
_index = lbAdd [103, "4xCBU-78"]
lbSetData [103, _index, "4xCBU-78"]
;;12
_index = lbAdd [103, "2x480GAL"]
lbSetData [103, _index, "2x480GAL"]
;;13
_index = lbAdd [103, "4xGBU-12"]
lbSetData [103, _index, "4xGBU-12"]
;;14
_index = lbAdd [103, "4xGBU-16"]
lbSetData [103, _index, "4xGBU-16"]
;;15
_index = lbAdd [103, "2xAGM-84D"]
lbSetData [103, _index, "2xAGM-84D"]
;;16
_index = lbAdd [103, "2xAGM-84H"]
lbSetData [103, _index, "2xAGM-84H"]
;;hardpoint
_index = lbAdd [104, "EMPTY"]
lbSetData [104, _index, "EMPTY"]
;;1
_index = lbAdd [104, "2xMk82"]
lbSetData [104, _index, "2xMk82"]
;;2
_index = lbAdd [104, "2xMk20"]
lbSetData [104, _index, "2xMk20"]
;;3
_index = lbAdd [104, "2xMk83"]
lbSetData [104, _index, "2xMk83"]
;;4
_index = lbAdd [104, "2xAGM-65E"]
lbSetData [104, _index, "2xAGM-65E"]
;;5
_index = lbAdd [104, "2xAGM-88"]
lbSetData [104, _index, "2xAGM-88"]
;;6
_index = lbAdd [104, "2xCBU-78"]
lbSetData [104, _index, "2xCBU-78"]
;;7
_index = lbAdd [104, "2xGBU-12"]
lbSetData [104, _index, "2xGBU-12"]
;;8
_index = lbAdd [104, "2xGBU-16"]
lbSetData [104, _index, "2xGBU-16"]
;;9
_index = lbAdd [104, "2xAIM-120C"]
lbSetData [104, _index, "2xAIM-120C"]
;;hardpoint
_index = lbAdd [105, "EMPTY"]
lbSetData [105, _index, "EMPTY"]
_index = lbAdd [105, "2xAIM-9X"]
lbSetData [105, _index, "2xAIM-9X"]
_index = lbAdd [105, "2xAIM-9M"]
lbSetData [105, _index, "2xAIM-9M"]
;;hardpoint
_index = lbAdd [106, "EMPTY"]
lbSetData [106, _index, "EMPTY"]
_index = lbAdd [106, "1x480GAL"]
lbSetData [106, _index, "1x480GAL"]
;;hardpoint
_index = lbAdd [107, "EMPTY"]
lbSetData [107, _index, "EMPTY"]
_index = lbAdd [107, "1xAIM-120C"]
lbSetData [107, _index, "1xAIM-120C"]
_index = lbAdd [107, "1xAIM-7M"]
lbSetData [107, _index, "1xAIM-7M"]
;;hardpoint
_index1108 = lbAdd [108, "EMPTY"]
lbSetData [108, _index1108, "EMPTY"]
_index2108 = lbAdd [108, "1xAIM-120C"]
lbSetData [108, _index2108, "1xAIM-120C"]
_index3108 = lbAdd [108, "1xAIM-7M"]
lbSetData [108, _index3108, "1xAIM-7M"]
_index4108 = lbAdd [108, "1xATFLIR"]
lbSetData [108, _index4108, "1xATFLIR"]
;;end hardpoints

;;weapon info drop down
_wepinfo = lbAdd [114, "WEAPON INFO"]
lbSetData [114, _wepinfo, "WEAPON INFO"]
;;1
_wepinfo = lbAdd [114, "480GAL"]
lbSetData [114, _wepinfo, "480GAL"]
;;2
_wepinfo = lbAdd [114, "AIM-7M"]
lbSetData [114, _wepinfo, "AIM-7M"]
;;3
_wepinfo = lbAdd [114, "AIM-9M"]
lbSetData [114, _wepinfo, "AIM-9M"]
;;4
_wepinfo = lbAdd [114, "AIM-9X"]
lbSetData [114, _wepinfo, "AIM-9X"]
;;5
_wepinfo = lbAdd [114, "AIM-120C"]
lbSetData [114, _wepinfo, "AIM-120C"]
;;6
_wepinfo = lbAdd [114, "AGM-65E"]
lbSetData [114, _wepinfo, "AGM-65E"]
;;7
_wepinfo = lbAdd [114, "AGM-84D"]
lbSetData [114, _wepinfo, "AGM-84D"]
;;8
_wepinfo = lbAdd [114, "AGM-84H"]
lbSetData [114, _wepinfo, "AGM-84H"]
;;9
_wepinfo = lbAdd [114, "AGM-88C"]
lbSetData [114, _wepinfo, "AGM-88C"]
;;10
_wepinfo = lbAdd [114, "AGM-154A"]
lbSetData [114, _wepinfo, "AGM-154A"]
;;11
_wepinfo = lbAdd [114, "GBU-10"]
lbSetData [114, _wepinfo, "GBU-10"]
;;12
_wepinfo = lbAdd [114, "GBU-12"]
lbSetData [114, _wepinfo, "GBU-12"]
;;13
_wepinfo = lbAdd [114, "GBU-16"]
lbSetData [114, _wepinfo, "GBU-16"]
;;14
_wepinfo = lbAdd [114, "Mk20"]
lbSetData [114, _wepinfo, "Mk20"]
;;15
_wepinfo = lbAdd [114, "CBU-78"]
lbSetData [114, _wepinfo, "CBU-78"]
;;16
_wepinfo = lbAdd [114, "Mk82"]
lbSetData [114, _wepinfo, "Mk82"]
;;17
_wepinfo = lbAdd [114, "Mk83"]
lbSetData [114, _wepinfo, "Mk83"]
;;18
_wepinfo = lbAdd [114, "Mk84"]
lbSetData [114, _wepinfo, "Mk84"]
;;19
_wepinfo = lbAdd [114, "D-704P"]
lbSetData [114, _wepinfo, "D-704P"]
;;end wep info

lbSetCurSel [102, 0]
lbSetCurSel [103, 0]
lbSetCurSel [104, 0]
lbSetCurSel [105, 0]
lbSetCurSel [106, 0]
lbSetCurSel [107, 0]
lbSetCurSel [108, 0]
lbSetCurSel [114, 0]

#loop
?(fzloaddialog == 0): exit
~0.001
_cntxt = format ["%1",_f18 ammo "fz_f18_m61"]
_cntxt = _cntxt + " ROUNDS"
ctrlSetText [120, _cntxt]
_fltxt = (fuel vehicle _f18) * 100
_fltxt = format ["%1",_fltxt]
_fltxt = _fltxt + "% INT FUEL"
ctrlSetText [121, _fltxt]
_dmtxt = (getdammage _f18) * 100
_dmtxt = format ["%1",_dmtxt]
_dmtxt = _dmtxt + "% DAMAGE"
ctrlSetText [122, _dmtxt]
_selectedcntr = lbCurSel 106
_selectedwing1 = lbCurSel 102
_selectedwing2 = lbCurSel 103
_selectedwing3 = lbCurSel 104
_selectedfuse1 = lbCurSel 108
_selectedfuse2 = lbCurSel 107
_selectedwingtip = lbCurSel 105
hp1wep = _selectedwing1
hp2wep = _selectedwing2
hp3wep = _selectedwing3
rightfusewep = _selectedfuse2
leftfusewep = _selectedfuse1
?(hp1wep == 4 and hp2wep == 11): lbSetCurSel [102, 0]
?(hp1wep == 11 and hp2wep == 5): lbSetCurSel [103, 0]
?(_selectedcntr == 0): cntrtnk = 0
?(_selectedcntr == 1): cntrtnk = 1
?(_selectedwing1 == 9): cntrtnk = 3; lbSetCurSel [106, 1]
?(_selectedcntr == 0 and _selectedwing1 == 9): cntrtnk = 3; lbSetCurSel [106, 1]
?(_selectedwing1 != 9 and cntrtnk == 3 and _selectedcntr == 1): cntrtnk = 1
?(_selectedwing1 != 9 and cntrtnk == 3 and _selectedcntr == 0): cntrtnk = 0
?(_selectedcntr == 1 and _selectedwing1 == 9 and _selectedwing2 == 12): cntrtnk = 6
?(_selectedcntr != 1 and _selectedwing1 != 9 and _selectedwing2 == 12): lbSetCurSel [102, 9]; lbSetCurSel [106, 1]
?(_selectedcntr != 1 and _selectedwing1 == 9 and _selectedwing2 == 12): lbSetCurSel [106, 1]
?(_selectedcntr == 1 and _selectedwing1 != 9 and _selectedwing2 == 12): lbSetCurSel [102, 9]
?(_selectedwing3 == 4 or _selectedwing3 == 7 or _selectedwing3 == 8): lbSetCurSel [108, 3]
?(_selectedwing2 == 7 or _selectedwing2 == 8 or _selectedwing2 == 13 or _selectedwing2 == 14): lbSetCurSel [108, 3]
?(_selectedwing1 == 6 or _selectedwing1 == 7 or _selectedwing1 == 12 or _selectedwing1 == 13): lbSetCurSel [108, 3]
?(_selectedwing1 == 12 and _selectedwing2 == 3): lbSetCurSel [103, 0]
?(_selectedwing1 == 2 and _selectedwing2 == 13): lbSetCurSel [102, 0]
?(_selectedwing1 == 13 and _selectedwing2 == 4): lbSetCurSel [103, 0]
?(_selectedwing1 == 3 and _selectedwing2 == 14): lbSetCurSel [102, 0]
?(_selectedwing1 == 14 and _selectedwing2 == 16): lbSetCurSel [103, 0]
?(_selectedwing1 == 15 and _selectedwing2 == 15): lbSetCurSel [103, 0]
?(_selectedfuse1 == 1): lbSetCurSel [107, 1]
?(_selectedfuse1 == 2): lbSetCurSel [107, 2]
?(_selectedwingtip == 0): wingtipwep = 0
?(_selectedwingtip == 1): wingtipwep = 1
?(_selectedwingtip == 2): wingtipwep = 2
?(lbCurSel 114 == 0): ctrlSetText [116, "Select a weapon for more information."]; ctrlSetText [115, "\fz_f18\gui\nodata.jpg"]
?(lbCurSel 114 == 1): ctrlSetText [116, "The 480 Gallon drop tank is the primary auxilliary fuel tank for the Super Hornet. A maximum of 5 can be carried. Each tank replenishes 15 percent of the internal fuel capacity."]; ctrlSetText [115, "\fz_f18\gui\480gal.jpg"]
?(lbCurSel 114 == 2): ctrlSetText [116, "The AIM-7M is the most current model of the Sparrow available. It was the Navy's first medium range missile, but is now considered obsolete. However, it is still used in many units and the Super Hornet still supports it. It has more power than an AIM-120, but with a less reliable guidance system and shorter range. The Super Hornet can carry a maximum of 4."] && ctrlSetText [115, "\fz_f18\gui\ld_aim7m.jpg"]
?(lbCurSel 114 == 3): ctrlSetText [116, "The AIM-9M is the most common Sidewinder model available. It was a large leap forward over previous variants of the Sidewinder, in that it had an all-aspect seeker. It also included a larger warhead and increased range. It is an effective, simple, and well-balanced short range missile. The Super Hornet can carry 2."] && ctrlSetText [115, "\fz_f18\gui\ld_aim9m.jpg"]
?(lbCurSel 114 == 4): ctrlSetText [116, "The AIM-9X is a next-generation short range missile. It is far more capable than it's predecessor, the AIM-9M. It has a high seeker azimuth and thrust vectoring, coupled with greater range. Its warhead is not powerful, but it is very accurate and maneuverable. The Super Hornet can carry 2."] && ctrlSetText [115, "\fz_f18\gui\wpn_aim9x.jpg"]
?(lbCurSel 114 == 5): ctrlSetText [116, "The AIM-120C is the primary Medium Range Air-To-Air missile for the Super Hornet. It has good range and good damage, and is quite maneuverable for its class. It utilizes a 30kg blast-fragmentation warhead and flies at 3200kmh. The Super Hornet can carry 12."] && ctrlSetText [115, "\fz_f18\gui\ld_aim120c.jpg"]
?(lbCurSel 114 == 6): ctrlSetText [116, "The AGM-65E is a laser guided version of the famed Maverick missile. Rather than unreliable TV guidance or complex imaging infra-red guidance, it relies upon the ATFLIR pod or equivalent laser designator to guide it to it's target. The warhead is powerful enough to destroy most tanks with a single hit. The Super Hornet can carry 6."] && ctrlSetText [115, "\fz_f18\gui\ld_agm65e.jpg"]
?(lbCurSel 114 == 7): ctrlSetText [116, "The AGM-84D is the US Navy's primary anti-ship missile. Originally designed to attack submarines, it was reassigned to the anti-shipping role after the sinking of the Israeli destroyer Eilat. It is guided by a simple three dimensional system initially, then acquires a target through radar. The Super Hornet can carry a maximum of 4."] && ctrlSetText [115, "\fz_f18\gui\wpn_agm84d.jpg"]
?(lbCurSel 114 == 8): ctrlSetText [116, "The AGM-84H, referred to as the SLAM-ER - Stand Off Land Attack Missile - Expanded Response - is a GPS or IIR guided missile. It is used for high value targets from long range. The Super Hornet can carry a maximum of 4."] && ctrlSetText [115, "\fz_f18\gui\wpn_agm84h.jpg"]
?(lbCurSel 114 == 9): ctrlSetText [116, "The AGM-88C is the Super Hornet's primary anti-radiation missile. It flies at a high rate of speed and is capable of flying a great distance to hit it's target. The Super Hornet can carry 6."] && ctrlSetText [115, "\fz_f18\gui\ld_agm88.jpg"]
?(lbCurSel 114 == 10): ctrlSetText [116, "The AGM-154A gives the Super Hornet the capability to strike targets deep in protected enemy territory without putting itself at risk. The AGM-154A is not a missile, but a glide bomb. It carries a payload of submunitions that is excellent against stationary garrisons. The Super Hornet can carry 4."] && ctrlSetText [115, "\fz_f18\gui\ld_agm154a.jpg"]
?(lbCurSel 114 == 11): ctrlSetText [116, "The GBU-10 is a 2,000lb laser guided bomb with a blast fragmentation warhead. It is a highly accurate weapon, but requires significant altitude or speed in order to hit it's target. It has a very large blast radius and is capable of destroying most hardened targets. The Super Hornet can carry 4."] && ctrlSetText [115, "\fz_f18\gui\ld_gb10.jpg"]
?(lbCurSel 114 == 12): ctrlSetText [116, "The GBU-12 is a 500lb laser guided bomb with a blast fragmentation warhead. It is very accurate but requires altitude and speed to strike it's target. The Super Hornet can carry a maximum of 10."] && ctrlSetText [115, "\fz_f18\gui\wpn_gbu12.jpg"]
?(lbCurSel 114 == 13): ctrlSetText [116, "The GBU-16 is a 1000lb warhead with a Paveway guidance kit. Otherwise identical to the GBU-12, but heavier with a more powerful warhead.. The Super Hornet can carry a maximum of 10."] && ctrlSetText [115, "\fz_f18\gui\wpn_gbu16.jpg"]
?(lbCurSel 114 == 14): ctrlSetText [116, "The Mk20 is an anti-tank cluster bomb. It scatters a number of anti-tank submunitions around a 50m radius which can destroy or disable most tanks with a few hits. The Super Hornet can carry 10."] && ctrlSetText [115, "\fz_f18\gui\ld_mk20.jpg"]
?(lbCurSel 114 == 15): ctrlSetText [116, "The CBU-78 Gator is a Mk20 dispenser modified to carry a number of Gator anti-tank mines. It spreads them around a 50m radius and they can disable most tanks with 2 to 3 hits. The Super Hornet can carry 10."] && ctrlSetText [115, "\fz_f18\gui\ld_cbu78.jpg"]
?(lbCurSel 114 == 16): ctrlSetText [116, "The Mk82 Snakeye is a general purpose 500lb bomb. It is an effective weapon for destroying light structures, vehicles, and infantry. It has a blast radius of about 20m. The Super Hornet can carry a maximum of 10."] && ctrlSetText [115, "\fz_f18\gui\ld_mk82hd.jpg"]
?(lbCurSel 114 == 17): ctrlSetText [116, "The Mk83 Snakeye is a low-drag or high-drag bomb, depending on which mode is used. It can be used for carpet bombing or precision bombing. It uses a 1,000lb warhead and has a blast radius of about 30m. The Super Hornet can carry a maximum of 10."] && ctrlSetText [115, "\fz_f18\gui\ld_mk83hd.jpg"]
?(lbCurSel 114 == 18): ctrlSetText [116, "The Mk84 is a 2,00lb free-fall bomb. It is unguided and highly inaccurate. Nonetheless, it is a powerful weapon, and ideal for taking out clusters of various enemies. The warhead is very powerful and affects a large 50m radius from where it hit. The GBU-10 uses the same warhead. The Super Hornet can carry 4."] && ctrlSetText [115, "\fz_f18\gui\ld_mk84ld.jpg"]
?(lbCurSel 114 == 19): ctrlSetText [116, "The D-704P is an aerial refuelling pod attached to the Super Hornet's centerline. It draws from the aircrafts' internal fuel supply, usually augmented by external tanks."] && ctrlSetText [115, "\fz_f18\gui\480gal.jpg"]
goto "loop"