auto-git:

[change] src/app/App.tsx
 [change] tests/domain/runtime-project-time.test.ts
This commit is contained in:
2026-04-22 17:23:52 +02:00
parent ec5d00b7ed
commit e59f6bcd49
2 changed files with 53 additions and 38 deletions

View File

@@ -2474,7 +2474,10 @@ export function App({ store, initialStatusMessage }: AppProps) {
const cameraRigActorOptions = Array.from( const cameraRigActorOptions = Array.from(
new Set( new Set(
entityList entityList
.filter((entity): entity is Extract<EntityInstance, { kind: "npc" }> => entity.kind === "npc") .filter(
(entity): entity is Extract<EntityInstance, { kind: "npc" }> =>
entity.kind === "npc"
)
.map((entity) => entity.actorId) .map((entity) => entity.actorId)
) )
).sort((left, right) => left.localeCompare(right)); ).sort((left, right) => left.localeCompare(right));
@@ -15084,14 +15087,14 @@ export function App({ store, initialStatusMessage }: AppProps) {
</div> </div>
</div> </div>
<div className="form-section"> <div className="form-section">
<div className="label">Celestial Orbits</div> <div className="label">Celestial Orbits</div>
<div className="material-summary"> <div className="material-summary">
These angles drive the time-aware sun and moon paths in These angles drive the time-aware sun and moon paths in
the editor viewport and runner. Base peak altitude is the editor viewport and runner. Base peak altitude is the
the 12-hour reference height; longer or shorter 12-hour reference height; longer or shorter day/night
day/night windows shift the orbit automatically. windows shift the orbit automatically.
</div> </div>
<div className="vector-inputs vector-inputs--two"> <div className="vector-inputs vector-inputs--two">
<label className="form-field"> <label className="form-field">
<span className="label">Sun Azimuth</span> <span className="label">Sun Azimuth</span>
@@ -18649,8 +18652,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
type="checkbox" type="checkbox"
checked={cameraRigDefaultActiveDraft} checked={cameraRigDefaultActiveDraft}
onChange={(event) => { onChange={(event) => {
const nextValue = const nextValue = event.currentTarget.checked;
event.currentTarget.checked;
setCameraRigDefaultActiveDraft(nextValue); setCameraRigDefaultActiveDraft(nextValue);
scheduleDraftCommit(() => scheduleDraftCommit(() =>
applyCameraRigChange({ applyCameraRigChange({
@@ -18683,7 +18685,8 @@ export function App({ store, initialStatusMessage }: AppProps) {
} else if (nextKind === "entity") { } else if (nextKind === "entity") {
setCameraRigTargetEntityIdDraft( setCameraRigTargetEntityIdDraft(
cameraRigTargetEntityIdDraft.trim() || cameraRigTargetEntityIdDraft.trim() ||
cameraRigEntityTargetOptions[0]?.entity.id || cameraRigEntityTargetOptions[0]?.entity
.id ||
"" ""
); );
} }
@@ -18709,8 +18712,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
className="select-input" className="select-input"
value={cameraRigTargetActorIdDraft} value={cameraRigTargetActorIdDraft}
onChange={(event) => { onChange={(event) => {
const nextActorId = const nextActorId = event.currentTarget.value;
event.currentTarget.value;
setCameraRigTargetActorIdDraft(nextActorId); setCameraRigTargetActorIdDraft(nextActorId);
scheduleDraftCommit(() => scheduleDraftCommit(() =>
applyCameraRigChange() applyCameraRigChange()
@@ -18734,8 +18736,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
className="select-input" className="select-input"
value={cameraRigTargetEntityIdDraft} value={cameraRigTargetEntityIdDraft}
onChange={(event) => { onChange={(event) => {
const nextEntityId = const nextEntityId = event.currentTarget.value;
event.currentTarget.value;
setCameraRigTargetEntityIdDraft(nextEntityId); setCameraRigTargetEntityIdDraft(nextEntityId);
scheduleDraftCommit(() => scheduleDraftCommit(() =>
applyCameraRigChange() applyCameraRigChange()
@@ -18764,10 +18765,12 @@ export function App({ store, initialStatusMessage }: AppProps) {
step={DEFAULT_GRID_SIZE} step={DEFAULT_GRID_SIZE}
value={cameraRigTargetWorldPointDraft.x} value={cameraRigTargetWorldPointDraft.x}
onChange={(event) => onChange={(event) =>
setCameraRigTargetWorldPointDraft((draft) => ({ setCameraRigTargetWorldPointDraft(
...draft, (draft) => ({
x: event.currentTarget.value ...draft,
})) x: event.currentTarget.value
})
)
} }
onBlur={() => applyCameraRigChange()} onBlur={() => applyCameraRigChange()}
onKeyDown={(event) => onKeyDown={(event) =>
@@ -18799,10 +18802,12 @@ export function App({ store, initialStatusMessage }: AppProps) {
step={DEFAULT_GRID_SIZE} step={DEFAULT_GRID_SIZE}
value={cameraRigTargetWorldPointDraft.y} value={cameraRigTargetWorldPointDraft.y}
onChange={(event) => onChange={(event) =>
setCameraRigTargetWorldPointDraft((draft) => ({ setCameraRigTargetWorldPointDraft(
...draft, (draft) => ({
y: event.currentTarget.value ...draft,
})) y: event.currentTarget.value
})
)
} }
onBlur={() => applyCameraRigChange()} onBlur={() => applyCameraRigChange()}
onKeyDown={(event) => onKeyDown={(event) =>
@@ -18834,10 +18839,12 @@ export function App({ store, initialStatusMessage }: AppProps) {
step={DEFAULT_GRID_SIZE} step={DEFAULT_GRID_SIZE}
value={cameraRigTargetWorldPointDraft.z} value={cameraRigTargetWorldPointDraft.z}
onChange={(event) => onChange={(event) =>
setCameraRigTargetWorldPointDraft((draft) => ({ setCameraRigTargetWorldPointDraft(
...draft, (draft) => ({
z: event.currentTarget.value ...draft,
})) z: event.currentTarget.value
})
)
} }
onBlur={() => applyCameraRigChange()} onBlur={() => applyCameraRigChange()}
onKeyDown={(event) => onKeyDown={(event) =>

View File

@@ -304,16 +304,24 @@ describe("runtime project time", () => {
dayCount: 0, dayCount: 0,
dayLengthMinutes: 24 dayLengthMinutes: 24
}); });
const shortNightMoonPeak = resolveRuntimeDayNightWorldState(world, longDay, { const shortNightMoonPeak = resolveRuntimeDayNightWorldState(
timeOfDayHours: 1, world,
dayCount: 0, longDay,
dayLengthMinutes: 24 {
}); timeOfDayHours: 1,
const longNightMoonPeak = resolveRuntimeDayNightWorldState(world, shortDay, { dayCount: 0,
timeOfDayHours: 1, dayLengthMinutes: 24
dayCount: 0, }
dayLengthMinutes: 24 );
}); const longNightMoonPeak = resolveRuntimeDayNightWorldState(
world,
shortDay,
{
timeOfDayHours: 1,
dayCount: 0,
dayLengthMinutes: 24
}
);
expect(shortDayPeak.sunLight.direction.y).toBeLessThan( expect(shortDayPeak.sunLight.direction.y).toBeLessThan(
longDayPeak.sunLight.direction.y longDayPeak.sunLight.direction.y