Merge pull request #612 from Pax1601/542-spawn-menu-dropdowns-overlap-menu

Alignment fixed, spelling corrected
This commit is contained in:
Pax1601 2023-11-30 11:12:52 +01:00 committed by GitHub
commit 4bd017e3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 156 additions and 64 deletions

View File

@ -154,6 +154,10 @@ declare module "constants/constants" {
bounds: LatLngBounds;
zoom: number;
};
Normandy: {
bounds: LatLngBounds;
zoom: number;
};
};
export const mapLayers: {
"ArcGIS Satellite": {
@ -204,6 +208,7 @@ declare module "constants/constants" {
export const IADSDensities: {
[key: string]: number;
};
export const GROUND_UNIT_AIR_DEFENCE_REGEX: RegExp;
export const HIDE_GROUP_MEMBERS = "Hide group members when zoomed out";
export const SHOW_UNIT_LABELS = "Show unit labels (L)";
export const SHOW_UNITS_ENGAGEMENT_RINGS = "Show units threat range rings (Q)";
@ -232,33 +237,34 @@ declare module "constants/constants" {
horizontalVelocity = 15,
verticalVelocity = 16,
heading = 17,
isActiveTanker = 18,
isActiveAWACS = 19,
onOff = 20,
followRoads = 21,
fuel = 22,
desiredSpeed = 23,
desiredSpeedType = 24,
desiredAltitude = 25,
desiredAltitudeType = 26,
leaderID = 27,
formationOffset = 28,
targetID = 29,
targetPosition = 30,
ROE = 31,
reactionToThreat = 32,
emissionsCountermeasures = 33,
TACAN = 34,
radio = 35,
generalSettings = 36,
ammo = 37,
contacts = 38,
activePath = 39,
isLeader = 40,
operateAs = 41,
shotsScatter = 42,
shotsIntensity = 43,
health = 44,
track = 18,
isActiveTanker = 19,
isActiveAWACS = 20,
onOff = 21,
followRoads = 22,
fuel = 23,
desiredSpeed = 24,
desiredSpeedType = 25,
desiredAltitude = 26,
desiredAltitudeType = 27,
leaderID = 28,
formationOffset = 29,
targetID = 30,
targetPosition = 31,
ROE = 32,
reactionToThreat = 33,
emissionsCountermeasures = 34,
TACAN = 35,
radio = 36,
generalSettings = 37,
ammo = 38,
contacts = 39,
activePath = 40,
isLeader = 41,
operateAs = 42,
shotsScatter = 43,
shotsIntensity = 44,
health = 45,
endOfData = 255
}
export const MGRS_PRECISION_10KM = 2;
@ -529,6 +535,7 @@ declare module "interfaces" {
}
export interface UnitData {
category: string;
categoryDisplayName: string;
ID: number;
alive: boolean;
human: boolean;
@ -546,6 +553,7 @@ declare module "interfaces" {
horizontalVelocity: number;
verticalVelocity: number;
heading: number;
track: number;
isActiveTanker: boolean;
isActiveAWACS: boolean;
onOff: boolean;
@ -818,7 +826,7 @@ declare module "other/utils" {
export function enumToCoalition(coalitionID: number): "" | "blue" | "red" | "neutral";
export function coalitionToEnum(coalition: string): 0 | 1 | 2;
export function convertDateAndTimeToDate(dateAndTime: DateAndTime): Date;
export function createCheckboxOption(value: string, text: string, checked?: boolean, callback?: CallableFunction): HTMLElement;
export function createCheckboxOption(value: string, text: string, checked?: boolean, callback?: CallableFunction, options?: any): HTMLElement;
export function getCheckboxOptions(dropdown: Dropdown): {
[key: string]: boolean;
};
@ -1123,6 +1131,7 @@ declare module "unit/unit" {
getHorizontalVelocity(): number;
getVerticalVelocity(): number;
getHeading(): number;
getTrack(): number;
getIsActiveAWACS(): boolean;
getIsActiveTanker(): boolean;
getOnOff(): boolean;
@ -1178,6 +1187,11 @@ declare module "unit/unit" {
* @returns string containing the default marker
*/
abstract getDefaultMarker(): string;
/** Get the category but for display use - for the user. (i.e. has spaces in it)
*
* @returns string
*/
getCategoryLabel(): string;
/********************** Unit data *************************/
/** This function is called by the units manager to update all the data coming from the backend. It reads the binary raw data using a DataExtractor
*
@ -1708,22 +1722,63 @@ declare module "mission/missionmanager" {
export class MissionManager {
#private;
constructor();
/** Update location of bullseyes
*
* @param object <BulleyesData>
*/
updateBullseyes(data: BullseyesData): void;
/** Update airbase information
*
* @param object <AirbasesData>
*/
updateAirbases(data: AirbasesData): void;
/** Update mission information
*
* @param object <MissionData>
*/
updateMission(data: MissionData): void;
/** Get the bullseyes set in this theatre
*
* @returns object
*/
getBullseyes(): {
[name: string]: Bullseye;
};
/** Get the airbases in this theatre
*
* @returns object
*/
getAirbases(): {
[name: string]: Airbase;
};
/** Get the options/settings as set in the command mode
*
* @returns object
*/
getCommandModeOptions(): CommandModeOptions;
/** Get the current date and time of the mission (based on local time)
*
* @returns object
*/
getDateAndTime(): DateAndTime;
/**
* Get the number of seconds left of setup time
* @returns number
*/
getRemainingSetupTime(): number;
/** Get an object with the coalitions in it
*
* @returns object
*/
getCoalitions(): {
red: string[];
blue: string[];
};
/** Get the current theatre (map) name
*
* @returns string
*/
getTheatre(): string;
getAvailableSpawnPoints(): number;
getCommandedCoalition(): "blue" | "red" | "all";
refreshSpawnPoints(): void;
@ -1892,6 +1947,43 @@ declare module "dialog/dialog" {
show(): void;
}
}
declare module "unit/importexport/unitdatafile" {
import { Dialog } from "dialog/dialog";
export abstract class UnitDataFile {
#private;
protected data: any;
protected dialog: Dialog;
constructor();
buildCategoryCoalitionTable(): void;
getData(): any;
}
}
declare module "unit/importexport/unitdatafileexport" {
import { Dialog } from "dialog/dialog";
import { Unit } from "unit/unit";
import { UnitDataFile } from "unit/importexport/unitdatafile";
export class UnitDataFileExport extends UnitDataFile {
#private;
protected data: any;
protected dialog: Dialog;
constructor(elementId: string);
/**
* Show the form to start the export journey
*/
showForm(units: Unit[]): void;
}
}
declare module "unit/importexport/unitdatafileimport" {
import { Dialog } from "dialog/dialog";
import { UnitDataFile } from "unit/importexport/unitdatafile";
export class UnitDataFileImport extends UnitDataFile {
#private;
protected data: any;
protected dialog: Dialog;
constructor(elementId: string);
selectFile(): void;
}
}
declare module "unit/unitsmanager" {
import { LatLng, LatLngBounds } from "leaflet";
import { Unit } from "unit/unit";

View File

@ -241,8 +241,8 @@
}
.unit-label-count-container {
display: flex;
flex-direction: row;
display: grid;
grid-template-columns: 187px 1fr 1fr;
align-items: center;
column-gap: 5px;
}

View File

@ -1554,7 +1554,7 @@ input[type=number]::-webkit-outer-spin-button {
width: 100%;
}
.ol-contexmenu-button {
.ol-context-menu-button {
border: none;
border-radius: 0px;
height: 48px;
@ -1563,23 +1563,23 @@ input[type=number]::-webkit-outer-spin-button {
width: 48px;
}
.ol-contexmenu-button:last-of-type {
.ol-context-menu-button:last-of-type {
border-bottom-right-radius: var(--border-radius-sm);
border-top-right-radius: var(--border-radius-sm);
}
[data-coalition="blue"].ol-contexmenu-button:hover,
[data-coalition="blue"].ol-contexmenu-button.is-open {
[data-coalition="blue"].ol-context-menu-button:hover,
[data-coalition="blue"].ol-context-menu-button.is-open {
background-color: var(--primary-blue)
}
[data-coalition="red"].ol-contexmenu-button:hover,
[data-coalition="red"].ol-contexmenu-button.is-open {
[data-coalition="red"].ol-context-menu-button:hover,
[data-coalition="red"].ol-context-menu-button.is-open {
background-color: var(--primary-red)
}
[data-coalition="neutral"].ol-contexmenu-button:hover,
[data-coalition="neutral"].ol-contexmenu-button.is-open {
[data-coalition="neutral"].ol-context-menu-button:hover,
[data-coalition="neutral"].ol-context-menu-button.is-open {
background-color: var(--primary-neutral)
}

View File

@ -2,14 +2,14 @@
<div id="airbase-active-coalition-label" data-coalition="blue"></div>
<div class="upper-bar ol-panel">
<button data-coalition="blue" id="airbase-aircraft-spawn-button" title="Spawn aircraft" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "aircraft" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/aircraft.svg" inject-svg></button>
data-on-click-params='{ "type": "aircraft" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/aircraft.svg" inject-svg></button>
<button data-coalition="blue" id="airbase-helicopter-spawn-button" title="Spawn helicopter" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "helicopter" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/helicopter.svg" inject-svg></button>
data-on-click-params='{ "type": "helicopter" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/helicopter.svg" inject-svg></button>
</div>
<div id="airbase-aircraft-spawn-menu" class="ol-contexmenu-panel ol-panel hide">
<div id="airbase-aircraft-spawn-menu" class="ol-context-menu-panel ol-panel hide">
<!-- Here the aircraft spawn menu will be shown -->
</div>
<div id="airbase-helicopter-spawn-menu" class="ol-contexmenu-panel ol-panel hide">
<div id="airbase-helicopter-spawn-menu" class="ol-context-menu-panel ol-panel hide">
<!-- Here the helicopter spawn menu will be shown -->
</div>
</div>

View File

@ -3,15 +3,15 @@
<div class="upper-bar ol-panel">
<div id="coalition-area-switch" class="ol-switch ol-coalition-switch"></div>
<button data-coalition="blue" id="iads-button" title="Create Integrated Air Defense System" data-on-click="coalitionAreaContextMenuShow"
data-on-click-params='{ "type": "iads" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/sam.svg" inject-svg></button>
data-on-click-params='{ "type": "iads" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/sam.svg" inject-svg></button>
<!--<button data-coalition="blue" id="cap-button" title="Create Combat Air Patrols" data-on-click="coalitionAreaContextMenuShow"
data-on-click-params='{ "type": "cap" }' class="ol-contexmenu-button"></button>-->
data-on-click-params='{ "type": "cap" }' class="ol-context-menu-button"></button>-->
<button data-coalition="blue" id="coalitionarea-back-button" title="Bring area to back" data-on-click="coalitionAreaBringToBack"
class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/other/back.svg" inject-svg></button>
class="ol-context-menu-button"><img src="/resources/theme/images/buttons/other/back.svg" inject-svg></button>
<button data-coalition="blue" id="coalitionarea-delete-button" title="Delete area" data-on-click="coalitionAreaDelete"
class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/other/delete.svg" inject-svg></button>
class="ol-context-menu-button"><img src="/resources/theme/images/buttons/other/delete.svg" inject-svg></button>
</div>
<div id="iads-menu" class="ol-panel ol-contexmenu-panel hide">
<div id="iads-menu" class="ol-panel ol-context-menu-panel hide">
<div id="iads-units-type-options" class="ol-select">
<div class="ol-select-value">Unit types</div>
<div class="ol-select-options">

View File

@ -3,51 +3,51 @@
<div class="upper-bar ol-panel">
<div class="switch-control coalition no-label"><div id="coalition-switch" class="ol-switch"></div></div>
<button data-coalition="blue" id="aircraft-spawn-button" title="Spawn aircraft" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "aircraft" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/aircraft.svg" inject-svg></button>
data-on-click-params='{ "type": "aircraft" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/aircraft.svg" inject-svg></button>
<button data-coalition="blue" id="helicopter-spawn-button" title="Spawn helicopter" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "helicopter" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/helicopter.svg" inject-svg></button>
data-on-click-params='{ "type": "helicopter" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/helicopter.svg" inject-svg></button>
<button data-coalition="blue" id="air-defence-spawn-button" title="Spawn air defence unit" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "air-defence" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/sam.svg" inject-svg></button>
data-on-click-params='{ "type": "air-defence" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/sam.svg" inject-svg></button>
<button data-coalition="blue" id="groundunit-spawn-button" title="Spawn ground unit" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "groundunit" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/groundunit.svg" inject-svg></button>
data-on-click-params='{ "type": "groundunit" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/groundunit.svg" inject-svg></button>
<button data-coalition="blue" id="coalition-area-button" title="Edit coalition area" data-on-click="editCoalitionArea"
class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/other/edit.svg" inject-svg></button>
class="ol-context-menu-button"><img src="/resources/theme/images/buttons/other/edit.svg" inject-svg></button>
<button data-coalition="blue" id="more-options-button" title="More options" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "more" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/more.svg" inject-svg></button>
data-on-click-params='{ "type": "more" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/more.svg" inject-svg></button>
</div>
<div id="more-options-button-bar" class="upper-bar ol-panel hide">
<button data-coalition="blue" id="navyunit-spawn-button" title="Spawn navy unit" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "navyunit" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/navyunit.svg" inject-svg></button>
data-on-click-params='{ "type": "navyunit" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/navyunit.svg" inject-svg></button>
<button data-coalition="blue" id="smoke-spawn-button" title="Spawn smoke" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "smoke" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/smoke.svg" inject-svg></button>
data-on-click-params='{ "type": "smoke" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/smoke.svg" inject-svg></button>
<button data-coalition="blue" id="explosion-spawn-button" title="Explosion" data-on-click="mapContextMenuShow"
data-on-click-params='{ "type": "explosion" }' class="ol-contexmenu-button"><img src="/resources/theme/images/buttons/spawn/explosion.svg" inject-svg></button>
data-on-click-params='{ "type": "explosion" }' class="ol-context-menu-button"><img src="/resources/theme/images/buttons/spawn/explosion.svg" inject-svg></button>
<button data-coalition="blue" id="polygon-draw-button" title="Enter polygon draw mode" data-on-click="toggleCoalitionAreaDraw"
data-on-click-params='{"type": "polygon"}' class="ol-contexmenu-button"><img src="resources/theme/images/buttons/tools/draw-polygon-solid.svg" inject-svg></button>
data-on-click-params='{"type": "polygon"}' class="ol-context-menu-button"><img src="resources/theme/images/buttons/tools/draw-polygon-solid.svg" inject-svg></button>
</div>
<div id="aircraft-spawn-menu" class="ol-contexmenu-panel ol-panel hide">
<div id="aircraft-spawn-menu" class="ol-context-menu-panel ol-panel hide">
<!-- Here the aircraft spawn menu will be shown -->
</div>
<div id="helicopter-spawn-menu" class="ol-contexmenu-panel ol-panel hide">
<div id="helicopter-spawn-menu" class="ol-context-menu-panel ol-panel hide">
<!-- Here the helicopter spawn menu will be shown -->
</div>
<div id="air-defence-spawn-menu" class="ol-panel ol-contexmenu-panel hide">
<div id="air-defence-spawn-menu" class="ol-panel ol-context-menu-panel hide">
<!-- Here the air defence units' spawn menu will be shown -->
</div>
<div id="groundunit-spawn-menu" class="ol-panel ol-contexmenu-panel hide">
<div id="groundunit-spawn-menu" class="ol-panel ol-context-menu-panel hide">
<!-- Here the ground units' spawn menu will be shown -->
</div>
<div id="navyunit-spawn-menu" class="ol-panel ol-contexmenu-panel hide">
<div id="navyunit-spawn-menu" class="ol-panel ol-context-menu-panel hide">
<!-- Here the navy units' spawn menu will be shown -->
</div>
<div id="smoke-spawn-menu" class="ol-panel ol-contexmenu-panel hide">
<div id="smoke-spawn-menu" class="ol-panel ol-context-menu-panel hide">
<button class="smoke-button" title="" data-smoke-color="white" data-on-click="contextMenuDeploySmoke" data-on-click-params='{ "color": "white" }'>White smoke</button>
<button class="smoke-button" title="" data-smoke-color="blue" data-on-click="contextMenuDeploySmoke" data-on-click-params='{ "color": "blue" }'>Blue smoke</button>
<button class="smoke-button" title="" data-smoke-color="red" data-on-click="contextMenuDeploySmoke" data-on-click-params='{ "color": "red" }'>Red smoke</button>
<button class="smoke-button" title="" data-smoke-color="green" data-on-click="contextMenuDeploySmoke" data-on-click-params='{ "color": "green" }'>Green smoke</button>
<button class="smoke-button" title="" data-smoke-color="orange" data-on-click="contextMenuDeploySmoke" data-on-click-params='{ "color": "orange" }'>Orange smoke</button>
</div>
<div id="explosion-menu" class="ol-panel ol-contexmenu-panel hide">
<div id="explosion-menu" class="ol-panel ol-context-menu-panel hide">
<button class="explosion-button" title="" data-on-click="contextMenuExplosion" data-on-click-params='{ "explosionType": "normal", "strength": 1 }'>Small explosion</button>
<button class="explosion-button" title="" data-on-click="contextMenuExplosion" data-on-click-params='{ "explosionType": "normal", "strength": 10 }'>Big explosion</button>
<button class="explosion-button" title="" data-on-click="contextMenuExplosion" data-on-click-params='{ "explosionType": "phosphorous"}'>White phosphorous</button>