mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Merge origin/main into the renderer seam
Brings in main up to f24abfc88: cockpit subject providers, the render
failure notice, aircraft drawn in their own mesh colours, airport ground
vehicles, and an aircraft with no ground track facing its true heading.
Under the seam:
- The render failure notice lives in the Cesium adapter
(src/render/cesium/renderFailure.js) and is the application hook
renderFailureNotice({allowReload, store}); its private Cesium fields
(Event's raise queue, the widget's render loop flag) are read through
internals.js. The inline panel's timer waits while the frame port reports
the loop stopped, and goes on after a Retry.
- Ordinary aircraft models draw white with the 'highlight' colour blend
through the draw port; tracked and emergency colours tint the mesh.
- Held trains and transit vehicles hide their route set and markers through
the draw port; the fleet model test fakes answer loads through the fake
draw port instead of Cesium's glTF loader.
- The Cockpit's subject view follows and places the camera through the
camera port.
This commit is contained in:
commit
866a9816f2
142 files changed
+9067
-308
No files matched your search
@@ -34,6 +34,16 @@ export function createSelection({ state, services, parts }) {
|
||||
function refreshSelectedCard(force) {
|
||||
const entry = state._trains.get(state._selectedKey);
|
||||
if (!entry) return;
|
||||
// A train a first-person view rides shows no card.
|
||||
if (entry.key === state._cockpitSubjectKey) {
|
||||
state._selectedCardText = null;
|
||||
state._overlayHost.setEntries(
|
||||
RAIL_SELECTED_OVERLAY_SOURCE_ID,
|
||||
[],
|
||||
RAIL_SELECTED_OVERLAY_SOURCE_OPTIONS,
|
||||
);
|
||||
return;
|
||||
}
|
||||
const now = Date.now();
|
||||
if (!force && now - state._selectedCardAt < SELECTED_CARD_REFRESH_MS)
|
||||
return;
|
||||
@@ -102,6 +112,8 @@ export function createSelection({ state, services, parts }) {
|
||||
*/
|
||||
function selectAndFocusTrain(key) {
|
||||
if (!state._trains.has(key)) return;
|
||||
// A selection by the user, even of the selected train (cockpitSubject.js).
|
||||
state._selectedAtMs = Date.now();
|
||||
const following = parts.follow.isFollowing(key);
|
||||
// Another train's follow lets go first, so this is never taken for a
|
||||
// move between two copies of one train.
|
||||
@@ -119,6 +131,7 @@ export function createSelection({ state, services, parts }) {
|
||||
const hadSelection = state._selectedKey !== null;
|
||||
parts.follow.release({ untrack });
|
||||
state._selectedKey = null;
|
||||
state._selectedAtMs = null;
|
||||
state._selectedCardText = null;
|
||||
if (hadSelection) {
|
||||
parts.rendering.paintAll();
|
||||
@@ -135,6 +148,8 @@ export function createSelection({ state, services, parts }) {
|
||||
}
|
||||
|
||||
function onKeyDown(event) {
|
||||
// While a first-person view rides the train, Escape is the view's.
|
||||
if (state._cockpitSubjectKey) return;
|
||||
if (event.key === 'Escape' && state._selectedKey) clearSelection();
|
||||
}
|
||||
|
||||
@@ -156,6 +171,8 @@ export function createSelection({ state, services, parts }) {
|
||||
// and skips it while a tool holds the pointer.
|
||||
state._clickSubscription = inputFor(viewer).onClick((event) => {
|
||||
if (!state._enabled) return;
|
||||
// A held train keeps the selection until its view lets it go.
|
||||
if (state._cockpitSubjectKey) return;
|
||||
const key = trainKeyOf(event.drawHit);
|
||||
if (key) selectAndFocusTrain(key);
|
||||
else if (state._selectedKey) clearSelection();
|
||||
|
||||
Reference in new issue
Block a user