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
@@ -5,12 +5,14 @@ import { t } from '../../../i18n/index.js';
|
||||
import { vPanelState } from '../../rail/panelState.js';
|
||||
import { vClassToggle } from '../../rail/classToggle.js';
|
||||
import PanelCollapseButton from '../../rail/PanelCollapseButton.vue';
|
||||
import UiPanelEdge from '../../kit/UiPanelEdge.vue';
|
||||
import UiSegmented from '../../kit/UiSegmented.vue';
|
||||
import UiSlider from '../../kit/UiSlider.js';
|
||||
import { useDisplayStore } from '../../stores/display.js';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
import UiSelect from '../../kit/UiSelect.js';
|
||||
import { StyleParameterRows } from '../../styleParameters.js';
|
||||
import VisualPresets from './VisualPresets.vue';
|
||||
|
||||
// The Display panel. VisualSettings presents the HUD, Sonar, Scope,
|
||||
// Celestial, detection, bloom and sharpen and AircraftDisplay the 3D group,
|
||||
@@ -29,6 +31,7 @@ const detectButton = computed(() => detection.value?.button ?? null);
|
||||
const allocation = computed(() => detection.value?.allocation ?? 'ELASTIC');
|
||||
const scopeOn = computed(() => view.value?.scope.enabled ?? true);
|
||||
const scopeFeather = computed(() => view.value?.scope.featherPct ?? 100);
|
||||
const scopeOpacity = computed(() => view.value?.scope.opacityPct ?? 100);
|
||||
const celestial = computed(() => view.value?.celestial ?? null);
|
||||
const celestialTitle = computed(() =>
|
||||
celestial.value && !celestial.value.supported
|
||||
@@ -51,12 +54,15 @@ const allocationOptions = computed(() => [
|
||||
<!-- Post-processing toggles (top-right) -->
|
||||
<div id="pp-toggles" v-panel-state="'pp-toggles'" class="panel-collapsible collapsed ui-scroll" data-panel-id="pp-toggles">
|
||||
<div class="compact pp-header-row">
|
||||
<span class="pp-header-label">{{ t('DISPLAY') }}</span>
|
||||
<span class="pp-header-label">{{ t('VISUAL') }}</span>
|
||||
<span class="panel-divider" aria-hidden="true"></span>
|
||||
<PanelCollapseButton class="pp-collapse-btn" target="pp-toggles" :name="t('DISPLAY')" sideways start-collapsed />
|
||||
<UiPanelEdge />
|
||||
<PanelCollapseButton class="pp-collapse-btn" target="pp-toggles" :name="t('VISUAL')" sideways start-collapsed />
|
||||
</div>
|
||||
<div class="pp-panel-body ui-scroll" data-rail-scroller>
|
||||
<VisualPresets />
|
||||
<!-- Cockpit shows these four groups in its Display popover: each teleports to the slot the Cockpit display portal publishes. While disabled a Teleport stays in place; its 'body' target only keeps server rendering from dropping it. -->
|
||||
<p class="pp-section-heading">{{ t('Overlay') }}</p>
|
||||
<Teleport :to="cockpitPortal?.hud ?? 'body'" :disabled="!cockpitPortal?.hud">
|
||||
<div class="pp-toggle-group">
|
||||
<button class="pp-toggle-btn" :class="{ active: hud?.visible }" id="hud-toggle" @click="act('toggleHud')" :title="t('Intelligence HUD (H)')">
|
||||
@@ -168,17 +174,23 @@ const allocationOptions = computed(() => [
|
||||
<UiSlider class="pp-slider" id="scope-feather-slider" @update:model-value="act('setScopeFeather', $event)" min="0" max="200" :model-value="scopeFeather" :disabled="!scopeOn" :aria-label="t('Scope edge feather')" :title="t('Scope edge feather as a percentage of the keyhole radius')" />
|
||||
<span class="pp-slider-value" id="scope-feather-value">{{ pct(scopeFeather) }}</span>
|
||||
</div>
|
||||
<div class="pp-slider-row visible" id="scope-opacity-row">
|
||||
<span class="pp-slider-mini-label">{{ t('Opacity') }}</span>
|
||||
<UiSlider class="pp-slider" id="scope-opacity-slider" @update:model-value="act('setScopeOpacity', $event)" min="0" max="100" :model-value="scopeOpacity" :disabled="!scopeOn" :aria-label="t('Scope opacity')" :title="t('How dark the scope shades the view outside the keyhole')" />
|
||||
<span class="pp-slider-value" id="scope-opacity-value">{{ pct(scopeOpacity) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="pp-toggle-btn" id="clean-view-toggle" @click="act('toggleCleanView')" :title="t('Hide UI chrome')">
|
||||
<span class="pp-icon">□</span>
|
||||
<span class="pp-label">{{ t('Clean UI') }}</span>
|
||||
</button>
|
||||
<p class="pp-section-heading">{{ t('Effects') }}</p>
|
||||
<div class="pp-toggle-group">
|
||||
<UiButton class="pp-toggle-btn" :pressed="celestial?.active ?? false" pressed-class="active" id="celestial-toggle" @click="act('toggleCelestial')" :title="celestialTitle" :disabled="celestial ? !celestial.supported : undefined" :aria-disabled="celestial ? String(!celestial.supported) : undefined">
|
||||
<span class="pp-icon material-symbols-outlined" aria-hidden="true">flare</span>
|
||||
<span class="pp-label">{{ t('Celestial') }}</span>
|
||||
</UiButton>
|
||||
</div>
|
||||
<button class="pp-toggle-btn" id="clean-view-toggle" @click="act('toggleCleanView')" :title="t('Hide UI chrome')">
|
||||
<span class="pp-icon">□</span>
|
||||
<span class="pp-label">{{ t('Clean UI') }}</span>
|
||||
</button>
|
||||
<div class="pp-toggle-group">
|
||||
<button class="pp-toggle-btn" :class="{ active: view?.bloom.active }" id="bloom-toggle" @click="act('toggleBloom')" :title="t('Bloom / Glow')">
|
||||
<span class="pp-icon">✨</span>
|
||||
@@ -199,6 +211,9 @@ const allocationOptions = computed(() => [
|
||||
<span class="pp-slider-value" id="sharpen-intensity-value">{{ pct(view?.sharpen.intensity ?? 49) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="pp-reset-btn" :title="t('Reset Visual to its defaults: Normal look, HUD, scope, labels and effects')" @click="act('resetVisual')">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">restart_alt</span>{{ t('Reset to default') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user