Merge branch 'main' into fix/shortcuts-modifier-keys

This commit is contained in:
German Khokhlov authored and GitHub committed 2026-11-19 16:11:04 +04:00
commit b3724c7bac
1214 files changed
+37676 -9143

No files matched your search

+45 -25
View File
@@ -30,7 +30,7 @@ import { LocationNavigation } from './locationNavigation.js';
import { bindCameraOrientationControls } from './cameraOrientationControls.js';
import { createMapSourceControls } from './mapSource.js';
import { STYLES } from './effects.js';
import { isHudLayout } from '../hudLayouts.js';
import { isHudLayout, isLegacySonarHudLayout } from '../hudLayouts.js';
import {
getCyberSonarControlState,
setCyberSonarControls,
@@ -62,6 +62,8 @@ import { applyLocaleChoice } from './localePicker.js';
import { PanelNavigation } from './panelNavigation.js';
import { applicationPinia, createUiRuntime } from './vueRuntime.js';
import { useContextStore } from './stores/context.js';
import { useSpaceMissionsStore } from './stores/spaceMissions.js';
import { SpaceMissionsControls } from './spaceMissionsControls.js';
import { useMissionReplayStore } from './stores/missionReplay.js';
import { useCelestialRingStore } from './stores/celestialRing.js';
import { icrfToFixedAxes } from '../sky/icrf.js';
@@ -78,6 +80,12 @@ import { useCockpitStore } from './stores/cockpit.js';
import { useGlobeActionsStore } from './stores/globeActions.js';
import { useRecordingStore } from './stores/recording.js';
import { onPlacePacksLoadingChange } from '../data/placeBelow.js';
import {
hideOsmCredit,
registerDynamicCredit,
showOsmCredit,
WIKIDATA_PLACES_CREDIT,
} from '../data/dataCredits.js';
import { withPlacePacks } from './placePacksLoading.js';
import { preloadOwnerFlags } from './ownerFlag.js';
@@ -182,6 +190,14 @@ export class StyleManager extends ShellFacade {
layers: () => this._dataManager?.getAll?.() || [],
setLayer: (id, enabled) =>
this._dataManager?.setEnabled(id, enabled, { origin: 'user' }),
// The Omnibar shows names from the bundled Wikidata packs.
creditPlaces: () =>
registerDynamicCredit(this.viewer, WIKIDATA_PLACES_CREDIT),
// Photon's suggestions are OpenStreetMap data: credited while shown.
creditSuggestions: (shown) =>
shown
? showOsmCredit(this.viewer, 'omnibar')
: hideOsmCredit(this.viewer, 'omnibar'),
});
// Scrolling at a screen edge steps through that side's rail panels.
this._removeRailEdgeScroll = installRailEdgeScroll();
@@ -203,7 +219,6 @@ export class StyleManager extends ShellFacade {
pinia: applicationPinia(),
pickWorld: services.pickWorldFromScreen,
regionalBrief: services.fetchRegionalBrief,
overlayHit: services.hitTestWorldOverlay,
});
this.mapStackController = mapStackController;
this.placeSearch = placeSearch;
@@ -312,6 +327,7 @@ export class StyleManager extends ShellFacade {
readControls: () => ({
hud: this.hud,
_contextControls: this._contextControls,
_spaceMissionsControls: this._spaceMissionsControls,
_cctvControls: this._cctvControls,
_radioControls: this._radioControls,
_streetLevelControls: this._streetLevelControls,
@@ -676,6 +692,7 @@ export class StyleManager extends ShellFacade {
this._initStreetLevelPanel();
this._initWildlifeSightingCard();
this._initGlobalContextPanel();
this._initSpaceMissionsPanel();
this._initLocationBar();
this._initMobileShell();
this._initShareButton();
@@ -1012,17 +1029,12 @@ export class StyleManager extends ShellFacade {
}
_initGlobalContextPanel() {
const {
radioLayer,
militaryInstallationsLayer,
militaryAwarenessLayer,
rocketLaunchesLayer,
} = this.services;
const { radioLayer, militaryInstallationsLayer, militaryAwarenessLayer } =
this.services;
const contextStore = useContextStore(applicationPinia());
this._contextControls = new ContextControls({
elements: {
_globalContextFlightsBtn: this._globalContextFlightsBtn,
_globalContextMissionsBtn: this._globalContextMissionsBtn,
_installationsSearchBtn: this._installationsSearchBtn,
},
installations: militaryInstallationsLayer,
@@ -1058,13 +1070,24 @@ export class StyleManager extends ShellFacade {
militaryAwarenessLayer?.subscribeDirectionOverlay?.((view) =>
awarenessDirectionStore.publish(view),
);
}
_initSpaceMissionsPanel() {
const { rocketLaunchesLayer } = this.services;
// The Space Missions layer publishes its roster and selected mission.
contextStore.connectMissions(rocketLaunchesLayer);
this._missionsPanelUnsubscribe?.();
contextStore.publishMissions(null);
this._missionsPanelUnsubscribe = rocketLaunchesLayer?.subscribePanel?.(
(view) => contextStore.publishMissions(view),
);
this._spaceMissionsControls?.destroy();
this._spaceMissionsControls = new SpaceMissionsControls({
layer: rocketLaunchesLayer,
store: useSpaceMissionsStore(applicationPinia()),
actions: {
setPanelCollapsed: (...args) => this.setPanelCollapsed(...args),
isCockpitActive: () => Boolean(this.cockpitView?.active),
// After the panel has rendered as shown: the phone shell will not
// open the Missions sheet over a hidden panel.
revealPanel: () =>
nextTick(() => this.revealPanel('space-missions-panel')),
},
});
// And its replay vehicle overlay, which the scene chrome renders.
const missionReplayStore = useMissionReplayStore(applicationPinia());
this._missionReplayUnsubscribe?.();
@@ -1377,17 +1400,18 @@ export class StyleManager extends ShellFacade {
}
/**
* Switches the HUD layout variant.
* Switches the HUD layout variant. The removed Cyber layout is accepted
* as an alias: it opens Tactical with the Sonar style on.
* @param {'tactical'|'minimal'|'cyber'} variantName - Layout variant.
* @returns {{ok: boolean, layout?: string, visible?: boolean, error?: string}}
*/
setHudLayout(variantName) {
const variant = String(variantName ?? '').toLowerCase();
if (!isHudLayout(variant)) {
if (!isHudLayout(variant) && !isLegacySonarHudLayout(variant)) {
return { ok: false, error: `Unknown HUD layout: ${variantName}` };
}
this.shareLinkManager?.claimRestoreLane?.('visual');
this._setHudVariant(variant, { applyVisualDefaults: true });
this._setHudVariant(variant);
return {
ok: true,
layout: this.hud.getVariant(),
@@ -1506,7 +1530,7 @@ export class StyleManager extends ShellFacade {
};
}
/** Apply Cyber-only sonar settings through the shared visual controls. */
/** Apply sonar visual-style settings through the shared visual controls. */
setCyberSonar(settings) {
return setCyberSonarControls(this, settings);
}
@@ -1642,8 +1666,6 @@ export class StyleManager extends ShellFacade {
* @param {string} styleName - Target style ('normal'|'retro'|'surveillance'|'thermal'|'anime'|'noir').
* @param {object} [options]
* @param {boolean} [options.applyPreset=true] - Whether to apply STYLE_PRESET_DEFAULTS for the new style.
* @param {boolean} [options.userInitiated=false] - Whether a direct user preset choice owns the Cyber exit style.
* @param {boolean} [options.preserveCyberRestore=false] - Whether an automatic style update keeps the Cyber entry snapshot.
* @returns {void}
*/
setStyle(
@@ -1943,16 +1965,14 @@ export class StyleManager extends ShellFacade {
this._awarenessDirectionUnsubscribe?.();
this._awarenessDirectionUnsubscribe = null;
useAwarenessDirectionStore(applicationPinia()).publish(null);
this._missionsPanelUnsubscribe?.();
this._missionsPanelUnsubscribe = null;
this._spaceMissionsControls?.destroy();
this._spaceMissionsControls = null;
this._missionReplayUnsubscribe?.();
this._missionReplayUnsubscribe = null;
useMissionReplayStore(applicationPinia()).publish(null);
const contextStore = useContextStore(applicationPinia());
contextStore.connectAwareness(null);
contextStore.publishAwareness(null);
contextStore.connectMissions(null);
contextStore.publishMissions(null);
this._cockpitCoordinator.stop();
this._visualSettings.stop();
this.shareLinkManager?.destroy();