Detect cases where tooltips were overlapping edge of draw area

* We now detect where this is about to happen and reposition the tooltip accordingly
Fix not all costs being picked up

* We were only reading unit/structure costs from the first set of "Cost/Resources" we came across and mising those on parent templates.
   - Thus, the tooltips of some units/stuctures were showing cheaper than they should be.
* Noticed by Prodigal Son on wildfiregames.com forums. Thank you.