Base
This commit is contained in:
1 parent
80cb726501
commit
93c7815d96
12 files changed
+43101
-30
No files matched your search
@@ -0,0 +1,11 @@
|
||||
<script type="text/html" id="TFDi_MD11_efb">
|
||||
<div id="MSFS_REACT_MOUNT">
|
||||
<h1>If you're seeing this, instrument didn't load.</h1>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.css" />
|
||||
<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/index.css" />
|
||||
<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js" import-async="false"></script>
|
||||
+43065
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tfdidesign-md11-load-manager",
|
||||
"version": "0.1.22",
|
||||
"version": "0.1.28",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
|
||||
@@ -14,7 +14,9 @@ import svgs from 'svg-slim';
|
||||
|
||||
const { NODE_ENV: targetEnv = 'development' } = process.env;
|
||||
const outDirBase = '../html_ui';
|
||||
const panelDirBase = `${outDirBase}/InGamePanels/tfdidesign-md11-load-manager-panel`;
|
||||
const panelDirBaseNorm = `${outDirBase}/InGamePanels/tfdidesign-md11-load-manager-panel`;
|
||||
const panelDirBaseSplit = `${outDirBase}/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb`;
|
||||
const panelDirBase = process.env.SPLIT ? panelDirBaseSplit : panelDirBaseNorm;
|
||||
|
||||
function svgSlim(code, id) {
|
||||
if (!id.endsWith('.svg')) return code;
|
||||
|
||||
@@ -9,11 +9,7 @@ import {
|
||||
} from './constants';
|
||||
import { WASMDataF, WASMDataPax } from './types/WASMData';
|
||||
|
||||
interface IAppProps {
|
||||
commBus: ViewListener.ViewListener;
|
||||
}
|
||||
|
||||
const App: FC<IAppProps> = ({ commBus }) => {
|
||||
const App: FC = () => {
|
||||
const [SBUsername, setSBUsername] = useState<string>();
|
||||
const [WASMData, setWASMData] = useState<WASMDataPax | WASMDataF>();
|
||||
const [isReady, setIsReady] = useState(false);
|
||||
@@ -29,6 +25,8 @@ const App: FC<IAppProps> = ({ commBus }) => {
|
||||
useEffect(() => {
|
||||
console.log('Initializing CommBus');
|
||||
|
||||
const commBus = RegisterViewListener('JS_LISTENER_COMM_BUS');
|
||||
|
||||
commBus.on(TFDI_SIMBRIEF_USERNAME_EVENT, usernameCallback);
|
||||
commBus.on(COMM_BUS_LIVE_DATA_EVENT, wasmCallback);
|
||||
|
||||
@@ -39,6 +37,8 @@ const App: FC<IAppProps> = ({ commBus }) => {
|
||||
return () => {
|
||||
commBus.off(TFDI_SIMBRIEF_USERNAME_EVENT, usernameCallback);
|
||||
commBus.off(COMM_BUS_LIVE_DATA_EVENT, wasmCallback);
|
||||
|
||||
commBus.unregister();
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FC, useEffect, useState } from 'react';
|
||||
import { GSX_SERVICE_CALLED, GSX_SERVICE_FINISHED } from '../../constants';
|
||||
import { WASMDataF } from '../../types/WASMData';
|
||||
import { LoadingState, SimBrief } from '../../types/general';
|
||||
import { ImportFlightPlan } from '../../utils/TFDISBImport';
|
||||
import { ImportFlightPlanKH } from '../../utils/TFDISBImport';
|
||||
import { CoherentCallSBEntryF, inRangeOf, loadAircraft, unloadAircraft } from '../../utils/utils';
|
||||
import CGSelect from '../CGSelect/CGSelect';
|
||||
import ActionBar from '../actionbar/ActionBar';
|
||||
@@ -59,7 +59,7 @@ const SBEntryF: FC<SBEntryProps> = ({ WASMData, loadingState, username, setLoadi
|
||||
const handleSB = async () => {
|
||||
setSBInFlight(true);
|
||||
|
||||
const SBResponse = await ImportFlightPlan(
|
||||
const SBResponse = await ImportFlightPlanKH(
|
||||
username,
|
||||
WASMData.limits.maxZFW,
|
||||
WASMData.limits.maxTOW,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FC, useEffect, useState } from 'react';
|
||||
import { GSX_SERVICE_CALLED, GSX_SERVICE_FINISHED } from '../../constants';
|
||||
import { WASMDataPax } from '../../types/WASMData';
|
||||
import { LoadingState, SimBrief } from '../../types/general';
|
||||
import { ImportFlightPlan } from '../../utils/TFDISBImport';
|
||||
import { ImportFlightPlanKH } from '../../utils/TFDISBImport';
|
||||
import { CoherentCallSBEntryPax, inRangeOf, loadAircraft, unloadAircraft } from '../../utils/utils';
|
||||
import CGSelect from '../CGSelect/CGSelect';
|
||||
import ActionBar from '../actionbar/ActionBar';
|
||||
@@ -59,7 +59,7 @@ const SBEntryPax: FC<SBEntryProps> = ({ WASMData, loadingState, username, setLoa
|
||||
const handleSB = async () => {
|
||||
setSBInFlight(true);
|
||||
|
||||
const SBResponse = await ImportFlightPlan(
|
||||
const SBResponse = await ImportFlightPlanKH(
|
||||
username,
|
||||
WASMData.limits.maxZFW,
|
||||
WASMData.limits.maxTOW,
|
||||
|
||||
@@ -3,8 +3,6 @@ import { createRoot } from 'react-dom/client';
|
||||
import App from './App';
|
||||
|
||||
class TFDiDesignMD11LoadManagerPanel extends TemplateElement {
|
||||
private commBus: ViewListener.ViewListener | undefined;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
@@ -12,20 +10,16 @@ class TFDiDesignMD11LoadManagerPanel extends TemplateElement {
|
||||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
this.commBus = RegisterViewListener('JS_LISTENER_COMM_BUS');
|
||||
|
||||
const container = document.getElementById('react');
|
||||
if (container) {
|
||||
console.log('Starting React');
|
||||
const root = createRoot(container);
|
||||
root.render(createElement(App, { commBus: this.commBus }));
|
||||
root.render(createElement(App));
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback();
|
||||
|
||||
this.commBus?.unregister();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const getSimBriefFlightPlan = async (simBriefUsername: string) => {
|
||||
const getSimBriefFlightPlanKH = async (simBriefUsername: string) => {
|
||||
const flightPlanURL = `https://www.simbrief.com/api/xml.fetcher.php?username=${simBriefUsername}&json=1`;
|
||||
let response: Response;
|
||||
let success = false;
|
||||
@@ -15,14 +15,14 @@ const getSimBriefFlightPlan = async (simBriefUsername: string) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const ImportFlightPlan = async (
|
||||
export const ImportFlightPlanKH = async (
|
||||
username: string,
|
||||
maxZFW: number,
|
||||
maxTOW: number,
|
||||
maxFuel: number,
|
||||
isImperial: boolean
|
||||
) => {
|
||||
const flightPlan = await getSimBriefFlightPlan(username);
|
||||
const flightPlan = await getSimBriefFlightPlanKH(username);
|
||||
if (!flightPlan.success) {
|
||||
return {
|
||||
type: 'error',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
|
||||
/* Language and Environment */
|
||||
"target": "es6",
|
||||
"target": "es2017",
|
||||
/* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
"lib": ["es2017", "dom"],
|
||||
/* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
@@ -29,7 +29,7 @@
|
||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||
|
||||
/* Modules */
|
||||
"module": "es6",
|
||||
"module": "es2015",
|
||||
/* Specify what module code is generated. */
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
"moduleResolution": "node",
|
||||
@@ -65,7 +65,7 @@
|
||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||
"outDir": "../html_ui/InGamePanels/tfdidesign-md11-load-manager-panel",
|
||||
// "outDir": "../html_ui/InGamePanels/tfdidesign-md11-load-manager-panel",
|
||||
/* Specify an output folder for all emitted files. */
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"fileNames":["./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.dom.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/common.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/pages/vcockpit/instruments/shared/baseinstrument.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/datastorage.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/buttons.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/services/toolbarpanels.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/simvar.d.ts","./index.d.ts","./__generated__/src/app.module.scss.d.ts","./__generated__/src/components/profile/profile.module.scss.d.ts","./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts","./node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/global.d.ts","./node_modules/.pnpm/csstype@3.1.3/node_modules/csstype/index.d.ts","./node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts","./node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/jsx-runtime.d.ts","./src/constants.ts","./src/types/general.ts","./src/types/wasmdata.ts","./src/utils/utils.ts","./src/components/togglecomponent/togglecomponent.tsx","./src/components/options/optionsf.tsx","./src/components/profile/profile.tsx","./src/utils/tfdisbimport.ts","./src/components/cgselect/cgselect.tsx","./src/components/actionbar/actionbar.tsx","./src/components/sbentry/sbentryf.tsx","./src/components/stationentry/stationentryf.tsx","./src/components/tabbar/tabbar.tsx","./src/components/zfwentry/zfwentryf.tsx","./src/components/freighter/freighter.tsx","./src/components/options/optionspax.tsx","./src/components/sbentry/sbentrypax.tsx","./src/components/stationentry/stationentrypax.tsx","./src/components/zfwentry/zfwentrypax.tsx","./src/components/pax/pax.tsx","./src/app.tsx","./node_modules/.pnpm/@types+react-dom@19.1.6_@types+react@19.1.6/node_modules/@types/react-dom/client.d.ts","./src/index.ts","./node_modules/.pnpm/@types+react-dom@19.1.6_@types+react@19.1.6/node_modules/@types/react-dom/index.d.ts","./node_modules/.pnpm/@types+uuid@10.0.0/node_modules/@types/uuid/index.d.ts"],"fileIdsList":[[26,27,28,29,30,31],[38],[36,37],[35,38,39,40,42,54,59],[35,38,39,41],[35,38,39],[35,38,39,40,41,42,45,46,50,51,52,53],[35,38,39,40,41,42,43,44],[35,38,39,40,41,42,46,52,55,56,57,58],[34,35,38,39],[35,38,39,40,41,42,43,47,48,49],[35,38,39,40,41,42,43,49],[35,39],[35,38,39,40,41,42,43,48,49],[35,38,39,60,61],[35,39,40,41]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobLine truncated
|
||||
Reference in new issue
Block a user