1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00
This commit is contained in:
Itamea 2020-06-22 00:51:35 +02:00
commit 73d796a714
24 changed files with 229 additions and 62 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:3c91adcd4e00006ffa4aed4db19d1530bf8c58935b1624d1640fc8e9465a2824 oid sha256:ebde52e75e54d2f4add0cf498c85f059082a0745212a23c4de7328a7d78b00a5
size 176993 size 238170

View File

@ -29,7 +29,7 @@ function gulptasksSounds($, gulp, buildFolder) {
.audioChannels(1) .audioChannels(1)
.audioFrequency(22050) .audioFrequency(22050)
.audioCodec("libmp3lame") .audioCodec("libmp3lame")
.audioFilters(["volume=0.3"]); .audioFilters(["volume=0.15"]);
}), }),
{ {
name: "music", name: "music",

View File

@ -40,7 +40,7 @@ html {
background: #dee1ea; background: #dee1ea;
@include DarkThemeOverride { @include DarkThemeOverride {
background: #5c606c; background: $darkModeGameBackground;
} }
} }

View File

@ -75,6 +75,15 @@
@include StyleBelowWidth(700px) { @include StyleBelowWidth(700px) {
display: none !important; display: none !important;
} }
&.compact {
width: unset !important;
grid-template-columns: 1fr;
.buildingImage,
.description > .text {
display: none;
}
}
} }
#ingame_HUD_PlacerVariants { #ingame_HUD_PlacerVariants {
@ -86,6 +95,10 @@
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
&.compact {
@include S(top, 150px);
}
.explanation { .explanation {
text-transform: uppercase; text-transform: uppercase;
grid-row: 1 / 2; grid-row: 1 / 2;

View File

@ -21,15 +21,17 @@
} }
} }
$darkModeDialogBg: darken($darkModeGameBackground, 10);
@include DarkThemeOverride { @include DarkThemeOverride {
background: rgba(#33363d, 0.9); background: rgba($darkModeDialogBg, 0.9);
@include InlineAnimation(0.12s ease-in-out) { @include InlineAnimation(0.12s ease-in-out) {
0% { 0% {
background-color: transparent; background-color: transparent;
opacity: 0.5; opacity: 0.5;
} }
100% { 100% {
background-color: rgba(#33363d, 0.9); background-color: rgba($darkModeDialogBg, 0.9);
} }
} }

View File

@ -29,7 +29,7 @@
#ingame_HUD_Waypoints { #ingame_HUD_Waypoints {
position: absolute; position: absolute;
@include S(right, 10px); @include S(right, 10px);
@include S(top, 60px); @include S(top, 45px);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@include DarkThemeInvert(); @include DarkThemeInvert();

View File

@ -112,6 +112,6 @@ body.modalDialogActive,
body.externalAdOpen, body.externalAdOpen,
body.ingameDialogOpen { body.ingameDialogOpen {
> *:not(.ingameDialog):not(.modalDialogParent):not(.loadingDialog):not(.gameLoadingOverlay):not(#ingame_HUD_ModalDialogs):not(.noBlur) { > *:not(.ingameDialog):not(.modalDialogParent):not(.loadingDialog):not(.gameLoadingOverlay):not(#ingame_HUD_ModalDialogs):not(.noBlur) {
filter: blur(5px) !important; // filter: blur(5px) !important;
} }
} }

View File

@ -31,7 +31,7 @@
@include DarkThemeOverride { @include DarkThemeOverride {
.gameLoadingOverlay { .gameLoadingOverlay {
background: #56565c; background: $darkModeGameBackground;
} }
} }
} }

View File

@ -403,7 +403,7 @@
} }
@include DarkThemeOverride { @include DarkThemeOverride {
background: #53565e center center / cover !important; background: $darkModeGameBackground center center / cover !important;
.topButtons { .topButtons {
filter: invert(1); filter: invert(1);
@ -414,17 +414,17 @@
} }
.mainContainer { .mainContainer {
background: #4b4c50; background: darken($darkModeGameBackground, 10);
.savegames .savegame { .savegames .savegame {
background: #62646a; background: darken($darkModeGameBackground, 15);
color: white; color: white;
} }
} }
.footer { .footer {
> a { > a {
background: #4b4c50; background: darken($darkModeGameBackground, 10);
color: #eee; color: #eee;
} }

View File

@ -92,11 +92,11 @@
@include DarkThemeOverride { @include DarkThemeOverride {
.content { .content {
.setting { .setting {
background: #424345; background: darken($darkModeGameBackground, 10);
.value.enum { .value.enum {
// dirty but works // dirty but works
filter: invert(0.8); filter: invert(0.85);
color: #222; color: #222;
} }
@ -104,7 +104,7 @@
background-color: #74767b; background-color: #74767b;
&.checked { &.checked {
background-color: #605b7d; background-color: $colorBlueBright;
} }
} }
} }

View File

@ -65,7 +65,7 @@
@include DarkThemeOverride { @include DarkThemeOverride {
.headerBar { .headerBar {
h1 { h1 {
color: #cfceca; color: #e2e0db;
} }
.backButton { .backButton {
@ -74,7 +74,7 @@
} }
> .container > .content { > .container > .content {
background: #4b4c50; background: darken($darkModeGameBackground, 3);
color: #eee; color: #eee;
} }
} }

View File

@ -38,6 +38,8 @@ $ingameHudBg: rgba(#333438, 0.9);
$text3dColor: #f4ffff; $text3dColor: #f4ffff;
$darkModeGameBackground: #5c606c;
// Dialog properties // Dialog properties
$modalDialogBg: rgba(160, 165, 180, 0.8); $modalDialogBg: rgba(160, 165, 180, 0.8);
$dialogBgColor: lighten($mainBgColor, 10); $dialogBgColor: lighten($mainBgColor, 10);

View File

@ -1,18 +1,23 @@
export const CHANGELOG = [ export const CHANGELOG = [
{ {
version: "1.1.16", version: "1.1.16",
date: "unreleased", date: "21.06.2020",
entries: [ entries: [
"You can now pickup buildings below your cursor with 'Q'!",
"The game soundtrack has been extended! There are now 4 songs with over 13 minutes of playtime from <a href='https://soundcloud.com/pettersumelius' target='blank'>Peppsen</a>!", "The game soundtrack has been extended! There are now 4 songs with over 13 minutes of playtime from <a href='https://soundcloud.com/pettersumelius' target='blank'>Peppsen</a>!",
"Refactor keybindings overlay to show more appropriate keybindings", "Refactor keybindings overlay to show more appropriate keybindings",
"Show keybindings for area-select in the upper left instead", "Show keybindings for area-select in the upper left instead",
"Automatically deselect area when selecting a new building", "Automatically deselect area when selecting a new building",
"Raise markers limit from 14 characters to 71 (by Joker-vD)", "Raise markers limit from 14 characters to 71 (by Joker-vD)",
"Optimize performance by caching miner items (by Phlosioneer)", "Optimize performance by caching extractor items (by Phlosioneer)",
"Added setting to enable compact building infos, which only show ratios and hide the image / description",
"Apply dark theme to menu as well (by dengr1065)",
"Fix belt planner not placing the last belt", "Fix belt planner not placing the last belt",
"Fix buildings getting deleted when right clicking while placing a blueprint", "Fix buildings getting deleted when right clicking while placing a blueprint",
"Fix for exporting screenshots for huge bases (It was showing an empty file) (by xSparfuchs)", "Fix for exporting screenshots for huge bases (It was showing an empty file) (by xSparfuchs)",
"Fix buttons not responding when using right click directly after left click (by davidburhans)", "Fix buttons not responding when using right click directly after left click (by davidburhans)",
"Fix hub marker being hidden by building info panel",
"Disable dialog background blur since it can cause performance issues",
"Added simplified chinese translations", "Added simplified chinese translations",
"Update translations (Thanks to all translators!)", "Update translations (Thanks to all translators!)",
], ],

View File

@ -34,6 +34,7 @@ import { HUDPartTutorialHints } from "./parts/tutorial_hints";
import { HUDWaypoints } from "./parts/waypoints"; import { HUDWaypoints } from "./parts/waypoints";
import { HUDInteractiveTutorial } from "./parts/interactive_tutorial"; import { HUDInteractiveTutorial } from "./parts/interactive_tutorial";
import { HUDScreenshotExporter } from "./parts/screenshot_exporter"; import { HUDScreenshotExporter } from "./parts/screenshot_exporter";
import { Entity } from "../entity";
export class GameHUD { export class GameHUD {
/** /**

View File

@ -1,15 +1,15 @@
import { DrawParameters } from "../../../core/draw_parameters"; import { DrawParameters } from "../../../core/draw_parameters";
import { STOP_PROPAGATION } from "../../../core/signal"; import { STOP_PROPAGATION } from "../../../core/signal";
import { TrackedState } from "../../../core/tracked_state"; import { TrackedState } from "../../../core/tracked_state";
import { makeDiv } from "../../../core/utils";
import { Vector } from "../../../core/vector"; import { Vector } from "../../../core/vector";
import { T } from "../../../translations";
import { enumMouseButton } from "../../camera"; import { enumMouseButton } from "../../camera";
import { KEYMAPPINGS } from "../../key_action_mapper"; import { KEYMAPPINGS } from "../../key_action_mapper";
import { BaseHUDPart } from "../base_hud_part";
import { Blueprint } from "./blueprint";
import { makeDiv } from "../../../core/utils";
import { DynamicDomAttach } from "../dynamic_dom_attach";
import { blueprintShape } from "../../upgrades"; import { blueprintShape } from "../../upgrades";
import { T } from "../../../translations"; import { BaseHUDPart } from "../base_hud_part";
import { DynamicDomAttach } from "../dynamic_dom_attach";
import { Blueprint } from "./blueprint";
export class HUDBlueprintPlacer extends BaseHUDPart { export class HUDBlueprintPlacer extends BaseHUDPart {
createElements(parent) { createElements(parent) {
@ -34,9 +34,7 @@ export class HUDBlueprintPlacer extends BaseHUDPart {
const keyActionMapper = this.root.keyMapper; const keyActionMapper = this.root.keyMapper;
keyActionMapper.getBinding(KEYMAPPINGS.general.back).add(this.abortPlacement, this); keyActionMapper.getBinding(KEYMAPPINGS.general.back).add(this.abortPlacement, this);
keyActionMapper keyActionMapper.getBinding(KEYMAPPINGS.placement.pipette).add(this.abortPlacement, this);
.getBinding(KEYMAPPINGS.placement.abortBuildingPlacement)
.add(this.abortPlacement, this);
keyActionMapper.getBinding(KEYMAPPINGS.placement.rotateWhilePlacing).add(this.rotateBlueprint, this); keyActionMapper.getBinding(KEYMAPPINGS.placement.rotateWhilePlacing).add(this.rotateBlueprint, this);
keyActionMapper.getBinding(KEYMAPPINGS.massSelect.pasteLastBlueprint).add(this.pasteBlueprint, this); keyActionMapper.getBinding(KEYMAPPINGS.massSelect.pasteLastBlueprint).add(this.pasteBlueprint, this);
@ -62,10 +60,9 @@ export class HUDBlueprintPlacer extends BaseHUDPart {
} }
update() { update() {
this.domAttach.update(this.currentBlueprint.get()); const currentBlueprint = this.currentBlueprint.get();
this.trackedCanAfford.set( this.domAttach.update(currentBlueprint && currentBlueprint.getCost() > 0);
this.currentBlueprint.get() && this.currentBlueprint.get().canAfford(this.root) this.trackedCanAfford.set(currentBlueprint && currentBlueprint.canAfford(this.root));
);
} }
/** /**

View File

@ -38,6 +38,10 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
this.buildingInfoElements.tutorialImage = makeDiv(this.element, null, ["buildingImage"]); this.buildingInfoElements.tutorialImage = makeDiv(this.element, null, ["buildingImage"]);
this.variantsElement = makeDiv(parent, "ingame_HUD_PlacerVariants"); this.variantsElement = makeDiv(parent, "ingame_HUD_PlacerVariants");
const compact = this.root.app.settings.getAllSettings().compactBuildingInfo;
this.element.classList.toggle("compact", compact);
this.variantsElement.classList.toggle("compact", compact);
} }
initialize() { initialize() {

View File

@ -1,5 +1,6 @@
import { Math_abs, Math_degrees, Math_round } from "../../../core/builtins"; import { Math_abs, Math_degrees, Math_round } from "../../../core/builtins";
import { globalConfig } from "../../../core/config"; import { globalConfig } from "../../../core/config";
import { gMetaBuildingRegistry } from "../../../core/global_registries";
import { Signal, STOP_PROPAGATION } from "../../../core/signal"; import { Signal, STOP_PROPAGATION } from "../../../core/signal";
import { TrackedState } from "../../../core/tracked_state"; import { TrackedState } from "../../../core/tracked_state";
import { Vector } from "../../../core/vector"; import { Vector } from "../../../core/vector";
@ -9,7 +10,6 @@ import { Entity } from "../../entity";
import { KEYMAPPINGS } from "../../key_action_mapper"; import { KEYMAPPINGS } from "../../key_action_mapper";
import { defaultBuildingVariant, MetaBuilding } from "../../meta_building"; import { defaultBuildingVariant, MetaBuilding } from "../../meta_building";
import { BaseHUDPart } from "../base_hud_part"; import { BaseHUDPart } from "../base_hud_part";
import { lerp } from "../../../core/utils";
/** /**
* Contains all logic for the building placer - this doesn't include the rendering * Contains all logic for the building placer - this doesn't include the rendering
@ -97,10 +97,8 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
keyActionMapper keyActionMapper
.getBinding(KEYMAPPINGS.placement.switchDirectionLockSide) .getBinding(KEYMAPPINGS.placement.switchDirectionLockSide)
.add(this.switchDirectionLockSide, this); .add(this.switchDirectionLockSide, this);
keyActionMapper
.getBinding(KEYMAPPINGS.placement.abortBuildingPlacement)
.add(this.abortPlacement, this);
keyActionMapper.getBinding(KEYMAPPINGS.general.back).add(this.abortPlacement, this); keyActionMapper.getBinding(KEYMAPPINGS.general.back).add(this.abortPlacement, this);
keyActionMapper.getBinding(KEYMAPPINGS.placement.pipette).add(this.startPipette, this);
this.root.gameState.inputReciever.keyup.add(this.checkForDirectionLockSwitch, this); this.root.gameState.inputReciever.keyup.add(this.checkForDirectionLockSwitch, this);
// BINDINGS TO GAME EVENTS // BINDINGS TO GAME EVENTS
@ -220,6 +218,125 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
} }
} }
/**
* Starts the pipette function
*/
startPipette() {
// Disable in overview
if (this.root.camera.getIsMapOverlayActive()) {
return;
}
const mousePosition = this.root.app.mousePosition;
if (!mousePosition) {
// Not on screen
return;
}
const worldPos = this.root.camera.screenToWorld(mousePosition);
const tile = worldPos.toTileSpace();
const contents = this.root.map.getTileContent(tile);
if (!contents) {
this.currentMetaBuilding.set(null);
return;
}
// Try to extract the building
const extracted = this.hack_reconstructMetaBuildingAndVariantFromBuilding(contents);
if (!extracted) {
this.currentMetaBuilding.set(null);
return;
}
this.currentMetaBuilding.set(extracted.metaBuilding);
this.currentVariant.set(extracted.variant);
this.currentBaseRotation = contents.components.StaticMapEntity.rotation;
// Make sure we selected something, and also make sure it's not a special entity
// if (contents && !contents.components.Unremovable) {
// }
}
/**
* HACK!
*
* This attempts to reconstruct the meta building and its variant from a given entity
* @param {Entity} entity
* @returns {{ metaBuilding: MetaBuilding, variant: string }}
*/
hack_reconstructMetaBuildingAndVariantFromBuilding(entity) {
if (entity.components.Hub) {
// Hub is not copyable
return null;
}
const matches = [];
const metaBuildings = gMetaBuildingRegistry.entries;
for (let i = 0; i < metaBuildings.length; ++i) {
const metaBuilding = metaBuildings[i];
const availableVariants = metaBuilding.getAvailableVariants(this.root);
checkVariant: for (let k = 0; k < availableVariants.length; ++k) {
const variant = availableVariants[k];
let unplaced = metaBuilding.createEntity({
root: this.root,
variant,
origin: new Vector(0, 0),
rotation: 0,
originalRotation: 0,
rotationVariant: 0,
});
// Compare if both entities share the same components
for (let component in entity.components) {
if ((entity.components[component] == null) !== (unplaced.components[component] == null)) {
continue checkVariant;
}
}
// Check for same item processor
if (
entity.components.ItemProcessor &&
entity.components.ItemProcessor.type != unplaced.components.ItemProcessor.type
) {
continue checkVariant;
}
// Check for underground belt
if (
entity.components.UndergroundBelt &&
entity.components.UndergroundBelt.tier != unplaced.components.UndergroundBelt.tier
) {
continue checkVariant;
}
// Check for same sprite key - except for underground belts
// since the sprite may vary here
if (
!entity.components.UndergroundBelt &&
entity.components.StaticMapEntity.spriteKey !=
unplaced.components.StaticMapEntity.spriteKey
) {
continue checkVariant;
}
matches.push({ metaBuilding, variant });
}
}
if (matches.length == 1) {
const staticEntity = entity.components.StaticMapEntity;
const key = staticEntity.spriteKey || staticEntity.blueprintSpriteKey;
assert(
key &&
key.includes(matches[0].metaBuilding.id) &&
(matches[0].variant === defaultBuildingVariant || key.includes(matches[0].variant))
);
return matches[0];
}
return null;
}
switchDirectionLockSide() { switchDirectionLockSide() {
this.currentDirectionLockSide = 1 - this.currentDirectionLockSide; this.currentDirectionLockSide = 1 - this.currentDirectionLockSide;
} }
@ -237,18 +354,6 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
} }
} }
/**
* Canvas click handler
* @param {Vector} mousePos
* @param {boolean} cancelAction
*/
onCanvasClick(mousePos, cancelAction = false) {
// Prevent any other canvas clicks
if (this.currentMetaBuilding.get()) {
return STOP_PROPAGATION;
}
}
/** /**
* Tries to place the current building at the given tile * Tries to place the current building at the given tile
* @param {Vector} tile * @param {Vector} tile
@ -473,7 +578,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
this.currentlyDragging = true; this.currentlyDragging = true;
this.currentlyDeleting = true; this.currentlyDeleting = true;
this.lastDragTile = this.root.camera.screenToWorld(pos).toTileSpace(); this.lastDragTile = this.root.camera.screenToWorld(pos).toTileSpace();
this.currentMetaBuilding.set(null); this.deleteBelowCursor();
return STOP_PROPAGATION; return STOP_PROPAGATION;
} }

View File

@ -44,7 +44,7 @@ export class HUDKeybindingOverlay extends BaseHUDPart {
* it supports the belt planner * it supports the belt planner
* @returns {boolean} * @returns {boolean}
*/ */
get buildingPlacementBeltPlanner() { get buildingPlacementSupportsBeltPlanner() {
const placer = this.root.hud.parts.buildingPlacer; const placer = this.root.hud.parts.buildingPlacer;
return ( return (
!this.mapOverviewActive && !this.mapOverviewActive &&
@ -164,10 +164,17 @@ export class HUDKeybindingOverlay extends BaseHUDPart {
condition: () => this.mapOverviewActive && !this.blueprintPlacementActive, condition: () => this.mapOverviewActive && !this.blueprintPlacementActive,
}, },
{
// Pipette
label: T.ingame.keybindingsOverlay.pipette,
keys: [k.placement.pipette],
condition: () => !this.mapOverviewActive,
},
{ {
// Cancel placement // Cancel placement
label: T.ingame.keybindingsOverlay.stopPlacement, label: T.ingame.keybindingsOverlay.stopPlacement,
keys: [KEYCODE_RMB, DIVIDER_TOKEN, k.placement.abortBuildingPlacement], keys: [KEYCODE_RMB],
condition: () => this.anyPlacementActive, condition: () => this.anyPlacementActive,
}, },
@ -218,7 +225,7 @@ export class HUDKeybindingOverlay extends BaseHUDPart {
// Belt planner // Belt planner
label: T.ingame.keybindingsOverlay.lockBeltDirection, label: T.ingame.keybindingsOverlay.lockBeltDirection,
keys: [k.placementModifiers.lockBeltDirection], keys: [k.placementModifiers.lockBeltDirection],
condition: () => this.buildingPlacementActive && !this.beltPlannerActive, condition: () => this.buildingPlacementSupportsBeltPlanner && !this.beltPlannerActive,
}, },
{ {

View File

@ -24,7 +24,7 @@ export const KEYMAPPINGS = {
menuOpenStats: { keyCode: key("G") }, menuOpenStats: { keyCode: key("G") },
toggleHud: { keyCode: 113 }, // F2 toggleHud: { keyCode: 113 }, // F2
exportScreenshot: { keyCode: 114 }, // F3 exportScreenshot: { keyCode: 114 }, // F3PS
toggleFPSInfo: { keyCode: 115 }, // F4 toggleFPSInfo: { keyCode: 115 }, // F4
}, },
@ -56,7 +56,7 @@ export const KEYMAPPINGS = {
}, },
placement: { placement: {
abortBuildingPlacement: { keyCode: key("Q") }, pipette: { keyCode: key("Q") },
rotateWhilePlacing: { keyCode: key("R") }, rotateWhilePlacing: { keyCode: key("R") },
rotateInverseModifier: { keyCode: 16 }, // SHIFT rotateInverseModifier: { keyCode: 16 }, // SHIFT
cycleBuildingVariants: { keyCode: key("T") }, cycleBuildingVariants: { keyCode: key("T") },

View File

@ -147,10 +147,32 @@ export class MetaBuilding {
* @param {string} param0.variant * @param {string} param0.variant
*/ */
createAndPlaceEntity({ root, origin, rotation, originalRotation, rotationVariant, variant }) { createAndPlaceEntity({ root, origin, rotation, originalRotation, rotationVariant, variant }) {
const entity = this.createEntity({
root,
origin,
rotation,
originalRotation,
rotationVariant,
variant,
});
root.map.placeStaticEntity(entity);
root.entityMgr.registerEntity(entity);
return entity;
}
/**
* Creates the entity without placing it
* @param {object} param0
* @param {GameRoot} param0.root
* @param {Vector} param0.origin Origin tile
* @param {number=} param0.rotation Rotation
* @param {number} param0.originalRotation Original Rotation
* @param {number} param0.rotationVariant Rotation variant
* @param {string} param0.variant
*/
createEntity({ root, origin, rotation, originalRotation, rotationVariant, variant }) {
const entity = new Entity(root); const entity = new Entity(root);
const blueprintSprite = this.getBlueprintSprite(rotationVariant, variant); const blueprintSprite = this.getBlueprintSprite(rotationVariant, variant);
entity.addComponent( entity.addComponent(
new StaticMapEntityComponent({ new StaticMapEntityComponent({
spriteKey: spriteKey:
@ -166,12 +188,8 @@ export class MetaBuilding {
blueprintSpriteKey: blueprintSprite ? blueprintSprite.spriteName : "", blueprintSpriteKey: blueprintSprite ? blueprintSprite.spriteName : "",
}) })
); );
this.setupEntityComponents(entity, root); this.setupEntityComponents(entity, root);
this.updateVariants(entity, rotationVariant, variant); this.updateVariants(entity, rotationVariant, variant);
root.map.placeStaticEntity(entity);
root.entityMgr.registerEntity(entity);
return entity; return entity;
} }

View File

@ -200,6 +200,7 @@ export const allApplicationSettings = [
new BoolSetting("alwaysMultiplace", categoryGame, (app, value) => {}), new BoolSetting("alwaysMultiplace", categoryGame, (app, value) => {}),
new BoolSetting("enableTunnelSmartplace", categoryGame, (app, value) => {}), new BoolSetting("enableTunnelSmartplace", categoryGame, (app, value) => {}),
new BoolSetting("vignette", categoryGame, (app, value) => {}), new BoolSetting("vignette", categoryGame, (app, value) => {}),
new BoolSetting("compactBuildingInfo", categoryGame, (app, value) => {}),
]; ];
export function getApplicationSettingById(id) { export function getApplicationSettingById(id) {
@ -223,6 +224,7 @@ class SettingsStorage {
this.offerHints = true; this.offerHints = true;
this.enableTunnelSmartplace = true; this.enableTunnelSmartplace = true;
this.vignette = true; this.vignette = true;
this.compactBuildingInfo = false;
/** /**
* @type {Object.<string, number>} * @type {Object.<string, number>}
@ -412,7 +414,7 @@ export class ApplicationSettings extends ReadWriteProxy {
} }
getCurrentVersion() { getCurrentVersion() {
return 12; return 13;
} }
/** @param {{settings: SettingsStorage, version: number}} data */ /** @param {{settings: SettingsStorage, version: number}} data */
@ -459,6 +461,11 @@ export class ApplicationSettings extends ReadWriteProxy {
data.version = 12; data.version = 12;
} }
if (data.version < 13) {
data.settings.compactBuildingInfo = false;
data.version = 13;
}
return ExplainedResult.good(); return ExplainedResult.good();
} }
} }

View File

@ -288,6 +288,7 @@ ingame:
cutSelection: Cut cutSelection: Cut
copySelection: Copy copySelection: Copy
clearSelection: Clear Selection clearSelection: Clear Selection
pipette: Pipette
# Everything related to placing buildings (I.e. as soon as you selected a building # Everything related to placing buildings (I.e. as soon as you selected a building
# from the toolbar) # from the toolbar)
@ -686,6 +687,11 @@ settings:
description: >- description: >-
Enables the vignette which darkens the screen corners and makes text easier to read. Enables the vignette which darkens the screen corners and makes text easier to read.
compactBuildingInfo:
title: Compact Building Infos
description: >-
Shortens info boxes for buildings by only showing their ratios. Otherwise a description and image is shown.
keybindings: keybindings:
title: Keybindings title: Keybindings
hint: >- hint: >-
@ -733,7 +739,7 @@ keybindings:
painter: *painter painter: *painter
trash: *trash trash: *trash
abortBuildingPlacement: Abort Placement pipette: Pipette
rotateWhilePlacing: Rotate rotateWhilePlacing: Rotate
rotateInverseModifier: >- rotateInverseModifier: >-
Modifier: Rotate CCW instead Modifier: Rotate CCW instead