mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Add setting to show chunk borders
This commit is contained in:
parent
49ea6fc381
commit
bca379ee89
@ -18,6 +18,7 @@ export const CHANGELOG = [
|
|||||||
"Updated and added new translations (Thanks to all contributors!)",
|
"Updated and added new translations (Thanks to all contributors!)",
|
||||||
"Added setting to be able to delete buildings while placing (inspired by hexy)",
|
"Added setting to be able to delete buildings while placing (inspired by hexy)",
|
||||||
"Mark pinned shapes in statistics dialog and show them first (inspired by davidburhans)",
|
"Mark pinned shapes in statistics dialog and show them first (inspired by davidburhans)",
|
||||||
|
"Added setting to show chunk borders",
|
||||||
"Quad painters have been reworked! They now are integrated with the wires, and only paint the shape when the value is 1 (inspired by dengr1605)",
|
"Quad painters have been reworked! They now are integrated with the wires, and only paint the shape when the value is 1 (inspired by dengr1605)",
|
||||||
"There are now compact 1x1 splitters available to be unlocked!",
|
"There are now compact 1x1 splitters available to be unlocked!",
|
||||||
"Allow editing waypoints (by isaisstillalive)",
|
"Allow editing waypoints (by isaisstillalive)",
|
||||||
|
@ -9,7 +9,8 @@ import { DrawParameters } from "../core/draw_parameters";
|
|||||||
import { gMetaBuildingRegistry } from "../core/global_registries";
|
import { gMetaBuildingRegistry } from "../core/global_registries";
|
||||||
import { createLogger } from "../core/logging";
|
import { createLogger } from "../core/logging";
|
||||||
import { Rectangle } from "../core/rectangle";
|
import { Rectangle } from "../core/rectangle";
|
||||||
import { randomInt, round2Digits, round3Digits } from "../core/utils";
|
import { ORIGINAL_SPRITE_SCALE } from "../core/sprites";
|
||||||
|
import { lerp, randomInt, round2Digits } from "../core/utils";
|
||||||
import { Vector } from "../core/vector";
|
import { Vector } from "../core/vector";
|
||||||
import { Savegame } from "../savegame/savegame";
|
import { Savegame } from "../savegame/savegame";
|
||||||
import { SavegameSerializer } from "../savegame/savegame_serializer";
|
import { SavegameSerializer } from "../savegame/savegame_serializer";
|
||||||
@ -30,7 +31,6 @@ import { GameRoot } from "./root";
|
|||||||
import { ShapeDefinitionManager } from "./shape_definition_manager";
|
import { ShapeDefinitionManager } from "./shape_definition_manager";
|
||||||
import { SoundProxy } from "./sound_proxy";
|
import { SoundProxy } from "./sound_proxy";
|
||||||
import { GameTime } from "./time/game_time";
|
import { GameTime } from "./time/game_time";
|
||||||
import { ORIGINAL_SPRITE_SCALE } from "../core/sprites";
|
|
||||||
|
|
||||||
const logger = createLogger("ingame/core");
|
const logger = createLogger("ingame/core");
|
||||||
|
|
||||||
@ -61,6 +61,12 @@ export class GameCore {
|
|||||||
|
|
||||||
// Cached
|
// Cached
|
||||||
this.boundInternalTick = this.updateLogic.bind(this);
|
this.boundInternalTick = this.updateLogic.bind(this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opacity of the overview alpha
|
||||||
|
* @TODO Doesn't belong here
|
||||||
|
*/
|
||||||
|
this.overlayAlpha = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -385,10 +391,10 @@ export class GameCore {
|
|||||||
// Main rendering order
|
// Main rendering order
|
||||||
// -----
|
// -----
|
||||||
|
|
||||||
if (this.root.camera.getIsMapOverlayActive()) {
|
const desiredOverlayAlpha = this.root.camera.getIsMapOverlayActive() ? 1 : 0;
|
||||||
// Map overview
|
this.overlayAlpha = lerp(this.overlayAlpha, desiredOverlayAlpha, 0.25);
|
||||||
root.map.drawOverlay(params);
|
|
||||||
} else {
|
if (this.overlayAlpha < 0.99) {
|
||||||
// Background (grid, resources, etc)
|
// Background (grid, resources, etc)
|
||||||
root.map.drawBackground(params);
|
root.map.drawBackground(params);
|
||||||
|
|
||||||
@ -410,6 +416,13 @@ export class GameCore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.overlayAlpha > 0.01) {
|
||||||
|
// Map overview
|
||||||
|
context.globalAlpha = this.overlayAlpha;
|
||||||
|
root.map.drawOverlay(params);
|
||||||
|
context.globalAlpha = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (G_IS_DEV) {
|
if (G_IS_DEV) {
|
||||||
root.map.drawStaticEntityDebugOverlays(params);
|
root.map.drawStaticEntityDebugOverlays(params);
|
||||||
}
|
}
|
||||||
|
@ -1,96 +1,92 @@
|
|||||||
import { makeOffscreenBuffer } from "../../../core/buffer_utils";
|
import { makeOffscreenBuffer } from "../../../core/buffer_utils";
|
||||||
import { globalConfig } from "../../../core/config";
|
import { globalConfig } from "../../../core/config";
|
||||||
import { DrawParameters } from "../../../core/draw_parameters";
|
import { DrawParameters } from "../../../core/draw_parameters";
|
||||||
import { KEYMAPPINGS } from "../../key_action_mapper";
|
import { KEYMAPPINGS } from "../../key_action_mapper";
|
||||||
import { THEME } from "../../theme";
|
import { THEME } from "../../theme";
|
||||||
import { BaseHUDPart } from "../base_hud_part";
|
import { BaseHUDPart } from "../base_hud_part";
|
||||||
import { Loader } from "../../../core/loader";
|
import { Loader } from "../../../core/loader";
|
||||||
import { lerp } from "../../../core/utils";
|
import { lerp } from "../../../core/utils";
|
||||||
|
|
||||||
const wiresBackgroundDpi = 4;
|
const wiresBackgroundDpi = 4;
|
||||||
|
|
||||||
export class HUDWiresOverlay extends BaseHUDPart {
|
export class HUDWiresOverlay extends BaseHUDPart {
|
||||||
createElements(parent) {}
|
createElements(parent) {}
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
// Probably not the best location, but the one which makes most sense
|
// Probably not the best location, but the one which makes most sense
|
||||||
this.root.keyMapper.getBinding(KEYMAPPINGS.ingame.switchLayers).add(this.switchLayers, this);
|
this.root.keyMapper.getBinding(KEYMAPPINGS.ingame.switchLayers).add(this.switchLayers, this);
|
||||||
|
|
||||||
this.generateTilePattern();
|
this.generateTilePattern();
|
||||||
|
|
||||||
this.currentAlpha = 0.0;
|
this.currentAlpha = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switches between layers
|
* Switches between layers
|
||||||
*/
|
*/
|
||||||
switchLayers() {
|
switchLayers() {
|
||||||
if (this.root.currentLayer === "regular") {
|
if (this.root.currentLayer === "regular") {
|
||||||
this.root.currentLayer = "wires";
|
this.root.currentLayer = "wires";
|
||||||
} else {
|
} else {
|
||||||
this.root.currentLayer = "regular";
|
this.root.currentLayer = "regular";
|
||||||
}
|
}
|
||||||
this.root.signals.editModeChanged.dispatch(this.root.currentLayer);
|
this.root.signals.editModeChanged.dispatch(this.root.currentLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the background pattern for the wires overlay
|
* Generates the background pattern for the wires overlay
|
||||||
*/
|
*/
|
||||||
generateTilePattern() {
|
generateTilePattern() {
|
||||||
const overlayTile = Loader.getSprite("sprites/wires/overlay_tile.png");
|
const overlayTile = Loader.getSprite("sprites/wires/overlay_tile.png");
|
||||||
const dims = globalConfig.tileSize * wiresBackgroundDpi;
|
const dims = globalConfig.tileSize * wiresBackgroundDpi;
|
||||||
const [canvas, context] = makeOffscreenBuffer(dims, dims, {
|
const [canvas, context] = makeOffscreenBuffer(dims, dims, {
|
||||||
smooth: false,
|
smooth: false,
|
||||||
reusable: false,
|
reusable: false,
|
||||||
label: "wires-tile-pattern",
|
label: "wires-tile-pattern",
|
||||||
});
|
});
|
||||||
context.clearRect(0, 0, dims, dims);
|
context.clearRect(0, 0, dims, dims);
|
||||||
overlayTile.draw(context, 0, 0, dims, dims);
|
overlayTile.draw(context, 0, 0, dims, dims);
|
||||||
this.tilePatternCanvas = canvas;
|
this.tilePatternCanvas = canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
const desiredAlpha = this.root.currentLayer === "wires" ? 1.0 : 0.0;
|
const desiredAlpha = this.root.currentLayer === "wires" ? 1.0 : 0.0;
|
||||||
this.currentAlpha = lerp(this.currentAlpha, desiredAlpha, 0.12);
|
this.currentAlpha = lerp(this.currentAlpha, desiredAlpha, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {DrawParameters} parameters
|
* @param {DrawParameters} parameters
|
||||||
*/
|
*/
|
||||||
draw(parameters) {
|
draw(parameters) {
|
||||||
if (this.currentAlpha < 0.02) {
|
if (this.currentAlpha < 0.02) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.root.camera.getIsMapOverlayActive()) {
|
if (!this.cachedPatternBackground) {
|
||||||
return;
|
this.cachedPatternBackground = parameters.context.createPattern(this.tilePatternCanvas, "repeat");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.cachedPatternBackground) {
|
const bounds = parameters.visibleRect;
|
||||||
this.cachedPatternBackground = parameters.context.createPattern(this.tilePatternCanvas, "repeat");
|
|
||||||
}
|
parameters.context.globalAlpha = this.currentAlpha;
|
||||||
|
|
||||||
const bounds = parameters.visibleRect;
|
const scaleFactor = 1 / wiresBackgroundDpi;
|
||||||
|
parameters.context.globalCompositeOperation = "overlay";
|
||||||
parameters.context.globalAlpha = this.currentAlpha;
|
parameters.context.fillStyle = "rgba(50, 200, 150, 1)";
|
||||||
|
parameters.context.fillRect(bounds.x, bounds.y, bounds.w, bounds.h);
|
||||||
const scaleFactor = 1 / wiresBackgroundDpi;
|
parameters.context.globalCompositeOperation = "source-over";
|
||||||
parameters.context.globalCompositeOperation = "overlay";
|
|
||||||
parameters.context.fillStyle = "rgba(50, 200, 150, 1)";
|
parameters.context.scale(scaleFactor, scaleFactor);
|
||||||
parameters.context.fillRect(bounds.x, bounds.y, bounds.w, bounds.h);
|
parameters.context.fillStyle = this.cachedPatternBackground;
|
||||||
parameters.context.globalCompositeOperation = "source-over";
|
parameters.context.fillRect(
|
||||||
|
bounds.x / scaleFactor,
|
||||||
parameters.context.scale(scaleFactor, scaleFactor);
|
bounds.y / scaleFactor,
|
||||||
parameters.context.fillStyle = this.cachedPatternBackground;
|
bounds.w / scaleFactor,
|
||||||
parameters.context.fillRect(
|
bounds.h / scaleFactor
|
||||||
bounds.x / scaleFactor,
|
);
|
||||||
bounds.y / scaleFactor,
|
parameters.context.scale(1 / scaleFactor, 1 / scaleFactor);
|
||||||
bounds.w / scaleFactor,
|
|
||||||
bounds.h / scaleFactor
|
parameters.context.globalAlpha = 1;
|
||||||
);
|
}
|
||||||
parameters.context.scale(1 / scaleFactor, 1 / scaleFactor);
|
}
|
||||||
|
|
||||||
parameters.context.globalAlpha = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -133,6 +133,12 @@ export class MapChunkView extends MapChunk {
|
|||||||
: THEME.map.chunkOverview.empty;
|
: THEME.map.chunkOverview.empty;
|
||||||
context.fillRect(0, 0, w, h);
|
context.fillRect(0, 0, w, h);
|
||||||
|
|
||||||
|
if (this.root.app.settings.getAllSettings().displayChunkBorders) {
|
||||||
|
context.fillStyle = THEME.map.chunkBorders;
|
||||||
|
context.fillRect(0, 0, w, 1);
|
||||||
|
context.fillRect(0, 1, 1, h);
|
||||||
|
}
|
||||||
|
|
||||||
for (let x = 0; x < globalConfig.mapChunkSize; ++x) {
|
for (let x = 0; x < globalConfig.mapChunkSize; ++x) {
|
||||||
const lowerArray = this.lowerLayer[x];
|
const lowerArray = this.lowerLayer[x];
|
||||||
const upperArray = this.contents[x];
|
const upperArray = this.contents[x];
|
||||||
|
@ -196,6 +196,7 @@ export class MapView extends BaseMap {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Render tile grid
|
||||||
if (!this.root.app.settings.getAllSettings().disableTileGrid) {
|
if (!this.root.app.settings.getAllSettings().disableTileGrid) {
|
||||||
const dpi = this.backgroundCacheDPI;
|
const dpi = this.backgroundCacheDPI;
|
||||||
parameters.context.scale(1 / dpi, 1 / dpi);
|
parameters.context.scale(1 / dpi, 1 / dpi);
|
||||||
|
@ -1,107 +1,113 @@
|
|||||||
import { globalConfig } from "../../core/config";
|
import { globalConfig } from "../../core/config";
|
||||||
import { DrawParameters } from "../../core/draw_parameters";
|
import { DrawParameters } from "../../core/draw_parameters";
|
||||||
import { GameSystem } from "../game_system";
|
import { GameSystem } from "../game_system";
|
||||||
import { MapChunkView } from "../map_chunk_view";
|
import { MapChunkView } from "../map_chunk_view";
|
||||||
import { THEME } from "../theme";
|
import { THEME } from "../theme";
|
||||||
import { drawSpriteClipped } from "../../core/draw_utils";
|
import { drawSpriteClipped } from "../../core/draw_utils";
|
||||||
|
|
||||||
export class MapResourcesSystem extends GameSystem {
|
export class MapResourcesSystem extends GameSystem {
|
||||||
/**
|
/**
|
||||||
* Draws the map resources
|
* Draws the map resources
|
||||||
* @param {DrawParameters} parameters
|
* @param {DrawParameters} parameters
|
||||||
* @param {MapChunkView} chunk
|
* @param {MapChunkView} chunk
|
||||||
*/
|
*/
|
||||||
drawChunk(parameters, chunk) {
|
drawChunk(parameters, chunk) {
|
||||||
const basicChunkBackground = this.root.buffers.getForKey({
|
const basicChunkBackground = this.root.buffers.getForKey({
|
||||||
key: "mapresourcebg",
|
key: "mapresourcebg",
|
||||||
subKey: chunk.renderKey,
|
subKey: chunk.renderKey,
|
||||||
w: globalConfig.mapChunkSize,
|
w: globalConfig.mapChunkSize,
|
||||||
h: globalConfig.mapChunkSize,
|
h: globalConfig.mapChunkSize,
|
||||||
dpi: 1,
|
dpi: 1,
|
||||||
redrawMethod: this.generateChunkBackground.bind(this, chunk),
|
redrawMethod: this.generateChunkBackground.bind(this, chunk),
|
||||||
});
|
});
|
||||||
|
|
||||||
parameters.context.imageSmoothingEnabled = false;
|
parameters.context.imageSmoothingEnabled = false;
|
||||||
drawSpriteClipped({
|
drawSpriteClipped({
|
||||||
parameters,
|
parameters,
|
||||||
sprite: basicChunkBackground,
|
sprite: basicChunkBackground,
|
||||||
x: chunk.tileX * globalConfig.tileSize,
|
x: chunk.tileX * globalConfig.tileSize,
|
||||||
y: chunk.tileY * globalConfig.tileSize,
|
y: chunk.tileY * globalConfig.tileSize,
|
||||||
w: globalConfig.mapChunkWorldSize,
|
w: globalConfig.mapChunkWorldSize,
|
||||||
h: globalConfig.mapChunkWorldSize,
|
h: globalConfig.mapChunkWorldSize,
|
||||||
originalW: globalConfig.mapChunkSize,
|
originalW: globalConfig.mapChunkSize,
|
||||||
originalH: globalConfig.mapChunkSize,
|
originalH: globalConfig.mapChunkSize,
|
||||||
});
|
});
|
||||||
parameters.context.imageSmoothingEnabled = true;
|
parameters.context.imageSmoothingEnabled = true;
|
||||||
|
|
||||||
parameters.context.globalAlpha = 0.5;
|
parameters.context.globalAlpha = 0.5;
|
||||||
|
|
||||||
if (this.root.app.settings.getAllSettings().lowQualityMapResources) {
|
if (this.root.app.settings.getAllSettings().lowQualityMapResources) {
|
||||||
// LOW QUALITY: Draw patch items only
|
// LOW QUALITY: Draw patch items only
|
||||||
for (let i = 0; i < chunk.patches.length; ++i) {
|
for (let i = 0; i < chunk.patches.length; ++i) {
|
||||||
const patch = chunk.patches[i];
|
const patch = chunk.patches[i];
|
||||||
const destX = chunk.x * globalConfig.mapChunkWorldSize + patch.pos.x * globalConfig.tileSize;
|
const destX = chunk.x * globalConfig.mapChunkWorldSize + patch.pos.x * globalConfig.tileSize;
|
||||||
const destY = chunk.y * globalConfig.mapChunkWorldSize + patch.pos.y * globalConfig.tileSize;
|
const destY = chunk.y * globalConfig.mapChunkWorldSize + patch.pos.y * globalConfig.tileSize;
|
||||||
const diameter = Math.min(80, 40 / parameters.zoomLevel);
|
const diameter = Math.min(80, 40 / parameters.zoomLevel);
|
||||||
|
|
||||||
patch.item.drawItemCenteredClipped(destX, destY, parameters, diameter);
|
patch.item.drawItemCenteredClipped(destX, destY, parameters, diameter);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// HIGH QUALITY: Draw all items
|
// HIGH QUALITY: Draw all items
|
||||||
const layer = chunk.lowerLayer;
|
const layer = chunk.lowerLayer;
|
||||||
for (let x = 0; x < globalConfig.mapChunkSize; ++x) {
|
for (let x = 0; x < globalConfig.mapChunkSize; ++x) {
|
||||||
const row = layer[x];
|
const row = layer[x];
|
||||||
const worldX = (chunk.tileX + x) * globalConfig.tileSize;
|
const worldX = (chunk.tileX + x) * globalConfig.tileSize;
|
||||||
for (let y = 0; y < globalConfig.mapChunkSize; ++y) {
|
for (let y = 0; y < globalConfig.mapChunkSize; ++y) {
|
||||||
const lowerItem = row[y];
|
const lowerItem = row[y];
|
||||||
if (lowerItem) {
|
if (lowerItem) {
|
||||||
const worldY = (chunk.tileY + y) * globalConfig.tileSize;
|
const worldY = (chunk.tileY + y) * globalConfig.tileSize;
|
||||||
|
|
||||||
const destX = worldX + globalConfig.halfTileSize;
|
const destX = worldX + globalConfig.halfTileSize;
|
||||||
const destY = worldY + globalConfig.halfTileSize;
|
const destY = worldY + globalConfig.halfTileSize;
|
||||||
|
|
||||||
lowerItem.drawItemCenteredClipped(
|
lowerItem.drawItemCenteredClipped(
|
||||||
destX,
|
destX,
|
||||||
destY,
|
destY,
|
||||||
parameters,
|
parameters,
|
||||||
globalConfig.defaultItemDiameter
|
globalConfig.defaultItemDiameter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parameters.context.globalAlpha = 1;
|
parameters.context.globalAlpha = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {MapChunkView} chunk
|
* @param {MapChunkView} chunk
|
||||||
* @param {HTMLCanvasElement} canvas
|
* @param {HTMLCanvasElement} canvas
|
||||||
* @param {CanvasRenderingContext2D} context
|
* @param {CanvasRenderingContext2D} context
|
||||||
* @param {number} w
|
* @param {number} w
|
||||||
* @param {number} h
|
* @param {number} h
|
||||||
* @param {number} dpi
|
* @param {number} dpi
|
||||||
*/
|
*/
|
||||||
generateChunkBackground(chunk, canvas, context, w, h, dpi) {
|
generateChunkBackground(chunk, canvas, context, w, h, dpi) {
|
||||||
if (this.root.app.settings.getAllSettings().disableTileGrid) {
|
if (this.root.app.settings.getAllSettings().disableTileGrid) {
|
||||||
// The map doesn't draw a background, so we have to
|
// The map doesn't draw a background, so we have to
|
||||||
context.fillStyle = THEME.map.background;
|
context.fillStyle = THEME.map.background;
|
||||||
context.fillRect(0, 0, w, h);
|
context.fillRect(0, 0, w, h);
|
||||||
} else {
|
} else {
|
||||||
context.clearRect(0, 0, w, h);
|
context.clearRect(0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.globalAlpha = 0.5;
|
context.globalAlpha = 0.5;
|
||||||
const layer = chunk.lowerLayer;
|
const layer = chunk.lowerLayer;
|
||||||
for (let x = 0; x < globalConfig.mapChunkSize; ++x) {
|
for (let x = 0; x < globalConfig.mapChunkSize; ++x) {
|
||||||
const row = layer[x];
|
const row = layer[x];
|
||||||
for (let y = 0; y < globalConfig.mapChunkSize; ++y) {
|
for (let y = 0; y < globalConfig.mapChunkSize; ++y) {
|
||||||
const item = row[y];
|
const item = row[y];
|
||||||
if (item) {
|
if (item) {
|
||||||
context.fillStyle = item.getBackgroundColorAsResource();
|
context.fillStyle = item.getBackgroundColorAsResource();
|
||||||
context.fillRect(x, y, 1, 1);
|
context.fillRect(x, y, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
if (this.root.app.settings.getAllSettings().displayChunkBorders) {
|
||||||
|
context.fillStyle = THEME.map.chunkBorders;
|
||||||
|
context.fillRect(0, 0, w, 1);
|
||||||
|
context.fillRect(0, 1, 1, h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,48 +1,50 @@
|
|||||||
{
|
{
|
||||||
"uiStyle": "dark",
|
"uiStyle": "dark",
|
||||||
"map": {
|
"map": {
|
||||||
"background": "#2e2f37",
|
"background": "#2e2f37",
|
||||||
"grid": "rgba(255, 255, 255, 0.02)",
|
"grid": "rgba(255, 255, 255, 0.02)",
|
||||||
"gridLineWidth": 0.5,
|
"gridLineWidth": 0.5,
|
||||||
|
|
||||||
"selectionOverlay": "rgba(74, 163, 223, 0.7)",
|
"selectionOverlay": "rgba(74, 163, 223, 0.7)",
|
||||||
"selectionOutline": "rgba(74, 163, 223, 0.5)",
|
"selectionOutline": "rgba(74, 163, 223, 0.5)",
|
||||||
"selectionBackground": "rgba(74, 163, 223, 0.2)",
|
"selectionBackground": "rgba(74, 163, 223, 0.2)",
|
||||||
|
|
||||||
"directionLock": {
|
"chunkBorders": "rgba(127, 190, 255, 0.04)",
|
||||||
"regular": {
|
|
||||||
"color": "rgb(74, 237, 134)",
|
"directionLock": {
|
||||||
"background": "rgba(74, 237, 134, 0.2)"
|
"regular": {
|
||||||
},
|
"color": "rgb(74, 237, 134)",
|
||||||
"wires": {
|
"background": "rgba(74, 237, 134, 0.2)"
|
||||||
"color": "rgb(209, 107, 203)",
|
},
|
||||||
"background": "rgba(209, 107, 203, 0.2)"
|
"wires": {
|
||||||
}
|
"color": "rgb(209, 107, 203)",
|
||||||
},
|
"background": "rgba(209, 107, 203, 0.2)"
|
||||||
|
}
|
||||||
"colorBlindPickerTile": "rgba(255, 255, 255, 0.5)",
|
},
|
||||||
|
|
||||||
"resources": {
|
"colorBlindPickerTile": "rgba(255, 255, 255, 0.5)",
|
||||||
"shape": "#3d3f4a",
|
|
||||||
"red": "#4a3d3f",
|
"resources": {
|
||||||
"green": "#3e4a3d",
|
"shape": "#3d3f4a",
|
||||||
"blue": "#35384a"
|
"red": "#4a3d3f",
|
||||||
},
|
"green": "#3e4a3d",
|
||||||
"chunkOverview": {
|
"blue": "#35384a"
|
||||||
"empty": "#444856",
|
},
|
||||||
"filled": "#646b7d"
|
"chunkOverview": {
|
||||||
},
|
"empty": "#444856",
|
||||||
|
"filled": "#646b7d"
|
||||||
"wires": {
|
},
|
||||||
"overlayColor": "rgba(97, 161, 152, 0.75)",
|
|
||||||
"previewColor": "rgb(97, 161, 152, 0.5)",
|
"wires": {
|
||||||
"highlightColor": "rgba(0, 0, 255, 0.5)"
|
"overlayColor": "rgba(97, 161, 152, 0.75)",
|
||||||
}
|
"previewColor": "rgb(97, 161, 152, 0.5)",
|
||||||
},
|
"highlightColor": "rgba(0, 0, 255, 0.5)"
|
||||||
|
}
|
||||||
"items": {
|
},
|
||||||
"outline": "#111418",
|
|
||||||
"outlineWidth": 0.75,
|
"items": {
|
||||||
"circleBackground": "rgba(20, 30, 40, 0.3)"
|
"outline": "#111418",
|
||||||
}
|
"outlineWidth": 0.75,
|
||||||
}
|
"circleBackground": "rgba(20, 30, 40, 0.3)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,49 +1,51 @@
|
|||||||
{
|
{
|
||||||
"uiStyle": "light",
|
"uiStyle": "light",
|
||||||
"map": {
|
"map": {
|
||||||
"background": "#fff",
|
"background": "#fff",
|
||||||
"grid": "#fafafa",
|
"grid": "#fafafa",
|
||||||
"gridLineWidth": 1,
|
"gridLineWidth": 1,
|
||||||
|
|
||||||
"selectionOverlay": "rgba(74, 163, 223, 0.7)",
|
"selectionOverlay": "rgba(74, 163, 223, 0.7)",
|
||||||
"selectionOutline": "rgba(74, 163, 223, 0.5)",
|
"selectionOutline": "rgba(74, 163, 223, 0.5)",
|
||||||
"selectionBackground": "rgba(74, 163, 223, 0.2)",
|
"selectionBackground": "rgba(74, 163, 223, 0.2)",
|
||||||
|
|
||||||
"directionLock": {
|
"chunkBorders": "rgba(0, 30, 50, 0.03)",
|
||||||
"regular": {
|
|
||||||
"color": "rgb(74, 237, 134)",
|
"directionLock": {
|
||||||
"background": "rgba(74, 237, 134, 0.2)"
|
"regular": {
|
||||||
},
|
"color": "rgb(74, 237, 134)",
|
||||||
"wires": {
|
"background": "rgba(74, 237, 134, 0.2)"
|
||||||
"color": "rgb(209, 107, 203)",
|
},
|
||||||
"background": "rgba(209, 107, 203, 0.2)"
|
"wires": {
|
||||||
}
|
"color": "rgb(209, 107, 203)",
|
||||||
},
|
"background": "rgba(209, 107, 203, 0.2)"
|
||||||
|
}
|
||||||
"colorBlindPickerTile": "rgba(50, 50, 50, 0.4)",
|
},
|
||||||
|
|
||||||
"resources": {
|
"colorBlindPickerTile": "rgba(50, 50, 50, 0.4)",
|
||||||
"shape": "#eaebec",
|
|
||||||
"red": "#ffbfc1",
|
"resources": {
|
||||||
"green": "#cbffc4",
|
"shape": "#eaebec",
|
||||||
"blue": "#bfdaff"
|
"red": "#ffbfc1",
|
||||||
},
|
"green": "#cbffc4",
|
||||||
|
"blue": "#bfdaff"
|
||||||
"chunkOverview": {
|
},
|
||||||
"empty": "#a6afbb",
|
|
||||||
"filled": "#c5ccd6"
|
"chunkOverview": {
|
||||||
},
|
"empty": "#a6afbb",
|
||||||
|
"filled": "#c5ccd6"
|
||||||
"wires": {
|
},
|
||||||
"overlayColor": "rgba(97, 161, 152, 0.75)",
|
|
||||||
"previewColor": "rgb(97, 161, 152, 0.4)",
|
"wires": {
|
||||||
"highlightColor": "rgba(72, 137, 255, 0.8)"
|
"overlayColor": "rgba(97, 161, 152, 0.75)",
|
||||||
}
|
"previewColor": "rgb(97, 161, 152, 0.4)",
|
||||||
},
|
"highlightColor": "rgba(72, 137, 255, 0.8)"
|
||||||
|
}
|
||||||
"items": {
|
},
|
||||||
"outline": "#55575a",
|
|
||||||
"outlineWidth": 0.75,
|
"items": {
|
||||||
"circleBackground": "rgba(40, 50, 65, 0.1)"
|
"outline": "#55575a",
|
||||||
}
|
"outlineWidth": 0.75,
|
||||||
}
|
"circleBackground": "rgba(40, 50, 65, 0.1)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -261,6 +261,7 @@ export const allApplicationSettings = [
|
|||||||
new BoolSetting("compactBuildingInfo", enumCategories.userInterface, (app, value) => {}),
|
new BoolSetting("compactBuildingInfo", enumCategories.userInterface, (app, value) => {}),
|
||||||
new BoolSetting("disableCutDeleteWarnings", enumCategories.advanced, (app, value) => {}),
|
new BoolSetting("disableCutDeleteWarnings", enumCategories.advanced, (app, value) => {}),
|
||||||
new BoolSetting("rotationByBuilding", enumCategories.advanced, (app, value) => {}),
|
new BoolSetting("rotationByBuilding", enumCategories.advanced, (app, value) => {}),
|
||||||
|
new BoolSetting("displayChunkBorders", enumCategories.advanced, (app, value) => {}),
|
||||||
|
|
||||||
new EnumSetting("refreshRate", {
|
new EnumSetting("refreshRate", {
|
||||||
options: refreshRateOptions,
|
options: refreshRateOptions,
|
||||||
@ -303,6 +304,7 @@ class SettingsStorage {
|
|||||||
this.disableCutDeleteWarnings = false;
|
this.disableCutDeleteWarnings = false;
|
||||||
this.rotationByBuilding = true;
|
this.rotationByBuilding = true;
|
||||||
this.clearCursorOnDeleteWhilePlacing = true;
|
this.clearCursorOnDeleteWhilePlacing = true;
|
||||||
|
this.displayChunkBorders = false;
|
||||||
|
|
||||||
this.enableColorBlindHelper = false;
|
this.enableColorBlindHelper = false;
|
||||||
|
|
||||||
@ -509,7 +511,7 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCurrentVersion() {
|
getCurrentVersion() {
|
||||||
return 22;
|
return 23;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param {{settings: SettingsStorage, version: number}} data */
|
/** @param {{settings: SettingsStorage, version: number}} data */
|
||||||
@ -607,6 +609,11 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
data.version = 22;
|
data.version = 22;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.version < 23) {
|
||||||
|
data.settings.displayChunkBorders = false;
|
||||||
|
data.version = 23;
|
||||||
|
}
|
||||||
|
|
||||||
return ExplainedResult.good();
|
return ExplainedResult.good();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -571,7 +571,7 @@ buildings:
|
|||||||
|
|
||||||
lever:
|
lever:
|
||||||
default:
|
default:
|
||||||
name: &lever Button
|
name: &lever Switch
|
||||||
description: Can be toggled to emit 1 / 0
|
description: Can be toggled to emit 1 / 0
|
||||||
|
|
||||||
logic_gate:
|
logic_gate:
|
||||||
@ -870,6 +870,11 @@ settings:
|
|||||||
description: >-
|
description: >-
|
||||||
Uses low quality textures to save performance. This will make the game look very ugly!
|
Uses low quality textures to save performance. This will make the game look very ugly!
|
||||||
|
|
||||||
|
displayChunkBorders:
|
||||||
|
title: Display Chunk Borders
|
||||||
|
description: >-
|
||||||
|
The game is divided into chunks of 16x16 tiles, if this setting is enabled the borders of each chunk are displayed.
|
||||||
|
|
||||||
keybindings:
|
keybindings:
|
||||||
title: Keybindings
|
title: Keybindings
|
||||||
hint: >-
|
hint: >-
|
||||||
|
Loading…
Reference in New Issue
Block a user