mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
More bugfixing
This commit is contained in:
parent
2f839624a8
commit
f111e513c5
@ -721,8 +721,8 @@ nav.ol-panel> :last-child {
|
||||
}
|
||||
|
||||
#rapid-controls svg {
|
||||
height: 25px;
|
||||
width: 25px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
fill: white;
|
||||
stroke: white;
|
||||
}
|
||||
|
||||
@ -100,6 +100,10 @@ body.feature-forceShowUnitControlPanel #unit-control-panel {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
#advanced-settings-dialog .ol-text-input input {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
#general-settings-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import * as L from "leaflet"
|
||||
import { getUnitsManager } from "..";
|
||||
import { getMissionHandler, getUnitsManager } from "..";
|
||||
import { BoxSelect } from "./boxselect";
|
||||
import { MapContextMenu } from "../controls/mapcontextmenu";
|
||||
import { UnitContextMenu } from "../controls/unitcontextmenu";
|
||||
@ -117,11 +117,20 @@ export class Map extends L.Map {
|
||||
Object.values(getUnitsManager().getUnits()).forEach((unit: Unit) => unit.updateVisibility());
|
||||
});
|
||||
|
||||
document.addEventListener("toggleUnitVisibility", (ev: CustomEventInit) => {
|
||||
document.addEventListener("toggleMarkerVisibility", (ev: CustomEventInit) => {
|
||||
const el = ev.detail._element;
|
||||
el?.classList.toggle("off");
|
||||
ev.detail.types.forEach((type: string) => getUnitsManager().setHiddenType(type, !el?.classList.contains("off")));
|
||||
Object.values(getUnitsManager().getUnits()).forEach((unit: Unit) => unit.updateVisibility());
|
||||
|
||||
if (ev.detail.types.includes("airbase")) {
|
||||
Object.values(getMissionHandler().getAirbases()).forEach((airbase: Airbase) => {
|
||||
if (el?.classList.contains("off"))
|
||||
airbase.removeFrom(this);
|
||||
else
|
||||
airbase.addTo(this);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -152,7 +161,7 @@ export class Map extends L.Map {
|
||||
this.#optionButtons["visibility"] = visibilityControls.map((option: string, index: number) => {
|
||||
var typesArrayString = `"${visibilityControlsTypes[index][0]}"`;
|
||||
visibilityControlsTypes[index].forEach((type: string, idx: number) => {if (idx > 0) typesArrayString = `${typesArrayString}, "${type}"`});
|
||||
return this.#createOptionButton(option, `visibility/${option.toLowerCase()}.svg`, visibilityControlsTootlips[index], "toggleUnitVisibility", `{"types": [${typesArrayString}]}`);
|
||||
return this.#createOptionButton(option, `visibility/${option.toLowerCase()}.svg`, visibilityControlsTootlips[index], "toggleMarkerVisibility", `{"types": [${typesArrayString}]}`);
|
||||
});
|
||||
document.querySelector("#unit-visibility-control")?.append(...this.#optionButtons["visibility"]);
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ export class Airbase extends CustomMarker
|
||||
img.onload = () => SVGInjector(img);
|
||||
el.appendChild(img);
|
||||
this.getElement()?.appendChild(el);
|
||||
el.dataset.coalition = this.#coalition;
|
||||
}
|
||||
|
||||
setCoalition(coalition: string)
|
||||
|
||||
@ -2847,7 +2847,7 @@ export class AircraftDatabase extends UnitDatabase {
|
||||
"roles": [
|
||||
"CAP"
|
||||
],
|
||||
"code": "R-73*2,R-27R*2,Fuel-1500",
|
||||
"code": "R-73*4,R-27R*2,Fuel-1500",
|
||||
"name": "Heavy / Fox 1, HOBS Fox 2 / Medium Range"
|
||||
},
|
||||
{
|
||||
@ -2935,7 +2935,7 @@ export class AircraftDatabase extends UnitDatabase {
|
||||
"CAP"
|
||||
],
|
||||
"code": "R-73*2,R-27R*2,Fuel-1500",
|
||||
"name": "Heavy / Fox 1 / Medium Range"
|
||||
"name": "Heavy / Fox 1, HOBS Fox 2 / Medium Range"
|
||||
},
|
||||
{
|
||||
"fuel": 1,
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
|
||||
<div id="rapid-controls" class="ol-panel">
|
||||
<button title="Increase units altitude" class="ol-button" data-on-click="selectedUnitsChangeAltitude" data-on-click-params='{ "type": "climb" }'><img src="/resources/theme/images/icons/climb.svg" inject-svg></button>
|
||||
<button title="Descrease units altitude" class="ol-button" data-on-click="selectedUnitsChangeAltitude" data-on-click-params='{ "type": "descent" }'><img src="/resources/theme/images/icons/descent.svg" inject-svg></button>
|
||||
<button title="Descrease units altitude" class="ol-button" data-on-click="selectedUnitsChangeAltitude" data-on-click-params='{ "type": "descend" }'><img src="/resources/theme/images/icons/descent.svg" inject-svg></button>
|
||||
<button title="Increase units speed" class="ol-button" data-on-click="selectedUnitsChangeSpeed" data-on-click-params='{ "type": "fast" }'><img src="/resources/theme/images/icons/speed-increase.svg" inject-svg></button>
|
||||
<button title="Decrease units speed" class="ol-button" data-on-click="selectedUnitsChangeSpeed" data-on-click-params='{ "type": "slow" }'><img src="/resources/theme/images/icons/speed-decrease.svg" inject-svg></button>
|
||||
<button title="Stop unit and go back to idle state" class="ol-button" data-on-click="selectedUnitsChangeSpeed" data-on-click-params='{ "type": "stop" }'><img src="/resources/theme/images/icons/hand-solid.svg" inject-svg></button>
|
||||
|
||||
@ -427,6 +427,10 @@ function Olympus.generateAirUnitsTable(units)
|
||||
local loadout = unit.loadout -- loadout: a string, one of the names defined in unitPayloads.lua. Must be compatible with the unitType
|
||||
local payload = unit.payload -- payload: a table, if present the unit will receive this specific payload. Overrides loadout
|
||||
|
||||
if unit.heading == nil then
|
||||
unit.heading = 0
|
||||
end
|
||||
|
||||
if payload == nil then
|
||||
if loadout and loadout ~= "" and Olympus.unitPayloads[unit.unitType][loadout] then
|
||||
payload = Olympus.unitPayloads[unit.unitType][loadout]
|
||||
@ -445,7 +449,7 @@ function Olympus.generateAirUnitsTable(units)
|
||||
["alt_type"] = "BARO",
|
||||
["skill"] = "Excellent",
|
||||
["payload"] = { ["pylons"] = payload, ["fuel"] = 999999, ["flare"] = 60, ["ammo_type"] = 1, ["chaff"] = 60, ["gun"] = 100, },
|
||||
["heading"] = 0,
|
||||
["heading"] = unit.heading,
|
||||
["callsign"] = { [1] = 1, [2] = 1, [3] = 1, ["name"] = "Olympus" .. Olympus.unitCounter.. "-" .. #unitTable + 1 },
|
||||
["name"] = "Olympus-" .. Olympus.unitCounter .. "-" .. #unitTable + 1
|
||||
}
|
||||
@ -535,7 +539,7 @@ function Olympus.generateGroundUnitsTable(units)
|
||||
["type"] = unit.unitType,
|
||||
["x"] = spawnLocation.x,
|
||||
["y"] = spawnLocation.z,
|
||||
["heading"] = 0,
|
||||
["heading"] = unit.heading,
|
||||
["skill"] = "High",
|
||||
["name"] = "Olympus-" .. Olympus.unitCounter .. "-" .. #unitTable + 1
|
||||
}
|
||||
@ -569,7 +573,7 @@ function Olympus.generateNavyUnitsTable(units)
|
||||
["type"] = unit.unitType,
|
||||
["x"] = spawnLocation.x,
|
||||
["y"] = spawnLocation.z,
|
||||
["heading"] = 0,
|
||||
["heading"] = unit.heading,
|
||||
["skill"] = "High",
|
||||
["name"] = "Olympus-" .. Olympus.unitCounter .. "-" .. #unitTable + 1,
|
||||
["transportable"] = { ["randomTransportable"] = false }
|
||||
@ -585,6 +589,9 @@ function Olympus.clone(ID, lat, lng, category)
|
||||
Olympus.debug("Olympus.clone " .. ID .. ", " .. category, 2)
|
||||
local unit = Olympus.getUnitByID(ID)
|
||||
if unit then
|
||||
local position = unit:getPosition()
|
||||
local heading = math.atan2( position.x.z, position.x.x )
|
||||
|
||||
-- TODO: understand category in this script
|
||||
local spawnTable = {
|
||||
coalition = Olympus.getCoalitionByCoalitionID(unit:getCoalition()),
|
||||
@ -594,6 +601,7 @@ function Olympus.clone(ID, lat, lng, category)
|
||||
lat = lat,
|
||||
lng = lng,
|
||||
alt = unit:getPoint().y,
|
||||
heading = heading,
|
||||
unitType = unit:getTypeName(),
|
||||
payload = Olympus.payloadRegistry[unit:getName()]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user