mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Prettier and readded shapez.io logo
This commit is contained in:
parent
31a6444bfc
commit
9f5ceff0bb
BIN
res/logo.png
BIN
res/logo.png
Binary file not shown.
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
Binary file not shown.
Before Width: | Height: | Size: 26 KiB |
@ -1,27 +1,6 @@
|
||||
$buildings: belt,
|
||||
cutter,
|
||||
miner,
|
||||
mixer,
|
||||
painter,
|
||||
rotater,
|
||||
balancer,
|
||||
stacker,
|
||||
trash,
|
||||
underground_belt,
|
||||
wire,
|
||||
constant_signal,
|
||||
logic_gate,
|
||||
lever,
|
||||
filter,
|
||||
wire_tunnel,
|
||||
display,
|
||||
virtual_processor,
|
||||
reader,
|
||||
storage,
|
||||
transistor,
|
||||
analyzer,
|
||||
comparator,
|
||||
item_producer;
|
||||
$buildings: belt, cutter, miner, mixer, painter, rotater, balancer, stacker, trash, underground_belt, wire,
|
||||
constant_signal, logic_gate, lever, filter, wire_tunnel, display, virtual_processor, reader, storage,
|
||||
transistor, analyzer, comparator, item_producer;
|
||||
@each $building in $buildings {
|
||||
[data-icon="building_icons/#{$building}.png"] {
|
||||
/* @load-async */
|
||||
@ -29,41 +8,11 @@ item_producer;
|
||||
}
|
||||
}
|
||||
|
||||
$buildingsAndVariants: belt,
|
||||
balancer,
|
||||
underground_belt,
|
||||
underground_belt-tier2,
|
||||
miner,
|
||||
miner-chainable,
|
||||
cutter,
|
||||
cutter-quad,
|
||||
rotater,
|
||||
rotater-ccw,
|
||||
stacker,
|
||||
mixer,
|
||||
painter-double,
|
||||
painter-quad,
|
||||
trash,
|
||||
storage,
|
||||
reader,
|
||||
rotater-rotate180,
|
||||
display,
|
||||
constant_signal,
|
||||
wire,
|
||||
wire_tunnel,
|
||||
logic_gate-or,
|
||||
logic_gate-not,
|
||||
logic_gate-xor,
|
||||
analyzer,
|
||||
virtual_processor-rotater,
|
||||
virtual_processor-unstacker,
|
||||
item_producer,
|
||||
virtual_processor-stacker,
|
||||
virtual_processor-painter,
|
||||
wire-second,
|
||||
painter,
|
||||
painter-mirrored,
|
||||
comparator;
|
||||
$buildingsAndVariants: belt, balancer, underground_belt, underground_belt-tier2, miner, miner-chainable,
|
||||
cutter, cutter-quad, rotater, rotater-ccw, stacker, mixer, painter-double, painter-quad, trash, storage,
|
||||
reader, rotater-rotate180, display, constant_signal, wire, wire_tunnel, logic_gate-or, logic_gate-not,
|
||||
logic_gate-xor, analyzer, virtual_processor-rotater, virtual_processor-unstacker, item_producer,
|
||||
virtual_processor-stacker, virtual_processor-painter, wire-second, painter, painter-mirrored, comparator;
|
||||
@each $building in $buildingsAndVariants {
|
||||
[data-icon="building_tutorials/#{$building}.png"] {
|
||||
/* @load-async */
|
||||
@ -108,9 +57,7 @@ comparator;
|
||||
background-image: uiResource("res/ui/building_tutorials/virtual_processor-cutter.png") !important;
|
||||
}
|
||||
|
||||
$icons: notification_saved,
|
||||
notification_success,
|
||||
notification_upgrade;
|
||||
$icons: notification_saved, notification_success, notification_upgrade;
|
||||
@each $icon in $icons {
|
||||
[data-icon="icons/#{$icon}.png"] {
|
||||
/* @load-async */
|
||||
@ -118,34 +65,8 @@ notification_upgrade;
|
||||
}
|
||||
}
|
||||
|
||||
$languages: en,
|
||||
de,
|
||||
cs,
|
||||
da,
|
||||
et,
|
||||
es-419,
|
||||
fr,
|
||||
it,
|
||||
pt-BR,
|
||||
sv,
|
||||
tr,
|
||||
el,
|
||||
ru,
|
||||
uk,
|
||||
zh-TW,
|
||||
zh-CN,
|
||||
nb,
|
||||
mt-MT,
|
||||
ar,
|
||||
nl,
|
||||
vi,
|
||||
th,
|
||||
hu,
|
||||
pl,
|
||||
ja,
|
||||
kor,
|
||||
no,
|
||||
pt-PT;
|
||||
$languages: en, de, cs, da, et, es-419, fr, it, pt-BR, sv, tr, el, ru, uk, zh-TW, zh-CN, nb, mt-MT, ar, nl, vi,
|
||||
th, hu, pl, ja, kor, no, pt-PT;
|
||||
@each $language in $languages {
|
||||
[data-languageicon="#{$language}"] {
|
||||
/* @load-async */
|
||||
@ -153,7 +74,6 @@ pt-PT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
PRICE
|
||||
*/
|
||||
|
@ -1,13 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>shapez.io - Build automated factories to build, combine and color shapes!</title>
|
||||
|
||||
<!-- mobile stuff -->
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no, viewport-fit=cover" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no, viewport-fit=cover"
|
||||
/>
|
||||
<meta name="HandheldFriendly" content="true" />
|
||||
<meta name="MobileOptimized" content="320" />
|
||||
<meta name="theme-color" content="#393747" />
|
||||
@ -15,10 +17,19 @@
|
||||
<!-- seo -->
|
||||
<meta name="copyright" content="2020 Tobias Springer IT Solutions and .io Games" />
|
||||
<meta name="author" content="Tobias Springer, tobias.springer1@gmail.com" />
|
||||
<meta name="description" content="shapez.io is an open-source factory building game about combining and producing different types of shapes." />
|
||||
<meta name="keywords" content="shapes, .io games, factorio, incremental, upgrades, base building, open source" />
|
||||
<meta
|
||||
name="description"
|
||||
content="shapez.io is an open-source factory building game about combining and producing different types of shapes."
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
content="shapes, .io games, factorio, incremental, upgrades, base building, open source"
|
||||
/>
|
||||
<meta property="og:title" content="shapez.io" />
|
||||
<meta property="og:description" content="shapez.io is a fun factory base building game about combining shapes" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="shapez.io is a fun factory base building game about combining shapes"
|
||||
/>
|
||||
<meta property="og:url" content="https://shapez.io/" />
|
||||
<meta property="og:image" content="https://shapez.io/og_thumb.png" />
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
@ -31,6 +42,5 @@
|
||||
<link rel="canonical" href="https://shapez.io" />
|
||||
</head>
|
||||
|
||||
<body oncontextmenu="return false" style="background: #393747"></body>
|
||||
|
||||
<body oncontextmenu="return false" style="background: #393747;"></body>
|
||||
</html>
|
@ -1,7 +1,8 @@
|
||||
/**
|
||||
* @type {Array<{version: string, date: string, entries: Array<String>}>} changelog
|
||||
*/
|
||||
export const CHANGELOG = [{
|
||||
export const CHANGELOG = [
|
||||
{
|
||||
version: "1.2.3",
|
||||
date: "unreleased",
|
||||
entries: [
|
||||
|
@ -111,9 +111,9 @@ export class ReadWriteProxy {
|
||||
const checksum = decompressed.substring(0, 40);
|
||||
const jsonString = decompressed.substr(40);
|
||||
|
||||
const desiredChecksum = checksum.startsWith(CRC_PREFIX) ?
|
||||
computeCrc(jsonString + salt) :
|
||||
sha1(jsonString + salt);
|
||||
const desiredChecksum = checksum.startsWith(CRC_PREFIX)
|
||||
? computeCrc(jsonString + salt)
|
||||
: sha1(jsonString + salt);
|
||||
|
||||
if (desiredChecksum !== checksum) {
|
||||
// Checksum mismatch
|
||||
@ -202,9 +202,9 @@ export class ReadWriteProxy {
|
||||
const checksum = decompressed.substring(0, 40);
|
||||
const jsonString = decompressed.substr(40);
|
||||
|
||||
const desiredChecksum = checksum.startsWith(CRC_PREFIX) ?
|
||||
computeCrc(jsonString + salt) :
|
||||
sha1(jsonString + salt);
|
||||
const desiredChecksum = checksum.startsWith(CRC_PREFIX)
|
||||
? computeCrc(jsonString + salt)
|
||||
: sha1(jsonString + salt);
|
||||
|
||||
if (desiredChecksum !== checksum) {
|
||||
// Checksum mismatch
|
||||
|
@ -97,7 +97,8 @@ export class StateManager {
|
||||
|
||||
this.app.analytics.trackStateEnter(key);
|
||||
|
||||
window.history.pushState({
|
||||
window.history.pushState(
|
||||
{
|
||||
key,
|
||||
},
|
||||
key
|
||||
|
@ -573,9 +573,9 @@ export function round1DigitLocalized(speed, separator = T.global.decimalSeparato
|
||||
* @param {string=} separator The decimal separator for numbers like 50.1 (separator='.')
|
||||
*/
|
||||
export function formatItemsPerSecond(speed, double = false, separator = T.global.decimalSeparator) {
|
||||
return speed === 1.0 ?
|
||||
T.ingame.buildingPlacement.infoTexts.oneItemPerSecond :
|
||||
T.ingame.buildingPlacement.infoTexts.itemsPerSecond.replace(
|
||||
return speed === 1.0
|
||||
? T.ingame.buildingPlacement.infoTexts.oneItemPerSecond
|
||||
: T.ingame.buildingPlacement.infoTexts.itemsPerSecond.replace(
|
||||
"<x>",
|
||||
round2Digits(speed).toString().replace(".", separator)
|
||||
) + (double ? " " + T.ingame.buildingPlacement.infoTexts.itemsPerSecondDouble : "");
|
||||
|
@ -119,7 +119,8 @@ MetaAnalyzerBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.left,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -186,7 +187,8 @@ MetaAnalyzerBuilding.layerPreview = {
|
||||
|
||||
MetaAnalyzerBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.left,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
|
@ -297,7 +297,8 @@ MetaBalancerBuilding.silhouetteColors = {
|
||||
|
||||
MetaBalancerBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
},
|
||||
@ -319,7 +320,8 @@ MetaBalancerBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaBalancerBuilding.variants.merger]: (entity, rotationVariant) => {
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
},
|
||||
@ -335,7 +337,8 @@ MetaBalancerBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaBalancerBuilding.variants.mergerInverse]: (entity, rotationVariant) => {
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
},
|
||||
@ -352,12 +355,15 @@ MetaBalancerBuilding.componentVariations = {
|
||||
|
||||
[MetaBalancerBuilding.variants.splitter]: (entity, rotationVariant) => {
|
||||
{
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemEjector.setSlots([{
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
},
|
||||
@ -375,12 +381,15 @@ MetaBalancerBuilding.componentVariations = {
|
||||
|
||||
[MetaBalancerBuilding.variants.splitterInverse]: (entity, rotationVariant) => {
|
||||
{
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemEjector.setSlots([{
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
},
|
||||
|
@ -138,20 +138,16 @@ export class MetaBeltBuilding extends MetaBuilding {
|
||||
|
||||
getPreviewSprite(rotationVariant) {
|
||||
switch (MetaBeltBuilding.variantToRotation[rotationVariant]) {
|
||||
case enumDirection.top:
|
||||
{
|
||||
case enumDirection.top: {
|
||||
return Loader.getSprite("sprites/buildings/belt_top.png");
|
||||
}
|
||||
case enumDirection.left:
|
||||
{
|
||||
case enumDirection.left: {
|
||||
return Loader.getSprite("sprites/buildings/belt_left.png");
|
||||
}
|
||||
case enumDirection.right:
|
||||
{
|
||||
case enumDirection.right: {
|
||||
return Loader.getSprite("sprites/buildings/belt_right.png");
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
assertAlways(false, "Invalid belt rotation variant");
|
||||
}
|
||||
}
|
||||
@ -159,20 +155,16 @@ export class MetaBeltBuilding extends MetaBuilding {
|
||||
|
||||
getBlueprintSprite(rotationVariant) {
|
||||
switch (MetaBeltBuilding.variantToRotation[rotationVariant]) {
|
||||
case enumDirection.top:
|
||||
{
|
||||
case enumDirection.top: {
|
||||
return Loader.getSprite("sprites/blueprints/belt_top.png");
|
||||
}
|
||||
case enumDirection.left:
|
||||
{
|
||||
case enumDirection.left: {
|
||||
return Loader.getSprite("sprites/blueprints/belt_left.png");
|
||||
}
|
||||
case enumDirection.right:
|
||||
{
|
||||
case enumDirection.right: {
|
||||
return Loader.getSprite("sprites/blueprints/belt_right.png");
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
assertAlways(false, "Invalid belt rotation variant");
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,8 @@ MetaComparatorBuilding.setupEntityComponents = [
|
||||
(entity, rotationVariant) =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -185,7 +186,8 @@ MetaComparatorBuilding.layerByVariant = {
|
||||
|
||||
MetaComparatorBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
|
@ -120,11 +120,13 @@ MetaConstantSignalBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
entity => entity.addComponent(new ConstantSignalComponent({})),
|
||||
@ -170,10 +172,12 @@ MetaConstantSignalBuilding.layerPreview = {
|
||||
|
||||
MetaConstantSignalBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
},
|
||||
};
|
@ -99,11 +99,13 @@ MetaCutterBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: "shape",
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
];
|
||||
|
@ -107,11 +107,13 @@ MetaDisplayBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.bottom,
|
||||
type: enumPinSlotType.logicalAcceptor,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
entity => entity.addComponent(new DisplayComponent()),
|
||||
@ -155,10 +157,12 @@ MetaDisplayBuilding.renderPins = {
|
||||
|
||||
MetaDisplayBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.bottom,
|
||||
type: enumPinSlotType.logicalAcceptor,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
},
|
||||
};
|
@ -132,28 +132,33 @@ MetaFilterBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.left,
|
||||
type: enumPinSlotType.logicalAcceptor,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemEjectorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
},
|
||||
@ -212,18 +217,23 @@ MetaFilterBuilding.renderPins = {
|
||||
|
||||
MetaFilterBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.left,
|
||||
type: enumPinSlotType.logicalAcceptor,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemEjector.setSlots([{
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
},
|
||||
|
@ -132,18 +132,21 @@ MetaHubBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 2),
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
direction: enumDirection.left,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.top, enumDirection.left],
|
||||
filter: "shape",
|
||||
@ -256,13 +259,16 @@ MetaHubBuilding.componentVariations = {
|
||||
|
||||
entity.components.ItemProcessor.type = enumItemProcessorTypes.hub;
|
||||
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 2),
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
direction: enumDirection.left,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.top, enumDirection.left],
|
||||
filter: "shape",
|
||||
|
@ -106,11 +106,13 @@ MetaItemProducerBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
type: enumPinSlotType.logicalAcceptor,
|
||||
direction: enumDirection.bottom,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
|
||||
@ -153,10 +155,12 @@ MetaItemProducerBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.ItemEjector.setSlots([{ pos: new Vector(0, 0), direction: enumDirection.top }]);
|
||||
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
type: enumPinSlotType.logicalAcceptor,
|
||||
direction: enumDirection.bottom,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
},
|
||||
};
|
@ -123,11 +123,13 @@ MetaLeverBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
entity => entity.addComponent(new LeverComponent({})),
|
||||
@ -172,10 +174,12 @@ MetaLeverBuilding.renderPins = {
|
||||
|
||||
MetaLeverBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
},
|
||||
};
|
@ -202,7 +202,8 @@ MetaLogicGateBuilding.layerPreview = {
|
||||
|
||||
MetaLogicGateBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -223,7 +224,8 @@ MetaLogicGateBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaLogicGateBuilding.variants.xor]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -244,7 +246,8 @@ MetaLogicGateBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaLogicGateBuilding.variants.or]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -264,7 +267,8 @@ MetaLogicGateBuilding.componentVariations = {
|
||||
entity.components.LogicGate.type = enumLogicGateType.or;
|
||||
},
|
||||
[MetaLogicGateBuilding.variants.not]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
|
@ -131,7 +131,8 @@ MetaMixerBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: "color",
|
||||
@ -195,7 +196,8 @@ MetaMixerBuilding.componentVariations = {
|
||||
|
||||
entity.components.ItemEjector.setSlots([{ pos: new Vector(0, 0), direction: enumDirection.top }]);
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: "color",
|
||||
|
@ -129,7 +129,8 @@ MetaPainterBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.left],
|
||||
filter: "shape",
|
||||
@ -251,7 +252,8 @@ MetaPainterBuilding.componentVariations = {
|
||||
entity.removeComponent(WiredPinsComponent);
|
||||
}
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.left],
|
||||
filter: "shape",
|
||||
@ -275,7 +277,8 @@ MetaPainterBuilding.componentVariations = {
|
||||
entity.removeComponent(WiredPinsComponent);
|
||||
}
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.left],
|
||||
filter: "shape",
|
||||
@ -299,7 +302,8 @@ MetaPainterBuilding.componentVariations = {
|
||||
entity.removeComponent(WiredPinsComponent);
|
||||
}
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.left],
|
||||
filter: "shape",
|
||||
@ -328,7 +332,8 @@ MetaPainterBuilding.componentVariations = {
|
||||
entity.addComponent(new WiredPinsComponent({ slots: [] }));
|
||||
}
|
||||
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.bottom,
|
||||
type: enumPinSlotType.logicalAcceptor,
|
||||
@ -350,7 +355,8 @@ MetaPainterBuilding.componentVariations = {
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.left],
|
||||
filter: "shape",
|
||||
|
@ -134,7 +134,8 @@ MetaReaderBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.right,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -150,19 +151,23 @@ MetaReaderBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemEjectorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
entity =>
|
||||
@ -175,10 +180,12 @@ MetaReaderBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new BeltUnderlaysComponent({
|
||||
underlays: [{
|
||||
underlays: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
entity => entity.addComponent(new BeltReaderComponent()),
|
||||
@ -229,23 +236,29 @@ MetaReaderBuilding.renderPins = {
|
||||
|
||||
MetaReaderBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemEjector.setSlots([{
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemProcessor.inputsPerCharge = 1;
|
||||
|
||||
entity.components.ItemProcessor.type = enumItemProcessorTypes.reader;
|
||||
|
||||
entity.components.BeltUnderlays.underlays = [{
|
||||
entity.components.BeltUnderlays.underlays = [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
}, ];
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
@ -144,11 +144,13 @@ MetaRotaterBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: "shape",
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
];
|
||||
|
@ -144,7 +144,8 @@ MetaStackerBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: "shape",
|
||||
@ -216,7 +217,8 @@ MetaStackerBuilding.componentVariations = {
|
||||
|
||||
entity.components.ItemEjector.setSlots([{ pos: new Vector(0, 0), direction: enumDirection.top }]);
|
||||
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: "shape",
|
||||
|
@ -135,7 +135,8 @@ MetaStorageBuilding.setupEntityComponents = [
|
||||
// Required, since the item processor needs this.
|
||||
entity.addComponent(
|
||||
new ItemEjectorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
},
|
||||
@ -149,7 +150,8 @@ MetaStorageBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 1),
|
||||
directions: [enumDirection.bottom],
|
||||
},
|
||||
@ -169,7 +171,8 @@ MetaStorageBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(1, 1),
|
||||
direction: enumDirection.right,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -232,7 +235,8 @@ MetaStorageBuilding.renderPins = {
|
||||
|
||||
MetaStorageBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.ItemEjector.setSlots([{
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
},
|
||||
@ -241,7 +245,8 @@ MetaStorageBuilding.componentVariations = {
|
||||
direction: enumDirection.top,
|
||||
},
|
||||
]);
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 1),
|
||||
directions: [enumDirection.bottom],
|
||||
},
|
||||
@ -251,7 +256,8 @@ MetaStorageBuilding.componentVariations = {
|
||||
},
|
||||
]);
|
||||
entity.components.Storage.maximumStorage = storageSize;
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(1, 1),
|
||||
direction: enumDirection.right,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
|
@ -120,7 +120,8 @@ MetaTransistorBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new WiredPinsComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
|
@ -122,7 +122,8 @@ MetaTrashBuilding.setupEntityComponents = [
|
||||
entity =>
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [{
|
||||
slots: [
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [
|
||||
enumDirection.top,
|
||||
@ -130,7 +131,8 @@ MetaTrashBuilding.setupEntityComponents = [
|
||||
enumDirection.bottom,
|
||||
enumDirection.left,
|
||||
],
|
||||
}, ],
|
||||
},
|
||||
],
|
||||
})
|
||||
),
|
||||
entity =>
|
||||
@ -182,7 +184,8 @@ MetaTrashBuilding.avaibleVariants = {
|
||||
|
||||
MetaTrashBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [
|
||||
enumDirection.top,
|
||||
@ -190,7 +193,8 @@ MetaTrashBuilding.componentVariations = {
|
||||
enumDirection.bottom,
|
||||
enumDirection.left,
|
||||
],
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
|
||||
entity.components.ItemProcessor.inputsPerCharge = 1;
|
||||
|
||||
|
@ -188,7 +188,8 @@ export class MetaUndergroundBeltBuilding extends MetaBuilding {
|
||||
const targetSenderRotation = rotation;
|
||||
|
||||
for (
|
||||
let searchOffset = 1; searchOffset <= globalConfig.undergroundBeltMaxTilesByTier[tier];
|
||||
let searchOffset = 1;
|
||||
searchOffset <= globalConfig.undergroundBeltMaxTilesByTier[tier];
|
||||
++searchOffset
|
||||
) {
|
||||
tile = tile.addScalars(searchVector.x, searchVector.y);
|
||||
@ -360,18 +361,22 @@ MetaUndergroundBeltBuilding.componentVariationsByRotation = {
|
||||
[enumUndergroundBeltMode.sender]: (entity, rotationVariant) => {
|
||||
entity.components.UndergroundBelt.mode = enumUndergroundBeltMode.sender;
|
||||
entity.components.ItemEjector.setSlots([]);
|
||||
entity.components.ItemAcceptor.setSlots([{
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
||||
[enumUndergroundBeltMode.receiver]: (entity, rotationVariant) => {
|
||||
entity.components.UndergroundBelt.mode = enumUndergroundBeltMode.receiver;
|
||||
entity.components.ItemAcceptor.setSlots([]);
|
||||
entity.components.ItemEjector.setSlots([{
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
}, ]);
|
||||
},
|
||||
]);
|
||||
},
|
||||
};
|
@ -219,7 +219,8 @@ MetaVirtualProcessorBuilding.silhouetteColors = {
|
||||
|
||||
MetaVirtualProcessorBuilding.componentVariations = {
|
||||
[defaultBuildingVariant]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.left,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -240,7 +241,8 @@ MetaVirtualProcessorBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaVirtualProcessorBuilding.variants.rotater]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -256,7 +258,8 @@ MetaVirtualProcessorBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaVirtualProcessorBuilding.variants.unstacker]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.left,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -277,7 +280,8 @@ MetaVirtualProcessorBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaVirtualProcessorBuilding.variants.stacker]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
@ -298,7 +302,8 @@ MetaVirtualProcessorBuilding.componentVariations = {
|
||||
},
|
||||
|
||||
[MetaVirtualProcessorBuilding.variants.painter]: (entity, rotationVariant) => {
|
||||
entity.components.WiredPins.setSlots([{
|
||||
entity.components.WiredPins.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
direction: enumDirection.top,
|
||||
type: enumPinSlotType.logicalEjector,
|
||||
|
@ -151,24 +151,19 @@ export class MetaWireBuilding extends MetaBuilding {
|
||||
getPreviewSprite(rotationVariant, variant) {
|
||||
const wireVariant = MetaWireBuilding.wireVariantToVariant[variant];
|
||||
switch (MetaWireBuilding.rotationVariantToType[rotationVariant]) {
|
||||
case enumWireType.forward:
|
||||
{
|
||||
case enumWireType.forward: {
|
||||
return Loader.getSprite("sprites/wires/sets/" + wireVariant + "_forward.png");
|
||||
}
|
||||
case enumWireType.turn:
|
||||
{
|
||||
case enumWireType.turn: {
|
||||
return Loader.getSprite("sprites/wires/sets/" + wireVariant + "_turn.png");
|
||||
}
|
||||
case enumWireType.split:
|
||||
{
|
||||
case enumWireType.split: {
|
||||
return Loader.getSprite("sprites/wires/sets/" + wireVariant + "_split.png");
|
||||
}
|
||||
case enumWireType.cross:
|
||||
{
|
||||
case enumWireType.cross: {
|
||||
return Loader.getSprite("sprites/wires/sets/" + wireVariant + "_cross.png");
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
assertAlways(false, "Invalid wire rotation variant");
|
||||
}
|
||||
}
|
||||
|
@ -66,14 +66,12 @@ export class BeltComponent extends Component {
|
||||
assert(progress <= 1.02, "Invalid progress: " + progress);
|
||||
return new Vector(0, 0.5 - progress);
|
||||
|
||||
case enumDirection.right:
|
||||
{
|
||||
case enumDirection.right: {
|
||||
assert(progress <= BeltComponent.curvedBeltLength + 0.02, "Invalid progress 2: " + progress);
|
||||
const arcProgress = (progress / BeltComponent.curvedBeltLength) * 0.5 * Math.PI;
|
||||
return new Vector(0.5 - 0.5 * Math.cos(arcProgress), 0.5 - 0.5 * Math.sin(arcProgress));
|
||||
}
|
||||
case enumDirection.left:
|
||||
{
|
||||
case enumDirection.left: {
|
||||
assert(progress <= BeltComponent.curvedBeltLength + 0.02, "Invalid progress 3: " + progress);
|
||||
const arcProgress = (progress / BeltComponent.curvedBeltLength) * 0.5 * Math.PI;
|
||||
return new Vector(-0.5 + 0.5 * Math.cos(arcProgress), 0.5 - 0.5 * Math.sin(arcProgress));
|
||||
|
@ -201,32 +201,28 @@ export class StaticMapEntityComponent extends Component {
|
||||
const size = this.getTileSize();
|
||||
|
||||
switch (this.rotation) {
|
||||
case 0:
|
||||
{
|
||||
case 0: {
|
||||
x = this.origin.x;
|
||||
y = this.origin.y;
|
||||
w = size.x;
|
||||
h = size.y;
|
||||
break;
|
||||
}
|
||||
case 90:
|
||||
{
|
||||
case 90: {
|
||||
x = this.origin.x - size.y + 1;
|
||||
y = this.origin.y;
|
||||
w = size.y;
|
||||
h = size.x;
|
||||
break;
|
||||
}
|
||||
case 180:
|
||||
{
|
||||
case 180: {
|
||||
x = this.origin.x - size.x + 1;
|
||||
y = this.origin.y - size.y + 1;
|
||||
w = size.x;
|
||||
h = size.y;
|
||||
break;
|
||||
}
|
||||
case 270:
|
||||
{
|
||||
case 270: {
|
||||
x = this.origin.x;
|
||||
y = this.origin.y - size.x + 1;
|
||||
w = size.y;
|
||||
@ -281,7 +277,9 @@ export class StaticMapEntityComponent extends Component {
|
||||
parameters.context.translate(rotationCenterX, rotationCenterY);
|
||||
parameters.context.rotate(Math.radians(this.rotation));
|
||||
sprite.drawCached(
|
||||
parameters, -globalConfig.halfTileSize - extrudePixels * size.x, -globalConfig.halfTileSize - extrudePixels * size.y,
|
||||
parameters,
|
||||
-globalConfig.halfTileSize - extrudePixels * size.x,
|
||||
-globalConfig.halfTileSize - extrudePixels * size.y,
|
||||
globalConfig.tileSize * size.x + 2 * extrudePixels * size.x,
|
||||
globalConfig.tileSize * size.y + 2 * extrudePixels * size.y,
|
||||
false // no clipping possible here
|
||||
|
@ -422,7 +422,9 @@ export class GameCore {
|
||||
// Transform to world space
|
||||
|
||||
if (G_IS_DEV && globalConfig.debug.testClipping) {
|
||||
params.visibleRect = params.visibleRect.expandedInAllDirections(-200 / this.root.camera.zoomLevel);
|
||||
params.visibleRect = params.visibleRect.expandedInAllDirections(
|
||||
-200 / this.root.camera.zoomLevel
|
||||
);
|
||||
}
|
||||
|
||||
root.camera.transform(context);
|
||||
|
@ -127,7 +127,8 @@ export class HubGoals extends BasicSerializableObject {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isEndOfDemoReached() {
|
||||
return (!this.root.gameMode.getIsFreeplayAvailable() &&
|
||||
return (
|
||||
!this.root.gameMode.getIsFreeplayAvailable() &&
|
||||
this.level >= this.root.gameMode.getLevelDefinitions().length
|
||||
);
|
||||
}
|
||||
|
@ -18,7 +18,8 @@ export class HUDBaseToolbar extends BaseHUDPart {
|
||||
* @param {Layer=} param0.layer
|
||||
*/
|
||||
constructor(
|
||||
root, { primaryBuildings, secondaryBuildings = [], visibilityCondition, htmlElementId, layer = "regular" }
|
||||
root,
|
||||
{ primaryBuildings, secondaryBuildings = [], visibilityCondition, htmlElementId, layer = "regular" }
|
||||
) {
|
||||
super(root);
|
||||
|
||||
@ -81,7 +82,8 @@ export class HUDBaseToolbar extends BaseHUDPart {
|
||||
|
||||
const itemContainer = makeDiv(
|
||||
this.primaryBuildings.includes(allBuildings[i]) ? rowPrimary : rowSecondary,
|
||||
null, ["building"]
|
||||
null,
|
||||
["building"]
|
||||
);
|
||||
itemContainer.setAttribute("data-icon", "building_icons/" + metaBuilding.getId() + ".png");
|
||||
itemContainer.setAttribute("data-id", metaBuilding.getId());
|
||||
@ -159,9 +161,9 @@ export class HUDBaseToolbar extends BaseHUDPart {
|
||||
|
||||
let newBuildingFound = false;
|
||||
let newIndex = this.lastSelectedIndex;
|
||||
const direction = this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed ?
|
||||
-1 :
|
||||
1;
|
||||
const direction = this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed
|
||||
? -1
|
||||
: 1;
|
||||
|
||||
for (let i = 0; i <= this.primaryBuildings.length; ++i) {
|
||||
newIndex = safeModulo(newIndex + direction, this.primaryBuildings.length);
|
||||
|
@ -34,7 +34,8 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
this.buildingInfoElements.descText = makeDiv(this.buildingInfoElements.desc, null, ["text"], "");
|
||||
this.buildingInfoElements.additionalInfo = makeDiv(
|
||||
this.buildingInfoElements.desc,
|
||||
null, ["additionalInfo"],
|
||||
null,
|
||||
["additionalInfo"],
|
||||
""
|
||||
);
|
||||
this.buildingInfoElements.hotkey = makeDiv(this.buildingInfoElements.desc, null, ["hotkey"], "");
|
||||
@ -189,7 +190,8 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
|
||||
makeDiv(
|
||||
this.variantsElement,
|
||||
null, ["explanation"],
|
||||
null,
|
||||
["explanation"],
|
||||
T.ingame.buildingPlacement.cycleBuildingVariants.replace(
|
||||
"<key>",
|
||||
"<code class='keybinding'>" +
|
||||
@ -442,7 +444,9 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
parameters.context.translate(worldPos.x, worldPos.y);
|
||||
parameters.context.rotate(angle);
|
||||
parameters.context.drawImage(
|
||||
arrowSprite, -6, -globalConfig.halfTileSize -
|
||||
arrowSprite,
|
||||
-6,
|
||||
-globalConfig.halfTileSize -
|
||||
clamp((this.root.time.realtimeNow() * 1.5) % 1.0, 0, 1) * 1 * globalConfig.tileSize +
|
||||
globalConfig.halfTileSize -
|
||||
6,
|
||||
@ -498,7 +502,8 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
|
||||
// Go over all slots
|
||||
for (
|
||||
let acceptorDirectionIndex = 0; acceptorDirectionIndex < slot.directions.length;
|
||||
let acceptorDirectionIndex = 0;
|
||||
acceptorDirectionIndex < slot.directions.length;
|
||||
++acceptorDirectionIndex
|
||||
) {
|
||||
const direction = slot.directions[acceptorDirectionIndex];
|
||||
|
@ -443,7 +443,8 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
|
||||
}
|
||||
|
||||
// Check if we should stop placement
|
||||
if (!metaBuilding.getStayInPlacementMode() &&
|
||||
if (
|
||||
!metaBuilding.getStayInPlacementMode() &&
|
||||
!this.root.keyMapper.getBinding(KEYMAPPINGS.placementModifiers.placeMultiple).pressed &&
|
||||
!this.root.app.settings.getAllSettings().alwaysMultiplace
|
||||
) {
|
||||
@ -471,9 +472,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
|
||||
console.warn("Invalid variant selected:", this.currentVariant.get());
|
||||
}
|
||||
const direction = this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier)
|
||||
.pressed ?
|
||||
-1 :
|
||||
1;
|
||||
.pressed
|
||||
? -1
|
||||
: 1;
|
||||
|
||||
const newIndex = safeModulo(index + direction, availableVariants.length);
|
||||
const newVariant = availableVariants[newIndex];
|
||||
|
@ -103,9 +103,9 @@ export class HUDMinerHighlight extends BaseHUDPart {
|
||||
parameters.context.globalAlpha = 0.6;
|
||||
parameters.context.font = "bold " + scale * 8 + "px GameFont";
|
||||
parameters.context.fillText(
|
||||
connectedEntities.length === 1 ?
|
||||
T.ingame.connectedMiners.one_miner :
|
||||
T.ingame.connectedMiners.n_miners.replace("<amount>", String(connectedEntities.length)),
|
||||
connectedEntities.length === 1
|
||||
? T.ingame.connectedMiners.one_miner
|
||||
: T.ingame.connectedMiners.n_miners.replace("<amount>", String(connectedEntities.length)),
|
||||
tooltipLocation.x + 10 * scale,
|
||||
tooltipLocation.y + 22 * scale
|
||||
);
|
||||
|
@ -15,7 +15,8 @@ export class HUDSettingsMenu extends BaseHUDPart {
|
||||
|
||||
this.statsElement = makeDiv(
|
||||
this.background,
|
||||
null, ["statsElement"],
|
||||
null,
|
||||
["statsElement"],
|
||||
`
|
||||
<strong>${T.ingame.settingsMenu.beltsPlaced}</strong><span class="beltsPlaced"></span>
|
||||
<strong>${T.ingame.settingsMenu.buildingsPlaced}</strong><span class="buildingsPlaced"></span>
|
||||
@ -110,7 +111,8 @@ export class HUDSettingsMenu extends BaseHUDPart {
|
||||
}
|
||||
}
|
||||
|
||||
HUDSettingsMenu.buttons = [{
|
||||
HUDSettingsMenu.buttons = [
|
||||
{
|
||||
id: "continue",
|
||||
action: hudSettingsMenu => () => hudSettingsMenu.close(),
|
||||
options: {
|
||||
|
@ -48,7 +48,8 @@ export class HUDWaypoints extends BaseHUDPart {
|
||||
if (this.root.app.settings.getAllSettings().offerHints) {
|
||||
this.hintElement = makeDiv(
|
||||
parent,
|
||||
"ingame_HUD_Waypoints_Hint", [],
|
||||
"ingame_HUD_Waypoints_Hint",
|
||||
[],
|
||||
`
|
||||
<strong class='title'>${T.ingame.waypoints.waypoints}</strong>
|
||||
<span class='desc'>${T.ingame.waypoints.description.replace(
|
||||
|
@ -36,7 +36,8 @@ export class HUDWireInfo extends BaseHUDPart {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.root.camera.getIsMapOverlayActive() &&
|
||||
if (
|
||||
!this.root.camera.getIsMapOverlayActive() &&
|
||||
!this.root.logic.getIsEntityIntersectedWithMatrix(entity, worldPos)
|
||||
) {
|
||||
// Detailed intersection check
|
||||
|
@ -146,9 +146,9 @@ export class HUDWiresOverlay extends BaseHUDPart {
|
||||
parameters.context.globalCompositeOperation = "source-over";
|
||||
|
||||
parameters.context.scale(scaleFactor, scaleFactor);
|
||||
parameters.context.fillStyle = hasTileGrid ?
|
||||
this.cachedPatternBackground :
|
||||
"rgba(78, 137, 125, 0.75)";
|
||||
parameters.context.fillStyle = hasTileGrid
|
||||
? this.cachedPatternBackground
|
||||
: "rgba(78, 137, 125, 0.75)";
|
||||
parameters.context.fillRect(
|
||||
bounds.x / scaleFactor,
|
||||
bounds.y / scaleFactor,
|
||||
|
@ -264,9 +264,9 @@ export function getStringForKeyCode(code) {
|
||||
return "'";
|
||||
}
|
||||
|
||||
return (48 <= code && code <= 57) || (65 <= code && code <= 90) ?
|
||||
String.fromCharCode(code) :
|
||||
"[" + code + "]";
|
||||
return (48 <= code && code <= 57) || (65 <= code && code <= 90)
|
||||
? String.fromCharCode(code)
|
||||
: "[" + code + "]";
|
||||
}
|
||||
|
||||
export class Keybinding {
|
||||
|
@ -142,9 +142,9 @@ export class MapChunkView extends MapChunk {
|
||||
*/
|
||||
generateOverlayBuffer(canvas, context, w, h, dpi) {
|
||||
context.fillStyle =
|
||||
this.containedEntities.length > 0 ?
|
||||
THEME.map.chunkOverview.filled :
|
||||
THEME.map.chunkOverview.empty;
|
||||
this.containedEntities.length > 0
|
||||
? THEME.map.chunkOverview.filled
|
||||
: THEME.map.chunkOverview.empty;
|
||||
context.fillRect(0, 0, w, h);
|
||||
|
||||
if (this.root.app.settings.getAllSettings().displayChunkBorders) {
|
||||
|
@ -43,7 +43,8 @@ function generateUpgrades(limitedVersion = false) {
|
||||
}
|
||||
|
||||
const upgrades = {
|
||||
belt: [{
|
||||
belt: [
|
||||
{
|
||||
required: [{ shape: "CuCuCuCu", amount: 30 }],
|
||||
},
|
||||
{
|
||||
@ -72,7 +73,8 @@ function generateUpgrades(limitedVersion = false) {
|
||||
...generateInfiniteUnlocks(),
|
||||
],
|
||||
|
||||
miner: [{
|
||||
miner: [
|
||||
{
|
||||
required: [{ shape: "RuRuRuRu", amount: 300 }],
|
||||
},
|
||||
{
|
||||
@ -101,7 +103,8 @@ function generateUpgrades(limitedVersion = false) {
|
||||
...generateInfiniteUnlocks(),
|
||||
],
|
||||
|
||||
processors: [{
|
||||
processors: [
|
||||
{
|
||||
required: [{ shape: "SuSuSuSu", amount: 500 }],
|
||||
},
|
||||
{
|
||||
@ -130,7 +133,8 @@ function generateUpgrades(limitedVersion = false) {
|
||||
...generateInfiniteUnlocks(),
|
||||
],
|
||||
|
||||
painting: [{
|
||||
painting: [
|
||||
{
|
||||
required: [{ shape: "RbRb----", amount: 600 }],
|
||||
},
|
||||
{
|
||||
@ -317,13 +321,15 @@ export function generateLevelDefinitions(limitedVersion = false) {
|
||||
},
|
||||
|
||||
// DEMO STOPS HERE
|
||||
...(limitedVersion ?
|
||||
[{
|
||||
...(limitedVersion
|
||||
? [
|
||||
{
|
||||
shape: "RpRpRpRp:CwCwCwCw",
|
||||
required: 0,
|
||||
reward: enumHubGoalRewards.reward_demo_end,
|
||||
}, ] :
|
||||
[
|
||||
},
|
||||
]
|
||||
: [
|
||||
// 14
|
||||
// Belt reader
|
||||
{
|
||||
@ -457,9 +463,9 @@ export class RegularGameMode extends GameMode {
|
||||
}
|
||||
|
||||
getUpgrades() {
|
||||
return this.root.app.restrictionMgr.getHasExtendedUpgrades() ?
|
||||
fullVersionUpgrades :
|
||||
demoVersionUpgrades;
|
||||
return this.root.app.restrictionMgr.getHasExtendedUpgrades()
|
||||
? fullVersionUpgrades
|
||||
: demoVersionUpgrades;
|
||||
}
|
||||
|
||||
getIsFreeplayAvailable() {
|
||||
@ -471,8 +477,8 @@ export class RegularGameMode extends GameMode {
|
||||
}
|
||||
|
||||
getLevelDefinitions() {
|
||||
return this.root.app.restrictionMgr.getHasExtendedLevelsAndFreeplay() ?
|
||||
fullVersionLevels :
|
||||
demoVersionLevels;
|
||||
return this.root.app.restrictionMgr.getHasExtendedLevelsAndFreeplay()
|
||||
? fullVersionLevels
|
||||
: demoVersionLevels;
|
||||
}
|
||||
}
|
@ -607,8 +607,10 @@ ShapeDefinition.renderQuad = {
|
||||
context.beginPath();
|
||||
context.moveTo(insetPadding + -quadrantHalfSize, -insetPadding + quadrantHalfSize);
|
||||
context.arc(
|
||||
insetPadding + -quadrantHalfSize, -insetPadding + quadrantHalfSize,
|
||||
quadrantSize * layerScale, -Math.PI * 0.5,
|
||||
insetPadding + -quadrantHalfSize,
|
||||
-insetPadding + quadrantHalfSize,
|
||||
quadrantSize * layerScale,
|
||||
-Math.PI * 0.5,
|
||||
0
|
||||
);
|
||||
context.closePath();
|
||||
|
@ -30,9 +30,9 @@ export class BeltReaderSystem extends GameSystemWithFilter {
|
||||
pinsComp.slots[1].value = readerComp.lastItem;
|
||||
pinsComp.slots[0].value =
|
||||
(readerComp.lastItemTimes[readerComp.lastItemTimes.length - 1] || 0) >
|
||||
minimumTimeForThroughput ?
|
||||
BOOL_TRUE_SINGLETON :
|
||||
BOOL_FALSE_SINGLETON;
|
||||
minimumTimeForThroughput
|
||||
? BOOL_TRUE_SINGLETON
|
||||
: BOOL_FALSE_SINGLETON;
|
||||
|
||||
if (now - readerComp.lastThroughputComputation > 0.5) {
|
||||
// Compute throughput
|
||||
|
@ -252,12 +252,14 @@ export class BeltUnderlaysSystem extends GameSystemWithFilter {
|
||||
}
|
||||
|
||||
// Culling, Part 2: Check if the overlay is visible
|
||||
if (!parameters.visibleRect.containsRect4Params(
|
||||
if (
|
||||
!parameters.visibleRect.containsRect4Params(
|
||||
destX,
|
||||
destY,
|
||||
globalConfig.tileSize,
|
||||
globalConfig.tileSize
|
||||
)) {
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -287,7 +289,9 @@ export class BeltUnderlaysSystem extends GameSystemWithFilter {
|
||||
this.underlayBeltSprites[
|
||||
animationIndex % this.underlayBeltSprites.length
|
||||
].drawCachedWithClipRect(
|
||||
parameters, -globalConfig.halfTileSize, -globalConfig.halfTileSize,
|
||||
parameters,
|
||||
-globalConfig.halfTileSize,
|
||||
-globalConfig.halfTileSize,
|
||||
globalConfig.tileSize,
|
||||
globalConfig.tileSize,
|
||||
clipRect
|
||||
|
@ -84,6 +84,6 @@ export class FilterSystem extends GameSystemWithFilter {
|
||||
}
|
||||
|
||||
FilterSystem.listToCheck = (entity, slot, item, filterComp, networkValue) =>
|
||||
networkValue.equals(BOOL_TRUE_SINGLETON) || networkValue.equals(item) ?
|
||||
filterComp.pendingItemsToLeaveThrough :
|
||||
filterComp.pendingItemsToReject;
|
||||
networkValue.equals(BOOL_TRUE_SINGLETON) || networkValue.equals(item)
|
||||
? filterComp.pendingItemsToLeaveThrough
|
||||
: filterComp.pendingItemsToReject;
|
||||
|
@ -104,9 +104,9 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||
*/
|
||||
compute_AND(parameters) {
|
||||
assert(parameters.length === 2, "bad parameter count for AND");
|
||||
return isTruthyItem(parameters[0]) && isTruthyItem(parameters[1]) ?
|
||||
BOOL_TRUE_SINGLETON :
|
||||
BOOL_FALSE_SINGLETON;
|
||||
return isTruthyItem(parameters[0]) && isTruthyItem(parameters[1])
|
||||
? BOOL_TRUE_SINGLETON
|
||||
: BOOL_FALSE_SINGLETON;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,9 +123,9 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||
*/
|
||||
compute_XOR(parameters) {
|
||||
assert(parameters.length === 2, "bad parameter count for XOR");
|
||||
return isTruthyItem(parameters[0]) !== isTruthyItem(parameters[1]) ?
|
||||
BOOL_TRUE_SINGLETON :
|
||||
BOOL_FALSE_SINGLETON;
|
||||
return isTruthyItem(parameters[0]) !== isTruthyItem(parameters[1])
|
||||
? BOOL_TRUE_SINGLETON
|
||||
: BOOL_FALSE_SINGLETON;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -134,9 +134,9 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||
*/
|
||||
compute_OR(parameters) {
|
||||
assert(parameters.length === 2, "bad parameter count for OR");
|
||||
return isTruthyItem(parameters[0]) || isTruthyItem(parameters[1]) ?
|
||||
BOOL_TRUE_SINGLETON :
|
||||
BOOL_FALSE_SINGLETON;
|
||||
return isTruthyItem(parameters[0]) || isTruthyItem(parameters[1])
|
||||
? BOOL_TRUE_SINGLETON
|
||||
: BOOL_FALSE_SINGLETON;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -226,12 +226,12 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||
const definition = /** @type {ShapeItem} */ (item).definition;
|
||||
const result = this.root.shapeDefinitionMgr.shapeActionCutHalf(definition);
|
||||
return [
|
||||
result[0].isEntirelyEmpty() ?
|
||||
null :
|
||||
this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[0]),
|
||||
result[1].isEntirelyEmpty() ?
|
||||
null :
|
||||
this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[1]),
|
||||
result[0].isEntirelyEmpty()
|
||||
? null
|
||||
: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[0]),
|
||||
result[1].isEntirelyEmpty()
|
||||
? null
|
||||
: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[1]),
|
||||
];
|
||||
}
|
||||
|
||||
@ -258,9 +258,9 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||
lowerLayers.length > 0 ? new ShapeDefinition({ layers: lowerLayers }) : null;
|
||||
|
||||
return [
|
||||
lowerLayerDefinition ?
|
||||
this.root.shapeDefinitionMgr.getShapeItemFromDefinition(lowerLayerDefinition) :
|
||||
null,
|
||||
lowerLayerDefinition
|
||||
? this.root.shapeDefinitionMgr.getShapeItemFromDefinition(lowerLayerDefinition)
|
||||
: null,
|
||||
this.root.shapeDefinitionMgr.getShapeItemFromDefinition(upperLayerDefinition),
|
||||
];
|
||||
}
|
||||
@ -340,30 +340,26 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||
}
|
||||
|
||||
switch (itemA.getItemType()) {
|
||||
case "shape":
|
||||
{
|
||||
case "shape": {
|
||||
return /** @type {ShapeItem} */ (itemA).definition.getHash() ===
|
||||
/** @type {ShapeItem} */
|
||||
(itemB).definition.getHash() ?
|
||||
BOOL_TRUE_SINGLETON :
|
||||
BOOL_FALSE_SINGLETON;
|
||||
(itemB).definition.getHash()
|
||||
? BOOL_TRUE_SINGLETON
|
||||
: BOOL_FALSE_SINGLETON;
|
||||
}
|
||||
case "color":
|
||||
{
|
||||
return /** @type {ColorItem} */ (itemA).color === /** @type {ColorItem} */ (itemB).color ?
|
||||
BOOL_TRUE_SINGLETON :
|
||||
BOOL_FALSE_SINGLETON;
|
||||
case "color": {
|
||||
return /** @type {ColorItem} */ (itemA).color === /** @type {ColorItem} */ (itemB).color
|
||||
? BOOL_TRUE_SINGLETON
|
||||
: BOOL_FALSE_SINGLETON;
|
||||
}
|
||||
|
||||
case "boolean":
|
||||
{
|
||||
return /** @type {BooleanItem} */ (itemA).value === /** @type {BooleanItem} */ (itemB).value ?
|
||||
BOOL_TRUE_SINGLETON :
|
||||
BOOL_FALSE_SINGLETON;
|
||||
case "boolean": {
|
||||
return /** @type {BooleanItem} */ (itemA).value === /** @type {BooleanItem} */ (itemB).value
|
||||
? BOOL_TRUE_SINGLETON
|
||||
: BOOL_FALSE_SINGLETON;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
assertAlways(false, "Bad item type: " + itemA.getItemType());
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,8 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
|
||||
|
||||
// Search in the direction of the tunnel
|
||||
for (
|
||||
let searchOffset = 0; searchOffset < globalConfig.undergroundBeltMaxTilesByTier[undergroundComp.tier];
|
||||
let searchOffset = 0;
|
||||
searchOffset < globalConfig.undergroundBeltMaxTilesByTier[undergroundComp.tier];
|
||||
++searchOffset
|
||||
) {
|
||||
currentTile = currentTile.add(searchVector);
|
||||
|
@ -217,10 +217,12 @@ export class WireSystem extends GameSystemWithFilter {
|
||||
currentNetwork.uid,
|
||||
")"
|
||||
);
|
||||
const entitiesToVisit = [{
|
||||
const entitiesToVisit = [
|
||||
{
|
||||
entity: initialEntity,
|
||||
slot,
|
||||
}, ];
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* Once we occur a wire, we store its variant so we don't connect to
|
||||
@ -245,7 +247,8 @@ export class WireSystem extends GameSystemWithFilter {
|
||||
//// WIRE
|
||||
if (wireComp) {
|
||||
// Sanity check
|
||||
assert(!wireComp.linkedNetwork || wireComp.linkedNetwork === currentNetwork,
|
||||
assert(
|
||||
!wireComp.linkedNetwork || wireComp.linkedNetwork === currentNetwork,
|
||||
"Mismatching wire network on wire entity " +
|
||||
(wireComp.linkedNetwork ? wireComp.linkedNetwork.uid : "<empty>") +
|
||||
" vs " +
|
||||
@ -287,7 +290,8 @@ export class WireSystem extends GameSystemWithFilter {
|
||||
}
|
||||
|
||||
// Sanity check
|
||||
assert(!slot.linkedNetwork || slot.linkedNetwork === currentNetwork,
|
||||
assert(
|
||||
!slot.linkedNetwork || slot.linkedNetwork === currentNetwork,
|
||||
"Mismatching wire network on pin slot entity " +
|
||||
(slot.linkedNetwork ? slot.linkedNetwork.uid : "<empty>") +
|
||||
" vs " +
|
||||
|
@ -121,9 +121,11 @@ export class WiredPinsSystem extends GameSystemWithFilter {
|
||||
if (collidingEntity) {
|
||||
const staticComp = collidingEntity.components.StaticMapEntity;
|
||||
const data = getBuildingDataFromCode(staticComp.code);
|
||||
if (!collidingEntity.components.StaticMapEntity.getMetaBuilding().getIsReplaceable(
|
||||
if (
|
||||
!collidingEntity.components.StaticMapEntity.getMetaBuilding().getIsReplaceable(
|
||||
data.variant
|
||||
)) {
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -193,7 +195,9 @@ export class WiredPinsSystem extends GameSystemWithFilter {
|
||||
const worldPos = tile.toWorldSpaceCenterOfTile();
|
||||
|
||||
// Culling
|
||||
if (!parameters.visibleRect.containsCircle(worldPos.x, worldPos.y, globalConfig.halfTileSize)) {
|
||||
if (
|
||||
!parameters.visibleRect.containsCircle(worldPos.x, worldPos.y, globalConfig.halfTileSize)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -28,31 +28,15 @@ const typed = x => x;
|
||||
* @enum {TutorialGoalReward?}
|
||||
*/
|
||||
export const enumHubGoalRewardsToContentUnlocked = {
|
||||
[enumHubGoalRewards.reward_cutter_and_trash]: typed([
|
||||
[MetaCutterBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_rotater]: typed([
|
||||
[MetaRotaterBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_painter]: typed([
|
||||
[MetaPainterBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_mixer]: typed([
|
||||
[MetaMixerBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_stacker]: typed([
|
||||
[MetaStackerBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_balancer]: typed([
|
||||
[MetaBalancerBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_tunnel]: typed([
|
||||
[MetaUndergroundBeltBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_cutter_and_trash]: typed([[MetaCutterBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_rotater]: typed([[MetaRotaterBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_painter]: typed([[MetaPainterBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_mixer]: typed([[MetaMixerBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_stacker]: typed([[MetaStackerBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_balancer]: typed([[MetaBalancerBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_tunnel]: typed([[MetaUndergroundBeltBuilding, defaultBuildingVariant]]),
|
||||
|
||||
[enumHubGoalRewards.reward_rotater_ccw]: typed([
|
||||
[MetaRotaterBuilding, MetaRotaterBuilding.variants.ccw]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_rotater_ccw]: typed([[MetaRotaterBuilding, MetaRotaterBuilding.variants.ccw]]),
|
||||
[enumHubGoalRewards.reward_rotater_180]: typed([
|
||||
[MetaRotaterBuilding, MetaRotaterBuilding.variants.rotate180],
|
||||
]),
|
||||
@ -65,34 +49,20 @@ export const enumHubGoalRewardsToContentUnlocked = {
|
||||
[enumHubGoalRewards.reward_splitter]: typed([
|
||||
[MetaBalancerBuilding, MetaBalancerBuilding.variants.splitter],
|
||||
]),
|
||||
[enumHubGoalRewards.reward_merger]: typed([
|
||||
[MetaBalancerBuilding, MetaBalancerBuilding.variants.merger]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_cutter_quad]: typed([
|
||||
[MetaCutterBuilding, MetaCutterBuilding.variants.quad]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_merger]: typed([[MetaBalancerBuilding, MetaBalancerBuilding.variants.merger]]),
|
||||
[enumHubGoalRewards.reward_cutter_quad]: typed([[MetaCutterBuilding, MetaCutterBuilding.variants.quad]]),
|
||||
[enumHubGoalRewards.reward_painter_double]: typed([
|
||||
[MetaPainterBuilding, MetaPainterBuilding.variants.double],
|
||||
]),
|
||||
[enumHubGoalRewards.reward_storage]: typed([
|
||||
[MetaStorageBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_storage]: typed([[MetaStorageBuilding, defaultBuildingVariant]]),
|
||||
|
||||
[enumHubGoalRewards.reward_belt_reader]: typed([
|
||||
[MetaReaderBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_display]: typed([
|
||||
[MetaDisplayBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_belt_reader]: typed([[MetaReaderBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_display]: typed([[MetaDisplayBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_constant_signal]: typed([
|
||||
[MetaConstantSignalBuilding, defaultBuildingVariant],
|
||||
]),
|
||||
[enumHubGoalRewards.reward_logic_gates]: typed([
|
||||
[MetaLogicGateBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_filter]: typed([
|
||||
[MetaFilterBuilding, defaultBuildingVariant]
|
||||
]),
|
||||
[enumHubGoalRewards.reward_logic_gates]: typed([[MetaLogicGateBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_filter]: typed([[MetaFilterBuilding, defaultBuildingVariant]]),
|
||||
[enumHubGoalRewards.reward_virtual_processing]: null,
|
||||
|
||||
[enumHubGoalRewards.reward_wires_painter_and_levers]: typed([
|
||||
|
@ -941,7 +941,8 @@ export class ShapezAPI {
|
||||
sourceImage.crossOrigin = "anonymous";
|
||||
sourceImage.onload = () => {
|
||||
// @ts-ignore
|
||||
Loader.internalParseAtlas({
|
||||
Loader.internalParseAtlas(
|
||||
{
|
||||
meta: atlasData.atlasData.meta,
|
||||
sourceData: atlasData.atlasData.frames,
|
||||
},
|
||||
|
@ -24,7 +24,8 @@ export const enumCategories = {
|
||||
debug: "debug",
|
||||
};
|
||||
|
||||
export const uiScales = [{
|
||||
export const uiScales = [
|
||||
{
|
||||
id: "super_small",
|
||||
size: 0.6,
|
||||
},
|
||||
@ -46,7 +47,8 @@ export const uiScales = [{
|
||||
},
|
||||
];
|
||||
|
||||
export const scrollWheelSensitivities = [{
|
||||
export const scrollWheelSensitivities = [
|
||||
{
|
||||
id: "super_slow",
|
||||
scale: 0.25,
|
||||
},
|
||||
@ -68,7 +70,8 @@ export const scrollWheelSensitivities = [{
|
||||
},
|
||||
];
|
||||
|
||||
export const movementSpeeds = [{
|
||||
export const movementSpeeds = [
|
||||
{
|
||||
id: "super_slow",
|
||||
multiplier: 0.25,
|
||||
},
|
||||
@ -94,7 +97,8 @@ export const movementSpeeds = [{
|
||||
},
|
||||
];
|
||||
|
||||
export const autosaveIntervals = [{
|
||||
export const autosaveIntervals = [
|
||||
{
|
||||
id: "one_minute",
|
||||
seconds: 60,
|
||||
},
|
||||
|
@ -117,7 +117,8 @@ export class BaseSetting {
|
||||
|
||||
export class EnumSetting extends BaseSetting {
|
||||
constructor(
|
||||
id, {
|
||||
id,
|
||||
{
|
||||
options,
|
||||
valueGetter,
|
||||
textGetter,
|
||||
|
@ -150,7 +150,8 @@ export class SavegameManager extends ReadWriteProxy {
|
||||
this.updateAfterSavegamesChanged();
|
||||
|
||||
return new Savegame(
|
||||
this.app, {
|
||||
this.app,
|
||||
{
|
||||
internalId: id,
|
||||
metaDataRef: metaData,
|
||||
},
|
||||
|
@ -1197,7 +1197,8 @@ export class TypeNullable extends BaseDataType {
|
||||
|
||||
getAsJsonSchemaUncached() {
|
||||
return {
|
||||
oneOf: [{
|
||||
oneOf: [
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
this.wrapped.getAsJsonSchema(),
|
||||
|
@ -155,7 +155,8 @@ export class KeybindingsState extends TextualGameState {
|
||||
resetBindings() {
|
||||
const { reset } = this.dialogs.showWarning(
|
||||
T.dialogs.resetKeybindingsConfirmation.title,
|
||||
T.dialogs.resetKeybindingsConfirmation.desc, ["cancel:good", "reset:bad"]
|
||||
T.dialogs.resetKeybindingsConfirmation.desc,
|
||||
["cancel:good", "reset:bad"]
|
||||
);
|
||||
|
||||
reset.add(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user