diff --git a/src/css/states/main_menu.scss b/src/css/states/main_menu.scss index be3bcce4..0981cdfc 100644 --- a/src/css/states/main_menu.scss +++ b/src/css/states/main_menu.scss @@ -147,6 +147,7 @@ flex-grow: 1; align-items: center; justify-content: center; + flex-direction: column; @include S(padding-top, 20px); img { @@ -160,6 +161,24 @@ background: uiResource("demo_badge.png") center center / contain no-repeat; display: inline-block; } + + position: relative; + .updateLabel { + position: absolute; + transform: translateX(50%) rotate(-5deg); + color: $colorRedBright; + @include Heading; + text-transform: uppercase; + font-weight: bold; + @include S(right, 40px); + @include S(bottom, 20px); + + @include InlineAnimation(1.3s ease-in-out infinite) { + 50% { + transform: translateX(50%) rotate(-7deg) scale(1.1); + } + } + } } .betaWarning { diff --git a/src/js/game/map_view.js b/src/js/game/map_view.js index 67ed143c..ed6c236c 100644 --- a/src/js/game/map_view.js +++ b/src/js/game/map_view.js @@ -35,6 +35,7 @@ export class MapView extends BaseMap { this.root.signals.entityAdded.add(this.onEntityChanged, this); this.root.signals.entityDestroyed.add(this.onEntityChanged, this); + this.root.signals.entityChanged.add(this.onEntityChanged, this); } cleanup() { @@ -44,7 +45,7 @@ export class MapView extends BaseMap { } /** - * Called when an entity was added or removed + * Called when an entity was added, removed or changed * @param {Entity} entity */ onEntityChanged(entity) { diff --git a/src/js/game/root.js b/src/js/game/root.js index 7bd42b4d..df0db09e 100644 --- a/src/js/game/root.js +++ b/src/js/game/root.js @@ -141,6 +141,7 @@ export class GameRoot { // Entities entityManuallyPlaced: /** @type {TypedSignal<[Entity]>} */ (new Signal()), entityAdded: /** @type {TypedSignal<[Entity]>} */ (new Signal()), + entityChanged: /** @type {TypedSignal<[Entity]>} */ (new Signal()), entityGotNewComponent: /** @type {TypedSignal<[Entity]>} */ (new Signal()), entityComponentRemoved: /** @type {TypedSignal<[Entity]>} */ (new Signal()), entityQueuedForDestroy: /** @type {TypedSignal<[Entity]>} */ (new Signal()), diff --git a/src/js/game/systems/belt.js b/src/js/game/systems/belt.js index 817fe1ed..19693c8b 100644 --- a/src/js/game/systems/belt.js +++ b/src/js/game/systems/belt.js @@ -185,6 +185,9 @@ export class BeltSystem extends GameSystemWithFilter { if (G_IS_DEV && globalConfig.debug.checkBeltPaths) { this.debug_verifyBeltPaths(); } + + // Make sure the chunks know about the update + this.root.signals.entityChanged.dispatch(targetEntity); } } } diff --git a/src/js/states/main_menu.js b/src/js/states/main_menu.js index 8f7d4a93..cf7a05ac 100644 --- a/src/js/states/main_menu.js +++ b/src/js/states/main_menu.js @@ -46,18 +46,15 @@ export class MainMenuState extends GameState { : "" } - - ${ - G_IS_STANDALONE - ? "" - : ` @@ -208,14 +205,12 @@ export class MainMenuState extends GameState { // Initialize video this.videoElement = this.htmlElement.querySelector("video"); - if (this.videoElement) { - this.videoElement.playbackRate = 0.9; - this.videoElement.addEventListener("canplay", () => { - if (this.videoElement) { - this.videoElement.classList.add("loaded"); - } - }); - } + this.videoElement.playbackRate = 0.9; + this.videoElement.addEventListener("canplay", () => { + if (this.videoElement) { + this.videoElement.classList.add("loaded"); + } + }); this.trackClicks(qs(".settingsButton"), this.onSettingsButtonClicked); this.trackClicks(qs(".changelog"), this.onChangelogClicked);