Node.js transition is completed!

This commit is contained in:
Pax1601 2023-01-27 08:16:40 +01:00
parent b8b2590323
commit 12c23bd607
20 changed files with 461 additions and 170 deletions

View File

@ -1,5 +1,7 @@
{
"name": "client",
"name": "DCS Olympus",
"node-main": "./bin/www",
"main": "http://localhost:3000",
"version": "0.0.0",
"private": true,
"scripts": {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,14 @@
.olympus-element-1 {
background-color: #247be2;
height: 28;
border-radius: 14px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 14px;
}
.bottom-separator {
border-bottom: 1px solid gray;
}

View File

@ -55,31 +55,39 @@ body {
padding-right: 10px;
}
#unit-control-panel {
#unit-control-buttons {
position: absolute;
left: 50%;
margin-left: -60px;
height: 30px;
width: 120px;
top: 10px;
height: fit-content;
width: fit-content;
right: 10px;
z-index: 1000;
}
#unit-control-panel {
display: none;
position: absolute;
top: 10px;
height: fit-content;
width: 250px;
right: 10px;
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 10px;
padding-right: 10px;
}
#connection-status-panel {
position: absolute;
height: 30px;
width: 140px;
top: 10px;
bottom: 10px;
right: 10px;
z-index: 1000;
}
@media only screen and (max-width: 1440px) {
@media only screen and (max-width: 1000px) {
#unit-control-buttons {
top: 50px;
}
#unit-control-panel {
top: 50px;
}

View File

@ -1,25 +1,91 @@
.olympus-selection-scroll-container {
margin: 0 auto;
position: fixed;
z-index: 1000;
width: 220px;
height: 220px;
overflow: visible;
overflow-y: scroll;
background-color: var(--background-color-dark);
opacity: 0.8;
font-size: 12px;
transition: bottom 0.2s;
border-radius: 15px;
box-shadow: 0px 2px 5px #000A;
width: 180px;
height: fit-content;
z-index: 1000;
max-height: 400px;
padding: 10px;
}
.olympus-selection-scroll {
overflow-y: auto;
max-height: calc(400px - 60px);
}
.olympus-selection-scroll::-webkit-scrollbar {
width: 10px;
}
.olympus-selection-scroll::-webkit-scrollbar-track {
background-color: transparent;
border-radius: 100px;
}
.olympus-selection-scroll::-webkit-scrollbar-thumb {
background-color: white;
border-radius: 100px;
opacity: 0.8;
margin-top: 10px;
}
.olympus-selection-scroll-element {
margin: 2px;
color: white;
text-shadow: 1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
cursor: pointer;
font-size: 12px;
font-size: 14px;
opacity: 1;
font-family: "Lucida Console", "Courier New", monospace !important;
border-radius: 5px;
margin: 5px;
padding: 5px;
padding-left: 15px;
}
.olympus-selection-scroll-element:hover {
background-color: var(--highlight-color);
}
.olympus-selection-scroll-container label {
width: 0;
height: 0;
}
.olympus-selection-scroll-container input {
width: 0;
height: 0;
}
.olympus-selection-scroll-switch {
position: relative;
display: inline-block;
left: calc(50% - 10px);
width: 60px;
height: 34px;
background-color: var(--active-coalition-color);
border-radius: 999px;
cursor: pointer;
margin-left: -30px;
}
.olympus-selection-scroll-switch:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: 0.2s;
transition: 0.2s;
border-radius: 999px;
}
input:checked+.olympus-selection-scroll-switch:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}

View File

@ -39,6 +39,10 @@ html {
font-family: 'Open Sans', sans-serif;
}
.leaflet-container.crosshair-cursor-enabled {
cursor:crosshair;
}
.rectangular-container {
padding: 0.5em;
background-color: gray;

View File

@ -1,4 +1,41 @@
#unit-control-panel .olympus-button {
#unit-control-buttons {
display: flex;
flex-direction: column;
row-gap: 5px;
padding: 10px;
border-radius: 999px;
}
#unit-control-buttons>div {
filter: invert(100%);
opacity: 0.8;
}
#unit-control-panel {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: flex-start;
row-gap: 5px;
padding-left: 30px;
padding-right: 30px;
padding-top: 20px;
padding-bottom: 20px;
}
/* Common */
#unit-info-panel>div {
height: 100%;
width: 100%;
}
#unit-control-panel .rounded-container {
width: 100%;
}
#unit-control-panel #title-label {
color: white;
font-size: 14px;
width: 100%;
font-weight: 600;
}

View File

@ -51,7 +51,7 @@
}
/* General section */
#general #name {
#general #unit-name {
color: white;
font-size: 18px;
width: 100%;

View File

@ -21,26 +21,36 @@
align-items: center;
}
.unit-marker-selected {
animation-name: flash;
animation-duration: 0.3s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-timing-function: linear;
width: 100%;
height: 100%;
border-radius: 50%;
}
@keyframes flash {
from {
filter: brightness(100%);
}
to {
filter: brightness(130%);
}
#ring {
top: 0px;
position: absolute;
display: inline-block;
-webkit-mask: radial-gradient(transparent 60%, #000 61%);
mask: radial-gradient(transparent 60%, #000 61%);
}
#background {
top: 0px;
position: absolute;
display: inline-block;
opacity: 0.2;
}
.blue.unit-marker-selected {
background-color: var(--blue-coalition-color);
}
.red.unit-marker-selected {
background-color: var(--red-coalition-color);
}
.unit-marker-hovered {
filter: brightness(130%);
}

View File

@ -1,4 +1,5 @@
import { LatLng } from "leaflet";
import { setActiveCoalition } from "..";
export class SelectionScroll {
#container: HTMLElement | null;
@ -8,26 +9,36 @@ export class SelectionScroll {
this.#container = document.getElementById(id);
this.#display = '';
if (this.#container != null) {
this.#container.querySelector("#coalition-switch")?.addEventListener('change', (e) => this.#onSwitch(e))
this.#display = this.#container.style.display;
this.hide();
}
}
show(x: number, y: number, options: any, callback: CallableFunction) {
show(x: number, y: number, options: any, callback: CallableFunction, showCoalition: boolean) {
/* Hide to remove buttons, if present */
this.hide();
if (this.#container != null && options.length > 1) {
if (this.#container != null && options.length >= 1) {
this.#container.style.display = this.#display;
this.#container.style.left = x - 110 + "px";
this.#container.style.top = y - 110 + "px";
for (let optionID in options) {
var node = document.createElement("div");
node.classList.add("olympus-selection-scroll-element");
node.appendChild(document.createTextNode(options[optionID]));
this.#container.appendChild(node);
node.addEventListener('click', () => callback(options[optionID]))
var scroll = this.#container.querySelector(".olympus-selection-scroll");
if (scroll != null)
{
for (let optionID in options) {
var node = document.createElement("div");
node.classList.add("olympus-selection-scroll-element");
if (typeof options[optionID] === 'string' || options[optionID] instanceof String){
node.appendChild(document.createTextNode(options[optionID]));
node.addEventListener('click', () => callback(options[optionID]));
}
else {
node.appendChild(document.createTextNode(options[optionID].tooltip));
node.addEventListener('click', () => options[optionID].callback());
}
scroll.appendChild(node);
}
}
}
}
@ -36,8 +47,25 @@ export class SelectionScroll {
if (this.#container != null) {
this.#container.style.display = "none";
var buttons = this.#container.querySelectorAll(".olympus-selection-scroll-element");
for (let child of buttons) {
this.#container.removeChild(child);
var scroll = this.#container.querySelector(".olympus-selection-scroll");
if (scroll != null)
{
for (let child of buttons) {
scroll.removeChild(child);
}
}
}
}
#onSwitch(e: any) {
if (this.#container != null) {
if (e.currentTarget.checked) {
document.documentElement.style.setProperty('--active-coalition-color', getComputedStyle(this.#container).getPropertyValue("--red-coalition-color"));
setActiveCoalition("red");
}
else {
document.documentElement.style.setProperty('--active-coalition-color', getComputedStyle(this.#container).getPropertyValue("--blue-coalition-color"));
setActiveCoalition("blue");
}
}
}

View File

@ -38,7 +38,7 @@ function setup() {
selectionScroll = new SelectionScroll("selection-scroll");
unitsManager = new UnitsManager();
unitInfoPanel = new UnitInfoPanel("unit-info-panel");
scenarioDropdown = new Dropdown("scenario-dropdown", ["Caucasus", "Syria", "Nevada", "Marianas", "South Atlantic", "The channel"], () => { });
scenarioDropdown = new Dropdown("scenario-dropdown", ["Caucasus", "Syria", "Marianas", "Nevada", "South Atlantic", "The channel"], () => { });
mapSourceDropdown = new Dropdown("map-source-dropdown", map.getLayers(), (option: string) => map.setLayer(option));
connectionStatusPanel = new ConnectionStatusPanel("connection-status-panel");
missionData = new MissionData();

View File

@ -95,10 +95,10 @@ export class Map extends L.Map {
this.#state = state;
if (this.#state === "IDLE") {
L.DomUtil.removeClass(this.getContainer(),'crosshair-cursor-enabled');
}
else if (this.#state === "MOVE_UNIT") {
L.DomUtil.addClass(this.getContainer(),'crosshair-cursor-enabled');
}
else if (this.#state === "ATTACK") {
@ -124,10 +124,10 @@ export class Map extends L.Map {
}
/* Selection scroll */
showSelectionScroll(e: ClickEvent | SpawnEvent, options: any, callback: CallableFunction) {
showSelectionScroll(e: ClickEvent | SpawnEvent, options: any, callback: CallableFunction, showCoalition: boolean = false) {
var x = e.x;
var y = e.y;
getSelectionScroll().show(x, y, options, callback);
getSelectionScroll().show(x, y, options, callback, showCoalition);
}
hideSelectionScroll() {
@ -158,7 +158,7 @@ export class Map extends L.Map {
{ "tooltip": "Smoke", "src": "spawnSmoke.png", "callback": () => this.#smokeSpawnMenu(spawnEvent) },
//{ "tooltip": "Explosion", "src": "spawnExplosion.png", "callback": () => this.#explosionSpawnMenu(e) }
]
this.showSelectionWheel(spawnEvent, options, true);
this.showSelectionScroll(spawnEvent, options, () => {}, true);
}
}
@ -198,7 +198,7 @@ export class Map extends L.Map {
{'coalition': true, 'tooltip': 'Radar', 'src': 'spawnRadar.png', 'callback': () => this.#selectGroundUnit(e, "Radar")},
{'coalition': true, 'tooltip': 'Unarmed', 'src': 'spawnUnarmed.png', 'callback': () => this.#selectGroundUnit(e, "Unarmed")}
]
this.showSelectionWheel(e, options, true);
this.showSelectionScroll(e, options, () => {}, true);
}
#smokeSpawnMenu(e: SpawnEvent) {
@ -211,7 +211,7 @@ export class Map extends L.Map {
{'tooltip': 'Green smoke', 'src': 'spawnSmoke.png', 'callback': () => {this.hideSelectionWheel(); this.hideSelectionScroll(); spawnSmoke('green', e.latlng)}, 'tint': 'green'},
{'tooltip': 'Orange smoke', 'src': 'spawnSmoke.png', 'callback': () => {this.hideSelectionWheel(); this.hideSelectionScroll(); spawnSmoke('orange', e.latlng)}, 'tint': 'orange'},
]
this.showSelectionWheel(e, options, true);
this.showSelectionScroll(e, options, () => {}, true);
}
#explosionSpawnMenu(e: SpawnEvent) {
@ -228,7 +228,7 @@ export class Map extends L.Map {
{ 'coalition': true, 'tooltip': 'Drone', 'src': 'spawnDrone.png', 'callback': () => this.#selectAircraft(e, "drone") },
{ 'coalition': true, 'tooltip': 'Transport', 'src': 'spawnTransport.png', 'callback': () => this.#selectAircraft(e, "transport") },
]
this.showSelectionWheel(e, options, true);
this.showSelectionScroll(e, options, () => {}, true);
}
/* Show unit selection for air units */
@ -236,7 +236,10 @@ export class Map extends L.Map {
this.hideSelectionWheel();
this.hideSelectionScroll();
var options = unitTypes.air[group];
options.sort();
if (options != undefined)
options.sort();
else
options = [];
this.showSelectionScroll(e, options, (unitType: string) => {
this.hideSelectionWheel();
this.hideSelectionScroll();

View File

@ -10,7 +10,7 @@ export class UnitInfoPanel {
this.#display = '';
if (this.#element != null) {
this.#display = this.#element.style.display;
this.show();
this.hide();
}
}
@ -23,27 +23,31 @@ export class UnitInfoPanel {
}
update(unit: Unit) {
var loadout = "";
for (let index in unit.ammo) {
var ammo = unit.ammo[index];
var displayName = ammo.desc.displayName;
var amount = ammo.count;
loadout += amount + "x" + displayName;
if (parseInt(index) < Object.keys(unit.ammo).length)
loadout += ", ";
}
if (this.#element != null) {
var els = this.#element.getElementsByClassName("js-loadout-element");
while (els.length > 0)
this.#element.querySelector("#loadout-data")?.removeChild(els[0]);
for (let index in unit.ammo) {
var ammo = unit.ammo[index];
var displayName = ammo.desc.displayName;
var amount = ammo.count;
var el = document.createElement("div")
el.classList.add("js-loadout-element", "rectangular-container-dark")
el.innerHTML = amount + "x" + displayName;
this.#element.querySelector("#loadout-data")?.appendChild(el);
}
this.#element.querySelector("#unit-name")!.innerHTML = unit.unitName;
this.#element.querySelector("#group-name")!.innerHTML = unit.groupName;
this.#element.querySelector("#heading")!.innerHTML = String(Math.floor(rad2deg(unit.heading)) + "°");
this.#element.querySelector("#altitude")!.innerHTML = String(Math.floor(unit.altitude / 0.3048) + "ft");
this.#element.querySelector("#groundspeed")!.innerHTML = String(Math.floor(unit.speed * 1.94384) + "kts");
this.#element.querySelector("#name")!.innerHTML = unit.name;
this.#element.querySelector("#heading")!.innerHTML = String(Math.floor(rad2deg(unit.heading)) + " °");
this.#element.querySelector("#altitude")!.innerHTML = String(Math.floor(unit.altitude / 0.3048) + " ft");
this.#element.querySelector("#ground-speed")!.innerHTML = String(Math.floor(unit.speed * 1.94384) + " kts");
this.#element.querySelector("#fuel")!.innerHTML = String(unit.fuel + "%");
this.#element.querySelector("#position")!.innerHTML = ConvertDDToDMS(unit.latitude, false) + " " + ConvertDDToDMS(unit.longitude, true);
this.#element.querySelector("#task")!.innerHTML = unit.currentTask;
this.#element.querySelector("#loadout")!.innerHTML = loadout;
this.#element.querySelector("#latitude")!.innerHTML = ConvertDDToDMS(unit.latitude, false);
this.#element.querySelector("#longitude")!.innerHTML = ConvertDDToDMS(unit.longitude, true);
this.#element.querySelector("#task")!.innerHTML = unit.currentTask !== ""? unit.currentTask: "Not controlled";
}
}
}

View File

@ -73,6 +73,9 @@ export class Unit {
this[entry] = response[entry];
}
/* Dead units can't be selected */
this.setSelected(this.getSelected() && this.alive)
this.#updateMarker();
this.#clearTargets();
@ -93,11 +96,6 @@ export class Unit {
this.wingmen.push(unitsManager.getUnitByID(ID));
}
}
this.formation = response["formation"];
this.missionData = missionData.getUnitData(this.ID)
this.setSelected(this.getSelected() && this.alive)
*/
}
@ -114,6 +112,14 @@ export class Unit {
return this.#selected;
}
setSelectable(selectable: boolean) {
this.#selectable = selectable;
}
getSelectable() {
return this.#selectable;
}
addDestination(latlng: L.LatLng) {
var path: any = {};
if (this.activePath != null) {
@ -153,16 +159,20 @@ export class Unit {
this.#preventClick = true;
var options = [
{ 'tooltip': 'Attack', 'src': 'attack.png', 'callback': () => { getMap().hideSelectionWheel(); getUnitsManager().attackUnit(this.ID); } },
{ 'tooltip': 'Go to tanker', 'src': 'tanker.png', 'callback': () => { getMap().hideSelectionWheel(); /*showMessage("Function not implemented yet");*/ } },
{ 'tooltip': 'RTB', 'src': 'rtb.png', 'callback': () => { getMap().hideSelectionWheel(); /*showMessage("Function not implemented yet");*/ } }
'Attack',
]
if (!this.leader && !this.wingman) {
options.push({ 'tooltip': 'Create formation', 'src': 'formation.png', 'callback': () => { getMap().hideSelectionWheel(); /*unitsManager.createFormation(this.ID);*/ } });
}
//if (!this.leader && !this.wingman) {
// options.push({ 'tooltip': 'Create formation', 'src': 'formation.png', 'callback': () => { getMap().hideSelectionWheel(); /*unitsManager.createFormation(this.ID);*/ } });
//}
getMap().showSelectionWheel(e.originalEvent, options, false);
getMap().showSelectionScroll(e.originalEvent, options, (action: string) => this.#executeAction(action));
}
#executeAction(action: string) {
getMap().hideSelectionScroll();
if (action === "Attack")
getUnitsManager().attackUnit(this.ID);
}
#updateMarker() {
@ -399,6 +409,12 @@ export class NavyUnit extends Unit {
}
export class Weapon extends Unit {
constructor(ID: number, marker: UnitMarker)
{
super(ID, marker);
this.setSelectable(false);
}
getHidden() {
if (this.alive)
{

View File

@ -250,7 +250,7 @@ unitTypes.air.strike = [
"Tu-142",
]
unitTypes.air.tank = [
unitTypes.air.tanker = [
"S-3B Tanker",
"KC-135",
"IL-78M",

View File

@ -33,10 +33,20 @@ export class UnitMarker extends L.Marker {
var symbol = new Symbol(this.#computeMarkerCode(options), { size: 25 });
var img = symbol.asCanvas().toDataURL('image/png');
var coalition = "";
if (options.coalitionID == 1)
coalition = "red"
else if (options.coalitionID == 2)
coalition = "blue"
else
coalition = "neutral"
var icon = new L.DivIcon({
html: `<table class="unit-marker-container" id="container">
<tr>
<td>
<div class="${coalition}" id="background"></div>
<div class="${coalition}" id="ring"></div>
<div class="unit-marker-icon" id="icon"><img src="${img}"></div>
<div class="unit-marker-unitName" id="unitName">${this.#unitName}</div>
<div class="unit-marker-altitude" id="altitude"></div>
@ -101,7 +111,8 @@ export class UnitMarker extends L.Marker {
setSelected(selected: boolean) {
this.#selected = selected;
this.getElement()?.querySelector("#icon")?.classList.remove("unit-marker-hovered");
this.getElement()?.querySelector("#icon")?.classList.toggle("unit-marker-selected", selected);
this.getElement()?.querySelector("#ring")?.classList.toggle("unit-marker-selected", selected);
this.getElement()?.querySelector("#background")?.classList.toggle("unit-marker-selected", selected);
}
getSelected() {

View File

@ -1,3 +1,8 @@
<div id="selection-scroll" class="olympus-selection-scroll-container">
<label id="coalition-switch-container">
<input type="checkbox" id="coalition-switch"> <span
class="olympus-selection-scroll-slider olympus-selection-scroll-switch"></span>
</label>
<div class="olympus-selection-scroll">
</div>
</div>

View File

@ -1,6 +1,12 @@
<div class="olympus-panel" id="unit-control-panel">
<div class="olympus-panel" id="unit-control-buttons">
<div class="olympus-button" id="slow-button"></div>
<div class="olympus-button" id="fast-button"></div>
<div class="olympus-button" id="descend-button"></div>
<div class="olympus-button" id="climb-button"></div>
</div>
<div class="olympus-panel" id="unit-control-panel">
<div id="title-label">Selected units</div>
<div class="rounded-container">Olympus-1</div>
<div class="rounded-container">Olympus-2</div>
</div>

View File

@ -1,35 +1,30 @@
<div class="olympus-panel padding-large" id="unit-info-panel">
<div id="general">
<div id="name">Olympus-6</div>
<div class="rectangular-container">F-15C</div>
<div class="rectangular-container">Olympus-1</div>
<div class="rounded-container" id="task">Reaching destination</div>
<div id="unit-name"></div>
<div class="rectangular-container" id="name"></div>
<div class="rectangular-container" id="group-name"></div>
<div class="rounded-container" id="task"></div>
</div>
<div class="vl h-margin-largest"></div>
<div id="flight-data">
<div id="flight-data-label">Flight data</div>
<div id="latitude">N37°17'33.25"</div>
<div id="longitude">W115°42'14.70"</div>
<div id="latitude"></div>
<div id="longitude"></div>
<img class="flight-data-icon" src="images/icons/speed.svg">
<div class="flight-data-label">Ground Speed</div>
<div class="flight-data-value">308 kts</div>
<div class="flight-data-value" id="ground-speed"></div>
<img class="flight-data-icon" src="images/icons/altitude.svg">
<div class="flight-data-label">Altitude</div>
<div class="flight-data-value">1064 ft</div>
<div class="flight-data-value" id="altitude"></div>
<img class="flight-data-icon" src="images/icons/heading.svg">
<div class="flight-data-label">Heading</div>
<div class="flight-data-value">67</div>
<div class="flight-data-value" id="heading"></div>
</div>
<div class="vl h-margin-largest"></div>
<div id="loadout-data">
<div id="loadout-label">Loadout</div>
<img class="flight-data-icon" src="images/icons/fuel.svg">
<div class="flight-data-label">Fuel</div>
<div class="flight-data-value">15%</div>
<div class="rectangular-container-dark">2x AIM-120B</div>
<div class="rectangular-container-dark">2x AIM-9P</div>
<div class="rectangular-container-dark">100x 50mm HE</div>
<div class="rectangular-container-dark">2x AGM-68</div>
<div class="flight-data-value" id="fuel"></div>
</div>
</div>

View File

@ -1,32 +1,58 @@
#define nwjsFolder "C:\Users\dpass\Documents\nwjs\"
[Setup]
AppName=DCS Olympus
AppVerName=DCS Olympus Alpha v0.0.1
AppVerName=DCS Olympus Alpha v0.0.2
DefaultDirName={usersavedgames}\DCS.openbeta
DefaultGroupName=DCSOlympus
OutputBaseFilename=DCSOlympus
[Tasks]
; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required.
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "..\scripts\OlympusExport.lua"; DestDir: "{app}\Scripts"; Flags: ignoreversion
Source: "..\scripts\OlympusHook.lua"; DestDir: "{app}\Scripts\Hooks"; Flags: ignoreversion
Source: "..\scripts\OlympusCommand.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\scripts\unitPayloads.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\scripts\OlympusMission.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\scripts\mist_4_4_90.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\bin\*.dll"; DestDir: "{app}\Mods\Services\Olympus\bin"; Flags: ignoreversion;
Source: "..\client\bin\*"; DestDir: "{app}\Mods\Services\Olympus\client\bin"; Flags: ignoreversion;
Source: "..\client\node_modules\*"; DestDir: "{app}\Mods\Services\Olympus\client\node_modules"; Flags: ignoreversion recursesubdirs;
Source: "..\client\public\*"; DestDir: "{app}\Mods\Services\Olympus\client\public"; Flags: ignoreversion recursesubdirs;
Source: "..\client\routes\*"; DestDir: "{app}\Mods\Services\Olympus\client\routes"; Flags: ignoreversion recursesubdirs;
Source: "..\client\views\*"; DestDir: "{app}\Mods\Services\Olympus\client\views"; Flags: ignoreversion recursesubdirs;
Source: "..\client\*.*"; DestDir: "{app}\Mods\Services\Olympus\client"; Flags: ignoreversion;
Source: "{#nwjsFolder}\*.*"; DestDir: "{app}\Mods\Services\Olympus\client"; Flags: ignoreversion recursesubdirs;
[Code]
procedure AppendExportString();
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
SaveStringToFile(ExpandConstant('{app}\Scripts\Export.lua'), #13#10 + 'local Olympuslfs=require(''lfs'');dofile(Olympuslfs.writedir()..''Scripts/OlympusExport.lua'')' + #13#10, True);
if not RegQueryStringValue(HKCU,
'Environment',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
{ look for the path with leading and trailing semicolon }
{ Pos() returns 0 if not found }
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;
[Registry]
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "DCSOLYMPUS_PATH"; ValueData: "{app}\Mods\Services\Olympus"; Flags: preservestringtype
; Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};DCSOLYMPUS_PATH\bin"
Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "DCSOLYMPUS_PATH"; ValueData: "{app}\Mods\Services\Olympus"; Flags: preservestringtype
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};%DCSOLYMPUS_PATH%\bin"; Check: NeedsAddPath('%DCSOLYMPUS_PATH%\bin');
[Setup]
; Tell Windows Explorer to reload the environment
ChangesEnvironment=yes
ChangesEnvironment=yes
[Icons]
Name: "{userdesktop}\DCS Olympus Client"; Filename: "{app}\Mods\Services\Olympus\client\nw.exe"; Tasks: desktopicon