Files
fulpstation/tgui-next/packages/tgui/routes.js
Aleksej Komarov 2e725d93d5 tgui-next: Low level stuff (#47122)
* tgui-next: Low level stuff

- More robust cache reloader, support WSL pathing
- Add a way to only reload the cache once without launching a full dev server

Throw a warning when using lowecase onclick on Button

Improve logging, add loader to inline svgs

- Logger can now handle circular references;
- Logger will not truncate long objects.

Typo, rebase, rebuild

Support --debug flag on dev server, improve logging

Lots of cosmetic and other changes

- Add support for Babel macros
- Implement a "multiline" macro for creating long multiline strings
- Rename interfaces to better match the component naming convention
- LabeledList.Divider size is 2 by default
- Sort routes by name
- Remove package-lock.json files on --clean
- Catch weird JSON parsing errors for better debuggability

Ignore sourcemaps

Clarify what that multiline function is

Try this travis fix

Bump NodeJS version to 12.x

Add a stub to make multiline usable as a template tag

- Just in case we will need to remove macros and have it still working.

Document debug flag in README

Fix LabeledList.Divider, reduce expensive SCSS calls

Separate dev and production builds so that they never overwrite each other

Run linter as a part of the production build

Rebuild tgui

Add react eslint plugin, massive jsx cleanup

* Mint janitor

* Optimization of tgui initialization path

- Call browse with titlebar and resize flags disabled

* Fix backend reducer

* Rebuild, fix linter errors
2019-10-20 16:49:13 +02:00

137 lines
3.5 KiB
JavaScript

import { Acclimator } from './interfaces/Acclimator';
import { AiAirlock } from './interfaces/AiAirlock';
import { AirAlarm } from './interfaces/AirAlarm';
import { AirlockElectronics } from './interfaces/AirlockElectronics';
import { Apc } from './interfaces/Apc';
import { AtmosAlertConsole } from './interfaces/AtmosAlertConsole';
import { AtmosControlConsole } from './interfaces/AtmosControlConsole';
import { AtmosFilter } from './interfaces/AtmosFilter';
import { AtmosMixer } from './interfaces/AtmosMixer';
import { AtmosPump } from './interfaces/AtmosPump';
import { BluespaceArtillery } from './interfaces/BluespaceArtillery';
import { BorgPanel } from './interfaces/BorgPanel';
import { BrigTimer } from './interfaces/BrigTimer';
import { Canister } from './interfaces/Canister';
import { Cargo } from './interfaces/Cargo';
import { CellularEmporium } from './interfaces/CellularEmporium';
import { CentcomPodLauncher } from './interfaces/CentcomPodLauncher';
import { ChemDispenser } from './interfaces/ChemDispenser';
import { Crayon } from './interfaces/Crayon';
import { DisposalUnit } from './interfaces/DisposalUnit';
import { KitchenSink } from './interfaces/KitchenSink';
import { Mint } from './interfaces/Mint';
import { ThermoMachine } from './interfaces/ThermoMachine';
import { VaultController } from './interfaces/VaultController';
import { Wires } from './interfaces/Wires';
const ROUTES = {
acclimator: {
component: () => Acclimator,
scrollable: false,
},
ai_airlock: {
component: () => AiAirlock,
scrollable: false,
},
airalarm: {
component: () => AirAlarm,
scrollable: true,
},
airlock_electronics: {
component: () => AirlockElectronics,
scrollable: false,
},
apc: {
component: () => Apc,
scrollable: false,
},
atmos_alert: {
component: () => AtmosAlertConsole,
scrollable: true,
},
atmos_control: {
component: () => AtmosControlConsole,
scrollable: true,
},
atmos_filter: {
component: () => AtmosFilter,
scrollable: false,
},
atmos_mixer: {
component: () => AtmosMixer,
scrollable: false,
},
atmos_pump: {
component: () => AtmosPump,
scrollable: false,
},
borgopanel: {
component: () => BorgPanel,
scrollable: true,
},
brig_timer: {
component: () => BrigTimer,
scrollable: false,
},
bsa: {
component: () => BluespaceArtillery,
scrollable: false,
},
canister: {
component: () => Canister,
scrollable: false,
},
cargo: {
component: () => Cargo,
scrollable: true,
},
cellular_emporium: {
component: () => CellularEmporium,
scrollable: true,
},
centcom_podlauncher: {
component: () => CentcomPodLauncher,
scrollable: false,
},
chem_dispenser: {
component: () => ChemDispenser,
scrollable: true,
},
crayon: {
component: () => Crayon,
scrollable: true,
},
disposal_unit: {
component: () => DisposalUnit,
scrollable: false,
},
mint: {
component: () => Mint,
scrollable: false,
},
thermomachine: {
component: () => ThermoMachine,
scrollable: false,
},
vault_controller: {
component: () => VaultController,
scrollable: false,
},
wires: {
component: () => Wires,
scrollable: false,
},
};
export const getRoute = state => {
// Show a kitchen sink
if (state.showKitchenSink) {
return {
component: () => KitchenSink,
scrollable: true,
};
}
// Refer to the routing table
return ROUTES[state.config && state.config.interface];
};