Minor art rework, update ratios
@ -1383,6 +1383,6 @@
|
|||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {"w":690,"h":127},
|
"size": {"w":690,"h":127},
|
||||||
"scale": "0.1",
|
"scale": "0.1",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
|
"smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 69 KiB |
@ -1383,6 +1383,6 @@
|
|||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {"w":1960,"h":2791},
|
"size": {"w":1960,"h":2791},
|
||||||
"scale": "1",
|
"scale": "1",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
|
"smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
@ -1383,6 +1383,6 @@
|
|||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {"w":841,"h":481},
|
"size": {"w":841,"h":481},
|
||||||
"scale": "0.25",
|
"scale": "0.25",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
|
"smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
@ -1383,6 +1383,6 @@
|
|||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {"w":970,"h":1507},
|
"size": {"w":970,"h":1507},
|
||||||
"scale": "0.5",
|
"scale": "0.5",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
|
"smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 522 KiB After Width: | Height: | Size: 520 KiB |
@ -1383,6 +1383,6 @@
|
|||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {"w":1863,"h":1690},
|
"size": {"w":1863,"h":1690},
|
||||||
"scale": "0.75",
|
"scale": "0.75",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
|
"smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.9 KiB |
@ -72,7 +72,7 @@ export const globalConfig = {
|
|||||||
painterQuad: 1 / 8,
|
painterQuad: 1 / 8,
|
||||||
mixer: 1 / 5,
|
mixer: 1 / 5,
|
||||||
stacker: 1 / 6,
|
stacker: 1 / 6,
|
||||||
advancedProcessor: 1 / 6,
|
advancedProcessor: 1 / 3,
|
||||||
},
|
},
|
||||||
|
|
||||||
// Zooming
|
// Zooming
|
||||||
|
@ -65,7 +65,7 @@ export class MetaAdvancedProcessorBuilding extends MetaBuilding {
|
|||||||
entity.addComponent(
|
entity.addComponent(
|
||||||
new EnergyConsumerComponent({
|
new EnergyConsumerComponent({
|
||||||
bufferSize: 3,
|
bufferSize: 3,
|
||||||
perCharge: 0.25,
|
perCharge: 1,
|
||||||
batteryPosition: new Vector(0.63, 0.7),
|
batteryPosition: new Vector(0.63, 0.7),
|
||||||
acceptorSlotIndex: 1,
|
acceptorSlotIndex: 1,
|
||||||
ejectorSlotIndex: 1,
|
ejectorSlotIndex: 1,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { ClickDetector } from "../../../core/click_detector";
|
import { ClickDetector } from "../../../core/click_detector";
|
||||||
import { globalConfig } from "../../../core/config";
|
import { globalConfig, THIRDPARTY_URLS } from "../../../core/config";
|
||||||
import { DrawParameters } from "../../../core/draw_parameters";
|
import { DrawParameters } from "../../../core/draw_parameters";
|
||||||
import { drawRotatedSprite } from "../../../core/draw_utils";
|
import { drawRotatedSprite, rotateTrapezRightFaced } from "../../../core/draw_utils";
|
||||||
import { Loader } from "../../../core/loader";
|
import { Loader } from "../../../core/loader";
|
||||||
import { clamp, makeDiv, removeAllChildren } from "../../../core/utils";
|
import { clamp, makeDiv, removeAllChildren } from "../../../core/utils";
|
||||||
import {
|
import {
|
||||||
@ -16,6 +16,8 @@ import { defaultBuildingVariant } from "../../meta_building";
|
|||||||
import { THEME } from "../../theme";
|
import { THEME } from "../../theme";
|
||||||
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
||||||
import { HUDBuildingPlacerLogic } from "./building_placer_logic";
|
import { HUDBuildingPlacerLogic } from "./building_placer_logic";
|
||||||
|
import { makeOffscreenBuffer } from "../../../core/buffer_utils";
|
||||||
|
import { enumLayer } from "../../root";
|
||||||
|
|
||||||
export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||||
/**
|
/**
|
||||||
@ -56,7 +58,12 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
|||||||
|
|
||||||
this.currentInterpolatedCornerTile = new Vector();
|
this.currentInterpolatedCornerTile = new Vector();
|
||||||
|
|
||||||
this.lockIndicatorSprite = Loader.getSprite("sprites/misc/lock_direction_indicator.png");
|
this.lockIndicatorSprites = {};
|
||||||
|
for (const layerId in enumLayer) {
|
||||||
|
this.lockIndicatorSprites[layerId] = this.makeLockIndicatorSprite(layerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the click detectors for the variants so we can clean them up later
|
* Stores the click detectors for the variants so we can clean them up later
|
||||||
@ -65,6 +72,37 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
|||||||
this.variantClickDetectors = [];
|
this.variantClickDetectors = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes the lock indicator sprite for the given layer
|
||||||
|
* @param {enumLayer} layer
|
||||||
|
*/
|
||||||
|
makeLockIndicatorSprite(layer) {
|
||||||
|
const dims = 48;
|
||||||
|
const [canvas, context] = makeOffscreenBuffer(dims, dims, {
|
||||||
|
smooth: true,
|
||||||
|
reusable: false,
|
||||||
|
label: "lock-direction-indicator",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Loader.getSprite("sprites/misc/lock_direction_indicator.png").draw(context, 0, 0, 48, 48);
|
||||||
|
context.fillStyle = THEME.map.directionLock[enumLayer.wires].color;
|
||||||
|
context.strokeStyle = THEME.map.directionLock[enumLayer.wires].color;
|
||||||
|
context.lineWidth = 2;
|
||||||
|
|
||||||
|
const padding = 5;
|
||||||
|
const height = dims * 0.5;
|
||||||
|
const bottom = (dims + height) / 2;
|
||||||
|
|
||||||
|
context.moveTo(padding, bottom);
|
||||||
|
context.lineTo(dims / 2, bottom - height);
|
||||||
|
context.lineTo(dims - padding, bottom);
|
||||||
|
context.closePath();
|
||||||
|
context.stroke();
|
||||||
|
context.fill();
|
||||||
|
|
||||||
|
return canvas;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rerenders the building info dialog
|
* Rerenders the building info dialog
|
||||||
*/
|
*/
|
||||||
@ -352,23 +390,28 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
|||||||
parameters.context.beginCircle(endLine.x, endLine.y, 5);
|
parameters.context.beginCircle(endLine.x, endLine.y, 5);
|
||||||
parameters.context.fill();
|
parameters.context.fill();
|
||||||
|
|
||||||
// Draw arrows
|
// Draw arrow
|
||||||
|
const arrowSprite = this.lockIndicatorSprites[this.root.currentLayer];
|
||||||
const path = this.computeDirectionLockPath();
|
const path = this.computeDirectionLockPath();
|
||||||
for (let i = 0; i < path.length - 1; i += 1) {
|
for (let i = 0; i < path.length - 1; i += 1) {
|
||||||
const { rotation, tile } = path[i];
|
const { rotation, tile } = path[i];
|
||||||
const worldPos = tile.toWorldSpaceCenterOfTile();
|
const worldPos = tile.toWorldSpaceCenterOfTile();
|
||||||
drawRotatedSprite({
|
const angle = Math.radians(rotation);
|
||||||
parameters,
|
|
||||||
sprite: this.lockIndicatorSprite,
|
parameters.context.translate(worldPos.x, worldPos.y);
|
||||||
x: worldPos.x,
|
parameters.context.rotate(angle);
|
||||||
y: worldPos.y,
|
parameters.context.drawImage(
|
||||||
angle: Math.radians(rotation),
|
arrowSprite,
|
||||||
size: 12,
|
-6,
|
||||||
offsetY:
|
|
||||||
-globalConfig.halfTileSize -
|
-globalConfig.halfTileSize -
|
||||||
clamp((this.root.time.realtimeNow() * 1.5) % 1.0, 0, 1) * 1 * globalConfig.tileSize +
|
clamp((this.root.time.realtimeNow() * 1.5) % 1.0, 0, 1) * 1 * globalConfig.tileSize +
|
||||||
globalConfig.halfTileSize,
|
globalConfig.halfTileSize -
|
||||||
});
|
6,
|
||||||
|
12,
|
||||||
|
12
|
||||||
|
);
|
||||||
|
parameters.context.rotate(-angle);
|
||||||
|
parameters.context.translate(-worldPos.x, -worldPos.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ export class HUDWiresOverlay extends BaseHUDPart {
|
|||||||
|
|
||||||
const scaleFactor = 1 / wiresBackgroundDpi;
|
const scaleFactor = 1 / wiresBackgroundDpi;
|
||||||
|
|
||||||
parameters.context.globalAlpha = 0.7 * this.currentAlpha;
|
parameters.context.globalAlpha = 0.9 * this.currentAlpha;
|
||||||
parameters.context.globalCompositeOperation = "darken";
|
parameters.context.globalCompositeOperation = "darken";
|
||||||
parameters.context.scale(scaleFactor, scaleFactor);
|
parameters.context.scale(scaleFactor, scaleFactor);
|
||||||
parameters.context.fillStyle = this.cachedPatternBackground;
|
parameters.context.fillStyle = this.cachedPatternBackground;
|
||||||
@ -89,9 +89,9 @@ export class HUDWiresOverlay extends BaseHUDPart {
|
|||||||
parameters.context.globalCompositeOperation = "source-over";
|
parameters.context.globalCompositeOperation = "source-over";
|
||||||
parameters.context.globalAlpha = 1;
|
parameters.context.globalAlpha = 1;
|
||||||
|
|
||||||
parameters.context.fillStyle = "#3abf88";
|
// parameters.context.fillStyle = "#3a85bf";
|
||||||
parameters.context.globalAlpha = 0.3 * this.currentAlpha;
|
// parameters.context.globalAlpha = 0.0 * this.currentAlpha;
|
||||||
parameters.context.fillRect(bounds.x, bounds.y, bounds.w, bounds.h);
|
// parameters.context.fillRect(bounds.x, bounds.y, bounds.w, bounds.h);
|
||||||
parameters.context.globalAlpha = 1;
|
// parameters.context.globalAlpha = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
"background": "rgba(74, 237, 134, 0.2)"
|
"background": "rgba(74, 237, 134, 0.2)"
|
||||||
},
|
},
|
||||||
"wires": {
|
"wires": {
|
||||||
"color": "rgb(144, 24, 255)",
|
"color": "rgb(74, 237, 134)",
|
||||||
"background": "rgba(144, 24, 255, 0.2)"
|
"background": "rgba(74, 237, 134, 0.5)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|