Damage Report MFD
By Nick Rogers

Overview - MFD
==============
This is a simple MFD that will automatically pop up in the first free MFD slot when equipment items are damaged. It will list items in cost order descending, so the more expensive items are listed at the top. The first line will display a count of the number of damaged items, and then the top 9 damaged items will be listed underneath.

The MFD has a couple of modes, selectable via a primable equipment item. Press "B" to change the mode. Available modes are:

Visible when damaged    - The damage report will always be visible when items are damaged.
Autohide after 60 sec   - The damage report will auto-hide itself after displaying damaged items for 60 seconds.
Manual                  - The damage report will only be displayed when the user makes it visible using the MFD selection keys.

The Damage Report MFD costs 250 Cr and is available from any system of tech level 4 or above.

The selected mode is stored in the save game file.

Damage Report Interface
-----------------------
When this OXP is installed, and your ship has damaged equipment, a new interface screen will become available on the F4 screen, called "Damage Report". Opening this screen will list each damaged item, the estimated cost of repairs, and the minimum tech level required in order to repair it.

If you select an item in the list and press enter, a long range chart will appear, mapping the route to the closest destination of a suitable tech level where repairs can be conducted. Below this will be details of that equipment item, including the estimated repair cost and tech level required for purchase.  

If the closest planet for repairs is not the current planet, you will be able to automatically set your destination to that planet with the option "Set course for (planet name)". 

If you have bought the MFD equipment, you will also have the ability to set the mode here. A menu option will be available, displaying the current type of MFD (Active or Passive), as well as the current mode. Selecting this menu item will cycle through all the available options.

MFD Active: The mode can be changed during flight using primable equipment.
MFD Passive: The mode can't be changed during flight, only via the interface screen.

License
=======
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/

Image from http://simpleicon.com/wrench.html.

Version History
===============
2.4
- Fixed discrepancy between route shown on map and the number of jumps shown in text.
- Integration with planned OXP's.

2.3.4
- Bug fixes.

2.3.3
- When setting a course to a target system, F7 screen will now display the new destination.
- When viewing course to nearest repair system, map with switch to a short range chart if the distance to it is less than 7.4 LY.

2.3.2
- Added total estimated costs to the F4 interface page if more than 1 item is damaged.
- Code refactoring.

2.3.1
- Added number of jumps to map screen.

2.3.0
- Included Ship Configuration armour repair items in damaged list.
- Included IronHide armour repair item in damaged list.

2.2.8
- Better integration with the ANA.

2.2.7
- Fixed issue with HUD not becoming visible again when launching while viewing the damage report screen.

2.2.6
- Fixed issue where player destination was getting reset when a chart screen is exited by pressing a function key, rather than via the "Exit" command.

2.2.5
- Fixed issue where displaying course info when there is no system in the current chart with the required TL would result in a blank page, rather than the chart.
- Added check for above condition, so now the player is told there is no system with the required TL in the current chart.
- Fixed issue where, if the system with the required TL was more than 99 ly away, it was being assumed there was no system available.

2.2.4
- Updated check for "Allow Big GUI".
- Bug fixes.

2.2.3
- Fixed small bug when attempting to update the MFD after the player ship is destroyed.
- Updated screenID's to enable BGS background sounds.
- Renamed background overlay image to prevent possibility of future duplication.
- Toned down overlay image.
- Trimmed unnecessary items from equipment.plist.
- Code refactoring.

2.2.2
- Fixed small issue with manifest file.

2.2.1
- Updated distance calculations to use route distance, rather than point-to-point distance.
- Fixed missing ";" in Javascript file.

2.2.0
- Added overlay background image to interface screen.

2.1.1
- Added routine to use 1.83/4 code to check for big GUI HUD's.

2.1.0
- MFD can now be removed.
- MFD now has two types: active (where the mode can be changed during flight) and passive (where the mode can only be changed via the interface screen)
- Added mission screen exception for Xenon Redux UI.
- Code refactoring.

2.0.1
- Added direct support for the MFD configuration system in the HUD Selector OXP.
- Improved the ability of the MFD to autohide itself when there are no damaged items.

2.0.0
- Added "Damage Report" interface screen.

1.0.0
- Initial release