Merge pull request #8 from tobspr/master

Update
pull/179/head
Killgaru 4 years ago committed by GitHub
commit daa9545ec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:92f3784f7a51e846da6f6fad53bc07d9525188a5133bab1a793eb6040a4c4341
size 185127
oid sha256:aac3ac709c7d6c9dc44c548a437cf9d499a0a699068307b51810d49edd9fd28e
size 220467

@ -1,11 +1,13 @@
export const CHANGELOG = [
{
version: "1.1.14",
date: "unreleased",
date: "16.06.2020",
entries: [
"There is now an indicator (compass) to the HUB for the HUB Marker!",
"You can now include shape short keys in markers to render shape icons instead of text!",
"Added mirrored variant of the painter",
"When placing tunnels, unnecessary belts inbetween are now removed!",
"You can now drag tunnels and they will automatically expand! (Just try it out, its intuitive)",
],
},
{

@ -483,6 +483,10 @@ export class HUDBuildingPlacer extends BaseHUDPart {
) {
// Succesfully placed
const entity = this.root.map.getTileContent(tile);
assert(entity, "Entity was not actually placed");
this.root.signals.entityManuallyPlaced.dispatch(entity);
if (
metaBuilding.getFlipOrientationAfterPlacement() &&
!this.root.keyMapper

@ -130,6 +130,7 @@ export class GameRoot {
this.signals = {
// Entities
entityManuallyPlaced: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
entityAdded: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
entityGotNewComponent: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
entityComponentRemoved: /** @type {TypedSignal<[Entity]>} */ (new Signal()),

@ -1,12 +1,17 @@
import { GameSystemWithFilter } from "../game_system_with_filter";
import { UndergroundBeltComponent, enumUndergroundBeltMode } from "../components/underground_belt";
import { Entity } from "../entity";
import { Loader } from "../../core/loader";
import { Math_max } from "../../core/builtins";
import { globalConfig } from "../../core/config";
import { enumDirection, enumDirectionToVector, enumDirectionToAngle } from "../../core/vector";
import { MapChunkView } from "../map_chunk_view";
import { DrawParameters } from "../../core/draw_parameters";
import { Loader } from "../../core/loader";
import {
enumDirection,
enumDirectionToAngle,
enumDirectionToVector,
Vector,
enumAngleToDirection,
enumInvertedDirections,
} from "../../core/vector";
import { enumUndergroundBeltMode, UndergroundBeltComponent } from "../components/underground_belt";
import { Entity } from "../entity";
import { GameSystemWithFilter } from "../game_system_with_filter";
export class UndergroundBeltSystem extends GameSystemWithFilter {
constructor(root) {
@ -20,6 +25,8 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
"sprites/buildings/underground_belt_exit.png"
),
};
this.root.signals.entityManuallyPlaced.add(this.onEntityPlaced, this);
}
update() {
@ -46,6 +53,135 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
}
}
/**
* Callback when an entity got placed, used to remove belts between underground belts
* @param {Entity} entity
*/
onEntityPlaced(entity) {
const undergroundComp = entity.components.UndergroundBelt;
if (undergroundComp && undergroundComp.mode === enumUndergroundBeltMode.receiver) {
const staticComp = entity.components.StaticMapEntity;
const tile = staticComp.origin;
const direction = enumAngleToDirection[staticComp.rotation];
const inverseDirection = enumInvertedDirections[direction];
const offset = enumDirectionToVector[inverseDirection];
let currentPos = tile.copy();
const tier = undergroundComp.tier;
const range = globalConfig.undergroundBeltMaxTilesByTier[tier];
// Search for the entrance which is furthes apart (this is why we can't reuse logic here)
let matchingEntrance = null;
for (let i = 0; i < range; ++i) {
currentPos.addInplace(offset);
const contents = this.root.map.getTileContent(currentPos);
if (!contents) {
continue;
}
const contentsUndergroundComp = contents.components.UndergroundBelt;
if (
contentsUndergroundComp &&
contentsUndergroundComp.tier === undergroundComp.tier &&
contentsUndergroundComp.mode === enumUndergroundBeltMode.sender
) {
matchingEntrance = {
entity: contents,
range: i,
};
}
}
if (!matchingEntrance) {
// Nothing found
return;
}
// Remove any belts between entrance and exit which have the same direction
currentPos = tile.copy();
for (let i = 0; i < matchingEntrance.range; ++i) {
currentPos.addInplace(offset);
const contents = this.root.map.getTileContent(currentPos);
if (!contents) {
continue;
}
const contentsStaticComp = contents.components.StaticMapEntity;
const contentsBeltComp = contents.components.Belt;
if (contentsBeltComp) {
// It's a belt
if (
contentsBeltComp.direction === enumDirection.top &&
enumAngleToDirection[contentsStaticComp.rotation] === direction
) {
// It's same rotation, drop it
this.root.logic.tryDeleteBuilding(contents);
}
}
}
// Remove any double tunnels, by checking the tile plus the tile above
currentPos = tile.copy().add(offset);
for (let i = 0; i < matchingEntrance.range - 1; ++i) {
const posBefore = currentPos.copy();
currentPos.addInplace(offset);
const entityBefore = this.root.map.getTileContent(posBefore);
const entityAfter = this.root.map.getTileContent(currentPos);
if (!entityBefore || !entityAfter) {
continue;
}
const undergroundBefore = entityBefore.components.UndergroundBelt;
const undergroundAfter = entityAfter.components.UndergroundBelt;
if (!undergroundBefore || !undergroundAfter) {
// Not an underground belt
continue;
}
if (
// Both same tier
undergroundBefore.tier !== undergroundAfter.tier ||
// And same tier as our original entity
undergroundBefore.tier !== undergroundComp.tier
) {
// Mismatching tier
continue;
}
if (
undergroundBefore.mode !== enumUndergroundBeltMode.sender ||
undergroundAfter.mode !== enumUndergroundBeltMode.receiver
) {
// Not the right mode
continue;
}
// Check rotations
const staticBefore = entityBefore.components.StaticMapEntity;
const staticAfter = entityAfter.components.StaticMapEntity;
if (
enumAngleToDirection[staticBefore.rotation] !== direction ||
enumAngleToDirection[staticAfter.rotation] !== direction
) {
// Wrong rotation
continue;
}
// All good, can remove
this.root.logic.tryDeleteBuilding(entityBefore);
this.root.logic.tryDeleteBuilding(entityAfter);
}
}
}
/**
*
* @param {Entity} entity

@ -480,13 +480,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the top input.
description: &painter_desc Colors the whole shape on the left input with the color from the top input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -461,13 +461,16 @@ buildings:
painter:
default:
name: &painter Barvič
description: Obarví celý tvar v levém vstupu barvou z pravého vstupu.
description: &painter_desc Obarví celý tvar v levém vstupu barvou z pravého vstupu.
double:
name: Barvič (dvojnásobný)
description: Obarví tvary z levých vstupů barvou z horního vstupu.
quad:
name: Barvič (čtyřnásobný)
description: Umožňuje obarvit každý dílek tvaru samostatně.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -475,7 +475,7 @@ buildings:
painter:
default:
name: &painter Färber
description: Färbt die ganze Form aus dem linken Eingang mit der Farbe aus dem oberen Eingang.
description: &painter_desc Färbt die ganze Form aus dem linken Eingang mit der Farbe aus dem oberen Eingang.
double:
name: Färber (2-Fach)
@ -484,6 +484,9 @@ buildings:
quad:
name: Färber (4-Fach)
description: Erlaubt jedes einzelne Viertel einer Form beliebig einzufärben.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -475,13 +475,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -469,13 +469,16 @@ buildings:
painter:
default:
name: &painter Pintor
description: Colorea la figura entera con el color que entra por la izquierda.
description: &painter_desc Colorea la figura entera con el color que entra por la izquierda.
double:
name: Pintor (Doble)
description: Colorea las figuras que entran por la izquierda con el color que entrapor arriba.
quad:
name: Pintor (Cuádruple)
description: Permite colorear cada cuadrante de una figura con un color distinto.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -478,13 +478,16 @@ buildings:
painter:
default:
name: &painter Peintre
description: Colorie entièrement la forme de gauche avec la couleur de droite.
description: &painter_desc Colorie entièrement la forme de gauche avec la couleur de droite.
double:
name: Peintre (Double)
description: Colorie les deux formes de gauche avec la couleur de droite.
quad:
name: Peintre (Quadruple)
description: Permet de colorier chaque quadrant d'une forme avec une couleur différente.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -475,13 +475,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -475,13 +475,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -249,7 +249,7 @@ dialogs:
createMarker:
title: マーカーを設置
desc: Give it a meaningful name, you can also include a <strong>short key</strong> of a shape (Which you can generate <a href="https://viewer.shapez.io" target="_blank">here</a>)
desc: わかりやすい名前をつけてください。形を表す<strong>短いキー</strong>を含めることもできます。(<a href="https://viewer.shapez.io" target="_blank">ここ</a>から生成できます)
markerDemoLimit:
desc: デモ版ではマーカー設置は2つまでに制限されています。スタンドアローン版は無制限です
@ -479,13 +479,16 @@ buildings:
painter:
default:
name: &painter 着色機
description: 左から入力された形の全体を、右から入力された色で着色します。
description: &painter_desc 左から入力された形の全体を、右から入力された色で着色します。
double:
name: 着色機 (ダブル)
description: 左から入力された形を、上から入力された色で着色します。
quad:
name: 着色機 (四分割)
description: 入力された形を四分割づつ別の色で塗り分けられます。
mirrored:
name: *painter
description: *painter_desc
trash:
default:
@ -537,7 +540,7 @@ storyRewards:
reward_underground_belt_tier_2:
title: トンネル レベルII
desc: You have unlocked a new variant of the <strong>tunnel</strong> - It has a <strong>bigger range</strong>, and you can also mix-n-match those tunnels now!
desc: <strong>トンネル</strong>のバリエーションが利用可能になりました。 - <strong>距離拡張版が追加され</strong>、以前のものと組み合わせて目的に応じて利用することができます!
reward_splitter_compact:
title: 合流機 (コンパクト)
@ -546,7 +549,7 @@ storyRewards:
reward_cutter_quad:
title: 四分割
desc: You have unlocked a variant of the <strong>cutter</strong> - It allows you to cut shapes in <strong>four parts</strong> instead of just two!
desc: <strong>切断機</strong>のバリエーションが利用可能になりました。 - 上下の二分割ではなく、<strong>四分割</strong>に切断できます!
reward_painter_double:
title: 着色機 (ダブル)
@ -566,7 +569,7 @@ storyRewards:
reward_blueprints:
title: ブループリント
desc: You can now <strong>copy and paste</strong> parts of your factory! Select an area (Hold CTRL, then drag with your mouse), and press 'C' to copy it.<br><br>Pasting it is <strong>not free</strong>, you need to produce <strong>blueprint shapes</strong> to afford it! (Those you just delivered).
desc: 工場の建造物の<strong>コピー&ペースト</strong>が利用可能になりました! 範囲選択(CTRLキーを押したままマウスドラッグ)した状態で、'C'キーを押すことでコピーができます。<br><br>ペーストは<strong>タダではありません。</strong><strong>ブループリントの形</strong>を生産することで可能になります!(たった今納品したものです)
# Special reward, which is shown when there is no reward actually
no_reward:
@ -732,7 +735,7 @@ keybindings:
pasteLastBlueprint: 直前のブループリントをペーストする
massSelectCut: 範囲カット
exportScreenshot: 工場の全体像を画像出力
mapMoveFaster: Move Faster
mapMoveFaster: より速く移動
about:
title: このゲームについて

@ -480,13 +480,16 @@ buildings:
painter:
default:
name: &painter 도형 색칠기
description: 도형을 색소로 색칠한다.
description: &painter_desc 도형을 색소로 색칠한다.
double:
name: 2단 도형 색칠기
description: 왼쪽에 입력되는 도형을 위에서 입력되는 색소로 색칠한다.
quad:
name: 4단 도형 색칠기
description: 도형의 4가지 분단을 각각 다른 색으로 색칠할 수 있다.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -480,13 +480,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the top input.
description: &painter_desc Colors the whole shape on the left input with the color from the top input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -474,13 +474,16 @@ buildings:
painter:
default:
name: &painter Verver
description: Verft de volledige vorm in de linker input met de kleur van de rechter input.
description: &painter_desc Verft de volledige vorm in de linker input met de kleur van de rechter input.
double:
name: Verver (Dubbel)
description: Verft de vormen in de linker inputs met de kleur van de rechter input.
quad:
name: Verver (Quad)
description: Verft elke kwart van de vorm een andere kleur.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -478,13 +478,16 @@ buildings:
painter:
default:
name: &painter Maler
description: Maler hele objektet på venstre inngang med fargen fra øverste inngang.
description: &painter_desc Maler hele objektet på venstre inngang med fargen fra øverste inngang.
double:
name: Maler (Dobbel)
description: Maler hele objektet på venstre inngang med fargen fra øverste inngang.
quad:
name: Maler (Fireganger)
description: Farger enhver kvadrant av objektet med forskjellige farger.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -254,7 +254,7 @@ dialogs:
createMarker:
title: Nowy Znacznik
desc: Give it a meaningful name, you can also include a <strong>short key</strong> of a shape (Which you can generate <a href="https://viewer.shapez.io" target="_blank">here</a>)
desc: Podaj nazwę znacznika. Możesz w niej zawrzeć <strong>kod kształtu</strong>, który możesz wygenerować <a href="https://viewer.shapez.io" target="_blank">tutaj</a>.
markerDemoLimit:
desc: Możesz stworzyć tylko dwa własne znaczniki w wersji demo. Zakup pełną wersję gry dla nielimitowanych znaczników!
@ -489,13 +489,16 @@ buildings:
# 2nd translator's note: All those buildings had different descriptions in english. Don't change them all to the same description.
default:
name: &painter Malarz
description: Koloruje kształt za pomocą koloru dostarczonego od boku.
description: &painter_desc Koloruje kształt za pomocą koloru dostarczonego od boku.
double:
name: Malarz (Podwójny)
description: Koloruje kształt za pomocą koloru dostarczonych od boku. Koloruje 2 kształty używając 1 barwnika.
quad:
name: Malarz (Poczwórny)
description: Koloruje każdą ćwiarkę kształtu na inny kolor, używając dostarczonych kolorów.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -477,13 +477,16 @@ buildings:
painter:
default:
name: &painter Pintor
description: Colore a forma inteira na entrada esquerda com a cor da entrada direita.
description: &painter_desc Colore a forma inteira na entrada esquerda com a cor da entrada direita.
double:
name: Pintor (Duplo)
description: Colore as duas formas na entrada esquerda com a cor da entrada direita.
quad:
name: Pintor (Quádruplo)
description: Permite colorir cada quadrante da forma com uma cor diferente.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -474,13 +474,16 @@ buildings:
painter:
default:
name: &painter Pintor
description: Pinta a forma geométrica da entrada esquerda com a cor da entrada superior.
description: &painter_desc Pinta a forma geométrica da entrada esquerda com a cor da entrada superior.
double:
name: Pintor (Duplo)
description: Pinta as formas geométricas das entradas esquerdas com a cor da entrada superior.
quad:
name: Pintor (Quádruplo)
description: Pinta cada quadrante da forma geométrica com uma cor diferente.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -475,13 +475,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -398,7 +398,7 @@ ingame:
# All shop upgrades
shopUpgrades:
belt:
name: Конвейеры, Расделители & Туннели
name: Конвейеры, Разделители & Туннели
description: Скорость x<currentMult> → x<newMult>
miner:
name: Добыча
@ -477,13 +477,16 @@ buildings:
painter:
default:
name: &painter Покрасчик
description: Красит всю фигуру из левого входа красителем из верхнего.
description: &painter_desc Красит всю фигуру из левого входа красителем из верхнего.
double:
name: Покрасчик\n(Двойной)
description: Красит фигуру из левых входов красителем из верхнего.
quad:
name: Покрасчик\n(4 Входа)
description: Позволяет раскрасить каждую четверть фигуры разными цветами.
mirrored:
name: *painter
description: *painter_desc
trash:
default:
@ -653,7 +656,7 @@ settings:
alwaysMultiplace:
title: Многократное размещение
description: >-
Если включено, все здания останутся выбранными после размещения, пока вы не отмените выбор. Это эквивалентно постоянному удержанию SHIFT.
Если включено, все здания останутся выбранными после размещения, пока вы не отмените выбор. Это эквивалентно постоянному удержанию SHIFT.
offerHints:
title: Подсказки & Обучение

@ -475,13 +475,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -480,13 +480,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -475,13 +475,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

@ -475,13 +475,16 @@ buildings:
painter:
default:
name: &painter Painter
description: Colors the whole shape on the left input with the color from the right input.
description: &painter_desc Colors the whole shape on the left input with the color from the right input.
double:
name: Painter (Double)
description: Colors the shapes on the left inputs with the color from the top input.
quad:
name: Painter (Quad)
description: Allows to color each quadrant of the shape with a different color.
mirrored:
name: *painter
description: *painter_desc
trash:
default:

Loading…
Cancel
Save