Complete camera control UI

This commit is contained in:
Davide Passoni 2024-02-27 16:46:11 +01:00
parent c74258e3ad
commit 05e0cc393a
23 changed files with 423 additions and 123 deletions

View File

@ -64,7 +64,7 @@
width: 20px;
}
#toolbar-container>*:nth-child(3)>svg {
#command-mode-toolbar>svg {
display: none;
}

View File

@ -330,7 +330,7 @@ body.feature-forceShowUnitControlPanel #unit-control-panel {
#advanced-settings-div>button {
background-color: var(--background-grey);
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.25);
/*box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.25);*/
font-size: 13px;
height: 40px;
padding: 0 20px;

View File

@ -177,7 +177,7 @@ button svg.fill-coalition[data-coalition="red"] * {
.ol-select>.ol-select-value {
align-content: center;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
/*box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);*/
cursor: pointer;
display: flex;
justify-content: left;
@ -279,7 +279,7 @@ button svg.fill-coalition[data-coalition="red"] * {
}
.ol-select>.ol-select-options div hr {
background-color: white;
background-color: var(--background-hover);
height: 1px;
width: 100%;
}
@ -408,10 +408,8 @@ nav.ol-panel {
display: flex;
flex-direction: row;
height: 58px;
}
nav.ol-panel> :last-child {
margin-right: 5px;
padding-left: 15px;
padding-right: 15px;
}
.ol-panel .ol-group {
@ -654,9 +652,9 @@ nav.ol-panel> :last-child {
align-items: center;
}
.ol-navbar-buttons-group > div {
.ol-navbar-buttons-group>div {
align-items: center;
display:flex;
display: flex;
flex-direction: row;
}
@ -683,9 +681,16 @@ nav.ol-panel> :last-child {
border: 1px solid white;
}
.ol-navbar-buttons-group button.off svg * {
fill: white !important; /* Higher price than the Soul Stone but inline styling is causing issues. */
stroke: white !important; /* I'm sorry, daughter. */
.ol-navbar-buttons-group button.off svg *[fill="black"] {
fill: white !important;
}
.ol-navbar-buttons-group button.off svg *[stroke="black"] {
stroke: white !important;
}
.ol-navbar-buttons-group button.off.red svg *[fill="black"] {
fill: red !important;
}
.ol-navbar-buttons-group button svg * {
@ -696,53 +701,54 @@ nav.ol-panel> :last-child {
.ol-navbar-buttons-group .protectable button:first-of-type {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
width:28px;
width: 28px;
}
.ol-navbar-buttons-group > .protectable > button.lock {
.ol-navbar-buttons-group>.protectable>button.lock {
align-items: center;
background-color: var(--primary-red);
border-bottom-left-radius: 0;
border-top-left-radius: 0;
display:flex;
display: flex;
justify-content: center;
width:18px;
width: 18px;
}
.ol-navbar-buttons-group > .protectable > button[data-protected].lock {
.ol-navbar-buttons-group>.protectable>button[data-protected].lock {
background-color: var(--background-grey);
}
.ol-navbar-buttons-group > .protectable > button.lock svg {
height:10px;
width:10px;
.ol-navbar-buttons-group>.protectable>button.lock svg {
height: 10px;
width: 10px;
}
@keyframes lock-prompt {
100% {
opacity: 1;
}
0% {
opacity: 0;
}
}
.ol-navbar-buttons-group > .protectable > button[data-protected].lock.prompt svg {
.ol-navbar-buttons-group>.protectable>button[data-protected].lock.prompt svg {
animation: lock-prompt .25s alternate infinite;
}
.ol-navbar-buttons-group > .protectable > button.lock svg.locked * {
fill:white !important;
.ol-navbar-buttons-group>.protectable>button.lock svg.locked * {
fill: white !important;
}
.ol-navbar-buttons-group > .protectable > button:not([data-protected]).lock svg.unlocked,
.ol-navbar-buttons-group > .protectable > button[data-protected].lock svg.locked {
display:flex;
.ol-navbar-buttons-group>.protectable>button:not([data-protected]).lock svg.unlocked,
.ol-navbar-buttons-group>.protectable>button[data-protected].lock svg.locked {
display: flex;
}
.ol-navbar-buttons-group > .protectable > button[data-protected].lock svg.unlocked,
.ol-navbar-buttons-group > .protectable > button:not([data-protected]).lock svg.locked {
display:none;
.ol-navbar-buttons-group>.protectable>button[data-protected].lock svg.unlocked,
.ol-navbar-buttons-group>.protectable>button:not([data-protected]).lock svg.locked {
display: none;
}
@ -750,8 +756,7 @@ nav.ol-panel> :last-child {
#roe-buttons-container button,
#reaction-to-threat-buttons-container button,
#emissions-countermeasures-buttons-container button,
#shots-scatter-buttons-container button
#shots-intensity-buttons-container button {
#shots-scatter-buttons-container button #shots-intensity-buttons-container button {
align-items: center;
background-color: transparent;
border: 1px solid var(--accent-light-blue);
@ -834,7 +839,7 @@ nav.ol-panel> :last-child {
width: auto;
}
}
#splash-content::after {
background-color: var(--background-steel);
content: "";
@ -1030,7 +1035,7 @@ nav.ol-panel> :last-child {
font-size: 14px;
font-weight: bolder;
padding-left: 10px;
margin-left: -11px;
margin-left: -16px;
margin-top: -0px;
margin-bottom: -0px;
height: 58px;
@ -1068,15 +1073,8 @@ nav.ol-panel> :last-child {
#spawn-points-container {
height: 100%;
border-right: 1px solid gray;
display: flex;
align-items: center;
padding-right: 20px;
}
#command-mode-phase::before {
content: "Time to start";
font-size: 14px;
}
#command-mode-phase.setup-phase::after {
@ -1085,7 +1083,6 @@ nav.ol-panel> :last-child {
border-radius: 999px;
padding: 5px 10px;
background-color: var(--background-grey);
margin-left: 15px;
content: attr(data-remaining-time);
font-size: 14px;
}
@ -1099,20 +1096,17 @@ nav.ol-panel> :last-child {
display: flex;
flex-direction: column;
align-items: center;
}
#command-mode-phase.game-commenced::before {
content: "Game commenced";
font-weight: bold;
justify-content: center;
height: 100%;
}
#command-mode-phase.game-commenced::after {
content: "Spawn restrictions are being enforced";
font-size: 10px;
content: "Spawn restrictions on";
font-size: 12px;
}
#command-mode-phase.no-restrictions::after {
content: "No spawn restrictions";
content: "Spawn restrictions on";
font-size: 10px;
}
@ -1327,8 +1321,8 @@ dl.ol-data-grid dd {
.ol-dialog-content table th {
background-color: var(--background-grey);
color:white;
font-size:14px;
color: white;
font-size: 14px;
font-weight: normal;
}
@ -1349,7 +1343,8 @@ dl.ol-data-grid dd {
overflow-y: auto;
}
.ol-checkbox label {
.ol-checkbox label,
.ol-text-input label {
align-items: center;
cursor: pointer;
display: flex;
@ -1357,6 +1352,11 @@ dl.ol-data-grid dd {
white-space: nowrap;
}
.ol-text-input label {
justify-content: space-between;
width: 100%;
}
.ol-checkbox input[type="checkbox"] {
appearance: none;
background-color: transparent;
@ -1388,16 +1388,19 @@ dl.ol-data-grid dd {
.ol-text-input input {
background-color: var(--background-grey);
border: 1px solid var(--background-grey);
border-radius: 5px;
border-radius: var(--border-radius-sm);
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
/*box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);*/
color: var(--background-offwhite);
height: 32px;
text-align: center;
}
.ol-text-input.border input {
border: 1px solid var(--background-offwhite);
}
.ol-text-input input[disabled] {
color:var(--ol-dialog-disabled-text-color);
color: var(--ol-dialog-disabled-text-color);
}
input[type=number] {
@ -1441,7 +1444,7 @@ input[type=number]::-webkit-outer-spin-button {
.ol-button-apply[disabled] {
border-color: var(--ol-dialog-disabled-text-color);
color:var(--ol-dialog-disabled-text-color);
color: var(--ol-dialog-disabled-text-color);
}
.ol-button-apply::before {
@ -1525,49 +1528,49 @@ input[type=number]::-webkit-outer-spin-button {
}
.switch-control.yes-no .ol-switch[data-value="false"] .ol-switch-fill {
background-color: var(--ol-switch-off);
background-color: var(--ol-switch-off);
}
.switch-control.yes-no .ol-switch[data-value="undefined"] .ol-switch-fill {
background-color: var(--ol-switch-undefined);
background-color: var(--ol-switch-undefined);
}
.switch-control.coalition .ol-switch>.ol-switch-fill::before,
.switch-control.yes-no .ol-switch>.ol-switch-fill::before {
translate:-100% 0;
translate: -100% 0;
transform: none;
}
.switch-control.yes-no .ol-switch[data-value="true"]>.ol-switch-fill::before {
content: "YES";
content: "YES";
}
.switch-control.yes-no .ol-switch[data-value="false"]>.ol-switch-fill::before {
content: "NO";
content: "NO";
}
.switch-control.coalition [data-value="true"] .ol-switch-fill {
background-color: var(--primary-blue);
background-color: var(--primary-blue);
}
.switch-control.coalition [data-value="false"] .ol-switch-fill {
background-color: var(--primary-red);
background-color: var(--primary-red);
}
.switch-control.coalition [data-value="undefined"] .ol-switch-fill {
background-color: var(--primary-neutral);
background-color: var(--primary-neutral);
}
.switch-control.coalition [data-value="true"] .ol-switch-fill::before {
content: "BLUE";
content: "BLUE";
}
.switch-control.coalition [data-value="false"] .ol-switch-fill::before {
content: "RED";
content: "RED";
}
.switch-control.no-label [data-value] .ol-switch-fill::before {
content:"";
content: "";
}
.ol-context-menu>ul {
@ -1628,17 +1631,17 @@ input[type=number]::-webkit-outer-spin-button {
}
#map-visibility-options .ol-select-options .ol-checkbox {
font-size:13px;
font-weight:400;
padding:6px 15px;
font-size: 13px;
font-weight: 400;
padding: 6px 15px;
}
#map-visibility-options .ol-select-options .ol-checkbox:first-of-type {
padding-top:12px;
padding-top: 12px;
}
#map-visibility-options .ol-select-options .ol-checkbox:last-of-type {
padding-bottom:12px;
padding-bottom: 18px;
}
#map-visibility-options .ol-select-options .ol-checkbox label:hover span {
@ -1658,19 +1661,19 @@ input[type=number]::-webkit-outer-spin-button {
}
.file-import-export .ol-dialog-content {
display:flex;
display: flex;
flex-direction: column;
justify-content: center;
}
.file-import-export p {
background-color: var(--background-grey);
border-left:6px solid var(--secondary-blue-text);
padding:12px;
border-left: 6px solid var(--secondary-blue-text);
padding: 12px;
}
.file-import-export th {
padding:4px 6px;
padding: 4px 6px;
}
.file-import-export tr td:first-child {
@ -1678,12 +1681,12 @@ input[type=number]::-webkit-outer-spin-button {
}
.file-import-export td {
color:white;
color: white;
text-align: center;
}
.file-import-export .ol-checkbox {
display:flex;
display: flex;
justify-content: center;
}
@ -1692,7 +1695,7 @@ input[type=number]::-webkit-outer-spin-button {
}
.file-import-export .ol-checkbox span {
display:none;
display: none;
}
.file-import-export button.start-transfer {
@ -1732,7 +1735,7 @@ input[type=number]::-webkit-outer-spin-button {
pointer-events: none;
}
.file-import-export .ol-dialog-footer button:first-of-type{
.file-import-export .ol-dialog-footer button:first-of-type {
margin-left: auto;
}
@ -1742,3 +1745,31 @@ input[type=number]::-webkit-outer-spin-button {
}
}
#camera-link-type-switch {
width: 60px;
height: 25px;
}
#camera-link-type-switch[data-value="true"]>.ol-switch-fill::before {
content: "MAP";
}
#camera-link-type-switch[data-value="false"]>.ol-switch-fill::before {
content: "LIVE";
}
#camera-link-type-switch[data-value="true"]>.ol-switch-fill {
background-color: var(--background-grey);
}
#camera-link-type-switch[data-value="false"]>.ol-switch-fill {
background-color: var(--background-offwhite);
}
#camera-link-type-switch[data-value="false"]>.ol-switch-fill::before {
color: var(--background-steel);
}
#camera-link-type-switch[data-value="false"]>.ol-switch-fill::after {
background-color: var(--background-steel);
}

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 16 16"
version="1.1"
id="svg1"
sodipodi:docname="linked.svg"
xml:space="preserve"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
width="16"
height="16"
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="defs1" /><sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
inkscape:zoom="12.703125"
inkscape:cx="15.940959"
inkscape:cy="19.01107"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" /><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path
d="m 14.718784,8.2555996 c 1.471866,-1.4718688 1.471866,-3.8555134 0,-5.3273791 C 13.416246,1.6256822 11.363445,1.4563517 9.8655269,2.5270381 l -0.041681,0.028645 C 9.4487143,2.8240079 9.3627479,3.3450208 9.63107,3.7175489 c 0.2683236,0.372525 0.789337,0.4610992 1.161864,0.1927748 l 0.04169,-0.028645 c 0.83623,-0.5965628 1.97986,-0.5027818 2.70407,0.2240338 0.820598,0.8205996 0.820598,2.1491875 0,2.9697871 l -2.922893,2.9281044 c -0.8206004,0.8206 -2.1491882,0.8206 -2.969788,0 C 6.9191889,9.2767887 6.8254045,8.1331608 7.4219671,7.2995366 l 0.028647,-0.041682 C 7.7189395,6.8827242 7.630369,6.3617082 7.2578404,6.0959918 6.8853158,5.8302724 6.3616949,5.9162417 6.0959777,6.2887668 l -0.028647,0.041682 C 4.9940392,7.8257624 5.1633693,9.8785611 6.4659076,11.1811 c 1.4718694,1.471869 3.8555134,1.471869 5.3273794,0 z M 1.1828078,7.6460126 c -1.47186608,1.4718659 -1.47186608,3.8555104 0,5.3273784 1.3025385,1.302539 3.3553399,1.471869 4.8532579,0.401182 l 0.041681,-0.02865 C 6.4528799,13.077605 6.5388455,12.556589 6.2705243,12.184063 6.0021998,11.811539 5.481187,11.722964 5.1086592,11.991289 l -0.041681,0.02865 c -0.8362262,0.596562 -1.9798574,0.502778 -2.7040679,-0.224038 -0.8205997,-0.823205 -0.8205997,-2.1517921 0,-2.9723919 L 5.2858059,5.8980077 c 0.8205997,-0.8205966 2.1491875,-0.8205966 2.9697873,0 0.7268153,0.7268156 0.8205997,1.8704464 0.2240372,2.7066757 L 8.450982,8.6463657 C 8.1826613,9.0214958 8.2712326,9.5425118 8.643758,9.8082277 9.0162857,10.073945 9.5399067,9.9879784 9.805623,9.6154532 L 9.83427,9.5737712 c 1.073291,-1.4979187 0.90396,-3.5507171 -0.3985777,-4.8532555 -1.4718686,-1.4718689 -3.8555132,-1.4718689 -5.3273817,0 z"
id="path1-3"
style="fill-opacity:1;stroke:none;stroke-width:0.0320135;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
fill="black" /></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -50,27 +50,26 @@
<path
d="m 10.664,18.4362 c 4.2922,0 7.7717,-3.4796 7.7717,-7.7717 0,-4.2921 -3.4796,-7.7717 -7.7717,-7.7717 -4.2921,0 -7.7717,3.4796 -7.7717,7.7717 0,4.2921 3.4796,7.7717 7.7717,7.7717 z m 0,2.8918 c 5.8893,0 10.664,-4.7742 10.664,-10.664 C 21.328,4.7742 16.5538,0 10.664,0 4.7742,0 0,4.7742 0,10.664 0,16.5538 4.7742,21.328 10.664,21.328 Z"
clip-rule="evenodd"
fill="#ffffff"
fill-rule="evenodd"
stroke-width="0"
style="fill:#000000"
fill="black"
id="path7220" />
<line
x1="7.796"
x2="13.187"
y1="6.8541994"
y2="14.231199"
stroke="#247BE2"
stroke="black"
stroke-linecap="square"
style="fill:none;stroke:#000000"
style="fill:none;"
id="line7222" />
<line
x1="14.397999"
x2="7.8680005"
y1="11.885201"
y2="11.450199"
stroke="#247BE2"
stroke="black"
stroke-linecap="square"
style="fill:none;stroke:#000000"
style="fill:none;"
id="line7224" />
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -36,6 +36,6 @@
<path
stroke-width="0"
d="m 13.1797,5.25 c 0.9297,0 2.5703,0.793 2.5703,1.75 0,0.9844 -1.6406,1.75 -2.5703,1.75 H 9.9805 L 7.2461,13.5625 C 7.082,13.8359 6.7812,14 6.4805,14 H 4.9492 C 4.6484,14 4.4297,13.7266 4.5117,13.4531 L 5.8516,8.75 H 3.0625 L 1.85938,10.3359 C 1.77734,10.4453 1.66797,10.5 1.53125,10.5 H 0.38281 C 0.16406,10.5 0,10.3359 0,10.1172 0,10.0898 0,10.0625 0,10.0352 L 0.875,7 0,3.9922 C 0,3.9648 0,3.9375 0,3.8828 0,3.6914 0.16406,3.5 0.38281,3.5 h 1.14844 c 0.13672,0 0.24609,0.082 0.32813,0.1914 L 3.0625,5.25 H 5.8516 L 4.5117,0.57422 C 4.4297,0.30078 4.6484,0 4.9492,0 H 6.4805 C 6.7812,0 7.082,0.19141 7.2461,0.46484 L 9.9805,5.25 Z"
fill="#202831"
fill="black"
id="path7232" />
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path d="M0 224.2C0 100.6 100.2 0 224 0h24c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8H448v64c0 35.3-28.7 64-64 64H320v32c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V407.3c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM224 64c-8.8 0-16 7.2-16 16c0 33-39.9 49.5-63.2 26.2c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6C145.5 152.1 129 192 96 192c-8.8 0-16 7.2-16 16s7.2 16 16 16c33 0 49.5 39.9 26.2 63.2c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0C168.1 286.5 208 303 208 336c0 8.8 7.2 16 16 16s16-7.2 16-16c0-33 39.9-49.5 63.2-26.2c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6C302.5 263.9 319 224 352 224c8.8 0 16-7.2 16-16s-7.2-16-16-16c-33 0-49.5-39.9-26.2-63.2c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0C279.9 129.5 240 113 240 80c0-8.8-7.2-16-16-16zm-24 96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 80a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"/></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -52,5 +52,6 @@
inkscape:connector-curvature="0"
d="m 3.173155,1.0409694 c 0,-0.46651814 0.3476271,-0.84342412 0.7779063,-0.84342412 h 9.3348367 c 0.430278,0 0.777906,0.37690598 0.777906,0.84342412 0,0.4665187 -0.347628,0.8434202 -0.777906,0.8434202 H 9.3963807 V 3.571233 h 0.7779053 c 2.148956,0 3.889518,1.8871557 3.889518,4.2171087 v 1.686841 c 0,0.4665172 -0.347628,0.8434233 -0.777906,0.8434233 H 9.3963807 7.8405774 c -0.4886243,0 -0.9505011,-0.250391 -1.2446479,-0.6747365 L 4.8602324,7.1346873 C 4.7751488,7.0108098 4.6584662,6.9159274 4.5271922,6.8579429 L 1.2089503,5.4188529 C 0.97800953,5.318696 0.80298167,5.1025686 0.7422081,4.8389987 L 0.18309237,2.4088928 C 0.11988251,2.1426888 0.30706869,1.8843896 0.55988607,1.8843896 H 1.2283992 c 0.245524,0 0.4764649,0.1238773 0.6223221,0.3373706 L 2.7842066,3.571233 H 7.8405774 V 1.8843896 H 3.9510613 c -0.4302792,0 -0.7779063,-0.3769015 -0.7779063,-0.8434202 z m 6.2232257,7.5907923 h 3.1116153 v -0.84342 c 0,-1.3969171 -1.045307,-2.5302639 -2.33371,-2.5302639 H 9.3963807 Z m 5.9947173,2.7780193 c 0.303871,0.329462 0.303871,0.864511 0,1.193968 l -0.09481,0.102794 c -0.583429,0.632565 -1.375917,0.988385 -2.200006,0.988385 H 6.2847694 c -0.4302775,0 -0.7779054,-0.376906 -0.7779054,-0.843421 0,-0.466518 0.3476279,-0.843424 0.7779054,-0.843424 h 6.8115166 c 0.413259,0 0.809506,-0.176591 1.101221,-0.492874 l 0.09481,-0.102793 c 0.30387,-0.329461 0.79735,-0.329461 1.101219,0 z"
id="path1174-3"
style="fill:#202831;fill-opacity:1;stroke-width:0.02531246" />
style="fill-opacity:1;stroke-width:0.02531246"
fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -36,6 +36,6 @@
<path
stroke-width="0"
d="m 5.2724978,0.875 c 0,-0.46484 0.3828,-0.875 0.875,-0.875 h 3.5 C 10.112298,0 10.522498,0.41016 10.522498,0.875 V 1.75 h 1.3125 c 0.7109,0 1.3125,0.6016 1.3125,1.3125 v 3.5 l 1.2031,0.4102 c 0.6289,0.2187 0.793,1.039 0.3008,1.4765 l -2.7617,2.543 c -0.4375,0.2461 -0.9297,0.4101 -1.3672,0.4101 -0.5469002,0 -1.1211002,-0.2187 -1.6406002,-0.5468 -0.6016,-0.4375 -1.3946,-0.4375 -1.9961,0 -0.4649,0.3007 -1.0391,0.5468 -1.6406,0.5468 -0.4375,0 -0.9297,-0.164 -1.3672,-0.4101 l -2.76175,-2.543 C 0.62405778,8.0117 0.78811778,7.1914 1.4170278,6.9727 l 1.23047,-0.4102 v -3.5 c 0,-0.7109 0.5742,-1.3125 1.3125,-1.3125 h 1.3125 z m -0.875,5.1133 2.9258,-0.9844 c 0.3554,-0.1094 0.7656,-0.1094 1.1211,0 L 11.397498,5.9883 V 3.5 H 4.3974978 Z m 3.9922,5.5508 c 0.6289,0.4375 1.3672,0.7109 2.1328002,0.7109 0.7109,0 1.5039,-0.2734 2.1055,-0.7109 0.3281,-0.2188 0.7656,-0.1914 1.0664,0.0547 0.4101,0.3281 0.9023,0.5742 1.3945,0.6835 0.4648,0.1094 0.7656,0.5743 0.6563,1.0665 -0.1094,0.4648 -0.6016,0.7656 -1.0665,0.6562 -0.6562,-0.1641 -1.2304,-0.4648 -1.5859,-0.6836 -0.793,0.4102 -1.668,0.6836 -2.5703,0.6836 -0.8750002,0 -1.6680002,-0.2461 -2.2148002,-0.4922 -0.1641,-0.082 -0.3008,-0.164 -0.4102,-0.2187 -0.1367,0.0547 -0.2734,0.1367 -0.4375,0.2187 -0.5469,0.2461 -1.3398,0.4922 -2.1875,0.4922 -0.9023,0 -1.8047,-0.2734 -2.5977,-0.6836 -0.3554,0.2188 -0.92964,0.5195 -1.58589,0.6836 -0.46485002,0.1094 -0.95703002,-0.1914 -1.06641002,-0.6562 -0.10938,-0.4649 0.19141,-0.9571 0.65625,-1.0665 0.49219002,-0.1093 1.01172002,-0.3554 1.39455002,-0.6835 0.3008,-0.2461 0.7383,-0.2735 1.0664,-0.0547 0.6016,0.4375 1.3945,0.7109 2.1328,0.7109 0.7383,0 1.5039,-0.2734 2.1055,-0.7109 0.3007,-0.2188 0.7109,-0.2188 1.0117,0 z"
fill="#181e25"
fill="black"
id="path7277" />
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path fill="black" d="M0 224.2C0 100.6 100.2 0 224 0h24c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8H448v64c0 35.3-28.7 64-64 64H320v32c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V407.3c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM224 64c-8.8 0-16 7.2-16 16c0 33-39.9 49.5-63.2 26.2c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6C145.5 152.1 129 192 96 192c-8.8 0-16 7.2-16 16s7.2 16 16 16c33 0 49.5 39.9 26.2 63.2c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0C168.1 286.5 208 303 208 336c0 8.8 7.2 16 16 16s16-7.2 16-16c0-33 39.9-49.5 63.2-26.2c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6C302.5 263.9 319 224 352 224c8.8 0 16-7.2 16-16s-7.2-16-16-16c-33 0-49.5-39.9-26.2-63.2c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0C279.9 129.5 240 113 240 80c0-8.8-7.2-16-16-16zm-24 96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 80a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 576 512"
version="1.1"
id="svg1"
sodipodi:docname="slew.svg"
xml:space="preserve"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
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="defs1" /><sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
inkscape:zoom="0.79394531"
inkscape:cx="352.03936"
inkscape:cy="210.97171"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" /><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path
d="m 18.892988,123.94151 c 0,-33.293066 27.068299,-60.361356 60.361351,-60.361356 H 320.69975 c 33.29306,0 60.36135,27.06829 60.36135,60.361356 V 365.3869 c 0,33.29306 -27.06829,60.36135 -60.36135,60.36135 H 79.254339 c -33.293052,0 -60.361351,-27.06829 -60.361351,-60.36135 z M 546.20598,97.344781 c 9.80872,5.281629 15.93917,15.467609 15.93917,26.596729 V 365.3869 c 0,11.12912 -6.13045,21.3151 -15.93917,26.59673 -9.80872,5.28161 -21.69237,4.71572 -31.02951,-1.50904 l -90.54203,-60.36135 -13.39267,-8.9599 V 305.02555 184.30286 168.17507 l 13.39267,-8.9599 90.54203,-60.361354 c 9.24284,-6.130451 21.12646,-6.790646 31.02951,-1.509035 z"
id="path1"
style="stroke-width:0.943146"
fill="black" /></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -3,5 +3,6 @@
<span id="command-mode"></span>
<div id="spawn-points-container">Spawn points<span id="spawn-points"></span></div>
<span id="command-mode-phase"></span>
<button id="command-mode-settings-button" class="ol-button" data-on-click="showCommandModeDialog"><img src="/resources/theme/images/icons/gears-solid.svg" inject-svg>Settings</button>
<button id="command-mode-settings-button" class="ol-button" data-on-click="showCommandModeDialog"><img
src="/resources/theme/images/icons/gears-solid.svg" inject-svg>Settings</button>
</nav>

View File

@ -6,7 +6,8 @@
<div class="ol-select-options">
<div id="toolbar-summary">
<h3>DCS Olympus</h3>
<div class="accent-green app-version-number">version {{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}</div>
<div class="accent-green app-version-number">version {{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}
</div>
</div>
<div>
<a href="https://discord.gg/wWXyVVBZT7" target="_blank">Discord</a>
@ -31,14 +32,16 @@
<div class="ol-group">
<div id="map-type" class="ol-select">
<div class="ol-select-value"><img src="resources/theme/images/icons/map-source.svg" inject-svg /><span class="ol-select-value-text">ArcGIS Satellite</span></div>
<div class="ol-select-value"><img src="resources/theme/images/icons/map-source.svg" inject-svg /><span
class="ol-select-value-text">ArcGIS Satellite</span></div>
<div class="ol-select-options">
<!-- Here the available map sources will be listed-->
</div>
</div>
<div id="map-visibility-options" class="ol-select">
<div class="ol-select-value"><img src="/resources/theme/images/icons/gears-solid.svg" inject-svg />Options</div>
<div class="ol-select-value"><img src="/resources/theme/images/icons/gears-solid.svg" inject-svg />Options
</div>
<div class="ol-select-options">
<!-- This is where the advanced visibility options will be listed -->
</div>
@ -57,17 +60,51 @@
<div id="coalition-visibility-control" class="ol-group ol-navbar-buttons-group">
<div>
<button id="coalition-visibility-control-blue" data-on-click="toggleCoalitionVisibility"
data-on-click-params='{ "coalition": "blue" }' title="Toggle Blue coalition visibility"><img src="/resources/theme/images/buttons/visibility/shield.svg" class="fill-coalition" data-coalition="blue" inject-svg /></button>
data-on-click-params='{ "coalition": "blue" }' title="Toggle Blue coalition visibility"><img
src="/resources/theme/images/buttons/visibility/shield.svg" class="fill-coalition"
data-coalition="blue" inject-svg /></button>
</div>
<div>
<button id="coalition-visibility-control-red" data-on-click="toggleCoalitionVisibility"
data-on-click-params='{ "coalition": "red" }' title="Toggle Red coalition visibility"><img src="/resources/theme/images/buttons/visibility/shield.svg" class="fill-coalition" data-coalition="red" inject-svg /></button>
data-on-click-params='{ "coalition": "red" }' title="Toggle Red coalition visibility"><img
src="/resources/theme/images/buttons/visibility/shield.svg" class="fill-coalition"
data-coalition="red" inject-svg /></button>
</div>
<div>
<button id="coalition-visibility-control-neutral" data-on-click="toggleCoalitionVisibility"
data-on-click-params='{ "coalition": "neutral" }' title="Toggle Neutral coalition visibility"><img src="/resources/theme/images/buttons/visibility/shield.svg" class="fill-coalition" data-coalition="neutral" inject-svg /></button>
data-on-click-params='{ "coalition": "neutral" }' title="Toggle Neutral coalition visibility"><img
src="/resources/theme/images/buttons/visibility/shield.svg" class="fill-coalition"
data-coalition="neutral" inject-svg /></button>
</div>
</div>
</nav>
<nav class="ol-panel" oncontextmenu="return false;">
<div id="camera-label" class="ol-panel-tab">
<img src="resources/theme/images/icons/camera.svg" inject-svg />
<span>Camera</span>
</div>
<div id="camera-control" class="ol-group ol-navbar-buttons-group">
<div>
<button class="off red" id="camera-link-control" data-on-click="toggleCameraLinkStatus"
title="Camera link to DCS is not available"><img src="/resources/theme/images/buttons/camera/linked.svg"
inject-svg /></button>
</div>
<div id="camera-link-type-switch" class="ol-switch"></div>
<!--
<div>
<button class="off" id="camera-slew-to-position" data-on-click="slewCameraToPosition" title="Camera link to DCS is not available"><img src="/resources/theme/images/buttons/camera/slew.svg" inject-svg /></button>
</div>
<div>
<button style="color: black" id="camera-link-control-map" data-on-click="toggleCameraLinkMapType"
title="Camera link to DCS is not available"><img src="/resources/theme/images/buttons/camera/F10.svg"
inject-svg /></button>
</div>
-->
</div>
</nav>

View File

@ -207,7 +207,7 @@ export const MAP_MARKER_CONTROLS: MapMarkerVisibilityControl[] = [{
"toggles": ["human"],
"tooltip": "Toggle human players' visibility"
}, {
"image": "visibility/head-side-virus-solid.svg",
"image": "visibility/olympus.svg",
"isProtected": false,
"name": "Olympus",
"protectable": false,
@ -268,6 +268,7 @@ export const FILL_SELECTED_RING = "Fill the threat range rings of selected units
export const SHOW_UNIT_CONTACTS = "Show selected units contact lines";
export const SHOW_UNIT_PATHS = "Show selected unit paths";
export const SHOW_UNIT_TARGETS = "Show selected unit targets";
export const DCS_LINK_PORT = "DCS Camera link port";
export enum DataIndexes {
startOfData = 0,

View File

@ -117,6 +117,13 @@ export class Dropdown {
this.#options.appendChild(optionElement);
}
addHorizontalDivider() {
let div = document.createElement("div");
let hr = document.createElement('hr');
div.appendChild(hr);
this.#options.appendChild(div);
}
/** Select the active value of the dropdown
*
* @param idx The index of the element to select

View File

@ -7,12 +7,12 @@ import { AirbaseContextMenu } from "../contextmenus/airbasecontextmenu";
import { Dropdown } from "../controls/dropdown";
import { Airbase } from "../mission/airbase";
import { Unit } from "../unit/unit";
import { bearing, createCheckboxOption, deg2rad, getGroundElevation, polyContains } from "../other/utils";
import { bearing, createCheckboxOption, createTextInputOption, deg2rad, getGroundElevation, polyContains } from "../other/utils";
import { DestinationPreviewMarker } from "./markers/destinationpreviewmarker";
import { TemporaryUnitMarker } from "./markers/temporaryunitmarker";
import { ClickableMiniMap } from "./clickableminimap";
import { SVGInjector } from '@tanem/svg-injector'
import { defaultMapLayers, mapBounds, minimapBoundaries, IDLE, COALITIONAREA_DRAW_POLYGON, MOVE_UNIT, SHOW_UNIT_CONTACTS, HIDE_GROUP_MEMBERS, SHOW_UNIT_PATHS, SHOW_UNIT_TARGETS, SHOW_UNIT_LABELS, SHOW_UNITS_ENGAGEMENT_RINGS, SHOW_UNITS_ACQUISITION_RINGS, HIDE_UNITS_SHORT_RANGE_RINGS, FILL_SELECTED_RING, MAP_MARKER_CONTROLS } from "../constants/constants";
import { defaultMapLayers, mapBounds, minimapBoundaries, IDLE, COALITIONAREA_DRAW_POLYGON, MOVE_UNIT, SHOW_UNIT_CONTACTS, HIDE_GROUP_MEMBERS, SHOW_UNIT_PATHS, SHOW_UNIT_TARGETS, SHOW_UNIT_LABELS, SHOW_UNITS_ENGAGEMENT_RINGS, SHOW_UNITS_ACQUISITION_RINGS, HIDE_UNITS_SHORT_RANGE_RINGS, FILL_SELECTED_RING, MAP_MARKER_CONTROLS, DCS_LINK_PORT } from "../constants/constants";
import { CoalitionArea } from "./coalitionarea/coalitionarea";
import { CoalitionAreaContextMenu } from "../contextmenus/coalitionareacontextmenu";
import { DrawingCursor } from "./coalitionarea/drawingcursor";
@ -70,6 +70,11 @@ export class Map extends L.Map {
#selecting: boolean = false;
#isZooming: boolean = false;
#previousZoom: number = 0;
#slaveDCSCamera: boolean = false;
#slaveDCSCameraAvailable: boolean = false;
#cameraControlTimer: number = 0;
#cameraControlPort: number = 3003;
#cameraControlMode: string = 'map';
#destinationGroupRotation: number = 0;
#computeDestinationRotation: boolean = false;
@ -94,7 +99,7 @@ export class Map extends L.Map {
#mapMarkerVisibilityControls: MapMarkerVisibilityControl[] = MAP_MARKER_CONTROLS;
#mapVisibilityOptionsDropdown: Dropdown;
#optionButtons: { [key: string]: HTMLButtonElement[] } = {}
#visibilityOptions: { [key: string]: boolean } = {}
#visibilityOptions: { [key: string]: boolean | string | number } = {}
#hiddenTypes: string[] = [];
/**
@ -158,7 +163,7 @@ export class Map extends L.Map {
this.on('drag', (e: any) => this.#onMouseMove(e));
this.on('keydown', (e: any) => this.#onKeyDown(e));
this.on('keyup', (e: any) => this.#onKeyUp(e));
this.on('move', (e: any) => this.#broadcastPosition(e));
this.on('move', (e: any) => { if (this.#slaveDCSCamera) this.#broadcastPosition() });
/* Event listeners */
document.addEventListener("toggleCoalitionVisibility", (ev: CustomEventInit) => {
@ -202,6 +207,7 @@ export class Map extends L.Map {
document.addEventListener("mapOptionsChanged", () => {
this.getContainer().toggleAttribute("data-hide-labels", !this.getVisibilityOptions()[SHOW_UNIT_LABELS]);
this.#cameraControlPort = this.getVisibilityOptions()[DCS_LINK_PORT] as number;
});
document.addEventListener("configLoaded", () => {
@ -216,6 +222,18 @@ export class Map extends L.Map {
}
})
document.addEventListener("toggleCameraLinkStatus", () => {
if (this.#slaveDCSCameraAvailable) {
this.setSlaveDCSCamera(!this.#slaveDCSCamera);
}
})
document.addEventListener("slewCameraToPosition", () => {
if (this.#slaveDCSCameraAvailable) {
this.#broadcastPosition();
}
})
/* Pan interval */
this.#panInterval = window.setInterval(() => {
if (this.#panUp || this.#panDown || this.#panRight || this.#panLeft)
@ -223,10 +241,19 @@ export class Map extends L.Map {
((this.#panUp ? -1 : 0) + (this.#panDown ? 1 : 0)) * this.#deafultPanDelta * (this.#shiftKey ? 3 : 1)));
}, 20);
/* Periodically check if the camera control endpoint is available */
this.#cameraControlTimer = window.setInterval(() => {
this.#checkCameraPort();
}, 1000)
/* Option buttons */
this.#createUnitMarkerControlButtons();
/* Create the checkboxes to select the advanced visibility options */
this.addVisibilityOption(DCS_LINK_PORT, 3003, { min: 1024, max: 65535 });
this.#mapVisibilityOptionsDropdown.addHorizontalDivider();
this.addVisibilityOption(SHOW_UNIT_CONTACTS, false);
this.addVisibilityOption(HIDE_GROUP_MEMBERS, true);
this.addVisibilityOption(SHOW_UNIT_PATHS, true);
@ -238,9 +265,14 @@ export class Map extends L.Map {
/* this.addVisibilityOption(FILL_SELECTED_RING, false); Removed since currently broken: TODO fix!*/
}
addVisibilityOption(option: string, defaultValue: boolean) {
addVisibilityOption(option: string, defaultValue: boolean | number | string, options?: { [key: string]: any }) {
this.#visibilityOptions[option] = defaultValue;
this.#mapVisibilityOptionsDropdown.addOptionElement(createCheckboxOption(option, option, defaultValue, (ev: any) => { this.#setVisibilityOption(option, ev); }));
if (typeof defaultValue === 'boolean')
this.#mapVisibilityOptionsDropdown.addOptionElement(createCheckboxOption(option, option, defaultValue as boolean, (ev: any) => { this.#setVisibilityOption(option, ev); }, options));
else if (typeof defaultValue === 'number')
this.#mapVisibilityOptionsDropdown.addOptionElement(createTextInputOption(option, option, defaultValue.toString(), 'number', (ev: any) => { this.#setVisibilityOption(option, ev); }, options));
else
this.#mapVisibilityOptionsDropdown.addOptionElement(createTextInputOption(option, option, defaultValue, 'text', (ev: any) => { this.#setVisibilityOption(option, ev); }, options));
}
setLayer(layerName: string) {
@ -538,6 +570,21 @@ export class Map extends L.Map {
return this.#mapMarkerVisibilityControls;
}
setSlaveDCSCamera(newSlaveDCSCamera: boolean) {
if (this.#slaveDCSCameraAvailable || !newSlaveDCSCamera) {
this.#slaveDCSCamera = newSlaveDCSCamera;
let button = document.getElementById("camera-link-control");
button?.classList.toggle("off", !newSlaveDCSCamera);
if (newSlaveDCSCamera)
this.#broadcastPosition();
}
}
setCameraControlMode(newCameraControlMode: string) {
this.#cameraControlMode = newCameraControlMode;
this.#broadcastPosition();
}
/* Event handlers */
#onClick(e: any) {
if (!this.#preventLeftClick) {
@ -720,27 +767,26 @@ export class Map extends L.Map {
this.#isZooming = false;
}
#broadcastPosition(e: any) {
#broadcastPosition() {
getGroundElevation(this.getCenter(), (response: string) => {
var groundElevation: number | null = null;
try {
groundElevation = parseFloat(response);
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("PUT", "http://localhost:8080");
xmlHttp.open("PUT", `http://localhost:${this.#cameraControlPort}`);
xmlHttp.setRequestHeader("Content-Type", "application/json");
const C = 40075016.686;
const C = 40075016.686;
let mpp = C * Math.cos(deg2rad(this.getCenter().lat)) / Math.pow(2, this.getZoom() + 8);
let d = mpp * 1920;
let alt = d / 2 * 1 / Math.tan(deg2rad(40));
if (alt > 100000)
alt = 100000;
xmlHttp.send(JSON.stringify({lat: this.getCenter().lat, lng: this.getCenter().lng, alt: alt + groundElevation}));
xmlHttp.send(JSON.stringify({ lat: this.getCenter().lat, lng: this.getCenter().lng, alt: alt + groundElevation, mode: this.#cameraControlMode }));
} catch {
console.warn("broadcastPosition: could not retrieve ground elevation")
}
});
}
/* */
@ -909,8 +955,47 @@ export class Map extends L.Map {
}
#setVisibilityOption(option: string, ev: any) {
this.#visibilityOptions[option] = ev.currentTarget.checked;
if (typeof this.#visibilityOptions[option] === 'boolean')
this.#visibilityOptions[option] = ev.currentTarget.checked;
else if (typeof this.#visibilityOptions[option] === 'number')
this.#visibilityOptions[option] = Number(ev.currentTarget.value);
else
this.#visibilityOptions[option] = ev.currentTarget.value;
document.dispatchEvent(new CustomEvent("mapOptionsChanged"));
}
#setSlaveDCSCameraAvailable(newSlaveDCSCameraAvailable: boolean) {
this.#slaveDCSCameraAvailable = newSlaveDCSCameraAvailable;
let linkButton = document.getElementById("camera-link-control");
if (linkButton) {
if (!newSlaveDCSCameraAvailable) {
this.setSlaveDCSCamera(false);
linkButton.classList.add("red");
linkButton.title = "Camera link to DCS is not available";
} else {
linkButton.classList.remove("red");
linkButton.title = "Link/Unlink DCS camera with Olympus position";
}
}
}
#checkCameraPort(){
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("OPTIONS", `http://localhost:${this.#cameraControlPort}`);
xmlHttp.onload = (res: any) => {
if (xmlHttp.status == 200)
this.#setSlaveDCSCameraAvailable(true);
else
this.#setSlaveDCSCameraAvailable(false);
};
xmlHttp.onerror = (res: any) => {
this.#setSlaveDCSCameraAvailable(false);
}
xmlHttp.ontimeout = (res: any) => {
this.#setSlaveDCSCameraAvailable(false);
}
xmlHttp.timeout = 500;
xmlHttp.send("");
}
}

View File

@ -118,8 +118,8 @@ export class MissionManager {
}
commandModePhaseEl.classList.toggle("setup-phase", this.#remainingSetupTime > 0 && this.getCommandModeOptions().restrictSpawns);
commandModePhaseEl.classList.toggle("game-commenced", this.#remainingSetupTime <= 0 || !this.getCommandModeOptions().restrictSpawns);
commandModePhaseEl.classList.toggle("no-restrictions", !this.getCommandModeOptions().restrictSpawns);
//commandModePhaseEl.classList.toggle("game-commenced", this.#remainingSetupTime <= 0 || !this.getCommandModeOptions().restrictSpawns);
//commandModePhaseEl.classList.toggle("no-restrictions", !this.getCommandModeOptions().restrictSpawns);
}
}
}

View File

@ -463,7 +463,7 @@ export function convertDateAndTimeToDate(dateAndTime: DateAndTime) {
return new Date(year, month, date.Day, time.h, time.m, time.s);
}
export function createCheckboxOption(value: string, text: string, checked: boolean = true, callback: CallableFunction = (ev: any) => {}, options?:any) {
export function createCheckboxOption(text: string, description: string, checked: boolean = true, callback: CallableFunction = (ev: any) => {}, options?:any) {
options = {
"disabled": false,
"name": "",
@ -473,16 +473,15 @@ export function createCheckboxOption(value: string, text: string, checked: boole
var div = document.createElement("div");
div.classList.add("ol-checkbox");
var label = document.createElement("label");
label.title = text;
label.title = description;
var input = document.createElement("input");
input.type = "checkbox";
input.checked = checked;
input.name = options.name;
input.disabled = options.disabled;
input.readOnly = options.readOnly;
input.value = value;
var span = document.createElement("span");
span.innerText = value;
span.innerText = text;
label.appendChild(input);
label.appendChild(span);
div.appendChild(label);
@ -503,6 +502,45 @@ export function getCheckboxOptions(dropdown: Dropdown) {
return values;
}
export function createTextInputOption(text: string, description: string, initialValue: string, type: string, callback: CallableFunction = (ev: any) => {}, options?:any) {
options = {
"disabled": false,
"name": "",
"readOnly": false,
...options
};
var div = document.createElement("div");
div.classList.add("ol-text-input", "border");
var label = document.createElement("label");
label.title = description;
var input = document.createElement("input");
input.type = type;
input.name = options.name;
input.disabled = options.disabled;
input.readOnly = options.readOnly;
if (options.min)
input.min = options.min;
if (options.max)
input.max = options.max;
input.value = initialValue;
input.style.width = "80px";
var span = document.createElement("span");
span.innerText = text;
label.appendChild(span);
label.appendChild(input);
div.appendChild(label);
input.onchange = (ev: any) => {
if (type === 'number') {
if (Number(input.max) && Number(ev.srcElement.value) > Number(input.max))
input.value = input.max;
else if (Number(input.min) && Number(ev.srcElement.value) < Number(input.min))
input.value = input.min;
}
callback(ev);
}
return div as HTMLElement;
}
export function getGroundElevation(latlng: LatLng, callback: CallableFunction) {
/* Get the ground elevation from the server endpoint */
const xhr = new XMLHttpRequest();

View File

@ -1,14 +1,21 @@
import { getApp } from "..";
import { Dropdown } from "../controls/dropdown";
import { Switch } from "../controls/switch";
import { Toolbar } from "./toolbar";
export class PrimaryToolbar extends Toolbar {
#mainDropdown: Dropdown;
#cameraLinkTypeSwitch: Switch;
constructor(ID: string) {
super(ID);
/* The content of the dropdown is entirely defined in the .ejs file */
this.#mainDropdown = new Dropdown("app-icon", () => { });
this.#cameraLinkTypeSwitch = new Switch("camera-link-type-switch", (value: boolean) => {
getApp().getMap().setCameraControlMode(value? 'map': 'live');
})
}
getMainDropdown() {

View File

@ -1654,7 +1654,7 @@ export class GroundUnit extends Unit {
/* When we zoom past the grouping limit, grouping is enabled and the unit is a leader, we redraw the unit to apply any possible grouped marker */
checkZoomRedraw(): boolean {
return (this.getIsLeader() && getApp().getMap().getVisibilityOptions()[HIDE_GROUP_MEMBERS] &&
return (this.getIsLeader() && getApp().getMap().getVisibilityOptions()[HIDE_GROUP_MEMBERS] as boolean &&
(getApp().getMap().getZoom() >= GROUPING_ZOOM_TRANSITION && getApp().getMap().getPreviousZoom() < GROUPING_ZOOM_TRANSITION ||
getApp().getMap().getZoom() < GROUPING_ZOOM_TRANSITION && getApp().getMap().getPreviousZoom() >= GROUPING_ZOOM_TRANSITION))
}

View File

@ -0,0 +1,23 @@
import socket
from email.utils import formatdate
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('127.0.0.1', 3003))
sock.listen(5)
count = 0
while True:
connection, address = sock.accept()
buf = connection.recv(1024)
print(buf.decode("utf-8"))
if "OPTIONS" in buf.decode("utf-8"):
resp = (f"""HTTP/1.1 200 OK\r\nDate: {formatdate(timeval=None, localtime=False, usegmt=True)}\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: PUT, GET, OPTIONS\r\nAccess-Control-Allow-Headers: *\r\nAccess-Control-Max-Age: 86400\r\nVary: Accept-Encoding, Origin\r\nKeep-Alive: timeout=2, max=100\r\nConnection: Keep-Alive\r\n""".encode("utf-8"))
connection.send(resp)
if not "PUT" in buf.decode("utf-8"):
connection.close()
else:
resp = (f"""HTTP/1.1 200 OK\r\nDate: {formatdate(timeval=None, localtime=False, usegmt=True)}\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: PUT, GET, OPTIONS\r\nAccess-Control-Allow-Headers: *\r\nAccess-Control-Max-Age: 86400\r\nVary: Accept-Encoding, Origin\r\nKeep-Alive: timeout=2, max=100\r\nConnection: Keep-Alive\r\n\r\n{{"Hi": "Wirts!"}}\r\n""".encode("utf-8"))
connection.send(resp)
connection.close()
count += 1