mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-28 07:12:30 +08:00
Display time delay on total row in tooltip
This commit is contained in:
+8
-7
@@ -901,18 +901,19 @@ var Room = {
|
|||||||
.addClass('row_val')
|
.addClass('row_val')
|
||||||
.text(Engine.getIncomeMsg(income.stores[store], income.delay))
|
.text(Engine.getIncomeMsg(income.stores[store], income.delay))
|
||||||
.appendTo(tt);
|
.appendTo(tt);
|
||||||
totalIncome[store] = Number(totalIncome[store]) || 0;
|
if (totalIncome[store] === undefined || totalIncome[store]['income'] === undefined) {
|
||||||
totalIncome[store] += Number(income.stores[store]);
|
totalIncome[store] = {};
|
||||||
|
totalIncome[store]['income'] = 0;
|
||||||
|
}
|
||||||
|
totalIncome[store]['income'] += Number(income.stores[store]);
|
||||||
|
totalIncome[store]['delay'] = income.delay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tt.children().length > 0) {
|
if(tt.children().length > 0) {
|
||||||
var total = totalIncome[storeName];
|
var total = totalIncome[storeName]['income'];
|
||||||
if (total > 0) {
|
|
||||||
total = '+'+total;
|
|
||||||
}
|
|
||||||
$('<div>').addClass('total row_key').text(_('total')).appendTo(tt);
|
$('<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);
|
tt.appendTo(el);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user