KSP2 date display mode autocheck

This commit is contained in:
Krafpy
2023-08-09 12:11:02 +02:00
parent 0af3ed7827
commit 75bcfa9d3d
4 changed files with 5 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ time:
# initialDate: 0 # the initial date, in seconds (real only)
hoursPerDay: 6 # number of hours in a day (Kerbal day) (base only)
daysPerYear: 426 # number of days per year (Kerbal year) (base only)
ksp2DateMode: true # [optional] autocheck the box to display the dates as elapsed time from UT (used by KSP2)
flybySequence:
radiusSamples: 10 # number of samples radius samples to test when evaluating a sequence feasability

View File

@@ -43,6 +43,7 @@ export async function initEditorWithSystem(systems, systemIndex) {
};
requestAnimationFrame(loop);
const datesAsElapsedCheckbox = document.getElementById("date-as-elapsed-checkbox");
datesAsElapsedCheckbox.checked = config.time.ksp2DateMode || false;
const initialDateDisplayMode = datesAsElapsedCheckbox.checked ? "elapsed" : "offset";
const systemTime = new TimeSelector("system", config, initialDateDisplayMode);
const updateSystemTime = () => {

View File

@@ -59,6 +59,7 @@ export async function initEditorWithSystem(systems: SolarSystemData[], systemInd
// Date display mode toggle:
const datesAsElapsedCheckbox = document.getElementById("date-as-elapsed-checkbox") as HTMLInputElement;
datesAsElapsedCheckbox.checked = config.time.ksp2DateMode || false;
const initialDateDisplayMode = datesAsElapsedCheckbox.checked ? "elapsed" : "offset";
// Setting up solar system time control

2
src/types.d.ts vendored
View File

@@ -71,11 +71,13 @@ type BaseTimeSettings = {
readonly type: "base";
readonly hoursPerDay: number;
readonly daysPerYear: number;
readonly ksp2DateMode: boolean | undefined;
};
type RealTimeSettings = {
readonly type: "real";
readonly initialDate: number;
readonly ksp2DateMode: boolean | undefined;
};
interface FBSequenceSettings {