mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Add scope opacity and a reset to the Visual panel
The Display panel is regrouped as Visual (Look, Overlay, Effects) with style presets, a scope opacity slider and a reset to the default look. Scope opacity is carried in share links as field 30 and as the legacy sco parameter; 100 is the default and is left out of a link. Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
d49d3d10cc
commit
d145c30967
13 files changed
+471
-11
No files matched your search
@@ -66,6 +66,7 @@ export class VisualSettings {
|
||||
celestialRing,
|
||||
scopeEnabled,
|
||||
scopeFeatherPct,
|
||||
scopeOpacityPct,
|
||||
scopeTerminusPct,
|
||||
mapStack,
|
||||
panelState,
|
||||
@@ -133,7 +134,11 @@ export class VisualSettings {
|
||||
focus: false,
|
||||
});
|
||||
}
|
||||
this._setScope({ enabled: scopeEnabled, featherPct: scopeFeatherPct });
|
||||
this._setScope({
|
||||
enabled: scopeEnabled,
|
||||
featherPct: scopeFeatherPct,
|
||||
opacityPct: typeof scopeOpacityPct === 'number' ? scopeOpacityPct : undefined,
|
||||
});
|
||||
// null restores the altitude-adaptive ramp; a number pins the terminus
|
||||
// (clamped to the supported 94..100 band, same as the `sce` hash key).
|
||||
if (scopeTerminusPct === null) setScopeTerminusOverride(null);
|
||||
@@ -479,6 +484,7 @@ export class VisualSettings {
|
||||
scope: {
|
||||
enabled: this._scopeEnabledShown,
|
||||
featherPct: this._scopeFeatherShown,
|
||||
opacityPct: this._scopeOpacityShown ?? 100,
|
||||
},
|
||||
celestial: this._celestialShown,
|
||||
};
|
||||
@@ -488,7 +494,12 @@ export class VisualSettings {
|
||||
* Apply the Scope mask and show it on its controls; a field that is not
|
||||
* given stays as it is. `apply: false` only shows the mask's state.
|
||||
*/
|
||||
_setScope({ enabled, featherPct } = {}, { apply = true } = {}) {
|
||||
_setScope({ enabled, featherPct, opacityPct } = {}, { apply = true } = {}) {
|
||||
if (typeof opacityPct === 'number') {
|
||||
const pct = Math.max(0, Math.min(100, Math.round(opacityPct)));
|
||||
if (apply) this.services.setScopeMaskOpacity?.(pct / 100);
|
||||
this._scopeOpacityShown = pct;
|
||||
}
|
||||
if (typeof enabled === 'boolean') {
|
||||
if (apply) this.services.setScopeMaskEnabled(enabled);
|
||||
this._scopeEnabledShown = enabled;
|
||||
@@ -903,6 +914,7 @@ export class VisualSettings {
|
||||
celestialRingEnabled: this.celestialRingEnabled,
|
||||
scopeEnabled: isScopeMaskEnabled(),
|
||||
scopeFeatherPct: Math.round(getScopeMaskFeather() * 100),
|
||||
scopeOpacityPct: this._scopeOpacityShown ?? 100,
|
||||
// null when adaptive — the share layer omits `sce` entirely in that case.
|
||||
scopeTerminusPct:
|
||||
getScopeTerminusOverride() == null
|
||||
|
||||
Reference in new issue
Block a user