diff --git a/gulp/steampipe/upload.bat b/gulp/steampipe/upload.bat index de461069..86dcf926 100644 --- a/gulp/steampipe/upload.bat +++ b/gulp/steampipe/upload.bat @@ -1,4 +1,4 @@ @echo off -cmd /c gulp standalone.prepareVDF +cmd /c yarn gulp standalone.prepareVDF steamcmd +login %STEAM_UPLOAD_SHAPEZ_ID% %STEAM_UPLOAD_SHAPEZ_USER% +run_app_build %cd%/scripts/app.vdf +quit start https://partner.steamgames.com/apps/builds/1318690 diff --git a/src/js/changelog.js b/src/js/changelog.js index 6fdb3f09..60df26cf 100644 --- a/src/js/changelog.js +++ b/src/js/changelog.js @@ -1,4 +1,12 @@ export const CHANGELOG = [ + { + version: "1.2.3", + date: "unreleased", + entries: [ + "Fixed constant signals being editable from the regular layer", + "Fixed items still overlapping sometimes between buildings and belts", + ], + }, { version: "1.2.2", date: "07.12.2020", diff --git a/src/js/game/hud/parts/constant_signal_edit.js b/src/js/game/hud/parts/constant_signal_edit.js index 59115e62..283c7619 100644 --- a/src/js/game/hud/parts/constant_signal_edit.js +++ b/src/js/game/hud/parts/constant_signal_edit.js @@ -13,6 +13,10 @@ export class HUDConstantSignalEdit extends BaseHUDPart { * @param {enumMouseButton} button */ downPreHandler(pos, button) { + if (this.root.currentLayer !== "wires") { + return; + } + const tile = this.root.camera.screenToWorld(pos).toTileSpace(); const contents = this.root.map.getLayerContentXY(tile.x, tile.y, "wires"); if (contents) { diff --git a/src/js/game/systems/item_ejector.js b/src/js/game/systems/item_ejector.js index 6bbb42ce..a4484795 100644 --- a/src/js/game/systems/item_ejector.js +++ b/src/js/game/systems/item_ejector.js @@ -332,10 +332,53 @@ export class ItemEjectorSystem extends GameSystemWithFilter { let progress = slot.progress; const nextBeltPath = slot.cachedBeltPath; if (nextBeltPath) { - progress = Math.min( - progress, - nextBeltPath.spacingToFirstItem / globalConfig.itemSpacingOnBelts - ); + /* + If you imagine the track between the center of the building and the center of the first belt as + a range from 0 to 1: + + Building Belt + | X | X | + | 0...................1 | + + And for example the first item on belt has a distance of 0.4 to the beginning of the belt: + + Building Belt + | X | X | + | 0...................1 | + ^ item + + Then the space towards this first item is always 0.5 (the distance from the center of the building to the beginning of the belt) + PLUS the spacing to the item, so in this case 0.5 + 0.4 = 0.9: + + Building Belt + | X | X | + | 0...................1 | + ^ item @ 0.9 + + Since items must not get clashed, we need to substract some spacing (lets assume it is 0.6, exact value see globalConfig.itemSpacingOnBelts), + So we do 0.9 - globalConfig.itemSpacingOnBelts = 0.3 + + Building Belt + | X | X | + | 0...................1 | + ^ ^ item @ 0.9 + ^ max progress = 0.3 + + Because now our range actually only goes to the end of the building, and not towards the center of the building, we need to multiply + all values by 2: + + Building Belt + | X | X | + | 0.........1.........2 | + ^ ^ item @ 1.8 + ^ max progress = 0.6 + + And that's it! If you summarize the calculations from above into a formula, you get the one below. + */ + + const maxProgress = + (0.5 + nextBeltPath.spacingToFirstItem - globalConfig.itemSpacingOnBelts) * 2; + progress = Math.min(maxProgress, progress); } // Skip if the item would barely be visible