FAForever/fa — pull request #242 by ChrisKitching (2014-12-22 10:40:36+00:00)
Title: Simplify some UI code

Mostly, this is the simplification of the skirmish support alluded to over in #228.

Some UI controls should not be visible in skirmish mode. Previously, CreateUI() would conditionally create those controls and then code that refers to those would have to keep checking if the UI element they want to play with exists.
With this patch, we unconditionally create UI controls but conditionally *show* them. This looks no different, but means we can optimise away a large amount of rage-inducing "if GUI.something then..." checks.

This patch also makes the creation of label textfields less repetative by moving the SetDropShadow call into the UIUtils utility function (and in some cases optimising away redundant explicit calls to SetFont/SetText immediately following CreateText (which alrady supports setting both of these things)).

Also throwing in a patch to make the ping-bar-colouring a bit faster and less repetative.