Added context buttons, temporary fixes to allow preview

This commit is contained in:
Davide Passoni 2024-06-28 11:04:18 +02:00
parent 329e9b86fd
commit cd38a2f053
12 changed files with 164 additions and 28 deletions

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="19"
height="15"
viewBox="0 0 19 15"
fill="none"
version="1.1"
id="svg6"
sodipodi:docname="miss-on-purpose.svg"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs10" /><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="39.220856"
inkscape:cx="12.557095"
inkscape:cy="8.8090887"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" /><path
d="m 12.943532,6.8396047 c -0.03696,-0.087198 -0.122686,-0.14337 -0.217274,-0.14337 -0.0946,0 -0.180324,0.056172 -0.217276,0.14337 L 11.857156,8.3605312 C 11.806899,8.4787725 11.7803,8.6044105 11.7803,8.7330024 V 9.8711105 L 9.6518899,11.112684 v -0.277877 c 0,-0.196581 -0.1581566,-0.354734 -0.3547342,-0.354734 -0.1965828,0 -0.3547359,0.158156 -0.3547359,0.354734 v 0.827717 0.472979 0.354735 c 0,0.196581 0.1581565,0.354735 0.3547359,0.354735 0.1965811,0 0.3547342,-0.158157 0.3547342,-0.354735 V 12.371997 H 11.7803 v 0.483326 l -0.864666,0.758245 c -0.05173,0.04434 -0.0813,0.109387 -0.0813,0.177369 v 0.23649 c 0,0.13007 0.106429,0.236489 0.236489,0.236489 h 1.41894 v -0.945959 c 0,-0.130071 0.106429,-0.23649 0.236491,-0.23649 0.130071,0 0.23649,0.106429 0.23649,0.23649 v 0.945959 h 1.41894 c 0.130071,0 0.23649,-0.106429 0.23649,-0.236489 v -0.23649 c 0,-0.06798 -0.02956,-0.133028 -0.0813,-0.177369 l -0.864666,-0.758245 v -0.483326 h 2.12841 v 0.118241 c 0,0.196581 0.158157,0.354735 0.354734,0.354735 0.196583,0 0.354736,-0.158157 0.354736,-0.354735 v -0.354735 -0.472979 -0.827717 c 0,-0.196581 -0.158156,-0.354734 -0.354736,-0.354734 -0.196581,0 -0.354734,0.158156 -0.354734,0.354734 v 0.277877 L 13.672207,9.8711105 V 8.7330024 c 0,-0.1285834 -0.0266,-0.2542265 -0.07686,-0.3724712 z"
id="path1154"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0276;stroke-dasharray:none;stroke-opacity:1" /><path
d="m 7.5302695,0.56363819 c 0.3429169,0 0.6199626,0.2770457 0.6199626,0.61996241 v 0.2014879 c 1.815328,0.2692961 3.2489919,1.7048969 3.5182869,3.518287 h 0.201489 c 0.342915,0 0.61996,0.2770457 0.61996,0.6199626 0,0.3429168 -0.277045,0.6199625 -0.61996,0.6199625 H 11.668519 C 11.399224,7.9586287 9.9636216,9.3922904 8.1502321,9.6615873 v 0.2014872 c 0,0.3429165 -0.2770457,0.6199625 -0.6199626,0.6199625 -0.3429169,0 -0.6199626,-0.277046 -0.6199626,-0.6199625 V 9.6615873 C 5.0949795,9.3922904 3.6613162,7.9586287 3.3920201,6.1433006 H 3.1905322 c -0.3429167,0 -0.6199624,-0.2770457 -0.6199624,-0.6199625 0,-0.3429169 0.2770457,-0.6199626 0.6199624,-0.6199626 H 3.3920201 C 3.6613162,3.0880479 5.0949795,1.6543846 6.9103069,1.3850885 V 1.1836006 c 0,-0.34291671 0.2770457,-0.61996241 0.6199626,-0.61996241 z M 4.6513189,6.1433006 c 0.2421728,1.1294943 1.1314322,2.0168152 2.258988,2.2589885 V 8.0031884 c 0,-0.3429169 0.2770457,-0.6199626 0.6199626,-0.6199626 0.3429169,0 0.6199626,0.2770457 0.6199626,0.6199626 V 8.4022891 C 9.2797263,8.1601158 10.167047,7.2708564 10.409221,6.1433006 H 10.01012 c -0.3429171,0 -0.6199628,-0.2770457 -0.6199628,-0.6199625 0,-0.3429169 0.2770457,-0.6199626 0.6199628,-0.6199626 h 0.399101 C 10.167047,3.7738812 9.2797263,2.8865601 8.1502321,2.6443873 v 0.3991009 c 0,0.3429164 -0.2770457,0.6199621 -0.6199626,0.6199621 -0.3429169,0 -0.6199626,-0.2770457 -0.6199626,-0.6199621 V 2.6443873 C 5.7808126,2.8865601 4.8934917,3.7738812 4.6513189,4.9033755 h 0.3991007 c 0.3429164,0 0.6199621,0.2770457 0.6199621,0.6199626 0,0.3429168 -0.2770457,0.6199625 -0.6199621,0.6199625 z M 7.5302695,4.9033755 a 0.61996259,0.61996259 0 1 1 0,1.2399251 0.61996259,0.61996259 0 1 1 0,-1.2399251 z"
id="path2"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0276;stroke-dasharray:none" /></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="19"
height="15"
viewBox="0 0 19 15"
fill="none"
version="1.1"
id="svg6"
sodipodi:docname="scenic-aaa.svg"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs10" /><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="32"
inkscape:cx="12.515625"
inkscape:cy="8.203125"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" /><path
d="m 11.193211,6.498903 c -0.0366,-0.086393 -0.121536,-0.1420355 -0.215249,-0.1420355 -0.09371,0 -0.178642,0.055645 -0.21525,0.1420355 l -0.645747,1.5067452 c -0.04979,0.1171426 -0.07614,0.2416063 -0.07614,0.3689989 V 9.5021428 L 7.9322576,10.732138 v -0.275284 c 0,-0.194749 -0.1566776,-0.351427 -0.3514268,-0.351427 -0.1947493,0 -0.3514276,0.156678 -0.3514276,0.351427 v 0.819998 0.468569 0.351428 c 0,0.194748 0.1566783,0.351427 0.3514276,0.351427 0.1947492,0 0.3514268,-0.156679 0.3514268,-0.351427 v -0.117143 h 2.1085644 v 0.47882 l -0.856604,0.751175 c -0.05125,0.04393 -0.08053,0.108354 -0.08053,0.175714 V 13.6197 c 0,0.128857 0.105428,0.234285 0.234285,0.234285 h 1.405709 v -0.93714 c 0,-0.128856 0.105431,-0.234285 0.234285,-0.234285 0.128856,0 0.234284,0.105431 0.234284,0.234285 v 0.93714 h 1.405711 c 0.128857,0 0.234284,-0.10543 0.234284,-0.234285 v -0.234285 c 0,-0.06736 -0.02928,-0.131785 -0.08053,-0.175714 l -0.856607,-0.751175 v -0.47882 h 2.108564 v 0.117143 c 0,0.19475 0.156679,0.351428 0.351427,0.351428 0.19475,0 0.351428,-0.156678 0.351428,-0.351428 v -0.351428 -0.468569 -0.819998 c 0,-0.194749 -0.156678,-0.351427 -0.351428,-0.351427 -0.194748,0 -0.351427,0.156678 -0.351427,0.351427 v 0.275284 L 11.915102,9.5021428 V 8.3746471 c 0,-0.1273926 -0.02637,-0.2518568 -0.07614,-0.3689989 z"
id="path1154-7"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.0146427;stroke-opacity:1" /><path
d="M 5.375668,1.2470443 C 5.30062,1.1962303 5.2005546,1.2056133 5.1364508,1.2689323 5.0723498,1.3322513 5.0629648,1.4331009 5.1145628,1.5073675 l 0.8755666,1.2766078 -0.7786288,0.25329 c -0.077394,0.025017 -0.1297722,0.096937 -0.1297722,0.1782399 0,0.081303 0.052378,0.1532245 0.1297722,0.1782407 L 6.0174912,3.6548524 5.6039425,4.4412997 c -0.038302,0.072703 -0.025016,0.1618233 0.033618,0.2196734 0.058635,0.057852 0.1469701,0.071921 0.2196742,0.033618 L 6.6436816,4.2810428 6.9047879,5.0870331 c 0.025017,0.077395 0.096937,0.1297722 0.1782406,0.1297722 0.081303,0 0.1532244,-0.052378 0.1782406,-0.1297722 l 0.261106,-0.8059907 0.7864472,0.4135487 c 0.072703,0.038302 0.1618234,0.025016 0.2196734,-0.033618 0.057853,-0.058635 0.071921,-0.1469701 0.033618,-0.2196735 L 8.1485644,3.6548524 8.9545554,3.3937462 c 0.077394,-0.025016 0.1297715,-0.096938 0.1297715,-0.1782407 0,-0.081302 -0.052379,-0.1532236 -0.1297715,-0.1782399 L 8.1219841,2.767559 8.3228958,2.2172025 C 8.347912,2.1484097 8.3307157,2.0717956 8.2791193,2.0202001 8.2275229,1.9686037 8.1509111,1.9514074 8.0821168,1.9764236 L 7.5317596,2.1773344 7.2612725,1.3439827 C 7.236256,1.2665882 7.1643354,1.2142105 7.0830319,1.2142105 c -0.081303,0 -0.1532246,0.052378 -0.1782408,0.1297722 L 6.6522839,2.1226115 Z"
id="path10424"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.00781758;stroke-opacity:1" /><path
d="m 0.9232391,10.130493 c -0.075048,-0.05081 -0.1751134,-0.04143 -0.2392172,0.02189 -0.064101,0.06332 -0.073486,0.164168 -0.021888,0.238435 l 0.8755666,1.276608 -0.7786288,0.25329 c -0.077394,0.02502 -0.1297722,0.09694 -0.1297722,0.178239 0,0.0813 0.052378,0.153225 0.1297722,0.178241 l 0.8059906,0.261107 -0.4135487,0.786447 c -0.038302,0.0727 -0.025016,0.161823 0.033618,0.219673 0.058635,0.05785 0.1469701,0.07192 0.2196742,0.03362 l 0.7864469,-0.41355 0.2611063,0.80599 c 0.025017,0.0774 0.096937,0.129773 0.1782406,0.129773 0.081303,0 0.1532244,-0.05238 0.1782406,-0.129773 l 0.261106,-0.80599 0.7864472,0.413548 c 0.072703,0.0383 0.1618234,0.02502 0.2196734,-0.03362 0.057853,-0.05863 0.071921,-0.14697 0.033618,-0.219673 l -0.4135493,-0.786445 0.805991,-0.261106 c 0.077394,-0.02502 0.1297715,-0.09694 0.1297715,-0.178241 0,-0.0813 -0.052379,-0.153224 -0.1297715,-0.17824 L 3.6695552,11.651007 3.8704669,11.100651 c 0.025016,-0.06879 0.00782,-0.145407 -0.043776,-0.197003 -0.051596,-0.0516 -0.1282082,-0.06879 -0.1970025,-0.04378 L 3.0793307,11.060783 2.8088436,10.227431 c -0.025017,-0.07739 -0.096937,-0.129772 -0.1782406,-0.129772 -0.081303,0 -0.1532246,0.05238 -0.1782408,0.129772 L 2.199855,11.00606 Z"
id="path10424-2"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.00781758;stroke-opacity:1" /><path
d="m 3.8607391,5.442993 c -0.075048,-0.05081 -0.1751134,-0.04143 -0.2392172,0.02189 -0.064101,0.06332 -0.073486,0.164168 -0.021888,0.238435 l 0.8755666,1.276608 -0.7786288,0.25329 c -0.077394,0.02502 -0.1297722,0.09694 -0.1297722,0.178239 0,0.0813 0.052378,0.153225 0.1297722,0.178241 L 4.5025623,7.850803 4.0890136,8.63725 c -0.038302,0.0727 -0.025016,0.161823 0.033618,0.219673 0.058635,0.05785 0.1469701,0.07192 0.2196742,0.03362 l 0.7864469,-0.41355 0.2611063,0.80599 c 0.025017,0.0774 0.096937,0.129773 0.1782406,0.129773 0.081303,0 0.1532244,-0.05238 0.1782406,-0.129773 l 0.261106,-0.80599 0.7864472,0.413548 c 0.072703,0.0383 0.1618234,0.02502 0.2196734,-0.03362 0.057853,-0.05863 0.071921,-0.14697 0.033618,-0.219673 L 6.6336355,7.850803 7.4396265,7.589697 c 0.077394,-0.02502 0.1297715,-0.09694 0.1297715,-0.178241 0,-0.0813 -0.052379,-0.153224 -0.1297715,-0.17824 L 6.6070552,6.963507 6.8079669,6.413151 C 6.8329829,6.344361 6.8157869,6.267744 6.7641909,6.216148 6.7125949,6.164548 6.6359827,6.147358 6.5671884,6.172368 L 6.0168307,6.373283 5.7463436,5.539931 C 5.7213266,5.462541 5.6494066,5.410159 5.568103,5.410159 c -0.081303,0 -0.1532246,0.05238 -0.1782408,0.129772 L 5.137355,6.31856 Z"
id="path10424-2-4"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.00781758;stroke-opacity:1" /><path
d="m 13.173239,2.1617426 c -0.07505,-0.050814 -0.175113,-0.041431 -0.239217,0.021888 -0.0641,0.063319 -0.07349,0.1641686 -0.02189,0.2384352 l 0.875566,1.2766078 -0.778628,0.25329 c -0.07739,0.025017 -0.129773,0.096937 -0.129773,0.1782399 0,0.081303 0.05238,0.1532245 0.129773,0.1782407 l 0.80599,0.2611065 -0.413549,0.7864473 c -0.0383,0.072703 -0.02502,0.1618233 0.03362,0.2196734 0.05864,0.057852 0.146971,0.071921 0.219675,0.033618 l 0.786447,-0.4135483 0.261106,0.8059903 c 0.02502,0.077395 0.09694,0.1297722 0.17824,0.1297722 0.0813,0 0.153225,-0.052378 0.178241,-0.1297722 l 0.261106,-0.8059907 0.786447,0.4135487 c 0.0727,0.038302 0.161824,0.025016 0.219674,-0.033618 0.05785,-0.058635 0.07192,-0.1469701 0.03362,-0.2196735 l -0.41355,-0.7864472 0.805991,-0.2611062 c 0.07739,-0.025016 0.129772,-0.096938 0.129772,-0.1782407 0,-0.081302 -0.05238,-0.1532236 -0.129772,-0.1782399 L 15.919555,3.6822573 16.120467,3.1319008 c 0.02502,-0.068793 0.0078,-0.1454069 -0.04378,-0.1970024 -0.0516,-0.051596 -0.128208,-0.068793 -0.197002,-0.043776 L 15.329331,3.0920327 15.058843,2.258681 c -0.02502,-0.077395 -0.09694,-0.1297722 -0.17824,-0.1297722 -0.0813,0 -0.153225,0.052378 -0.178241,0.1297722 l -0.252507,0.7786288 z"
id="path10424-1"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.00781758;stroke-opacity:1" /></svg>

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="19"
height="15"
viewBox="0 0 19 15"
fill="none"
version="1.1"
id="svg6"
sodipodi:docname="simulate-fire-fight.svg"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs10" /><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="39.220856"
inkscape:cx="4.2961836"
inkscape:cy="7.4067736"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" /><path
d="m 7.2492654,5.8221874 c 0.6167358,0 1.2091907,0.1723947 1.7190901,0.4831906 V 13.59209 H 4.3064157 V 9.3599202 L 3.0049573,11.559776 C 2.7330108,12.021113 2.1356998,12.174082 1.6743618,11.902135 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 Z M 4.6949108,3.1027222 c -4.536e-4,-2.59041913 3.8844965,-2.59041913 3.88495,0 4.539e-4,2.5904193 -3.8844964,2.5904193 -3.88495,0 z"
id="path10805"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:4.77275;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
sodipodi:nodetypes="scccccsccsssss" /><path
d="m 18.380988,10.005352 c 0,0.213672 -0.17482,0.388495 -0.388493,0.388495 h -2.823873 c -0.133542,0.233097 -0.386068,0.388495 -0.672584,0.388495 h -2.653906 l 0.128689,0.388494 h 1.359733 c 0.213672,0 0.388495,0.174824 0.388495,0.388499 v 0.388494 c 0,0.213673 -0.174823,0.388497 -0.388495,0.388497 h -2.051738 c -0.16754,0 -0.315653,-0.106835 -0.36907,-0.264664 L 10.4824,10.782342 H 9.8340985 v 1.165487 c 0,0.213673 -0.174823,0.388497 -0.388495,0.388497 h -0.388495 c -0.2136724,0 -0.3884952,-0.174824 -0.3884952,-0.388497 V 10.879466 L 6.432339,11.437928 C 6.1871018,11.49863 5.9491484,11.314095 5.9491484,11.061573 V 9.6168567 c 0,-0.2136722 0.1748227,-0.3884949 0.3884947,-0.3884949 H 8.6686133 V 8.839867 c 0,-0.4297729 0.3472172,-0.7769901 0.7769902,-0.7769901 h 3.4964555 c 0.429773,0 0.77699,0.3472172 0.77699,0.7769901 h 0.776989 c 0.286516,0 0.539038,0.1553976 0.672584,0.3884948 H 17.604 c 0,-0.2136721 0.174823,-0.3884948 0.388495,-0.3884948 0.213673,0 0.388493,0.1748227 0.388493,0.3884948 v 0.3884949 z"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.61478;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path14144-2" /></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -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: [")

View File

@ -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();

View File

@ -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}`)
}

File diff suppressed because one or more lines are too long

View File

@ -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() {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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 });