pioneerspacesim/pioneer — pull request #2589 by robn (2013-12-23 03:23:21+00:00)
Title: New UI: Station screens

The long-threatened station screen rewrite (first commit was over a year ago, wow!).

Its mostly self explanatory. The main thing I'd say for review is not to get into bikeshedding arguments. We can tweak the layout or change it wholesale later without fuss (indeed, I have plans). Right now the aim is to get us to more-or-less functional parity on top of the new UI. For review, please focus on functionality and code quality.

Supporting changes and fixes:

* Lots of station data and supporting code like the ship market and equipment levels are now entirely handled in Lua. Several extra Lua methods to do things like manipulate stock levels or change ship on purchase have been added.

* Ship labels are now generated in Lua, using the same algorithm as before.

* `MarketAgent` is gone. Player money is entirely handled in Lua. NPC ships and stations no longer have money stored in the core.

* New functions to allow crime state to be manipulated from Lua. I'd rather keep these internal for now until crime can be properly rewritten in Lua.

* Ship definitions now have a manufacturer and class (`shipClass`/`ship_class`). These are currently only used to display icons in the ship market, but I'd expect to see them used elsewhere.

* `SceneGraph.ModelSkin` can be created from Lua and serialized (needed for the ship market). The code to do this is pretty awful, but its at least contained. It will be dealt with properly when `json-savefile` happens.

* `TabGroup`s can now have a common footer.

* New `Format` methods for acceleration in G and mass in tonnes.

* `Ship.hullPercent` is now a bindable property. New `Ship` properties `totalCargo`, `usedCabins` and `totalCabins`.

* The `ARMOUR` flag to `InfoFace` now works.

* Option to pay fine remotely has been removed until crime and WorldView are fully in Lua.

* `Face.SetHeightLines` method to help set the height against a chunk of text.

Needs plenty of testing, including make sure things work sanely when moving between stations, systems and after save & load.

Hat tip to @johnbartholomew for the first cut of the repair screen and @nozmajner for the icons.