Add setting to always show shape tooltip

pull/1286/head
tobspr 3 years ago
parent ae6c5b151e
commit f61f25934f

@ -3,7 +3,7 @@ export const CHANGELOG = [
version: "1.4.3",
date: "28.08.2021",
entries: [
"You can now hold 'ALT' while hovering a building to see its output! (Thanks to Sense101)",
"You can now hold 'ALT' while hovering a building to see its output! (Thanks to Sense101) (PS: There is now a setting to have it always on!)",
"The map overview should now be much more performant! As a consequence, you can now zoom out farther! (Thanks to PFedak)",
"Puzzle DLC: There is now a 'next puzzle' button!",
"Puzzle DLC: There is now a search function!",

@ -29,9 +29,13 @@ export class HUDShapeTooltip extends BaseHUDPart {
isActive() {
const hudParts = this.root.hud.parts;
const active =
this.root.app.settings.getSetting("shapeTooltipAlwaysOn") ||
this.root.keyMapper.getBinding(KEYMAPPINGS.ingame.showShapeTooltip).pressed;
// return false if any other placer is active
return (
this.root.keyMapper.getBinding(KEYMAPPINGS.ingame.showShapeTooltip).pressed &&
active &&
!this.isPlacingBuilding &&
!hudParts.massSelector.currentSelectionStartWorld &&
hudParts.massSelector.selectedUids.size < 1 &&

@ -257,6 +257,7 @@ export const allApplicationSettings = [
}),
new BoolSetting("enableMousePan", enumCategories.advanced, (app, value) => {}),
new BoolSetting("shapeTooltipAlwaysOn", enumCategories.advanced, (app, value) => {}),
new BoolSetting("alwaysMultiplace", enumCategories.advanced, (app, value) => {}),
new BoolSetting("zoomToCursor", enumCategories.advanced, (app, value) => {}),
new BoolSetting("clearCursorOnDeleteWhilePlacing", enumCategories.advanced, (app, value) => {}),
@ -307,6 +308,7 @@ class SettingsStorage {
this.autosaveInterval = "two_minutes";
this.alwaysMultiplace = false;
this.shapeTooltipAlwaysOn = false;
this.offerHints = true;
this.enableTunnelSmartplace = true;
this.vignette = true;
@ -536,7 +538,7 @@ export class ApplicationSettings extends ReadWriteProxy {
}
getCurrentVersion() {
return 30;
return 31;
}
/** @param {{settings: SettingsStorage, version: number}} data */
@ -683,6 +685,11 @@ export class ApplicationSettings extends ReadWriteProxy {
data.version = 30;
}
if (data.version < 31) {
data.settings.shapeTooltipAlwaysOn = false;
data.version = 31;
}
return ExplainedResult.good();
}
}

@ -1286,6 +1286,11 @@ settings:
description: >-
Controls the size of the shapes on the map overview (when zooming out).
shapeTooltipAlwaysOn:
title: Shape Tooltip - Show Always
description: >-
Whether to always show the shape tooltip when hovering buildings, instead of having to hold 'ALT'.
keybindings:
title: Keybindings
hint: >-

Loading…
Cancel
Save