mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Fixed UCP toggles, added copy-paste control for plugins
This commit is contained in:
@@ -148,7 +148,7 @@ const navyuniteditor_1 = require("./navyuniteditor");
|
||||
class DatabaseManagerPlugin {
|
||||
constructor() {
|
||||
_DatabaseManagerPlugin_instances.add(this);
|
||||
_DatabaseManagerPlugin_app.set(this, null);
|
||||
_DatabaseManagerPlugin_app.set(this, void 0);
|
||||
_DatabaseManagerPlugin_element.set(this, void 0);
|
||||
_DatabaseManagerPlugin_mainContentContainer.set(this, void 0);
|
||||
_DatabaseManagerPlugin_contentDiv1.set(this, void 0);
|
||||
@@ -263,6 +263,14 @@ class DatabaseManagerPlugin {
|
||||
initialize(app) {
|
||||
var _a;
|
||||
__classPrivateFieldSet(this, _DatabaseManagerPlugin_app, app, "f");
|
||||
const contextManager = __classPrivateFieldGet(this, _DatabaseManagerPlugin_app, "f").getContextManager();
|
||||
contextManager.add("databaseManager", {
|
||||
"allowUnitCopying": false,
|
||||
"allowUnitPasting": false,
|
||||
"useSpawnMenu": false,
|
||||
"useUnitControlPanel": false,
|
||||
"useUnitInfoPanel": false
|
||||
});
|
||||
/* Load the databases and initialize the editors */
|
||||
__classPrivateFieldGet(this, _DatabaseManagerPlugin_instances, "m", _DatabaseManagerPlugin_loadDatabases).call(this);
|
||||
/* Add a button to the main Olympus App to allow the users to open the dialog */
|
||||
@@ -299,6 +307,8 @@ class DatabaseManagerPlugin {
|
||||
this.getElement().classList.toggle("hide", !bool);
|
||||
else
|
||||
this.getElement().classList.toggle("hide");
|
||||
if (__classPrivateFieldGet(this, _DatabaseManagerPlugin_app, "f"))
|
||||
__classPrivateFieldGet(this, _DatabaseManagerPlugin_app, "f").getContextManager().setContext(this.getElement().classList.contains("hide") ? "olympus" : "databaseManager");
|
||||
}
|
||||
}
|
||||
exports.DatabaseManagerPlugin = DatabaseManagerPlugin;
|
||||
|
||||
@@ -16,7 +16,7 @@ import { NavyUnitEditor } from "./navyuniteditor";
|
||||
*/
|
||||
|
||||
export class DatabaseManagerPlugin implements OlympusPlugin {
|
||||
#app: OlympusApp | null = null;
|
||||
#app!: OlympusApp;
|
||||
|
||||
#element: HTMLElement;
|
||||
#mainContentContainer: HTMLElement;
|
||||
@@ -157,6 +157,15 @@ export class DatabaseManagerPlugin implements OlympusPlugin {
|
||||
*/
|
||||
initialize(app: any) {
|
||||
this.#app = app;
|
||||
|
||||
const contextManager = this.#app.getContextManager();
|
||||
contextManager.add( "databaseManager", {
|
||||
"allowUnitCopying": false,
|
||||
"allowUnitPasting": false,
|
||||
"useSpawnMenu": false,
|
||||
"useUnitControlPanel": false,
|
||||
"useUnitInfoPanel": false
|
||||
});
|
||||
|
||||
/* Load the databases and initialize the editors */
|
||||
this.#loadDatabases();
|
||||
@@ -197,6 +206,9 @@ export class DatabaseManagerPlugin implements OlympusPlugin {
|
||||
this.getElement().classList.toggle("hide", !bool);
|
||||
else
|
||||
this.getElement().classList.toggle("hide");
|
||||
|
||||
if ( this.#app )
|
||||
this.#app.getContextManager().setContext( this.getElement().classList.contains("hide") ? "olympus" : "databaseManager" );
|
||||
}
|
||||
|
||||
/** Hide all the editors
|
||||
|
||||
Reference in New Issue
Block a user