mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
Display > HUD > Sonar now turns the sonar sweep on over Tactical or Minimal. It is off by default, ON reveals its five sliders, and it keeps its guards: an OFF control, the sweep only while the HUD is visible and outside Cockpit, no animation under reduced motion, and repaint timers re-armed only after a drawn frame that still shows contacts. The Cyber layout, its shell skin and its Cockpit lanes are removed. Share links, scenes, saved views and set_hud that name Cyber open Tactical with Sonar on; links and scene shots record Tactical with Sonar under the same code, and a restored state that names another layout turns Sonar off. set_cyber_sonar keeps its name and works under any layout. A newer Sonar toggle or voice setting wins over a share-link restore that lands later. From 1200px wide the command dock and World Timeline sit 74px above the bottom edge, as in the Omnibar layout, leaving the bottom row to the map attribution (left) and the Power Up corner row (right). The attribution moves to the bottom right when the page runs right to left, where the corner row sits at the bottom left, and a long credit line wraps upward before reaching the corner row. The Tactical bottom-right readout sits 8px above Power Up and the coordinates start level with it. The World Timeline is narrowed to sit between the corners. Toasts keep clear of the raised dock and the chat and voice panel height budgets subtract its rise. Below 1200px the layout is unchanged. The left rail treats the centered World Timeline and voice control as obstacles only where they reach a laid-out panel. On top of the Omnibar: sonar.css replaces cyber.css after the Omnibar imports, the Omnibar's HUD guide step now says Layout picks Tactical or Minimal, and the Omnibar's Tactical bottom-right readout keeps the same 8px above Power Up. Co-authored-by: Sameh Khamis <[email protected]>
82 lines
3.0 KiB
JavaScript
82 lines
3.0 KiB
JavaScript
/**
|
|
* Resolve where Cockpit's Display/Radio strip hangs in the right margin.
|
|
*
|
|
* The strip is anchored under the REC readout it shares that margin with, and
|
|
* is pulled back up whenever the briefing card below would otherwise be
|
|
* overrun — never above `minTop`, so it can't climb into the topline. The
|
|
* returned `maxHeight` is measured from that resolved top, so a corridor the
|
|
* strip cannot honour by moving is honoured by shrinking instead.
|
|
*
|
|
* @param {object} input
|
|
* @param {number} input.recBottom Bottom edge of the REC readout, in px.
|
|
* @param {number} input.signalTop Top edge of the briefing card, in px.
|
|
* @param {number} input.stripHeight Rendered height of the strip, in px.
|
|
* @param {number} input.viewportHeight Viewport height, in px.
|
|
* @param {number} [input.collapsedHeight] Height of one collapsed launcher.
|
|
* @param {number} [input.recGap] Clearance under the REC readout.
|
|
* @param {number} [input.signalGap] Clearance above the briefing card.
|
|
* @param {number} [input.minTopFloor] Absolute ceiling for the strip, in px.
|
|
* @param {number} [input.minTopRatio] Viewport-relative ceiling, 0..1.
|
|
* @returns {{ top: number, maxHeight: number }}
|
|
*/
|
|
export function resolveCockpitUtilityAnchor({
|
|
recBottom,
|
|
signalTop,
|
|
stripHeight,
|
|
viewportHeight,
|
|
collapsedHeight = 0,
|
|
recGap = 12,
|
|
signalGap = 8,
|
|
minTopFloor = 96,
|
|
minTopRatio = 0.12,
|
|
}) {
|
|
const viewport = Math.max(0, Number(viewportHeight) || 0);
|
|
const minTop = Math.max(minTopFloor, viewport * minTopRatio);
|
|
const anchoredTop = Math.max(minTop, (Number(recBottom) || 0) + recGap);
|
|
const strip = Math.max(0, Number(stripHeight) || 0);
|
|
const signal = Number(signalTop);
|
|
const lowerBound = Number.isFinite(signal) ? signal : viewport;
|
|
const clearedTop = lowerBound - signalGap - strip;
|
|
const top = Math.max(minTop, Math.min(anchoredTop, clearedTop));
|
|
const floor = Math.max(0, Number(collapsedHeight) || 0) || 50;
|
|
|
|
return { top, maxHeight: Math.max(floor, lowerBound - top - signalGap) };
|
|
}
|
|
|
|
/**
|
|
* Resolve whether a collapsed Cockpit utility launcher can share the desktop
|
|
* corridor with the currently expanded utility panel.
|
|
*
|
|
* @param {object} input
|
|
* @param {number} input.availableHeight
|
|
* @param {number} input.expandedHeight
|
|
* @param {number} input.collapsedHeight
|
|
* @param {number} [input.gap]
|
|
* @param {number} [input.minimumExpandedHeight]
|
|
* @returns {{ primaryOnly: boolean, expandedMaxHeight: number }}
|
|
*/
|
|
export function resolveCockpitUtilityLayout({
|
|
availableHeight,
|
|
expandedHeight,
|
|
collapsedHeight,
|
|
gap = 7,
|
|
minimumExpandedHeight = 120,
|
|
}) {
|
|
const available = Math.max(
|
|
minimumExpandedHeight,
|
|
Number(availableHeight) || 0,
|
|
);
|
|
const expanded = Math.max(0, Number(expandedHeight) || 0);
|
|
const collapsed = Math.max(0, Number(collapsedHeight) || 0);
|
|
const spacing = Math.max(0, Number(gap) || 0);
|
|
const primaryOnly = expanded + spacing + collapsed > available;
|
|
|
|
return {
|
|
primaryOnly,
|
|
expandedMaxHeight: Math.max(
|
|
minimumExpandedHeight,
|
|
available - (primaryOnly ? 0 : spacing + collapsed),
|
|
),
|
|
};
|
|
}
|