diff --git a/res_built/atlas/atlas0_10.json b/res_built/atlas/atlas0_10.json index 36392ee3..18433c54 100644 --- a/res_built/atlas/atlas0_10.json +++ b/res_built/atlas/atlas0_10.json @@ -1383,6 +1383,6 @@ "format": "RGBA8888", "size": {"w":690,"h":127}, "scale": "0.1", - "smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$" + "smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$" } } diff --git a/res_built/atlas/atlas0_10.png b/res_built/atlas/atlas0_10.png index 849386d2..afc208fe 100644 Binary files a/res_built/atlas/atlas0_10.png and b/res_built/atlas/atlas0_10.png differ diff --git a/res_built/atlas/atlas0_100.json b/res_built/atlas/atlas0_100.json index 6777456f..726142c7 100644 --- a/res_built/atlas/atlas0_100.json +++ b/res_built/atlas/atlas0_100.json @@ -1383,6 +1383,6 @@ "format": "RGBA8888", "size": {"w":1960,"h":2791}, "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$" + "smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$" } } diff --git a/res_built/atlas/atlas0_100.png b/res_built/atlas/atlas0_100.png index 5d60f65a..d17f889d 100644 Binary files a/res_built/atlas/atlas0_100.png and b/res_built/atlas/atlas0_100.png differ diff --git a/res_built/atlas/atlas0_25.json b/res_built/atlas/atlas0_25.json index b704486b..2849c650 100644 --- a/res_built/atlas/atlas0_25.json +++ b/res_built/atlas/atlas0_25.json @@ -1383,6 +1383,6 @@ "format": "RGBA8888", "size": {"w":841,"h":481}, "scale": "0.25", - "smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$" + "smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$" } } diff --git a/res_built/atlas/atlas0_25.png b/res_built/atlas/atlas0_25.png index ddf1360d..1064f068 100644 Binary files a/res_built/atlas/atlas0_25.png and b/res_built/atlas/atlas0_25.png differ diff --git a/res_built/atlas/atlas0_50.json b/res_built/atlas/atlas0_50.json index c0f124ba..277dd78b 100644 --- a/res_built/atlas/atlas0_50.json +++ b/res_built/atlas/atlas0_50.json @@ -1383,6 +1383,6 @@ "format": "RGBA8888", "size": {"w":970,"h":1507}, "scale": "0.5", - "smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$" + "smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$" } } diff --git a/res_built/atlas/atlas0_50.png b/res_built/atlas/atlas0_50.png index 6f5a0103..b15838b8 100644 Binary files a/res_built/atlas/atlas0_50.png and b/res_built/atlas/atlas0_50.png differ diff --git a/res_built/atlas/atlas0_75.json b/res_built/atlas/atlas0_75.json index 6f9250c8..ecdca341 100644 --- a/res_built/atlas/atlas0_75.json +++ b/res_built/atlas/atlas0_75.json @@ -1383,6 +1383,6 @@ "format": "RGBA8888", "size": {"w":1863,"h":1690}, "scale": "0.75", - "smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$" + "smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$" } } diff --git a/res_built/atlas/atlas0_75.png b/res_built/atlas/atlas0_75.png index b9488d16..f4fd7fae 100644 Binary files a/res_built/atlas/atlas0_75.png and b/res_built/atlas/atlas0_75.png differ diff --git a/res_raw/sprites/misc/wires_overlay_tile.png b/res_raw/sprites/misc/wires_overlay_tile.png index 2a57c0aa..b8ec3480 100644 Binary files a/res_raw/sprites/misc/wires_overlay_tile.png and b/res_raw/sprites/misc/wires_overlay_tile.png differ diff --git a/src/js/core/config.js b/src/js/core/config.js index e7f4afe0..e06f9422 100644 --- a/src/js/core/config.js +++ b/src/js/core/config.js @@ -72,7 +72,7 @@ export const globalConfig = { painterQuad: 1 / 8, mixer: 1 / 5, stacker: 1 / 6, - advancedProcessor: 1 / 6, + advancedProcessor: 1 / 3, }, // Zooming diff --git a/src/js/game/buildings/advanced_processor.js b/src/js/game/buildings/advanced_processor.js index 7166da12..ab15c155 100644 --- a/src/js/game/buildings/advanced_processor.js +++ b/src/js/game/buildings/advanced_processor.js @@ -65,7 +65,7 @@ export class MetaAdvancedProcessorBuilding extends MetaBuilding { entity.addComponent( new EnergyConsumerComponent({ bufferSize: 3, - perCharge: 0.25, + perCharge: 1, batteryPosition: new Vector(0.63, 0.7), acceptorSlotIndex: 1, ejectorSlotIndex: 1, diff --git a/src/js/game/hud/parts/building_placer.js b/src/js/game/hud/parts/building_placer.js index 4fa80d70..eefcfdf4 100644 --- a/src/js/game/hud/parts/building_placer.js +++ b/src/js/game/hud/parts/building_placer.js @@ -1,7 +1,7 @@ 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 { drawRotatedSprite } from "../../../core/draw_utils"; +import { drawRotatedSprite, rotateTrapezRightFaced } from "../../../core/draw_utils"; import { Loader } from "../../../core/loader"; import { clamp, makeDiv, removeAllChildren } from "../../../core/utils"; import { @@ -16,6 +16,8 @@ import { defaultBuildingVariant } from "../../meta_building"; import { THEME } from "../../theme"; import { DynamicDomAttach } from "../dynamic_dom_attach"; import { HUDBuildingPlacerLogic } from "./building_placer_logic"; +import { makeOffscreenBuffer } from "../../../core/buffer_utils"; +import { enumLayer } from "../../root"; export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { /** @@ -56,7 +58,12 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { 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 @@ -65,6 +72,37 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { 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 */ @@ -352,23 +390,28 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { parameters.context.beginCircle(endLine.x, endLine.y, 5); parameters.context.fill(); - // Draw arrows + // Draw arrow + const arrowSprite = this.lockIndicatorSprites[this.root.currentLayer]; const path = this.computeDirectionLockPath(); for (let i = 0; i < path.length - 1; i += 1) { const { rotation, tile } = path[i]; const worldPos = tile.toWorldSpaceCenterOfTile(); - drawRotatedSprite({ - parameters, - sprite: this.lockIndicatorSprite, - x: worldPos.x, - y: worldPos.y, - angle: Math.radians(rotation), - size: 12, - offsetY: - -globalConfig.halfTileSize - + const angle = Math.radians(rotation); + + parameters.context.translate(worldPos.x, worldPos.y); + parameters.context.rotate(angle); + parameters.context.drawImage( + arrowSprite, + -6, + -globalConfig.halfTileSize - 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); } } } diff --git a/src/js/game/hud/parts/wires_overlay.js b/src/js/game/hud/parts/wires_overlay.js index 3a8f18e2..8bda5d0d 100644 --- a/src/js/game/hud/parts/wires_overlay.js +++ b/src/js/game/hud/parts/wires_overlay.js @@ -75,7 +75,7 @@ export class HUDWiresOverlay extends BaseHUDPart { const scaleFactor = 1 / wiresBackgroundDpi; - parameters.context.globalAlpha = 0.7 * this.currentAlpha; + parameters.context.globalAlpha = 0.9 * this.currentAlpha; parameters.context.globalCompositeOperation = "darken"; parameters.context.scale(scaleFactor, scaleFactor); parameters.context.fillStyle = this.cachedPatternBackground; @@ -89,9 +89,9 @@ export class HUDWiresOverlay extends BaseHUDPart { parameters.context.globalCompositeOperation = "source-over"; parameters.context.globalAlpha = 1; - parameters.context.fillStyle = "#3abf88"; - parameters.context.globalAlpha = 0.3 * this.currentAlpha; - parameters.context.fillRect(bounds.x, bounds.y, bounds.w, bounds.h); - parameters.context.globalAlpha = 1; + // parameters.context.fillStyle = "#3a85bf"; + // parameters.context.globalAlpha = 0.0 * this.currentAlpha; + // parameters.context.fillRect(bounds.x, bounds.y, bounds.w, bounds.h); + // parameters.context.globalAlpha = 1; } } diff --git a/src/js/game/themes/light.json b/src/js/game/themes/light.json index b91b53c2..f7198a72 100644 --- a/src/js/game/themes/light.json +++ b/src/js/game/themes/light.json @@ -15,8 +15,8 @@ "background": "rgba(74, 237, 134, 0.2)" }, "wires": { - "color": "rgb(144, 24, 255)", - "background": "rgba(144, 24, 255, 0.2)" + "color": "rgb(74, 237, 134)", + "background": "rgba(74, 237, 134, 0.5)" } },