mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Add tutorial images for all building variants
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
$buildings: belt, cutter, miner, mixer, painter, rotater, splitter, stacker, trash, underground_belt;
|
||||
|
||||
@each $building in $buildings {
|
||||
[data-icon="building_tutorials/#{$building}.png"] {
|
||||
background-image: uiResource("res/ui/building_tutorials/#{$building}.png") !important;
|
||||
}
|
||||
[data-icon="building_icons/#{$building}.png"] {
|
||||
background-image: uiResource("res/ui/building_icons/#{$building}.png") !important;
|
||||
}
|
||||
}
|
||||
|
||||
$buildingsAndVariants: belt, splitter, splitter-compact, splitter-compact-inverse, underground_belt,
|
||||
underground_belt-tier2, miner, miner-chainable, cutter, cutter-quad, rotater, rotater-ccw, stacker, mixer,
|
||||
painter, painter-double, painter-quad, trash, trash-storage;
|
||||
@each $building in $buildingsAndVariants {
|
||||
[data-icon="building_tutorials/#{$building}.png"] {
|
||||
background-image: uiResource("res/ui/building_tutorials/#{$building}.png") !important;
|
||||
}
|
||||
}
|
||||
|
||||
$icons: notification_saved, notification_success, notification_upgrade;
|
||||
@each $icon in $icons {
|
||||
[data-icon="icons/#{$icon}.png"] {
|
||||
|
||||
@@ -79,16 +79,18 @@
|
||||
|
||||
#ingame_HUD_PlacerVariants {
|
||||
position: absolute;
|
||||
@include S(left, 10px);
|
||||
@include S(bottom, 80px);
|
||||
display: grid;
|
||||
grid-auto-flow: row;
|
||||
justify-items: start;
|
||||
@include S(right, 10px);
|
||||
@include S(top, 200px);
|
||||
display: flex;
|
||||
@include S(grid-gap, 5px);
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
|
||||
.explanation {
|
||||
text-transform: uppercase;
|
||||
grid-row: 1 / 2;
|
||||
@include SuperSmallText;
|
||||
text-align: right;
|
||||
.keybinding {
|
||||
position: relative;
|
||||
}
|
||||
@@ -98,53 +100,60 @@
|
||||
}
|
||||
}
|
||||
|
||||
.variant {
|
||||
@include S(border-radius, $globalBorderRadius);
|
||||
background: rgba(0, 10, 20, 0.1);
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
@include S(padding, 5px);
|
||||
@include S(grid-gap, 10px);
|
||||
.variants {
|
||||
display: grid;
|
||||
@include S(grid-gap, 5px);
|
||||
|
||||
&.active {
|
||||
background-color: rgba(74, 163, 223, 0.6);
|
||||
}
|
||||
|
||||
$iconSize: 25px;
|
||||
|
||||
.iconWrap {
|
||||
grid-column: 1 / 2;
|
||||
grid-row: 1 / 2;
|
||||
.variant {
|
||||
grid-row: 2 / 3;
|
||||
@include S(border-radius, $globalBorderRadius);
|
||||
background: rgba(0, 10, 20, 0.2);
|
||||
display: inline-flex;
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
@include S(width, $iconSize);
|
||||
@include S(height, $iconSize);
|
||||
background: center center / contain no-repeat;
|
||||
align-items: center;
|
||||
@include S(padding, 3px);
|
||||
@include S(grid-gap, 10px);
|
||||
|
||||
&[data-tile-w="2"] {
|
||||
@include S(width, 2 * $iconSize);
|
||||
&.active {
|
||||
background-color: rgba(74, 163, 223, 0.6);
|
||||
}
|
||||
&[data-tile-w="3"] {
|
||||
@include S(width, 3 * $iconSize);
|
||||
}
|
||||
&[data-tile-w="4"] {
|
||||
@include S(width, 4 * $iconSize);
|
||||
}
|
||||
&[data-tile-h="2"] {
|
||||
@include S(height, 2 * $iconSize);
|
||||
}
|
||||
&[data-tile-h="3"] {
|
||||
@include S(height, 3 * $iconSize);
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
display: none;
|
||||
grid-column: 2 / 3;
|
||||
text-transform: uppercase;
|
||||
grid-row: 1 / 2;
|
||||
@include SuperSmallText;
|
||||
color: #fff;
|
||||
$iconSize: 25px;
|
||||
|
||||
.iconWrap {
|
||||
grid-column: 1 / 2;
|
||||
grid-row: 1 / 2;
|
||||
position: relative;
|
||||
@include S(width, $iconSize);
|
||||
@include S(height, $iconSize);
|
||||
background: center center / contain no-repeat;
|
||||
|
||||
&[data-tile-w="2"] {
|
||||
@include S(width, 2 * $iconSize);
|
||||
}
|
||||
&[data-tile-h="2"] {
|
||||
@include S(height, 2 * $iconSize);
|
||||
}
|
||||
&[data-tile-h="3"] {
|
||||
@include S(height, 3 * $iconSize);
|
||||
}
|
||||
&[data-tile-w="3"] {
|
||||
@include S(width, 3 * $iconSize);
|
||||
}
|
||||
&[data-tile-w="4"] {
|
||||
@include S(width, 4 * $iconSize);
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
display: none;
|
||||
grid-column: 2 / 3;
|
||||
text-transform: uppercase;
|
||||
grid-row: 1 / 2;
|
||||
@include SuperSmallText;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ export const globalConfig = {
|
||||
rotater: 1 / 1,
|
||||
rotaterCCW: 1 / 1,
|
||||
painter: 1 / 6,
|
||||
painterDouble: 1 / 7,
|
||||
painterQuad: 1 / 7,
|
||||
painterDouble: 1 / 8,
|
||||
painterQuad: 1 / 8,
|
||||
mixer: 1 / 5,
|
||||
stacker: 1 / 6,
|
||||
},
|
||||
@@ -83,7 +83,7 @@ export const globalConfig = {
|
||||
|
||||
debug: {
|
||||
/* dev:start */
|
||||
// fastGameEnter: true,
|
||||
fastGameEnter: true,
|
||||
noArtificialDelays: true,
|
||||
// disableSavegameWrite: true,
|
||||
// showEntityBounds: true,
|
||||
@@ -93,8 +93,8 @@ export const globalConfig = {
|
||||
// disableZoomLimits: true,
|
||||
// showChunkBorders: true,
|
||||
// rewardsInstant: true,
|
||||
// allBuildingsUnlocked: true,
|
||||
// upgradesNoCost: true,
|
||||
allBuildingsUnlocked: true,
|
||||
upgradesNoCost: true,
|
||||
// disableUnlockDialog: true,
|
||||
// disableLogicTicks: true,
|
||||
// testClipping: true,
|
||||
|
||||
@@ -99,6 +99,13 @@ export class Camera extends BasicSerializableObject {
|
||||
this.internalInitEvents();
|
||||
this.clampZoomLevel();
|
||||
this.bindKeys();
|
||||
if (G_IS_DEV) {
|
||||
window.addEventListener("keydown", ev => {
|
||||
if (ev.key === "l") {
|
||||
this.zoomLevel = 3;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Serialization
|
||||
|
||||
@@ -258,11 +258,6 @@ export class HUDBuildingPlacer extends BaseHUDPart {
|
||||
})
|
||||
);
|
||||
metaBuilding.updateVariants(this.fakeEntity, 0, this.currentVariant.get());
|
||||
|
||||
this.buildingInfoElements.tutorialImage.setAttribute(
|
||||
"data-icon",
|
||||
"building_tutorials/" + metaBuilding.getId() + ".png"
|
||||
);
|
||||
} else {
|
||||
this.fakeEntity = null;
|
||||
}
|
||||
@@ -281,8 +276,10 @@ export class HUDBuildingPlacer extends BaseHUDPart {
|
||||
return;
|
||||
}
|
||||
|
||||
this.buildingInfoElements.label.innerHTML = T.buildings[metaBuilding.id].name;
|
||||
this.buildingInfoElements.descText.innerHTML = T.buildings[metaBuilding.id].description;
|
||||
const variant = this.currentVariant.get();
|
||||
|
||||
this.buildingInfoElements.label.innerHTML = T.buildings[metaBuilding.id][variant].name;
|
||||
this.buildingInfoElements.descText.innerHTML = T.buildings[metaBuilding.id][variant].description;
|
||||
|
||||
const binding = this.root.keyMapper.getBinding(KEYMAPPINGS.buildings[metaBuilding.getId()]);
|
||||
this.buildingInfoElements.hotkey.innerHTML = T.ingame.buildingPlacement.hotkeyLabel.replace(
|
||||
@@ -290,6 +287,14 @@ export class HUDBuildingPlacer extends BaseHUDPart {
|
||||
"<code class='keybinding'>" + binding.getKeyCodeString() + "</code>"
|
||||
);
|
||||
|
||||
this.buildingInfoElements.tutorialImage.setAttribute(
|
||||
"data-icon",
|
||||
"building_tutorials/" +
|
||||
metaBuilding.getId() +
|
||||
(variant === defaultBuildingVariant ? "" : "-" + variant) +
|
||||
".png"
|
||||
);
|
||||
|
||||
removeAllChildren(this.buildingInfoElements.additionalInfo);
|
||||
const additionalInfo = metaBuilding.getAdditionalStatistics(this.root, this.currentVariant.get());
|
||||
for (let i = 0; i < additionalInfo.length; ++i) {
|
||||
@@ -332,10 +337,12 @@ export class HUDBuildingPlacer extends BaseHUDPart {
|
||||
)
|
||||
);
|
||||
|
||||
const container = makeDiv(this.variantsElement, null, ["variants"]);
|
||||
|
||||
for (let i = 0; i < availableVariants.length; ++i) {
|
||||
const variant = availableVariants[i];
|
||||
|
||||
const element = makeDiv(this.variantsElement, null, ["variant"]);
|
||||
const element = makeDiv(container, null, ["variant"]);
|
||||
element.classList.toggle("active", variant === this.currentVariant.get());
|
||||
makeDiv(element, null, ["label"], variant);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user