Further fixes found during testing, update local config

This commit is contained in:
tobspr 2020-09-24 17:43:50 +02:00
parent 7cd1ee22fd
commit f584d9d93e
9 changed files with 53 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 157 KiB

View File

@ -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 */
};

View File

@ -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"} **/

View File

@ -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

View File

@ -15,14 +15,19 @@ export class HUDBaseToolbar extends BaseHUDPart {
* @param {Array<typeof MetaBuilding>=} 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.<string, {
* metaBuilding: MetaBuilding,
@ -67,7 +72,13 @@ export class HUDBaseToolbar extends BaseHUDPart {
for (let i = 0; i < allBuildings.length; ++i) {
const metaBuilding = gMetaBuildingRegistry.findByClass(allBuildings[i]);
const binding = actionMapper.getBinding(KEYMAPPINGS.buildings[metaBuilding.getId()]);
let rawBinding = KEYMAPPINGS.buildings[metaBuilding.getId() + "_" + this.layer];
if (!rawBinding) {
rawBinding = KEYMAPPINGS.buildings[metaBuilding.getId()];
}
const binding = actionMapper.getBinding(rawBinding);
const itemContainer = makeDiv(
this.primaryBuildings.includes(allBuildings[i]) ? rowPrimary : rowSecondary,

View File

@ -119,7 +119,15 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
this.buildingInfoElements.label.innerHTML = T.buildings[metaBuilding.id][variant].name;
this.buildingInfoElements.descText.innerHTML = T.buildings[metaBuilding.id][variant].description;
const binding = this.root.keyMapper.getBinding(KEYMAPPINGS.buildings[metaBuilding.getId()]);
const layer = this.root.currentLayer;
let rawBinding = KEYMAPPINGS.buildings[metaBuilding.getId() + "_" + layer];
if (!rawBinding) {
rawBinding = KEYMAPPINGS.buildings[metaBuilding.getId()];
}
const binding = this.root.keyMapper.getBinding(rawBinding);
this.buildingInfoElements.hotkey.innerHTML = T.ingame.buildingPlacement.hotkeyLabel.replace(
"<key>",
"<code class='keybinding'>" + binding.getKeyCodeString() + "</code>"

View File

@ -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",
});
}
}

View File

@ -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: {

View File

@ -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 <strong>constant signal</strong> on the wires layer! This is useful to connect it to <strong>item filters</strong> for example!
You unlocked the <strong>constant signal</strong> building on the wires layer! This is useful to connect it to <strong>item filters</strong> for example.<br><br>
The constant signal can emit a <strong>shape</strong>, <strong>color</strong> or <strong>boolean</strong> (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