@fboes/aerofly-custom-missions
Version:
Builder for Aerofly FS4 Custom Missions Files
45 lines (44 loc) • 1.24 kB
JavaScript
import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
/**
* @class
* A translation for the mission title and description.
*/
export class AeroflyLocalizedText {
/**
* @param {string} language ISO 639-1 like
* - br
* - cn
* - de
* - es
* - fr
* - id
* - it
* - jp
* - kr
* - pl
* - sv
* - tr
* @param {string} title of this flight plan
* @param {string} description text, mission briefing, etc
*/
constructor(language, title, description) {
this.language = language;
this.title = title;
this.description = description;
}
/**
* @returns {AeroflyConfigurationNode} to use in Aerofly FS4's `custom_missions_user.tmc`
*/
getElement() {
return new AeroflyConfigurationNode("tmmission_definition_localized", "element")
.appendChild("string8u", "language", this.language)
.appendChild("string8", "title", this.title)
.appendChild("string8", "description", this.description);
}
/**
* @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
*/
toString() {
return this.getElement().toString();
}
}