@kayahr/ed-journal
Version:
Typescript library to read/watch the player journal of Frontier's game Elite Dangerous
49 lines • 1.61 kB
JavaScript
/*
* Copyright (C) 2022 Klaus Reimer <k@ailis.de>
* See LICENSE.md for licensing information.
*/
import { registerJournalEventUpdate } from "../../JournalEvent.js";
registerJournalEventUpdate("FSDJump", (from, to) => {
if (from.Faction != null) {
to.SystemFaction = { Name: from.Faction };
delete from.Faction;
}
if (from.Government != null) {
to.SystemGovernment = from.Government;
delete from.Government;
}
if (from.Government_Localised != null) {
to.SystemGovernment_Localised = from.Government_Localised;
delete from.Government_Localised;
}
if (from.Economy != null) {
to.SystemEconomy = from.Economy;
delete from.Economy;
}
if (from.Economy_Localised != null) {
to.SystemEconomy_Localised = from.Economy_Localised;
delete from.Economy_Localised;
}
if (from.Security != null) {
to.SystemSecurity = from.Security;
delete from.Security;
}
if (from.Security_Localised != null) {
to.SystemSecurity_Localised = from.Security_Localised;
delete from.Security_Localised;
}
if (from.Allegiance != null) {
to.SystemAllegiance = from.Allegiance;
delete from.Allegiance;
}
if (typeof from.SystemFaction === "string") {
to.SystemFaction = {
Name: from.SystemFaction
};
}
if (from.FactionState != null && to.SystemFaction instanceof Object) {
to.SystemFaction.FactionState = from.FactionState;
delete from.FactionState;
}
});
//# sourceMappingURL=FSDJump.js.map