From cd38a2f053d1c1693dc651dcfb21c32226fdb5fb Mon Sep 17 00:00:00 2001 From: Davide Passoni Date: Fri, 28 Jun 2024 11:04:18 +0200 Subject: [PATCH] Added context buttons, temporary fixes to allow preview --- .../buttons/context/miss-on-purpose.svg | 41 +++++++++++++++ .../images/buttons/context/scenic-aaa.svg | 50 +++++++++++++++++++ .../buttons/context/simulate-fire-fight.svg | 42 ++++++++++++++++ .../theme/images/convertToFontAwesomIcons.py | 4 +- frontend/react/src/olympusapp.ts | 7 +-- frontend/react/src/server/servermanager.ts | 2 - frontend/react/src/ui/components/olicons.tsx | 3 ++ .../src/unit/databases/aircraftdatabase.ts | 4 +- .../src/unit/databases/groundunitdatabase.ts | 4 +- .../src/unit/databases/helicopterdatabase.ts | 4 +- .../src/unit/databases/navyunitdatabase.ts | 4 +- frontend/react/src/unit/unit.ts | 27 +++++----- 12 files changed, 164 insertions(+), 28 deletions(-) create mode 100644 frontend/react/public/resources/theme/images/buttons/context/miss-on-purpose.svg create mode 100644 frontend/react/public/resources/theme/images/buttons/context/scenic-aaa.svg create mode 100644 frontend/react/public/resources/theme/images/buttons/context/simulate-fire-fight.svg diff --git a/frontend/react/public/resources/theme/images/buttons/context/miss-on-purpose.svg b/frontend/react/public/resources/theme/images/buttons/context/miss-on-purpose.svg new file mode 100644 index 00000000..04000555 --- /dev/null +++ b/frontend/react/public/resources/theme/images/buttons/context/miss-on-purpose.svg @@ -0,0 +1,41 @@ + + diff --git a/frontend/react/public/resources/theme/images/buttons/context/scenic-aaa.svg b/frontend/react/public/resources/theme/images/buttons/context/scenic-aaa.svg new file mode 100644 index 00000000..8d09a374 --- /dev/null +++ b/frontend/react/public/resources/theme/images/buttons/context/scenic-aaa.svg @@ -0,0 +1,50 @@ + + diff --git a/frontend/react/public/resources/theme/images/buttons/context/simulate-fire-fight.svg b/frontend/react/public/resources/theme/images/buttons/context/simulate-fire-fight.svg new file mode 100644 index 00000000..2bfe0c36 --- /dev/null +++ b/frontend/react/public/resources/theme/images/buttons/context/simulate-fire-fight.svg @@ -0,0 +1,42 @@ + + diff --git a/frontend/react/public/resources/theme/images/convertToFontAwesomIcons.py b/frontend/react/public/resources/theme/images/convertToFontAwesomIcons.py index 4c746350..29b3bea5 100644 --- a/frontend/react/public/resources/theme/images/convertToFontAwesomIcons.py +++ b/frontend/react/public/resources/theme/images/convertToFontAwesomIcons.py @@ -1,4 +1,4 @@ -from svgpathtools import svg2paths, wsvg +from svgpathtools import svg2paths2 import os from glob import glob import svgelements @@ -15,7 +15,7 @@ with open(os.path.join( "..", "..", "..", "..", "src", "ui", "components", "oli iconName = temp[0] + ''.join(ele.capitalize() for ele in temp[1:]) svg = svgelements.SVG.parse(filename) - paths, attributes = svg2paths(filename) + paths, attributes, svg_attributes = svg2paths2(filename) fp.write(f"export const ol{iconName}: IconDefinition = {{") fp.write(" icon: [") diff --git a/frontend/react/src/olympusapp.ts b/frontend/react/src/olympusapp.ts index a893928d..442b97c8 100644 --- a/frontend/react/src/olympusapp.ts +++ b/frontend/react/src/olympusapp.ts @@ -158,7 +158,8 @@ export class OlympusApp { this.#weaponsManager = new WeaponsManager(); /* Set the address of the server */ - this.getServerManager().setAddress(window.location.href.split('?')[0]); + // Temporary forcing port 3000 for development + this.getServerManager().setAddress(window.location.href.split('?')[0].replace('8080', '3000')); /* Setup all global events */ this.#setupEvents(); @@ -181,8 +182,8 @@ export class OlympusApp { }) /* Load the config file from the server */ - // Temporary - const configRequest = new Request("http://localhost:3000/" + "resources/config"); + // Temporary forcing port 3000 for development + const configRequest = new Request(window.location.href.split('?')[0].replace('8080', '3000') + "resources/config"); fetch(configRequest).then((response) => { if (response.status === 200) { return response.json(); diff --git a/frontend/react/src/server/servermanager.ts b/frontend/react/src/server/servermanager.ts index 6e62bfef..0c981854 100644 --- a/frontend/react/src/server/servermanager.ts +++ b/frontend/react/src/server/servermanager.ts @@ -129,8 +129,6 @@ export class ServerManager { } setAddress(address: string) { - // Temporary - address = "http://localhost:3000/" this.#REST_ADDRESS = `${address}olympus` console.log(`Setting REST address to ${this.#REST_ADDRESS}`) } diff --git a/frontend/react/src/ui/components/olicons.tsx b/frontend/react/src/ui/components/olicons.tsx index a1548f7b..db5467e8 100644 --- a/frontend/react/src/ui/components/olicons.tsx +++ b/frontend/react/src/ui/components/olicons.tsx @@ -1,5 +1,8 @@ import { IconDefinition, IconName, IconPrefix } from "@fortawesome/fontawesome-svg-core"; export const olButtonsCameraLinked: IconDefinition = { icon: [ 16.0, 16.0, [], "","M 14.718784,8.2555996 C 16.190649999999998,6.7837308 16.190649999999998,4.4000862000000005 14.718784,2.9282205 C 13.416246,1.6256822 11.363445,1.4563517 9.8655269,2.5270381 L 9.8238459,2.5556831 C 9.4487143,2.8240079 9.3627479,3.3450208 9.63107,3.7175489 C 9.8993936,4.0900739 10.420406999999999,4.1786481 10.792933999999999,3.9103237 L 10.834623999999998,3.8816787 C 11.670853999999999,3.2851159 12.814483999999998,3.3788969 13.538693999999998,4.1057125 C 14.359291999999998,4.9263121000000005 14.359291999999998,6.2549 13.538693999999998,7.0754996000000006 L 10.615800999999998,10.003604000000001 C 9.795200599999998,10.824204000000002 8.466612799999996,10.824204000000002 7.646012999999998,10.003604000000001 C 6.9191889,9.2767887 6.8254045,8.1331608 7.4219671,7.2995366 L 7.4506141,7.2578546 C 7.7189395,6.8827242 7.630369,6.3617082 7.2578404,6.0959918 C 6.8853158,5.8302724 6.3616949,5.9162417 6.0959777,6.2887668 L 6.067330699999999,6.3304488 C 4.9940392,7.8257624 5.1633693,9.8785611 6.4659076,11.1811 C 7.9377770000000005,12.652969 10.321421,12.652969 11.793287,11.1811 L 14.718784,8.2555996 M 1.1828078,7.6460126 C -0.2890582800000001,9.1178785 -0.2890582800000001,11.501522999999999 1.1828078,12.973391 C 2.4853463,14.275929999999999 4.5381477,14.44526 6.0360657,13.374573 L 6.0777467,13.345922999999999 C 6.4528799,13.077605 6.5388455,12.556589 6.2705243,12.184063 C 6.0021998,11.811539 5.481187,11.722964 5.1086592,11.991289 L 5.0669782,12.019939 C 4.230752000000001,12.616501000000001 3.0871208,12.522717 2.3629103000000002,11.795901 C 1.5423106000000002,10.972696000000001 1.5423106000000002,9.6441089 2.3629103000000002,8.8235091 L 5.2858059,5.8980077 C 6.1064055999999995,5.0774111 7.4349934,5.0774111 8.2555932,5.8980077 C 8.9824085,6.6248233 9.0761929,7.7684541 8.4796304,8.604683399999999 L 8.450982,8.6463657 C 8.1826613,9.0214958 8.2712326,9.5425118 8.643758,9.8082277 C 9.0162857,10.073945 9.5399067,9.9879784 9.805623,9.6154532 L 9.83427,9.5737712 C 10.907561,8.0758525 10.73823,6.0230540999999995 9.4356923,4.720515699999999 C 7.963823699999999,3.248646799999999 5.5801791,3.248646799999999 4.108310599999999,4.720515699999999 L 1.1828078,7.6460126 "], iconName: "olympus-buttons-camera-linked" as IconName, prefix: "fas" as IconPrefix} +export const olButtonsContextMissOnPurpose: IconDefinition = { icon: [ 19.0, 15.0, [], "","M 12.943532,6.8396047 C 12.906571999999999,6.7524067 12.820846,6.6962347 12.726258,6.6962347 C 12.631658,6.6962347 12.545933999999999,6.7524067 12.508982,6.8396047 L 11.857156,8.3605312 C 11.806899,8.4787725 11.7803,8.6044105 11.7803,8.7330024 L 11.7803,9.8711105 L 9.6518899,11.112684 L 9.6518899,10.834807 C 9.6518899,10.638226 9.4937333,10.480072999999999 9.297155700000001,10.480072999999999 C 9.100572900000001,10.480072999999999 8.942419800000001,10.638228999999999 8.942419800000001,10.834807 L 8.942419800000001,11.662524 L 8.942419800000001,12.135503 L 8.942419800000001,12.490238 C 8.942419800000001,12.686819 9.100576300000002,12.844973 9.297155700000001,12.844973 C 9.4937368,12.844973 9.6518899,12.686816 9.6518899,12.490238 L 9.6518899,12.371997 L 11.7803,12.371997 L 11.7803,12.855323 L 10.915634,13.613568 C 10.863904000000002,13.657908 10.834334,13.722955 10.834334,13.790937000000001 L 10.834334,14.027427000000001 C 10.834334,14.157497000000001 10.940763,14.263916000000002 11.070823,14.263916000000002 L 12.489763,14.263916000000002 L 12.489763,13.317957000000002 C 12.489763,13.187886000000002 12.596192,13.081467000000002 12.726254,13.081467000000002 C 12.856325,13.081467000000002 12.962744,13.187896000000002 12.962744,13.317957000000002 L 12.962744,14.263916000000002 L 14.381684,14.263916000000002 C 14.511754999999999,14.263916000000002 14.618174,14.157487000000001 14.618174,14.027427000000001 L 14.618174,13.790937000000001 C 14.618174,13.722957000000001 14.588614,13.657909000000002 14.536874,13.613568 L 13.672208,12.855323 L 13.672208,12.371997 L 15.800618,12.371997 L 15.800618,12.490238 C 15.800618,12.686819 15.958775,12.844973 16.155352,12.844973 C 16.351935,12.844973 16.510088,12.686816 16.510088,12.490238 L 16.510088,12.135503 L 16.510088,11.662524 L 16.510088,10.834807 C 16.510088,10.638226 16.351931999999998,10.480072999999999 16.155352,10.480072999999999 C 15.958771,10.480072999999999 15.800618,10.638228999999999 15.800618,10.834807 L 15.800618,11.112684 L 13.672207,9.8711105 L 13.672207,8.7330024 C 13.672207,8.604419 13.645607,8.4787759 13.595347,8.3605312 L 12.943532,6.8396047 M 7.5302695,0.56363819 C 7.8731864,0.56363819 8.1502321,0.84068389 8.1502321,1.1836006000000001 L 8.1502321,1.3850885000000002 C 9.965560100000001,1.6543846000000002 11.399224,3.0899854 11.668519,4.9033755 L 11.870008,4.9033755 C 12.212923,4.9033755 12.489968000000001,5.1804212000000005 12.489968000000001,5.5233381 C 12.489968000000001,5.8662549 12.212923000000002,6.1433006 11.870008,6.1433006 L 11.668519,6.1433006 C 11.399224,7.9586287 9.9636216,9.3922904 8.1502321,9.6615873 L 8.1502321,9.863074500000002 C 8.1502321,10.205991000000001 7.8731864,10.483037000000001 7.5302695,10.483037000000001 C 7.1873526000000005,10.483037000000001 6.9103069,10.205991000000001 6.9103069,9.863074500000002 L 6.9103069,9.6615873 C 5.0949795,9.3922904 3.6613162,7.9586287 3.3920201,6.1433006 L 3.1905322,6.1433006 C 2.8476155,6.1433006 2.5705698,5.8662548999999995 2.5705698,5.5233381 C 2.5705698,5.1804212000000005 2.8476155,4.9033755 3.1905322,4.9033755 L 3.3920201,4.9033755 C 3.6613162,3.0880479 5.0949795,1.6543846 6.9103069,1.3850885 L 6.9103069,1.1836006 C 6.9103069,0.8406838899999999 7.1873526000000005,0.5636381899999999 7.5302695,0.5636381899999999 L 7.5302695,0.56363819 M 4.6513189,6.1433006 C 4.893491699999999,7.2727949 5.7827511,8.1601158 6.9103069,8.4022891 L 6.9103069,8.0031884 C 6.9103069,7.660271500000001 7.1873526000000005,7.383225800000001 7.5302695,7.383225800000001 C 7.8731864,7.383225800000001 8.1502321,7.660271500000001 8.1502321,8.0031884 L 8.1502321,8.4022891 C 9.2797263,8.1601158 10.167047,7.2708564 10.409221,6.1433006 L 10.01012,6.1433006 C 9.667202900000001,6.1433006 9.3901572,5.8662548999999995 9.3901572,5.5233381 C 9.3901572,5.1804212000000005 9.667202900000001,4.9033755 10.01012,4.9033755 L 10.409221,4.9033755 C 10.167047,3.7738812 9.2797263,2.8865601 8.1502321,2.6443873 L 8.1502321,3.0434882 C 8.1502321,3.3864046 7.8731864,3.6634503 7.5302695,3.6634503 C 7.1873526000000005,3.6634503 6.9103069,3.3864046 6.9103069,3.0434882 L 6.9103069,2.6443873 C 5.7808126,2.8865601 4.8934917,3.7738812 4.6513189,4.9033755 L 5.0504196,4.9033755 C 5.393336,4.9033755 5.6703817,5.1804212000000005 5.6703817,5.5233381 C 5.6703817,5.8662549 5.393336,6.1433006 5.0504196,6.1433006 L 4.6513189,6.1433006 M 7.5302695,4.9033755 A 0.61996259,0.61996259 0.0 1,1 7.5302695,6.1433006 A 0.61996259,0.61996259 0.0 1,1 7.5302695,4.9033755 "], iconName: "olympus-buttons-context-miss-on-purpose" as IconName, prefix: "fas" as IconPrefix} +export const olButtonsContextScenicAaa: IconDefinition = { icon: [ 19.0, 15.0, [], "","M 11.193211,6.498903 C 11.156611,6.41251 11.071674999999999,6.3568675 10.977962,6.3568675 C 10.884252,6.3568675 10.79932,6.4125125 10.762712,6.498903 L 10.116965,8.0056482 C 10.067175,8.122790799999999 10.040825,8.2472545 10.040825,8.374647099999999 L 10.040825,9.5021428 L 7.9322576,10.732138 L 7.9322576,10.456854000000002 C 7.9322576,10.262105000000002 7.77558,10.105427000000002 7.5808308,10.105427000000002 C 7.3860815,10.105427000000002 7.2294032,10.262105000000002 7.2294032,10.456854000000002 L 7.2294032,11.276852000000002 L 7.2294032,11.745421000000002 L 7.2294032,12.096849000000002 C 7.2294032,12.291597000000003 7.3860815,12.448276000000002 7.5808308,12.448276000000002 C 7.775580000000001,12.448276000000002 7.9322576,12.291597000000001 7.9322576,12.096849000000002 L 7.9322576,11.979706000000002 L 10.040822,11.979706000000002 L 10.040822,12.458526000000003 L 9.184218,13.209701000000003 C 9.132968,13.253631000000002 9.103688,13.318055000000003 9.103688,13.385415000000002 L 9.103688,13.6197 C 9.103688,13.748557 9.209116,13.853985 9.337973,13.853985 L 10.743682,13.853985 L 10.743682,12.916845 C 10.743682,12.787989 10.849113,12.68256 10.977967,12.68256 C 11.106823,12.68256 11.212251,12.787991 11.212251,12.916845 L 11.212251,13.853985 L 12.617962,13.853985 C 12.746819,13.853985 12.852246000000001,13.748555 12.852246000000001,13.6197 L 12.852246000000001,13.385415 C 12.852246000000001,13.318055 12.822966000000001,13.25363 12.771716000000001,13.209701 L 11.915109000000001,12.458526 L 11.915109000000001,11.979706 L 14.023673,11.979706 L 14.023673,12.096849 C 14.023673,12.291599000000001 14.180352000000001,12.448277000000001 14.3751,12.448277000000001 C 14.56985,12.448277000000001 14.726528,12.291599000000001 14.726528,12.096849 L 14.726528,11.745421 L 14.726528,11.276852 L 14.726528,10.456854 C 14.726528,10.262105 14.56985,10.105427 14.3751,10.105427 C 14.180352,10.105427 14.023673,10.262105 14.023673,10.456854 L 14.023673,10.732137999999999 L 11.915102,9.5021428 L 11.915102,8.3746471 C 11.915102,8.2472545 11.888732,8.1227903 11.838961999999999,8.005648200000001 L 11.193211,6.498903 M 5.375668,1.2470443 C 5.30062,1.1962303 5.2005546,1.2056133 5.1364508,1.2689323 C 5.0723498,1.3322513 5.0629648,1.4331009 5.1145628,1.5073675 L 5.9901294,2.7839753 L 5.2115006,3.0372652999999996 C 5.1341066,3.0622822999999997 5.0817284,3.1342022999999997 5.0817284,3.2155051999999995 C 5.0817284,3.2968081999999996 5.1341064,3.3687296999999994 5.2115006,3.3937458999999994 L 6.0174912,3.6548524 L 5.6039425,4.4412997 C 5.5656405,4.5140027 5.5789265,4.603123 5.637560499999999,4.6609731 C 5.696195499999999,4.718825099999999 5.784530599999999,4.732894099999999 5.857234699999999,4.694591099999999 L 6.6436816,4.2810428 L 6.9047879,5.0870331 C 6.9298049,5.1644281 7.001724899999999,5.2168053 7.083028499999999,5.2168053 C 7.164331499999999,5.2168053 7.236252899999999,5.1644273 7.261269099999999,5.0870331 L 7.522375099999999,4.2810424000000005 L 8.3088223,4.6945911 C 8.3815253,4.7328931 8.470645699999999,4.7196071 8.528495699999999,4.6609731000000005 C 8.586348699999999,4.602338100000001 8.600416699999998,4.514003000000001 8.5621137,4.441299600000001 L 8.1485644,3.6548524 L 8.9545554,3.3937462 C 9.0319494,3.3687302 9.0843269,3.2968081999999996 9.0843269,3.2155055 C 9.0843269,3.1342035 9.0319479,3.0622819 8.9545554,3.0372656 L 8.1219841,2.767559 L 8.3228958,2.2172025 C 8.347912,2.1484097 8.3307157,2.0717956 8.2791193,2.0202001 C 8.2275229,1.9686037 8.1509111,1.9514074 8.0821168,1.9764236 L 7.5317596,2.1773344 L 7.2612725,1.3439827 C 7.236256,1.2665882 7.1643354,1.2142105 7.0830319,1.2142105 C 7.0017289,1.2142105 6.9298073,1.2665885000000001 6.9047911,1.3439827000000002 L 6.6522839,2.1226115 L 5.375668,1.2470443 M 0.9232391,10.130493 C 0.8481911,10.079683 0.7481257,10.089063 0.6840219,10.152383 C 0.6199209,10.215703 0.6105358999999999,10.316551 0.6621338999999999,10.390818000000001 L 1.5377005,11.667426 L 0.7590716999999999,11.920716 C 0.6816776999999999,11.945736 0.6292994999999999,12.017656 0.6292994999999999,12.098955 C 0.6292994999999999,12.180255 0.6816774999999999,12.252180000000001 0.7590716999999999,12.277196 L 1.5650623,12.538302999999999 L 1.1515136,13.32475 C 1.1132115999999999,13.39745 1.1264976,13.486573 1.1851315999999998,13.544423 C 1.2437665999999998,13.602273 1.3321017,13.616343 1.4048057999999999,13.578043000000001 L 2.1912526999999997,13.164493 L 2.4523589999999995,13.970483 C 2.4773759999999996,14.047883 2.5492959999999996,14.100256 2.6305995999999996,14.100256 C 2.7119025999999997,14.100256 2.7838239999999996,14.047876 2.8088401999999997,13.970483 L 3.0699461999999995,13.164493 L 3.8563933999999995,13.578041 C 3.9290963999999997,13.616341 4.018216799999999,13.603061 4.0760667999999995,13.544421 C 4.133919799999999,13.485790999999999 4.147987799999999,13.397451 4.109684799999999,13.324748 L 3.696135499999999,12.538302999999999 L 4.502126499999999,12.277197 C 4.579520499999999,12.252177 4.631898,12.180257 4.631898,12.098956 C 4.631898,12.017655999999999 4.5795189999999995,11.945732 4.502126499999999,11.920715999999999 L 3.6695552,11.651007 L 3.8704669,11.100651 C 3.8954828999999997,11.031861 3.8782869,10.955243999999999 3.8266909,10.903647999999999 C 3.7750949,10.852047999999998 3.6984827,10.834857999999999 3.6296884,10.859867999999999 L 3.0793307,11.060783 L 2.8088436,10.227431 C 2.7838266,10.150041 2.7119066,10.097659 2.630603,10.097659 C 2.5492999999999997,10.097659 2.4773783999999996,10.150039 2.4523621999999996,10.227431 L 2.199855,11.00606 L 0.9232391,10.130493 M 3.8607391,5.442993 C 3.7856911,5.392183 3.6856257,5.401563 3.6215219,5.464883 C 3.5574209,5.528203 3.5480359,5.6290510000000005 3.5996338999999997,5.703318 L 4.4752005,6.979926000000001 L 3.6965717,7.2332160000000005 C 3.6191777,7.258236 3.5667994999999997,7.330156000000001 3.5667994999999997,7.411455 C 3.5667994999999997,7.492755 3.6191774999999997,7.56468 3.6965717,7.589696 L 4.5025623,7.850803 L 4.0890136,8.63725 C 4.0507116000000005,8.70995 4.0639976,8.799073 4.1226316,8.856923 C 4.1812666,8.914773 4.2696017,8.928843 4.3423058,8.890543000000001 L 5.1287527,8.476993 L 5.3898589999999995,9.282983 C 5.414876,9.360383 5.486795999999999,9.412756 5.568099599999999,9.412756 C 5.649402599999999,9.412756 5.721323999999999,9.360376 5.746340199999999,9.282983 L 6.007446199999999,8.476993 L 6.793893399999998,8.890541 C 6.866596399999998,8.928841 6.9557167999999985,8.915561 7.013566799999998,8.856921 C 7.0714197999999975,8.798290999999999 7.0854877999999974,8.709951 7.0471847999999975,8.637248 L 6.6336355,7.850803 L 7.4396265,7.589697 C 7.5170205,7.5646770000000005 7.5693980000000005,7.492757 7.5693980000000005,7.411456 C 7.5693980000000005,7.330156000000001 7.517019,7.2582320000000005 7.4396265,7.2332160000000005 L 6.6070552,6.963507 L 6.8079669,6.413151 C 6.8329829,6.344361 6.8157869,6.267744 6.7641909,6.216148 C 6.7125949,6.164548 6.6359827,6.147358 6.5671884,6.172368 L 6.0168307,6.373283 L 5.7463436,5.539931 C 5.7213266,5.462541 5.6494066,5.410159 5.568103,5.410159 C 5.4868,5.410159 5.4148784,5.4625390000000005 5.3898622,5.539931 L 5.137355,6.31856 L 3.8607391,5.442993 M 13.173239,2.1617426 C 13.098189000000001,2.1109286000000003 12.998126000000001,2.1203116 12.934022,2.1836306000000003 C 12.869922,2.2469496 12.860532000000001,2.3477992000000003 12.912132,2.4220658000000004 L 13.787697999999999,3.6986736000000002 L 13.00907,3.9519636 C 12.93168,3.9769806 12.879297,4.0489006 12.879297,4.1302035 C 12.879297,4.2115065000000005 12.931676999999999,4.283428000000001 13.00907,4.3084442 L 13.815059999999999,4.569550700000001 L 13.401511,5.3559980000000005 C 13.363211,5.428701 13.376491,5.5178213000000005 13.435131,5.5756714 C 13.493771,5.6335234 13.582102,5.6475924 13.654806,5.6092894 L 14.441253000000001,5.195741099999999 L 14.702359000000001,6.0017314 C 14.727379,6.0791264 14.799299000000001,6.131503599999999 14.880599000000002,6.131503599999999 C 14.961899000000003,6.131503599999999 15.033824000000003,6.079125599999999 15.058840000000002,6.0017314 L 15.319946000000002,5.1957407 L 16.106393,5.6092894 C 16.179093,5.6475914 16.268217,5.6343054 16.326067000000002,5.5756714 C 16.383917,5.5170364 16.397987,5.4287013 16.359687,5.3559979 L 15.946137,4.569550700000001 L 16.752128,4.3084445 C 16.829518,4.2834285 16.881899999999998,4.2115065000000005 16.881899999999998,4.1302038 C 16.881899999999998,4.0489018 16.82952,3.9769802000000003 16.752128,3.9519639000000004 L 15.919555,3.6822573 L 16.120467,3.1319008 C 16.145487000000003,3.0631078 16.128267,2.9864939 16.076687,2.9348984 C 16.025087,2.8833024 15.948478999999999,2.8661054 15.879685,2.8911224 L 15.329331,3.0920327 L 15.058843,2.258681 C 15.033823,2.181286 14.961903,2.1289088 14.880602999999999,2.1289088 C 14.799302999999998,2.1289088 14.727377999999998,2.1812868 14.702361999999999,2.258681 L 14.449855,3.0373098 L 13.173239,2.1617426 "], iconName: "olympus-buttons-context-scenic-aaa" as IconName, prefix: "fas" as IconPrefix} +export const olButtonsContextSimulateFireFight: IconDefinition = { icon: [ 19.0, 15.0, [], "","M 7.2492654,5.8221874 C 7.8660011999999995,5.8221874 8.4584561,5.9945821 8.9683555,6.305378 L 8.9683555,13.59209 L 4.3064157,13.59209 L 4.3064157,9.3599202 L 3.0049573,11.559776 C 2.7330108,12.021113 2.1356998,12.174082 1.6743618,11.902135 C 1.2130242,11.630189 1.060054,11.032878 1.3320006,10.571539 L 3.1822081,7.4441541 C 3.7770914,6.4389231 4.857593,5.8221874 6.0255062,5.8221874 L 7.2492654,5.8221874 M 4.6949108,3.1027222 C 4.6944571999999996,0.5123030700000002 8.5794073,0.5123030700000002 8.579860799999999,3.1027222 C 8.580314699999999,5.6931415 4.695364399999999,5.6931415 4.694910799999999,3.1027222 L 4.6949108,3.1027222 M 18.380988,10.005352 C 18.380988,10.219024000000001 18.206167999999998,10.393847000000001 17.992494999999998,10.393847000000001 L 15.168622,10.393847000000001 C 15.035079999999999,10.626944000000002 14.782554,10.782342000000002 14.496037999999999,10.782342000000002 L 11.842132,10.782342000000002 L 11.970820999999999,11.170836000000001 L 13.330554,11.170836000000001 C 13.544226,11.170836000000001 13.719049,11.34566 13.719049,11.559335 L 13.719049,11.947829 C 13.719049,12.161502 13.544226,12.336326 13.330554,12.336326 L 11.278815999999999,12.336326 C 11.111275999999998,12.336326 10.963163,12.229491 10.909745999999998,12.071662 L 10.4824,10.782342 L 9.8340985,10.782342 L 9.8340985,11.947829 C 9.8340985,12.161502 9.6592755,12.336326 9.445603499999999,12.336326 L 9.057108499999998,12.336326 C 8.843436099999998,12.336326 8.668613299999999,12.161502 8.668613299999999,11.947829 L 8.668613299999999,10.879466 L 6.432339,11.437928 C 6.1871018,11.49863 5.9491484,11.314095 5.9491484,11.061573 L 5.9491484,9.6168567 C 5.9491484,9.4031845 6.1239711,9.2283618 6.3376431,9.2283618 L 8.6686133,9.2283618 L 8.6686133,8.839867 C 8.6686133,8.4100941 9.0158305,8.0628769 9.4456035,8.0628769 L 12.942059,8.0628769 C 13.371832000000001,8.0628769 13.719049,8.410094099999998 13.719049,8.839867 L 14.496038,8.839867 C 14.782554000000001,8.839867 15.035076,8.9952646 15.168622000000001,9.2283618 L 17.604,9.2283618 C 17.604,9.0146897 17.778823,8.839867 17.992494999999998,8.839867 C 18.206167999999998,8.839867 18.380988,9.0146897 18.380988,9.2283618 L 18.380988,9.6168567 L 18.380988,10.005352 "], iconName: "olympus-buttons-context-simulate-fire-fight" as IconName, prefix: "fas" as IconPrefix} export const olButtonsEmissionsAttack: IconDefinition = { icon: [ 15.0, 15.0, [], "","M 7.5000002,0.0 C 7.9980002,0.0 8.437500199999999,0.4395 8.437500199999999,0.9375 L 8.437500199999999,1.2598 C 11.1621,1.6699 13.3301,3.8379002 13.7402,6.5625002 L 14.0625,6.5625002 C 14.5605,6.5625002 15.0,7.0020001999999995 15.0,7.5000002 C 15.0,8.027300199999999 14.5605,8.437500199999999 14.0625,8.437500199999999 L 13.7402,8.437500199999999 C 13.3301,11.1914 11.1621,13.3594 8.4375002,13.7695 L 8.4375002,14.0625 C 8.4375002,14.5898 7.998000200000001,15.0 7.500000200000001,15.0 C 6.9727002,15.0 6.562500200000001,14.5898 6.562500200000001,14.0625 L 6.562500200000001,13.7695 C 3.8086002,13.3594 1.6406,11.1914 1.2305,8.4375002 L 0.9375,8.4375002 C 0.4102,8.4375002 0.0,8.0273002 0.0,7.500000200000001 C 0.0,7.0020002 0.4102,6.562500200000001 0.9375,6.562500200000001 L 1.2305,6.562500200000001 C 1.6406,3.8379002 3.8086002,1.6699 6.5625002,1.2598 L 6.5625002,0.9375 C 6.5625002,0.4395 6.972700199999999,0.0 7.5000002,0.0 M 3.1348002,8.4375002 C 3.4863002,10.166 4.8340002,11.5137 6.562500200000001,11.865200000000002 L 6.562500200000001,11.25 C 6.562500200000001,10.752 6.9727002,10.3125 7.500000200000001,10.3125 C 7.998000200000001,10.3125 8.4375002,10.752 8.4375002,11.25 L 8.4375002,11.8652 C 10.1367,11.5137 11.4844,10.166 11.8359,8.4375002 L 11.25,8.4375002 C 10.7227,8.4375002 10.3125,8.0273002 10.3125,7.500000200000001 C 10.3125,7.0020002 10.7227,6.562500200000001 11.25,6.562500200000001 L 11.8359,6.562500200000001 C 11.4844,4.8633002 10.136700000000001,3.5156002000000006 8.4375002,3.1641002000000005 L 8.4375002,3.7500002000000006 C 8.4375002,4.277300200000001 7.998000200000001,4.687500200000001 7.500000200000001,4.687500200000001 C 6.9727002,4.687500200000001 6.562500200000001,4.277300200000001 6.562500200000001,3.7500002000000006 L 6.562500200000001,3.1641002000000005 C 4.8340002,3.5156002000000006 3.4863002000000005,4.8633002 3.1348002000000004,6.562500200000001 L 3.7500002000000006,6.562500200000001 C 4.248000200000001,6.562500200000001 4.687500200000001,7.0020002 4.687500200000001,7.500000200000001 C 4.687500200000001,8.0273002 4.248000200000001,8.4375002 3.7500002000000006,8.4375002 L 3.1348002,8.4375002 M 7.5000002,8.4375002 C 6.972700199999999,8.4375002 6.5625002,8.0273002 6.5625002,7.500000200000001 C 6.5625002,7.0020002 6.972700199999999,6.562500200000001 7.5000002,6.562500200000001 C 7.9980002,6.562500200000001 8.437500199999999,7.0020002 8.437500199999999,7.500000200000001 C 8.437500199999999,8.0273002 7.998000199999999,8.4375002 7.500000199999999,8.4375002 L 7.5000002,8.4375002 "], iconName: "olympus-buttons-emissions-attack" as IconName, prefix: "fas" as IconPrefix} export const olButtonsEmissionsDefend: IconDefinition = { icon: [ 14.063629, 14.9414, [], "","M 7.0324294,0.0 C 7.1496294,0.0 7.2961294,0.0293 7.4133294,0.0879 L 12.921129,2.4316 C 13.565629000000001,2.7246 14.063629,3.3398 14.063629,4.1015999999999995 C 14.034429000000001,7.0312 12.833229000000001,12.334 7.794129400000001,14.7656 C 7.296129400000001,15.0 6.739429400000001,15.0 6.241429400000001,14.7656 C 1.2023294000000009,12.334 0.0012293600000008453,7.031199999999999 0.0012293600000008453,4.1015999999999995 C -0.028070639999999154,3.3397999999999994 0.46992936000000085,2.7245999999999997 1.1144294000000008,2.4315999999999995 L 6.6222294,0.08789999999999942 C 6.7394294,0.0293 6.8859294,0.0 7.0324294,0.0 M 7.0324294,1.9629 L 7.0324294,13.0371 C 11.075429,11.0742 12.159429,6.7676 12.188629,4.1602 L 7.0324294,1.9629 "], iconName: "olympus-buttons-emissions-defend" as IconName, prefix: "fas" as IconPrefix} export const olButtonsEmissionsFree: IconDefinition = { icon: [ 13.126647, 15.015483, [], "","M 10.796771,3.75 C 10.796771,5.06836 10.034970999999999,6.21094 8.9217214,6.88476 L 8.9217214,7.50001 C 8.9217214,8.02731 8.482271399999998,8.43751 7.984221399999999,8.43751 L 5.171721399999999,8.43751 C 4.644381399999999,8.43751 4.234221399999999,8.02731 4.234221399999999,7.50001 L 4.234221399999999,6.88476 C 3.0916413999999994,6.21094 2.359221399999999,5.06836 2.359221399999999,3.75 C 2.359221399999999,1.69922 4.234221399999999,0.0 6.577971399999999,0.0 C 8.8924214,0.0 10.796771,1.69922 10.796771,3.75 M 4.9373514,5.15625 C 5.435391399999999,5.15625 5.8748514,4.74609 5.8748514,4.21875 C 5.8748514,3.7207 5.435391399999999,3.28125 4.9373514,3.28125 C 4.4100014,3.28125 3.9998514,3.7207 3.9998514,4.21875 C 3.9998514,4.74609 4.4100014,5.15625 4.9373514,5.15625 M 9.1560714,4.21875 C 9.1560714,3.7207 8.7166414,3.28125 8.2185914,3.28125 C 7.6912514,3.28125 7.281091399999999,3.7207 7.281091399999999,4.21875 C 7.281091399999999,4.74609 7.6912514,5.15625 8.2185914,5.15625 C 8.716641399999999,5.15625 9.1560714,4.74609 9.1560714,4.21875 M 0.10336144,8.02731 C 0.33774144,7.55861 0.89438144,7.38281 1.3631314,7.61721 L 6.5779714,10.22461 L 11.763471,7.61721 C 12.232270999999999,7.38281 12.788870999999999,7.55861 13.023271,8.02731 C 13.257671,8.49611 13.081871,9.05271 12.613171,9.28711 L 8.6580514,11.25001 L 12.613171,13.24221 C 13.081871,13.47661 13.257671,14.03321 13.023271,14.50191 C 12.788870999999999,14.97071 12.232270999999999,15.146510000000001 11.763471,14.91211 L 6.577971399999999,12.30471 L 1.3631313999999994,14.91211 C 0.8943814399999994,15.146510000000001 0.3377414399999994,14.97071 0.10336143999999936,14.50191 C -0.13101256000000064,14.03321 0.04476843999999936,13.47661 0.5135214399999994,13.24221 L 4.4685914,11.25001 L 0.51352144,9.28711 C 0.04476844000000002,9.05271 -0.13101256000000006,8.49611 0.10336143999999997,8.02731 L 0.10336144,8.02731 "], iconName: "olympus-buttons-emissions-free" as IconName, prefix: "fas" as IconPrefix} diff --git a/frontend/react/src/unit/databases/aircraftdatabase.ts b/frontend/react/src/unit/databases/aircraftdatabase.ts index 693dbee9..2b45f5e6 100644 --- a/frontend/react/src/unit/databases/aircraftdatabase.ts +++ b/frontend/react/src/unit/databases/aircraftdatabase.ts @@ -4,8 +4,8 @@ import { UnitDatabase } from "./unitdatabase" export class AircraftDatabase extends UnitDatabase { constructor() { - //Temporary - super('http://localhost:3000/api/databases/units/aircraftdatabase'); + // Temporary forcing port 3000 for development + super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/aircraftdatabase'); } getCategory() { diff --git a/frontend/react/src/unit/databases/groundunitdatabase.ts b/frontend/react/src/unit/databases/groundunitdatabase.ts index fb5903fa..e104a238 100644 --- a/frontend/react/src/unit/databases/groundunitdatabase.ts +++ b/frontend/react/src/unit/databases/groundunitdatabase.ts @@ -4,8 +4,8 @@ import { UnitDatabase } from "./unitdatabase" export class GroundUnitDatabase extends UnitDatabase { constructor() { - // Temporary - super('http://localhost:3000/api/databases/units/groundunitdatabase'); + // Temporary forcing port 3000 for development + super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/groundunitdatabase'); } getSpawnPointsByName(name: string) { diff --git a/frontend/react/src/unit/databases/helicopterdatabase.ts b/frontend/react/src/unit/databases/helicopterdatabase.ts index 538ce4cc..9fe3f647 100644 --- a/frontend/react/src/unit/databases/helicopterdatabase.ts +++ b/frontend/react/src/unit/databases/helicopterdatabase.ts @@ -4,8 +4,8 @@ import { UnitDatabase } from "./unitdatabase" export class HelicopterDatabase extends UnitDatabase { constructor() { - // Temporary - super('http://localhost:3000/api/databases/units/helicopterdatabase'); + // Temporary forcing port 3000 for development + super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/helicopterdatabase'); } getSpawnPointsByName(name: string) { diff --git a/frontend/react/src/unit/databases/navyunitdatabase.ts b/frontend/react/src/unit/databases/navyunitdatabase.ts index 44a18a00..39b27b4c 100644 --- a/frontend/react/src/unit/databases/navyunitdatabase.ts +++ b/frontend/react/src/unit/databases/navyunitdatabase.ts @@ -4,8 +4,8 @@ import { UnitDatabase } from "./unitdatabase" export class NavyUnitDatabase extends UnitDatabase { constructor() { - // Temporary - super('http://localhost:3000/api/databases/units/navyunitdatabase'); + // Temporary forcing port 3000 for development + super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/navyunitdatabase'); } getSpawnPointsByName(name: string) { diff --git a/frontend/react/src/unit/unit.ts b/frontend/react/src/unit/unit.ts index 5be53170..feacd2f2 100644 --- a/frontend/react/src/unit/unit.ts +++ b/frontend/react/src/unit/unit.ts @@ -15,8 +15,9 @@ import { RangeCircle } from "../map/rangecircle"; import { Group } from './group'; import { ContextActionSet } from './contextactionset'; import * as turf from "@turf/turf"; -import { olIconsDiamond, olIconsEchelonLh, olIconsEchelonRh, olIconsFollow, olIconsFront, olIconsGroupGround, olIconsLandAtPoint, olIconsLineAbreast, olIconsTrail, olStatesAttack, olStatesRefuel } from '../ui/components/olicons'; -import { faArrowDown, faExclamation, faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; +import { olButtonsContextMissOnPurpose, olButtonsContextScenicAaa, olButtonsContextSimulateFireFight, olIconsDiamond, olIconsEchelonLh, olIconsEchelonRh, olIconsFollow, olIconsFront, olIconsGroupGround, olIconsLandAtPoint, olIconsLineAbreast, olIconsTrail, olStatesAttack, olStatesMissOnPurpose, olStatesRefuel } from '../ui/components/olicons'; +import { faArrowDown, faExclamation, faLocationCrosshairs, faMapLocation, faPeopleGroup, faQuestionCircle, faXmarksLines } from '@fortawesome/free-solid-svg-icons'; +import { FaXmarksLines } from 'react-icons/fa6'; var pathIcon = new Icon({ iconUrl: '/resources/theme/images/markers/marker-icon.png', @@ -1505,7 +1506,7 @@ export abstract class AirUnit extends Unit { contextActionSet.addContextAction(this, "refuel", "Refuel", "Refuel units at the nearest AAR Tanker. If no tanker is available the unit will RTB", olStatesRefuel, (units: Unit[]) => { getApp().getUnitsManager().refuel(units) }, { executeImmediately: true }); - contextActionSet.addContextAction(this, "center-map", "Center map", "Center the map on the unit and follow it", faQuestionCircle, (units: Unit[]) => { + contextActionSet.addContextAction(this, "center-map", "Center map", "Center the map on the unit and follow it", faMapLocation, (units: Unit[]) => { getApp().getMap().centerOnUnit(units[0]); }, { executeImmediately: true }); @@ -1520,11 +1521,11 @@ export abstract class AirUnit extends Unit { }); /* Context actions with a target position */ - contextActionSet.addContextAction(this, "bomb", "Precision bombing", "Click on a point to execute a precision bombing attack", faQuestionCircle, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { + contextActionSet.addContextAction(this, "bomb", "Precision bombing", "Click on a point to execute a precision bombing attack", faLocationCrosshairs, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { if (targetPosition) getApp().getUnitsManager().bombPoint(targetPosition , units) }); - contextActionSet.addContextAction(this, "carpet-bomb", "Carpet bombing", "Click on a point to execute a carpet bombing attack", faQuestionCircle, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { + contextActionSet.addContextAction(this, "carpet-bomb", "Carpet bombing", "Click on a point to execute a carpet bombing attack", faXmarksLines, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { if (targetPosition) getApp().getUnitsManager().carpetBomb(targetPosition , units) }); @@ -1603,35 +1604,35 @@ export class GroundUnit extends Unit { appendContextActions(contextActionSet: ContextActionSet) { /* Context actions to be executed immediately */ - contextActionSet.addContextAction(this, "group-ground", "Group ground units", "Create a group of ground units", olIconsGroupGround, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { + contextActionSet.addContextAction(this, "group-ground", "Group ground units", "Create a group of ground units", faPeopleGroup, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { getApp().getUnitsManager().createGroup(units) }, { executeImmediately: true }); - contextActionSet.addContextAction(this, "center-map", "Center map", "Center the map on the unit and follow it", faQuestionCircle, (units: Unit[]) => { + contextActionSet.addContextAction(this, "center-map", "Center map", "Center the map on the unit and follow it", faMapLocation, (units: Unit[]) => { getApp().getMap().centerOnUnit(units[0]); }, { executeImmediately: true }); if (this.canAAA()) { - contextActionSet.addContextAction(this, "scenic-aaa", "Scenic AAA", "Shoot AAA in the air without aiming at any target, when an enemy unit gets close enough. WARNING: works correctly only on neutral units, blue or red units will aim", faQuestionCircle, (units: Unit[]) => { + contextActionSet.addContextAction(this, "scenic-aaa", "Scenic AAA", "Shoot AAA in the air without aiming at any target, when an enemy unit gets close enough. WARNING: works correctly only on neutral units, blue or red units will aim", olButtonsContextScenicAaa, (units: Unit[]) => { getApp().getUnitsManager().scenicAAA(units) }, { executeImmediately: true }); - contextActionSet.addContextAction(this, "miss-aaa", "Dynamic accuracy AAA", "Shoot AAA towards the closest enemy unit, but don't aim precisely. WARNING: works correctly only on neutral units, blue or red units will aim", faQuestionCircle, (units: Unit[]) => { + contextActionSet.addContextAction(this, "miss-aaa", "Dynamic accuracy AAA", "Shoot AAA towards the closest enemy unit, but don't aim precisely. WARNING: works correctly only on neutral units, blue or red units will aim", olButtonsContextMissOnPurpose, (units: Unit[]) => { getApp().getUnitsManager().missOnPurpose(units) }, { executeImmediately: true }); } /* Context actions that require a target unit */ - contextActionSet.addContextAction(this, "attack", "Attack unit", "Click on a unit to attack it", faQuestionCircle, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { + contextActionSet.addContextAction(this, "attack", "Attack unit", "Click on a unit to attack it", olStatesAttack, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { if (targetUnit) getApp().getUnitsManager().attackUnit(targetUnit.ID, units) }); /* Context actions that require a target position */ if (this.canTargetPoint()) { - contextActionSet.addContextAction(this, "fire-at-area", "Fire at area", "Click on a point to precisely fire at it (if possible)", faQuestionCircle, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { + contextActionSet.addContextAction(this, "fire-at-area", "Fire at area", "Click on a point to precisely fire at it (if possible)", faLocationCrosshairs, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { if (targetPosition) getApp().getUnitsManager().fireAtArea(targetPosition , units) }); - contextActionSet.addContextAction(this, "simulate-fire-fight", "Simulate fire fight", "Simulate a fire fight by shooting randomly in a certain large area. WARNING: works correctly only on neutral units, blue or red units will aim", faQuestionCircle, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { + contextActionSet.addContextAction(this, "simulate-fire-fight", "Simulate fire fight", "Simulate a fire fight by shooting randomly in a certain large area. WARNING: works correctly only on neutral units, blue or red units will aim", olButtonsContextSimulateFireFight, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { if (targetPosition) getApp().getUnitsManager().simulateFireFight(targetPosition , units) }); @@ -1711,7 +1712,7 @@ export class NavyUnit extends Unit { contextActionSet.addContextAction(this, "group-navy", "Group navy units", "Create a group of navy units", faQuestionCircle, (units: Unit[], targetUnit: Unit | null, targetPosition: LatLng | null) => { getApp().getUnitsManager().createGroup(units) }, { executeImmediately: true }); - contextActionSet.addContextAction(this, "center-map", "Center map", "Center the map on the unit and follow it", faQuestionCircle, (units: Unit[]) => { + contextActionSet.addContextAction(this, "center-map", "Center map", "Center the map on the unit and follow it", faMapLocation, (units: Unit[]) => { getApp().getMap().centerOnUnit(units[0]); }, { executeImmediately: true });