mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Modified database editor
This commit is contained in:
@@ -44,6 +44,8 @@ export class AirUnitEditor extends UnitEditor {
|
||||
addDropdownInput(this.contentDiv2, "Era", blueprint.era, ["WW2", "Early Cold War", "Mid Cold War", "Late Cold War", "Modern"]);
|
||||
addStringInput(this.contentDiv2, "Filename", blueprint.filename ?? "", "text", (value: string) => { blueprint.filename = value; });
|
||||
addStringInput(this.contentDiv2, "Cost", String(blueprint.cost) ?? "", "number", (value: string) => { blueprint.cost = parseFloat(value); });
|
||||
addStringInput(this.contentDiv2, "Rufels from", String(blueprint.refuelsFrom) ?? "", "text", (value: string) => { blueprint.refuelsFrom = value; });
|
||||
addStringInput(this.contentDiv2, "Refueling type", String(blueprint.refuelingType) ?? "", "text", (value: string) => { blueprint.refuelingType = value; });
|
||||
|
||||
/* Add a scrollable list of loadouts that the user can edit */
|
||||
var title = document.createElement("label");
|
||||
|
||||
@@ -157,7 +157,7 @@ export class DatabaseManagerPlugin implements OlympusPlugin {
|
||||
*/
|
||||
initialize(app: any) {
|
||||
this.#app = app;
|
||||
|
||||
|
||||
/* Load the databases and initialize the editors */
|
||||
this.#loadDatabases();
|
||||
|
||||
@@ -173,9 +173,10 @@ export class DatabaseManagerPlugin implements OlympusPlugin {
|
||||
toolbar.getMainDropdown().setOptionsElements(arr);
|
||||
mainButton.onclick = () => {
|
||||
toolbar.getMainDropdown().close();
|
||||
this.toggle();
|
||||
if (this.#app?.getMissionManager().getCommandModeOptions().commandMode === "Game master")
|
||||
this.toggle();
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,12 @@ export class GroundUnitEditor extends UnitEditor {
|
||||
addDropdownInput(this.contentDiv2, "Era", blueprint.era, ["WW2", "Early Cold War", "Mid Cold War", "Late Cold War", "Modern"]);
|
||||
//addStringInput(this.contentDiv2, "Filename", blueprint.filename?? "", "text", (value: string) => {blueprint.filename = value; });
|
||||
addStringInput(this.contentDiv2, "Cost", String(blueprint.cost)?? "", "number", (value: string) => {blueprint.cost = parseFloat(value); });
|
||||
addStringInput(this.contentDiv2, "Acquisition range [NM]", String(blueprint.acquisitionRange)?? "", "number", (value: string) => {blueprint.acquisitionRange = parseFloat(value); });
|
||||
addStringInput(this.contentDiv2, "Engagement range [NM]", String(blueprint.engagementRange)?? "", "number", (value: string) => {blueprint.engagementRange = parseFloat(value); });
|
||||
addStringInput(this.contentDiv2, "Barrel height [m]", String(blueprint.barrelHeight)?? "", "number", (value: string) => {blueprint.barrelHeight = parseFloat(value); });
|
||||
addStringInput(this.contentDiv2, "Muzzle velocity [m/s]", String(blueprint.muzzleVelocity)?? "", "number", (value: string) => {blueprint.muzzleVelocity = parseFloat(value); });
|
||||
addStringInput(this.contentDiv2, "Aim time [s]", String(blueprint.aimTime)?? "", "number", (value: string) => {blueprint.aimTime = parseFloat(value); });
|
||||
addStringInput(this.contentDiv2, "Burst quantity", String(blueprint.shotsToFire)?? "", "number", (value: string) => {blueprint.shotsToFire = Math.round(parseFloat(value)); });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,15 +9,16 @@
|
||||
z-index: 9999999;
|
||||
}
|
||||
|
||||
@media (orientation: landscape) {
|
||||
@media (min-width: 1200px) {
|
||||
.dm-container {
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
|
||||
@media (orientation: portrait) {
|
||||
@media (max-width: 1200px) {
|
||||
.dm-container {
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,14 +57,6 @@
|
||||
border-radius: 0px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.dm-container>div:nth-child(2) {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.dm-container>div:nth-child(3) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.dm-content-container {
|
||||
position: relative;
|
||||
margin: 10px;
|
||||
@@ -72,19 +65,40 @@
|
||||
row-gap: 5px;
|
||||
}
|
||||
|
||||
@media (orientation: landscape) {
|
||||
@media (min-width: 1200px) {
|
||||
.dm-content-container {
|
||||
height: calc(100% - 20px);
|
||||
min-width: 200px;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.dm-content-container:nth-of-type(1) {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.dm-content-container:nth-of-type(2) {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.dm-content-container:nth-of-type(3) {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@media (orientation: portrait) {
|
||||
@media (max-width: 1200px) {
|
||||
.dm-content-container {
|
||||
width: 100% - calc(20px);
|
||||
width: calc(100% - 20px);
|
||||
}
|
||||
|
||||
.dm-content-container:nth-of-type(1) {
|
||||
height: 30%;
|
||||
}
|
||||
|
||||
.dm-content-container:nth-of-type(2) {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.dm-content-container:nth-of-type(3) {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.dm-content-container>label {
|
||||
@@ -95,7 +109,7 @@
|
||||
.dm-scroll-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
overflow-y: scroll;
|
||||
max-height: 100%;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
@@ -113,7 +127,6 @@
|
||||
height: 100%;
|
||||
width: calc(100% - 25px);
|
||||
padding: 2px;
|
||||
text-wrap: wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
@@ -141,6 +154,15 @@
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.dm-content-container label {
|
||||
width: 100%;
|
||||
}
|
||||
.input-row {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.input-row>dt {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user