LWWidget.Beta5.Techs = LWWidget.Game.Page.inherits({ setData: function (data) { var _d = data.getChildren('Empire')[0].getChildren('Research')[0]; this.points = parseInt(_d.getAttribute('points'), 10); this.newTechs = parseInt(_d.getAttribute('new'), 10); this.foreseen = parseInt(_d.getAttribute('foreseen'), 10); _d = _d.getChildren('RBudget')[0]; this.fundamental = parseInt(_d.getAttribute('fundamental'), 10); this.military = parseInt(_d.getAttribute('military'), 10); this.civilian = parseInt(_d.getAttribute('civilian'), 10); }, draw: function (_e) { var _s = '
';
if (this.newTechs == 0) {
_s += 'No new technologies discovered.';
} else {
_s += '' + this.newTechs + ' new technolog' + (this.newTechs > 1 ? 'ies' : 'y') + ' discovered.';
}
_s += '
';
if (this.foreseen == 0) {
_s += 'No breakthroughs foreseen.';
} else {
_s += '' + this.foreseen + ' breakthrough' + (this.foreseen > 1 ? 's' : '') + ' foreseen.';
}
_s += '
Research budget
' + Base.Util.formatNumber(this.points) + ' research points per day
'
+ this.fundamental + '% allocated to Fundamental research
'
+ this.military + '% allocated to Military research
'
+ this.civilian + '% allocated to Civilian research