Get rid of performance warning, refactor roman numbers, mark balancers, rebalance upgrades
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.4 KiB |
@ -1,4 +1,6 @@
|
|||||||
|
/* typehints:start */
|
||||||
import { Application } from "../application";
|
import { Application } from "../application";
|
||||||
|
/* typehints:end */
|
||||||
import { IS_MAC } from "./config";
|
import { IS_MAC } from "./config";
|
||||||
import { ExplainedResult } from "./explained_result";
|
import { ExplainedResult } from "./explained_result";
|
||||||
import { queryParamOptions } from "./query_parameters";
|
import { queryParamOptions } from "./query_parameters";
|
||||||
|
@ -713,3 +713,40 @@ export function startFileChoose(acceptedType = ".bin") {
|
|||||||
input.click();
|
input.click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const romanLiterals = [
|
||||||
|
"0", // NULL
|
||||||
|
"I",
|
||||||
|
"II",
|
||||||
|
"III",
|
||||||
|
"IV",
|
||||||
|
"V",
|
||||||
|
"VI",
|
||||||
|
"VII",
|
||||||
|
"VIII",
|
||||||
|
"IX",
|
||||||
|
"X",
|
||||||
|
"XI",
|
||||||
|
"XII",
|
||||||
|
"XIII",
|
||||||
|
"XIV",
|
||||||
|
"XV",
|
||||||
|
"XVI",
|
||||||
|
"XVII",
|
||||||
|
"XVIII",
|
||||||
|
"XIX",
|
||||||
|
"XX",
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {number} number
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
export function getRomanNumber(number) {
|
||||||
|
number = Math.max(0, Math.round(number));
|
||||||
|
if (number < romanLiterals.length) {
|
||||||
|
return romanLiterals[number];
|
||||||
|
}
|
||||||
|
return String(number);
|
||||||
|
}
|
||||||
|
@ -45,7 +45,6 @@ import { HUDLeverToggle } from "./parts/lever_toggle";
|
|||||||
import { HUDLayerPreview } from "./parts/layer_preview";
|
import { HUDLayerPreview } from "./parts/layer_preview";
|
||||||
import { HUDMinerHighlight } from "./parts/miner_highlight";
|
import { HUDMinerHighlight } from "./parts/miner_highlight";
|
||||||
import { HUDBetaOverlay } from "./parts/beta_overlay";
|
import { HUDBetaOverlay } from "./parts/beta_overlay";
|
||||||
import { HUDPerformanceWarning } from "./parts/performance_warning";
|
|
||||||
import { HUDStandaloneAdvantages } from "./parts/standalone_advantages";
|
import { HUDStandaloneAdvantages } from "./parts/standalone_advantages";
|
||||||
import { HUDCatMemes } from "./parts/cat_memes";
|
import { HUDCatMemes } from "./parts/cat_memes";
|
||||||
|
|
||||||
@ -88,7 +87,6 @@ export class GameHUD {
|
|||||||
layerPreview: new HUDLayerPreview(this.root),
|
layerPreview: new HUDLayerPreview(this.root),
|
||||||
|
|
||||||
minerHighlight: new HUDMinerHighlight(this.root),
|
minerHighlight: new HUDMinerHighlight(this.root),
|
||||||
performanceWarning: new HUDPerformanceWarning(this.root),
|
|
||||||
|
|
||||||
// Typing hints
|
// Typing hints
|
||||||
/* typehints:start */
|
/* typehints:start */
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
import { T } from "../../../translations";
|
|
||||||
import { BaseHUDPart } from "../base_hud_part";
|
|
||||||
|
|
||||||
export class HUDPerformanceWarning extends BaseHUDPart {
|
|
||||||
initialize() {
|
|
||||||
this.warningShown = false;
|
|
||||||
this.root.signals.entityManuallyPlaced.add(this.checkAfterPlace, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
checkAfterPlace() {
|
|
||||||
if (!this.warningShown && this.root.entityMgr.entities.length > 10000) {
|
|
||||||
this.root.hud.parts.dialogs.showInfo(T.dialogs.entityWarning.title, T.dialogs.entityWarning.desc);
|
|
||||||
this.warningShown = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
import { ClickDetector } from "../../../core/click_detector";
|
import { ClickDetector } from "../../../core/click_detector";
|
||||||
import { InputReceiver } from "../../../core/input_receiver";
|
import { InputReceiver } from "../../../core/input_receiver";
|
||||||
import { formatBigNumber, makeDiv } from "../../../core/utils";
|
import { formatBigNumber, getRomanNumber, makeDiv } from "../../../core/utils";
|
||||||
import { T } from "../../../translations";
|
import { T } from "../../../translations";
|
||||||
import { KeyActionMapper, KEYMAPPINGS } from "../../key_action_mapper";
|
import { KeyActionMapper, KEYMAPPINGS } from "../../key_action_mapper";
|
||||||
import { BaseHUDPart } from "../base_hud_part";
|
import { BaseHUDPart } from "../base_hud_part";
|
||||||
@ -67,7 +67,7 @@ export class HUDShop extends BaseHUDPart {
|
|||||||
// Set tier
|
// Set tier
|
||||||
handle.elemTierLabel.innerText = T.ingame.shop.tier.replace(
|
handle.elemTierLabel.innerText = T.ingame.shop.tier.replace(
|
||||||
"<x>",
|
"<x>",
|
||||||
"" + T.ingame.shop.tierLabels[currentTier]
|
getRomanNumber(currentTier + 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
handle.elemTierLabel.setAttribute("data-tier", currentTier);
|
handle.elemTierLabel.setAttribute("data-tier", currentTier);
|
||||||
|
@ -31,7 +31,15 @@ function generateUpgrades(limitedVersion = false) {
|
|||||||
|
|
||||||
// Fill in endgame upgrades
|
// Fill in endgame upgrades
|
||||||
for (let i = 0; i < numEndgameUpgrades; ++i) {
|
for (let i = 0; i < numEndgameUpgrades; ++i) {
|
||||||
|
if (i < 20) {
|
||||||
fixedImprovements.push(0.1);
|
fixedImprovements.push(0.1);
|
||||||
|
} else if (i < 50) {
|
||||||
|
fixedImprovements.push(0.05);
|
||||||
|
} else if (i < 100) {
|
||||||
|
fixedImprovements.push(0.025);
|
||||||
|
} else {
|
||||||
|
fixedImprovements.push(0.0125);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const upgrades = {
|
const upgrades = {
|
||||||
|
@ -272,10 +272,6 @@ dialogs:
|
|||||||
title: Rename Savegame
|
title: Rename Savegame
|
||||||
desc: You can rename your savegame here.
|
desc: You can rename your savegame here.
|
||||||
|
|
||||||
entityWarning:
|
|
||||||
title: Performance Warning
|
|
||||||
desc: You have placed a lot of buildings, this is just a friendly reminder that the game can not handle an endless number of buildings - try to keep your factories compact!
|
|
||||||
|
|
||||||
ingame:
|
ingame:
|
||||||
# This is shown in the top left corner and displays useful keybindings in
|
# This is shown in the top left corner and displays useful keybindings in
|
||||||
# every situation
|
# every situation
|
||||||
@ -355,10 +351,6 @@ ingame:
|
|||||||
# Gets replaced to e.g. "Tier IX"
|
# Gets replaced to e.g. "Tier IX"
|
||||||
tier: Tier <x>
|
tier: Tier <x>
|
||||||
|
|
||||||
# The roman number for each tier
|
|
||||||
tierLabels:
|
|
||||||
[I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV, XVI, XVII, XVIII, XIX, XX]
|
|
||||||
|
|
||||||
maximumLevel: MAXIMUM LEVEL (Speed x<currentMult>)
|
maximumLevel: MAXIMUM LEVEL (Speed x<currentMult>)
|
||||||
|
|
||||||
# The "Statistics" window
|
# The "Statistics" window
|
||||||
|