Plugin (not) work.

This commit is contained in:
PeekabooSteam 2023-09-12 19:04:52 +01:00
parent 803f9a7fd6
commit 6aaffe20d9
6 changed files with 29 additions and 15 deletions

View File

@ -19,6 +19,10 @@ app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
if ( !fs.existsSync( "./src/_importedplugins" ) ) {
fs.mkdirSync( "./src/_importedplugins" );
}
app.use('/', indexRouter);
app.use('/api/atc', atcRouter);
app.use('/api/airbases', airbasesRouter);

View File

@ -38,6 +38,7 @@
"leaflet-path-drag": "*",
"leaflet.nauticscale": "^1.1.0",
"nodemon": "^2.0.20",
"requirejs": "^2.3.6",
"sortablejs": "^1.15.0",
"tsify": "^5.0.4",
"typescript": "^4.9.4",
@ -6776,6 +6777,19 @@
"node": ">=0.10.0"
}
},
"node_modules/requirejs": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
"integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==",
"dev": true,
"bin": {
"r_js": "bin/r.js",
"r.js": "bin/r.js"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/resolve": {
"version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
@ -13000,6 +13014,12 @@
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"dev": true
},
"requirejs": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
"integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==",
"dev": true
},
"resolve": {
"version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",

View File

@ -40,6 +40,7 @@
"leaflet-path-drag": "*",
"leaflet.nauticscale": "^1.1.0",
"nodemon": "^2.0.20",
"requirejs": "^2.3.6",
"sortablejs": "^1.15.0",
"tsify": "^5.0.4",
"typescript": "^4.9.4",

View File

@ -11,7 +11,6 @@ import { FeatureSwitches } from "./features/featureswitches";
import { LogPanel } from "./panels/logpanel";
import { getConfig, getPaused, setAddress, setCredentials, setPaused, startUpdate, toggleDemoEnabled } from "./server/server";
import { UnitDataTable } from "./atc/unitdatatable";
import { keyEventWasInInput } from "./other/utils";
import { Popup } from "./popups/popup";
import { Dropdown } from "./controls/dropdown";
import { HotgroupPanel } from "./panels/hotgrouppanel";
@ -21,9 +20,9 @@ import { ServerStatusPanel } from "./panels/serverstatuspanel";
import { WeaponsManager } from "./weapon/weaponsmanager";
import { IndexApp } from "./indexapp";
import { ShortcutKeyboard } from "./shortcut/shortcut";
import { ShortcutManager } from "./shortcut/shortcutmanager";
import { OlympusApp } from "./olympusapp";
var map: Map;
var unitsManager: UnitsManager;
@ -118,6 +117,8 @@ function setup() {
/* Setup event handlers */
setupEvents( indexApp );
indexApp.start();
}
function readConfig(config: any) {

View File

@ -1,5 +1,4 @@
import { FeatureSwitches } from "./features/featureswitches";
import { Map } from "./map/map";
import { MissionHandler } from "./mission/missionhandler";
import { IOlympusApp, OlympusApp } from "./olympusapp";
import { ConnectionStatusPanel } from "./panels/connectionstatuspanel";
@ -10,8 +9,6 @@ import { Panel } from "./panels/panel";
import { ServerStatusPanel } from "./panels/serverstatuspanel";
import { UnitControlPanel } from "./panels/unitcontrolpanel";
import { UnitInfoPanel } from "./panels/unitinfopanel";
import { PluginManager } from "./plugin/pluginmanager";
import { PluginHelloWorld } from "./plugins/helloworld/pluginhelloworld";
import { Popup } from "./popups/popup";
import { UnitsManager } from "./unit/unitsmanager";
@ -35,8 +32,6 @@ export interface IIndexAppPanels {
export class IndexApp extends OlympusApp {
#pluginManager!: PluginManager;
constructor( config:IIndexApp ) {
super( config );
@ -58,14 +53,6 @@ export class IndexApp extends OlympusApp {
Object.values( this.getPanelsManager().getAll() ).forEach( ( panel:Panel ) => {
panel.setOlympusApp( this );
});
// Plugins
this.#pluginManager = new PluginManager( this );
// Manual loading for now
this.getMap().whenReady( () => {
this.#pluginManager.add( "helloWorld", new PluginHelloWorld( this ) );
});
}

View File

@ -6,6 +6,7 @@ import { PanelsManager } from "./panels/panelsmanager";
import { ShortcutManager } from "./shortcut/shortcutmanager";
import { UnitsManager } from "./unit/unitsmanager";
export interface IOlympusApp {
featureSwitches: FeatureSwitches;
map: Map,