mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Fix entity rendering bug when zooming out, add "Wires update" label to main menu
This commit is contained in:
parent
0d74af92a7
commit
0bba6a9d79
@ -147,6 +147,7 @@
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@include S(padding-top, 20px);
|
@include S(padding-top, 20px);
|
||||||
img {
|
img {
|
||||||
@ -160,6 +161,24 @@
|
|||||||
background: uiResource("demo_badge.png") center center / contain no-repeat;
|
background: uiResource("demo_badge.png") center center / contain no-repeat;
|
||||||
display: inline-block;
|
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 {
|
.betaWarning {
|
||||||
|
@ -35,6 +35,7 @@ export class MapView extends BaseMap {
|
|||||||
|
|
||||||
this.root.signals.entityAdded.add(this.onEntityChanged, this);
|
this.root.signals.entityAdded.add(this.onEntityChanged, this);
|
||||||
this.root.signals.entityDestroyed.add(this.onEntityChanged, this);
|
this.root.signals.entityDestroyed.add(this.onEntityChanged, this);
|
||||||
|
this.root.signals.entityChanged.add(this.onEntityChanged, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
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
|
* @param {Entity} entity
|
||||||
*/
|
*/
|
||||||
onEntityChanged(entity) {
|
onEntityChanged(entity) {
|
||||||
|
@ -141,6 +141,7 @@ export class GameRoot {
|
|||||||
// Entities
|
// Entities
|
||||||
entityManuallyPlaced: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
entityManuallyPlaced: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
||||||
entityAdded: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
entityAdded: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
||||||
|
entityChanged: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
||||||
entityGotNewComponent: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
entityGotNewComponent: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
||||||
entityComponentRemoved: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
entityComponentRemoved: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
||||||
entityQueuedForDestroy: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
entityQueuedForDestroy: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
|
||||||
|
@ -185,6 +185,9 @@ export class BeltSystem extends GameSystemWithFilter {
|
|||||||
if (G_IS_DEV && globalConfig.debug.checkBeltPaths) {
|
if (G_IS_DEV && globalConfig.debug.checkBeltPaths) {
|
||||||
this.debug_verifyBeltPaths();
|
this.debug_verifyBeltPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the chunks know about the update
|
||||||
|
this.root.signals.entityChanged.dispatch(targetEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,18 +46,15 @@ export class MainMenuState extends GameState {
|
|||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
${
|
<video autoplay muted loop class="fullscreenBackgroundVideo">
|
||||||
G_IS_STANDALONE
|
|
||||||
? ""
|
|
||||||
: `<video autoplay muted loop class="fullscreenBackgroundVideo">
|
|
||||||
<source src="${cachebust("res/bg_render.webm")}" type="video/webm">
|
<source src="${cachebust("res/bg_render.webm")}" type="video/webm">
|
||||||
</video>`
|
</video>
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<img src="${cachebust("res/logo.png")}" alt="shapez.io Logo">
|
<img src="${cachebust("res/logo.png")}" alt="shapez.io Logo">
|
||||||
|
<span class="updateLabel">Wires update!</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -208,14 +205,12 @@ export class MainMenuState extends GameState {
|
|||||||
|
|
||||||
// Initialize video
|
// Initialize video
|
||||||
this.videoElement = this.htmlElement.querySelector("video");
|
this.videoElement = this.htmlElement.querySelector("video");
|
||||||
if (this.videoElement) {
|
this.videoElement.playbackRate = 0.9;
|
||||||
this.videoElement.playbackRate = 0.9;
|
this.videoElement.addEventListener("canplay", () => {
|
||||||
this.videoElement.addEventListener("canplay", () => {
|
if (this.videoElement) {
|
||||||
if (this.videoElement) {
|
this.videoElement.classList.add("loaded");
|
||||||
this.videoElement.classList.add("loaded");
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.trackClicks(qs(".settingsButton"), this.onSettingsButtonClicked);
|
this.trackClicks(qs(".settingsButton"), this.onSettingsButtonClicked);
|
||||||
this.trackClicks(qs(".changelog"), this.onChangelogClicked);
|
this.trackClicks(qs(".changelog"), this.onChangelogClicked);
|
||||||
|
Loading…
Reference in New Issue
Block a user