pioneerspacesim/pioneer — pull request #1660 by skapusniak (2012-11-01 21:50:51+00:00)
Title: Refactoring of Faction distance/colour retrieval code for SectorView

This should be ready for review/comment. It implements the idea(s) in #1641 as far as was feasible.

**Cleanup/Refactoring**

- General refactoring of ````Faction::GetNearestFactionIndex```` code.
- Stopped homeworld Sector construction happening every time a faction distance calculation is performed.
- Added overload of ````Faction::GetNearestFactionIndex```` taking sector and system index for when we already have the non-homeworld Sector and therefore don't need to construct it again from a system path.
- Added method on ```````` to populate it's ````````s with their faction colour without doing a sysgen for each system
- Switch SectorView to getting the faction colours through the above method, rather than doing a full sysgen for each system, thus letting me move it out of the 'supress while moving' code.
- Exposed a Radius attribute to the Faction Lua interface.
- Added a ```bool Sector::Contains(SystemPath sysPath)``` utility method to sector.
- Likely other related stuff I don't recall. See the commits :)

**Cosmetic Changes (Sector View)**

- Systems within a Faction's borders will now have their labels in the Faction colour whilst scrolling the SectorView, previously there they were shown in the uninhabited colour whilst scrolling.
- When you stop scrolling the SectorView inhabited, the brightness/intensity of system labels will be adjusted to reflect the systems' populations. Zero population systems will revert to the uninhabited colour.
- Labels for no, and low population systems will be dimmer than previously.

Both this and #1621 change ````Faction::GetNearestFactionIndex````. If either of these integrated, I'll likely need to check the other still merges okay.