Skip to content

Commit

Permalink
Display time delay on total row in tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebring committed Jul 29, 2015
1 parent 100ff27 commit 1e37f45
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions script/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -901,18 +901,19 @@ var Room = {
.addClass('row_val')
.text(Engine.getIncomeMsg(income.stores[store], income.delay))
.appendTo(tt);
totalIncome[store] = Number(totalIncome[store]) || 0;
totalIncome[store] += Number(income.stores[store]);
if (totalIncome[store] === undefined || totalIncome[store]['income'] === undefined) {
totalIncome[store] = {};
totalIncome[store]['income'] = 0;
}
totalIncome[store]['income'] += Number(income.stores[store]);
totalIncome[store]['delay'] = income.delay;
}
}
}
if(tt.children().length > 0) {
var total = totalIncome[storeName];
if (total > 0) {
total = '+'+total;
}
var total = totalIncome[storeName]['income'];
$('<div>').addClass('total row_key').text(_('total')).appendTo(tt);
$('<div>').addClass('total row_val').text(''+total).appendTo(tt);
$('<div>').addClass('total row_val').text(Engine.getIncomeMsg(total, totalIncome[storeName]['delay'])).appendTo(tt);
tt.appendTo(el);
}
});
Expand Down

0 comments on commit 1e37f45

Please sign in to comment.