mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Ground units' name no longer repeats, unit name now dynamic.
This commit is contained in:
parent
735e257900
commit
ab01003ae6
@ -77,19 +77,34 @@ export class UnitControlPanel extends Panel {
|
||||
}
|
||||
|
||||
var button = document.createElement("button");
|
||||
button.innerText = baseData.unitName;
|
||||
|
||||
let callsign;
|
||||
|
||||
const unitName = <HTMLInputElement>this.getElement().querySelector( "#unit-name" );
|
||||
|
||||
if (unit instanceof Aircraft) {
|
||||
button.innerText = "";
|
||||
button.setAttribute( "data-short-label", aircraftDatabase.getLabelByName( baseData.name ) );
|
||||
button.setAttribute( "data-callsign", aircraftDatabase.getLabelByName( baseData.unitName ) );
|
||||
|
||||
callsign = aircraftDatabase.getLabelByName( baseData.unitName );
|
||||
|
||||
button.setAttribute( "data-callsign", callsign );
|
||||
unitName.value = callsign;
|
||||
|
||||
} else if (unit instanceof GroundUnit) {
|
||||
|
||||
button.setAttribute( "data-short-label", groundUnitsDatabase.getShortLabelByName(baseData.name));
|
||||
|
||||
callsign = aircraftDatabase.getLabelByName( baseData.unitName ) || "";
|
||||
|
||||
button.setAttribute( "data-callsign", groundUnitsDatabase.getLabelByName( baseData.unitName ) );
|
||||
unitName.value = callsign;
|
||||
|
||||
} else {
|
||||
|
||||
button.setAttribute( "data-short-label", "");
|
||||
button.setAttribute( "data-callsign", "" );
|
||||
|
||||
}
|
||||
|
||||
button.setAttribute( "data-coalition", unit.getMissionData().coalition );
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<div class="unit-short-label"></div>
|
||||
</div>
|
||||
|
||||
<input id="unit-name" value="Olympus 1-1" readonly disabled />
|
||||
<input id="unit-name" value="" readonly disabled />
|
||||
|
||||
<!-- <button id="edit-unit-name" data-on-click="editUnitName"></button> -->
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user