diff --git a/res/ui/building_tutorials/constant_signal.png b/res/ui/building_tutorials/constant_signal.png index 6db1ebf4..70de0a21 100644 Binary files a/res/ui/building_tutorials/constant_signal.png and b/res/ui/building_tutorials/constant_signal.png differ diff --git a/src/js/core/config.local.js b/src/js/core/config.local.js index b75c5650..87aaaa14 100644 --- a/src/js/core/config.local.js +++ b/src/js/core/config.local.js @@ -26,9 +26,6 @@ export default { // Allow to zoom freely without limits // disableZoomLimits: true, // ----------------------------------------------------------------------------------- - // Shows a border arround every chunk - // showChunkBorders: true, - // ----------------------------------------------------------------------------------- // All rewards can be unlocked by passing just 1 of any shape // rewardsInstant: true, // ----------------------------------------------------------------------------------- @@ -110,5 +107,8 @@ export default { // Allows manual ticking // manualTickOnly: true, // ----------------------------------------------------------------------------------- + // Disables slow asserts, useful for debugging performance + // disableSlowAsserts: true, + // ----------------------------------------------------------------------------------- /* dev:end */ }; diff --git a/src/js/game/buildings/constant_signal.js b/src/js/game/buildings/constant_signal.js index 21583052..983594cb 100644 --- a/src/js/game/buildings/constant_signal.js +++ b/src/js/game/buildings/constant_signal.js @@ -5,6 +5,7 @@ import { MetaBuilding } from "../meta_building"; import { GameRoot } from "../root"; import { ConstantSignalComponent } from "../components/constant_signal"; import { generateMatrixRotations } from "../../core/utils"; +import { enumHubGoalRewards } from "../tutorial_goals"; const overlayMatrix = generateMatrixRotations([0, 1, 0, 1, 1, 1, 1, 1, 1]); @@ -21,8 +22,7 @@ export class MetaConstantSignalBuilding extends MetaBuilding { * @param {GameRoot} root */ getIsUnlocked(root) { - // @todo - return true; + return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_constant_signal); } /** @returns {"wires"} **/ diff --git a/src/js/game/buildings/filter.js b/src/js/game/buildings/filter.js index 698ac4db..b537fcb5 100644 --- a/src/js/game/buildings/filter.js +++ b/src/js/game/buildings/filter.js @@ -1,4 +1,6 @@ +import { formatItemsPerSecond } from "../../core/utils"; import { enumDirection, Vector } from "../../core/vector"; +import { T } from "../../translations"; import { FilterComponent } from "../components/filter"; import { ItemAcceptorComponent } from "../components/item_acceptor"; import { ItemEjectorComponent } from "../components/item_ejector"; @@ -32,6 +34,16 @@ export class MetaFilterBuilding extends MetaBuilding { return true; } + /** + * @param {GameRoot} root + * @param {string} variant + * @returns {Array<[string, string]>} + */ + getAdditionalStatistics(root, variant) { + const beltSpeed = root.hubGoals.getBeltBaseSpeed(); + return [[T.ingame.buildingPlacement.infoTexts.speed, formatItemsPerSecond(beltSpeed)]]; + } + /** * Creates the entity at the given location * @param {Entity} entity diff --git a/src/js/game/hud/parts/base_toolbar.js b/src/js/game/hud/parts/base_toolbar.js index 8697eaf6..a0e2a49f 100644 --- a/src/js/game/hud/parts/base_toolbar.js +++ b/src/js/game/hud/parts/base_toolbar.js @@ -15,14 +15,19 @@ export class HUDBaseToolbar extends BaseHUDPart { * @param {Array=} param0.secondaryBuildings * @param {function} param0.visibilityCondition * @param {string} param0.htmlElementId + * @param {Layer=} param0.layer */ - constructor(root, { primaryBuildings, secondaryBuildings = [], visibilityCondition, htmlElementId }) { + constructor( + root, + { primaryBuildings, secondaryBuildings = [], visibilityCondition, htmlElementId, layer = "regular" } + ) { super(root); this.primaryBuildings = primaryBuildings; this.secondaryBuildings = secondaryBuildings; this.visibilityCondition = visibilityCondition; this.htmlElementId = htmlElementId; + this.layer = layer; /** @type {Object.", "" + binding.getKeyCodeString() + "" diff --git a/src/js/game/hud/parts/wires_toolbar.js b/src/js/game/hud/parts/wires_toolbar.js index 6d19df1f..2e43386d 100644 --- a/src/js/game/hud/parts/wires_toolbar.js +++ b/src/js/game/hud/parts/wires_toolbar.js @@ -16,16 +16,17 @@ export class HUDWiresToolbar extends HUDBaseToolbar { MetaWireBuilding, MetaWireTunnelBuilding, MetaConstantSignalBuilding, + MetaLeverBuilding, MetaTransistorBuilding, MetaLogicGateBuilding, MetaAnalyzerBuilding, - MetaLeverBuilding, MetaVirtualProcessorBuilding, MetaComparatorBuilding, ], visibilityCondition: () => !this.root.camera.getIsMapOverlayActive() && this.root.currentLayer === "wires", htmlElementId: "ingame_HUD_wires_toolbar", + layer: "wires", }); } } diff --git a/src/js/game/key_action_mapper.js b/src/js/game/key_action_mapper.js index 6f53fb83..7a519839 100644 --- a/src/js/game/key_action_mapper.js +++ b/src/js/game/key_action_mapper.js @@ -67,11 +67,12 @@ export const KEYMAPPINGS = { wire: { keyCode: key("1") }, wire_tunnel: { keyCode: key("2") }, constant_signal: { keyCode: key("3") }, - transistor: { keyCode: key("6") }, - logic_gate: { keyCode: key("4") }, - virtual_processor: { keyCode: key("5") }, - analyzer: { keyCode: key("7") }, - comparator: { keyCode: key("8") }, + lever_wires: { keyCode: key("4") }, + logic_gate: { keyCode: key("5") }, + virtual_processor: { keyCode: key("6") }, + transistor: { keyCode: key("7") }, + analyzer: { keyCode: key("8") }, + comparator: { keyCode: key("9") }, }, placement: { diff --git a/translations/base-en.yaml b/translations/base-en.yaml index 9447d247..a87e85f2 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -584,7 +584,7 @@ buildings: lever: default: name: &lever Switch - description: Can be toggled to emit a boolean signal, which can then be used to control for example an item filter. + description: Can be toggled to emit a boolean signal (1 / 0) on the wires layer, which can then be used to control for example an item filter. logic_gate: default: @@ -612,7 +612,7 @@ buildings: filter: default: name: &filter Filter - description: Connect with a signal to route all matching items to the top and the remaining to the right. Can be controlled with boolean signals too. + description: Connect a signal to route all matching items to the top and the remaining to the right. Can be controlled with boolean signals too. display: default: @@ -758,7 +758,8 @@ storyRewards: reward_constant_signal: title: Constant Signal desc: >- - You can now emit a constant signal on the wires layer! This is useful to connect it to item filters for example! + You unlocked the constant signal building on the wires layer! This is useful to connect it to item filters for example.

+ The constant signal can emit a shape, color or boolean (1 / 0). reward_logic_gates: title: Logic Gates @@ -1035,7 +1036,8 @@ keybindings: wire: *wire constant_signal: *constant_signal logic_gate: Logic Gate - lever: *lever + lever: Switch (regular) + lever_wires: Switch (wires) filter: *filter wire_tunnel: *wire_tunnel display: *display