1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-17 12:11:51 +00:00

changed toolbar to completely hide editor buildings in test mode

This commit is contained in:
Sense101 2021-07-06 20:52:42 +01:00
parent 2add9ba18f
commit 900fcc8479
2 changed files with 82 additions and 80 deletions

View File

@ -49,97 +49,99 @@
}
.building {
display: flex;
@include S(width, 40px);
position: relative;
@include S(height, 40px);
.icon {
color: $accentColorDark;
&:not(.hidden) {
display: flex;
flex-direction: column-reverse;
@include S(width, 40px);
position: relative;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
@include S(border-radius, $globalBorderRadius);
background: center center / 70% no-repeat;
}
&:not(.unlocked) {
@include S(width, 25px);
@include S(height, 40px);
.icon {
opacity: 0.15;
color: $accentColorDark;
display: flex;
flex-direction: column-reverse;
position: relative;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
@include S(border-radius, $globalBorderRadius);
background: center center / 70% no-repeat;
}
&.editor {
&:not(.unlocked) {
@include S(width, 25px);
.icon {
pointer-events: all;
cursor: pointer;
&:hover {
background-color: rgba(22, 30, 68, 0.1);
opacity: 0.15;
}
&.editor {
.icon {
pointer-events: all;
cursor: pointer;
&:hover {
background-color: rgba(22, 30, 68, 0.1);
}
}
}
&:not(.editor) {
.icon {
background-image: uiResource("locked_building.png") !important;
}
}
}
&:not(.editor) {
&.unlocked {
.icon {
background-image: uiResource("locked_building.png") !important;
}
}
}
&.unlocked {
.icon {
pointer-events: all;
transition: all 50ms ease-in-out;
transition-property: background-color, transform;
cursor: pointer;
&:hover {
background-color: rgba(30, 40, 90, 0.1);
}
&.pressed {
transform: scale(0.9) !important;
}
}
&.selected {
// transform: scale(1.05);
background-color: rgba(lighten($colorBlueBright, 9), 0.4);
@include S(border-radius, 2px);
.keybinding {
color: #111;
}
}
.puzzle-lock {
&.active {
& {
/* @load-async */
background: uiResource("locked_building.png") center center / 90% no-repeat;
}
display: grid;
grid-auto-flow: column;
position: absolute;
@include S(top, -15px);
left: 50%;
transform: translateX(-50%) !important;
transition: all 0.12s ease-in-out;
transition-property: opacity, transform;
cursor: pointer;
pointer-events: all;
@include S(width, 12px);
@include S(height, 12px);
transition: all 50ms ease-in-out;
transition-property: background-color, transform;
cursor: pointer;
&:hover {
opacity: 0.5;
background-color: rgba(30, 40, 90, 0.1);
}
&.pressed {
transform: scale(0.9) !important;
}
}
&.selected {
// transform: scale(1.05);
background-color: rgba(lighten($colorBlueBright, 9), 0.4);
@include S(border-radius, 2px);
.keybinding {
color: #111;
}
}
.puzzle-lock {
&.active {
& {
/* @load-async */
background: uiResource("locked_building.png") center center / 90% no-repeat;
}
display: grid;
grid-auto-flow: column;
position: absolute;
@include S(top, -15px);
left: 50%;
transform: translateX(-50%) !important;
transition: all 0.12s ease-in-out;
transition-property: opacity, transform;
cursor: pointer;
pointer-events: all;
@include S(width, 12px);
@include S(height, 12px);
&:hover {
opacity: 0.5;
}
}
}
}

View File

@ -296,7 +296,7 @@ export class HUDBaseToolbar extends BaseHUDPart {
const metaBuilding = this.requiredBuildings[i];
const handle = this.buildingHandles[metaBuilding.getId()];
handle.puzzleLocked = testMode;
handle.element.classList.toggle("unlocked", !testMode);
handle.element.classList.toggle("hidden", testMode);
}
}