Merge pull request #560 from Pax1601/524-units-will-not-perform-scenic-aaa-until-the-operate-as-toggle-is-toggled

Fixed missing reset of expected value of operateAs toggle
This commit is contained in:
Pax1601
2023-11-23 20:09:09 +01:00
committed by GitHub
5 changed files with 15 additions and 2 deletions

View File

@@ -132,6 +132,8 @@ class DemoDataGenerator {
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
DEMO_UNIT_DATA[idx].category = "GroundUnit";
DEMO_UNIT_DATA[idx].isLeader = true;
DEMO_UNIT_DATA[idx].coalition = 0;
DEMO_UNIT_DATA[idx].operateAs = 2;
idx += 1;
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
@@ -141,6 +143,7 @@ class DemoDataGenerator {
DEMO_UNIT_DATA[idx].category = "GroundUnit";
DEMO_UNIT_DATA[idx].isLeader = true;
DEMO_UNIT_DATA[idx].coalition = 0;
DEMO_UNIT_DATA[idx].operateAs = 1;
idx += 1;
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));

View File

@@ -1469,6 +1469,10 @@ input[type=number]::-webkit-outer-spin-button {
background-color: var(--ol-switch-off);
}
.switch-control.yes-no .ol-switch[data-value="undefined"] .ol-switch-fill {
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;
@@ -1484,13 +1488,17 @@ input[type=number]::-webkit-outer-spin-button {
}
.switch-control.coalition [data-value="true"] .ol-switch-fill {
background-color: var(--accent-light-blue);
background-color: var(--primary-blue);
}
.switch-control.coalition [data-value="false"] .ol-switch-fill {
background-color: var(--primary-red);
}
.switch-control.coalition [data-value="undefined"] .ol-switch-fill {
background-color: var(--ol-switch-undefined);
}
.switch-control.coalition [data-value="true"]>.ol-switch-fill::before {
content: "BLUE" !important;
}

View File

@@ -46,6 +46,7 @@
--ol-select-secondary: #545F6C;
--ol-switch-off:#686868;
--ol-switch-undefined:#383838;
/*** General border radii **/
--border-radius-xs: 2px;

View File

@@ -175,6 +175,7 @@ export class UnitControlPanel extends Panel {
this.#AWACSSwitch.resetExpectedValue();
this.#onOffSwitch.resetExpectedValue();
this.#followRoadsSwitch.resetExpectedValue();
this.#operateAsSwitch.resetExpectedValue();
this.#altitudeSlider.resetExpectedValue();
this.#speedSlider.resetExpectedValue();
this.#calculateMaxHeight();

View File

@@ -325,7 +325,7 @@ export class UnitsManager {
var value: any = variableGetter(units[0]);
units.forEach((unit: Unit) => {
if (variableGetter(unit) !== value)
return undefined;
value = undefined;
});
return value;
};