Add hotkeys, document hotkeys, make 'DefaultGUI' runnable via NodeJS, generate hotkey documentation

This commit is contained in:
Pieter Vander Vennet 2022-12-24 03:44:21 +01:00
parent e2419c19cd
commit 43613e4ece
16 changed files with 328 additions and 89 deletions

View file

@ -13,7 +13,7 @@ import { VariableUiElement } from "../Base/VariableUIElement"
import FeatureInfoBox from "../Popup/FeatureInfoBox"
import CopyrightPanel from "./CopyrightPanel"
import FeaturePipelineState from "../../Logic/State/FeaturePipelineState"
import { FixedUiElement } from "../Base/FixedUiElement"
import Hotkeys from "../Base/Hotkeys"
export default class LeftControls extends Combine {
constructor(
@ -73,7 +73,7 @@ export default class LeftControls extends Combine {
guiState.downloadControlIsOpened.setData(true)
)
const downloadButtonn = new Toggle(
const downloadButton = new Toggle(
toggledDownload,
undefined,
state.featureSwitchEnableExport.map(
@ -94,11 +94,20 @@ export default class LeftControls extends Combine {
const toggledFilter = new MapControlButton(Svg.layers_svg()).onClick(() =>
guiState.filterViewIsOpened.setData(true)
)
state.featureSwitchFilter.addCallbackAndRun((f) => {
Hotkeys.RegisterHotkey(
{ nomod: "B" },
"Opens the Background, layers and filters panel",
() => {
guiState.filterViewIsOpened.setData(!guiState.filterViewIsOpened.data)
}
)
})
const filterButton = new Toggle(toggledFilter, undefined, state.featureSwitchFilter)
const mapSwitch = new Toggle(
new BackgroundMapSwitch(state, state.backgroundLayer),
new BackgroundMapSwitch(state, state.backgroundLayer, { enableHotkeys: true }),
undefined,
state.featureSwitchBackgroundSelection
)
@ -120,7 +129,7 @@ export default class LeftControls extends Combine {
state.featureSwitchWelcomeMessage
)
super([currentViewAction, filterButton, downloadButtonn, copyright, mapSwitch])
super([currentViewAction, filterButton, downloadButton, copyright, mapSwitch])
this.SetClass("flex flex-col")
}