feat: More bonus (exponential) and method to list icons needed
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Main game view. Static markup lives in index.html; this module binds the
|
||||
// controls once, builds the generator/upgrade lists, and refreshes the numbers.
|
||||
|
||||
import { generatorQuote, isUnlocked, upgradeVisible } from '../engine/engine.js';
|
||||
import { generatorQuote, isUnlocked, materialPurchase, upgradeVisible } from '../engine/engine.js';
|
||||
import { t } from '../services/i18n.js';
|
||||
import { $, h, icon, refreshStaticIcons } from './dom.js';
|
||||
|
||||
@@ -232,15 +232,16 @@ export function createView(actions) {
|
||||
|
||||
setText(el.makeYield, t('ui.makeYield', { amount: fmt.number(d.clickYield) }));
|
||||
el.make.disabled = state.material < d.materialPerUnit;
|
||||
const purchase = materialPurchase(state, d); // a partial lot when funds are short
|
||||
setText(
|
||||
el.buyMaterialInfo,
|
||||
t('ui.batchInfo', {
|
||||
amount: fmt.number(d.batchSize),
|
||||
cost: money(d.batchCost),
|
||||
amount: fmt.number(Math.floor(purchase.amount || d.batchSize)),
|
||||
cost: money(purchase.amount ? purchase.cost : d.batchCost),
|
||||
trend: TREND[state.materialTrend] ?? '',
|
||||
}),
|
||||
);
|
||||
el.buyMaterial.disabled = state.funds < d.batchCost;
|
||||
el.buyMaterial.disabled = purchase.amount <= 0;
|
||||
|
||||
updateMarket(state, d);
|
||||
updateGenerators(state, d);
|
||||
|
||||
Reference in New Issue
Block a user