Merge branch 'main' of https://github.com/Pax1601/DCSOlympus into unit-list

This commit is contained in:
PeekabooSteam 2023-03-20 11:54:53 +00:00
commit fa03e9dbd8
12 changed files with 41 additions and 33 deletions

View File

@ -19,7 +19,20 @@ const DEMO_UNIT_DATA = {
missionData: {
fuel: 50,
flags: {human: false},
ammo: [],
ammo: [
{
count: 4,
desc: {
displayName: "AIM-120"
}
},
{
count: 2,
desc: {
displayName: "AIM-7"
}
}
],
targets: [],
hasTask: true,
coalition: "blue"

View File

@ -1,12 +1,12 @@
{
"name": "DCSOlympus",
"version": "0.0.0",
"version": "0.1.0-alpha",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "DCSOlympus",
"version": "0.0.0",
"version": "0.1.0-alpha",
"dependencies": {
"@types/geojson": "^7946.0.10",
"@types/leaflet": "^1.9.0",

View File

@ -2,7 +2,7 @@
"name": "DCSOlympus",
"node-main": "./bin/www",
"main": "http://localhost:3000",
"version": "0.0.0",
"version": "0.1.0-alpha",
"private": true,
"scripts": {
"copy": "copy .\\node_modules\\leaflet\\dist\\leaflet.css .\\public\\stylesheets\\leaflet.css",

View File

@ -1,6 +1,6 @@
:root {
--airbase-marker-height: 63px;
--airbase-marker-width: 63px;
--airbase-marker-height: 40px;
--airbase-marker-width: 40px;
}
[data-object|="airbase"] {
@ -31,6 +31,7 @@ Marker
/* Airbase */
[data-object|="airbase"] .airbase-marker {
background-image: var(--airbase-marker-neutral-url);
background-size: contain;
height: var(--airbase-marker-height);
width: var(--airbase-marker-width);
}

View File

@ -56,5 +56,5 @@
}
#unit-info-panel #loadout-container .loadout-item::before {
content: attr( data-loadout-item ) ' \d7 ' attr( data-loadout-qty );
content: attr( data-loadout-qty )'\d7 ' attr( data-loadout-item ) ;
}

View File

@ -58,26 +58,18 @@ export class UnitInfoPanel extends Panel {
this.#task.classList.toggle("neutral", unit.getMissionData().coalition === "neutral");
/* Add the loadout elements */
var els = this.getElement().getElementsByClassName("js-loadout-element");
while (els.length > 0)
this.#loadoutContainer.removeChild(els[0]);
for (let index in unit.getMissionData().ammo)
this.#addLoadoutElement(unit, index);
this.#loadoutContainer.replaceChildren(...unit.getMissionData().ammo.map(
(ammo: any) => {
var el = document.createElement("div");
el.classList.add("pill", "loadout-item");
el.dataset.loadoutQty = ammo.count;
el.dataset.loadoutItem = ammo.desc.displayName;
return el;
}
))
}
}
#addLoadoutElement(unit: Unit, index: string)
{
var ammo = unit.getMissionData().ammo[index];
var displayName = ammo.desc.displayName;
var amount = ammo.count;
var el = document.createElement("div")
el.classList.add("js-loadout-element", "ol-rectangular-container-dark")
el.innerText = amount + "x" + displayName;
this.#loadoutContainer.appendChild(el);
}
#onUnitsSelection(units: Unit[]){
if (units.length == 1)
this.show();

View File

@ -22,10 +22,7 @@
</dl>
<div id="loadout-container" class="ol-group wrap">
<div class="pill loadout-item" data-loadout-qty="4" data-loadout-item="AIM-120"></div>
<div class="pill loadout-item" data-loadout-qty="4" data-loadout-item="AIM-54"></div>
<div class="pill loadout-item" data-loadout-qty="2" data-loadout-item="AIM-9P"></div>
<div class="pill loadout-item" data-loadout-qty="895" data-loadout-item="bullets"></div>
<!-- Here the loadout elements will be shown -->
</div>
</div>

View File

@ -2,7 +2,7 @@
[Setup]
AppName=DCS Olympus
AppVerName=DCS Olympus Alpha v0.0.7
AppVerName=DCS Olympus Alpha v0.1.0
DefaultDirName={usersavedgames}\DCS.openbeta
DefaultGroupName=DCSOlympus
OutputBaseFilename=DCSOlympus

View File

@ -15,7 +15,7 @@ declare_plugin(self_ID,
shortName = "Olympus",
fileMenuName = "Olympus",
version = "0.0.7",
version = "0.1.0-alpha",
state = "installed",
developerName= "DCS Refugees 767 squadron",
info = _("DCS Olympus is a mod for DCS World. It allows users to spawn, control, task, group, and remove units from a DCS World server using a real-time map interface, similarly to Real Time Strategy games. The user interface also provides useful informations units, like loadouts, fuel, tasking, and so on. In the future, more features for DCS World GCI and JTAC will be available."),

View File

@ -1,3 +1,5 @@
local version = 'v0.1.0-alpha'
Olympus = {}
Olympus.OlympusDLL = nil
Olympus.cppRESTDLL = nil
@ -24,7 +26,7 @@ end
do
if isOlympusModuleInitialized~=true then
local OlympusName = 'Olympus 0.0.1 C++ module';
local OlympusName = 'Olympus ' .. version .. ' C++ module';
isOlympusModuleInitialized=true;
Olympus.DLLsloaded = Olympus.loadDLLs()
if Olympus.DLLsloaded then

View File

@ -1,3 +1,5 @@
local version = 'v0.1.0-alpha'
Olympus = {}
Olympus.OlympusDLL = nil
Olympus.cppRESTDLL = nil
@ -24,7 +26,7 @@ end
do
if isOlympusModuleInitialized~=true then
local OlympusName = 'Olympus 0.0.1 C++ module';
local OlympusName = 'Olympus ' .. version .. ' C++ module';
Olympus.loadDLLs();
-- Register callbacks

View File

@ -1,3 +1,4 @@
local version = 'v0.1.0-alpha'
Olympus = {}
Olympus.groupIndex = 0
@ -131,4 +132,4 @@ function Olympus.serializeTable(val, name, skipnewlines, depth)
end
timer.scheduleFunction(Olympus.setMissionData, {}, timer.getTime() + 1)
Olympus.notify("OlympusMission script loaded correctly", 10)
Olympus.notify("OlympusMission " .. version .. " script loaded correctly", 10)