dsh-ocean-background 0.0.0-stage → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/client.js +582 -0
- package/docs/DETAIL.md +37 -0
- package/host/fork-snapshots.js +60 -0
- package/host/session-facts.js +205 -0
- package/host/session-state.js +383 -0
- package/icon.svg +19 -0
- package/index.js +299 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/mileage.js +312 -0
- package/package.json +35 -4
- package/runtime/assets/coconut-palm.glb +0 -0
- package/runtime/assets/dinghy.glb +0 -0
- package/runtime/assets/ship.glb +0 -0
- package/runtime/boats.js +199 -0
- package/runtime/fleet.js +260 -0
- package/runtime/glsl.js +60 -0
- package/runtime/index.html +22 -0
- package/runtime/lifecycle.js +94 -0
- package/runtime/main.js +615 -0
- package/runtime/ocean.js +192 -0
- package/runtime/resources.js +27 -0
- package/runtime/scenery-geometry.js +363 -0
- package/runtime/scenery-layout.js +147 -0
- package/runtime/scenery.js +300 -0
- package/runtime/ship.js +272 -0
- package/runtime/sky.js +64 -0
- package/runtime/state.js +362 -0
- package/runtime/style.css +45 -0
- package/runtime/vendor/THREE-LICENSE.txt +21 -0
- package/runtime/vendor/jsm/loaders/GLTFLoader.js +4890 -0
- package/runtime/vendor/jsm/utils/BufferGeometryUtils.js +1435 -0
- package/runtime/vendor/three.core.js +58773 -0
- package/runtime/vendor/three.module.js +18251 -0
- package/runtime/voyage.js +160 -0
- package/runtime/wave-field.js +125 -0
- package/runtime/wind-motion.js +93 -0
- package/runtime/wind.js +139 -0
- package/runtime/world-motion.js +24 -0
- package/README.md +0 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## Stylized Pirate Ship
|
|
4
|
+
|
|
5
|
+
- Author: Maksim Batyrev, https://sketchfab.com/c3posw01
|
|
6
|
+
- Source: https://sketchfab.com/3d-models/stylized-pirate-ship-1c62191534174bf7a67470fb02b97db1
|
|
7
|
+
- License: Creative Commons Attribution 4.0, https://creativecommons.org/licenses/by/4.0/
|
|
8
|
+
- Changes made here: removed the model's own water plane, replaced the sail
|
|
9
|
+
material with plain cream canvas, disabled the emissive glow on the sails, and
|
|
10
|
+
baked a furled morph target into each sail.
|
|
11
|
+
|
|
12
|
+
## Row Boat
|
|
13
|
+
|
|
14
|
+
- Author: Sk1ttle, https://sketchfab.com/Sk1ttle
|
|
15
|
+
- Source: https://sketchfab.com/3d-models/row-boat-1152ce68ca0e4e78bbd93a10c47056e5
|
|
16
|
+
- License: Creative Commons Attribution 4.0, https://creativecommons.org/licenses/by/4.0/
|
|
17
|
+
- Changes made here: scaled to the fleet's length, centred on the waterline, and
|
|
18
|
+
used unmodified materials. The oars are rocked slightly while a boat is working.
|
|
19
|
+
|
|
20
|
+
## Coconut palm
|
|
21
|
+
|
|
22
|
+
- Author: 3D Assets, https://3dassets.dev/u/3dassets
|
|
23
|
+
- Source: https://3dassets.dev/assets/tropical-island-ecology-coconut-palm-tall-7b181376
|
|
24
|
+
- License: CC0 1.0 Universal, https://creativecommons.org/publicdomain/zero/1.0/
|
|
25
|
+
- Changes made here: scaled and placed as one palm on each small sandbar.
|
|
26
|
+
|
|
27
|
+
## three.js
|
|
28
|
+
|
|
29
|
+
- Copyright three.js authors, MIT License, https://github.com/mrdoob/three.js
|
|
30
|
+
- Vendored under runtime/vendor. Full text in runtime/vendor/THREE-LICENSE.txt.
|
package/client.js
ADDED
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: 'dsh-ocean-background',
|
|
3
|
+
factory() {
|
|
4
|
+
const FRAME_ID = 'ocean-background-frame';
|
|
5
|
+
const SHELL_STYLE_ID = 'ocean-background-shell';
|
|
6
|
+
const UI_STYLE_ID = 'ocean-background-ui-style';
|
|
7
|
+
const BUTTON_ID = 'ocean-background-button';
|
|
8
|
+
const PANEL_ID = 'ocean-background-panel';
|
|
9
|
+
const MILEAGE_ID = 'ocean-background-mileage';
|
|
10
|
+
const DOCK_ID = 'ocean-background-dock';
|
|
11
|
+
const STORE_KEY = 'ocean-background:settings';
|
|
12
|
+
const KILL_KEY = 'ocean-background:disabled';
|
|
13
|
+
const READY_TIMEOUT = 8000;
|
|
14
|
+
const METERS_PER_NM = 1852;
|
|
15
|
+
const MILEAGE_POLL_MS = 1000;
|
|
16
|
+
|
|
17
|
+
const DEFAULTS = {
|
|
18
|
+
enabled: true, strength: 0.72, running: true, quality: 'balanced',
|
|
19
|
+
cameraDistance: 44, cameraHeight: 4.8, cameraPitch: 2.7, cameraXOffset: 0,
|
|
20
|
+
};
|
|
21
|
+
const CAMERA_LIMITS = {
|
|
22
|
+
cameraDistance: { min: 20, max: 100, step: 1 },
|
|
23
|
+
cameraHeight: { min: 2, max: 40, step: 0.1 },
|
|
24
|
+
cameraPitch: { min: -30, max: 60, step: 0.1 },
|
|
25
|
+
cameraXOffset: { min: -8, max: 8, step: 0.1 },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function cameraValue(key, value) {
|
|
29
|
+
const { min, max, step } = CAMERA_LIMITS[key];
|
|
30
|
+
if (!Number.isFinite(value)) return DEFAULTS[key];
|
|
31
|
+
const clamped = Math.min(max, Math.max(min, value));
|
|
32
|
+
return Number((Math.round(clamped / step) * step).toFixed(1));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function displayNauticalMiles(meters) {
|
|
36
|
+
return (Math.floor((meters * 100) / METERS_PER_NM + 1e-9) / 100).toFixed(2);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Interface copy is a locale table keyed by language tag. messagesFor()
|
|
40
|
+
// accepts any BCP 47 tag, falls back from a region variant to its base
|
|
41
|
+
// language, then to English. Adding a language means adding one entry here.
|
|
42
|
+
const MESSAGES = {
|
|
43
|
+
zh: { open: '海景设置', show: '显示海面', strength: '背景强度', running: '播放', quality: '画质', balanced: '均衡', high: '高', cameraDistance: '摄像机距离', cameraHeight: '摄像机高度', cameraPitch: '摄像机俯仰角', cameraXOffset: '镜头左右偏移', cameraHint: '左右偏移:负值向左,正值向右,上限 8。俯仰角:负值向上,正值向下。', recovering: '海面未就绪,界面保持原样', mileageToday: '今日已航行', mileageFleet: '目前已航行', mileageUnit: '海里' },
|
|
44
|
+
en: { open: 'Ocean settings', show: 'Show ocean', strength: 'Strength', running: 'Playing', quality: 'Quality', balanced: 'Balanced', high: 'High', cameraDistance: 'Camera distance', cameraHeight: 'Camera height', cameraPitch: 'Camera pitch', cameraXOffset: 'Camera horizontal offset', cameraHint: 'Horizontal offset: negative left, positive right; limit 8. Pitch: negative looks up, positive looks down.', recovering: 'Sea not ready, interface untouched', mileageToday: 'Sailed today', mileageFleet: 'Sailed', mileageUnit: 'nm' },
|
|
45
|
+
};
|
|
46
|
+
const FALLBACK_LANGUAGE = 'en';
|
|
47
|
+
|
|
48
|
+
function messagesFor(languageTag) {
|
|
49
|
+
const tag = String(languageTag || '').toLowerCase();
|
|
50
|
+
const base = tag.split('-')[0];
|
|
51
|
+
const matched = MESSAGES[tag] ? tag : (MESSAGES[base] ? base : FALLBACK_LANGUAGE);
|
|
52
|
+
return { ...MESSAGES[FALLBACK_LANGUAGE], ...MESSAGES[matched] };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Shell styling is the Open Sea Skin recipe, kept as close to the original as
|
|
56
|
+
// this plugin needs. The mechanism is a single one: the theme's own surface
|
|
57
|
+
// tokens are made translucent on #root, so every surface that reads a token
|
|
58
|
+
// becomes see-through at once. No container is targeted by class name, and
|
|
59
|
+
// nothing is forced fully transparent, which is what keeps the text readable.
|
|
60
|
+
//
|
|
61
|
+
// The frame is the one exception. It paints its own fill from --dsw-alias-bg-base
|
|
62
|
+
// and its columns paint again on top, so those get pinned to the same
|
|
63
|
+
// translucent token instead of compounding into a darker centre.
|
|
64
|
+
function shellCss(strength) {
|
|
65
|
+
const light = Math.min(0.95, Math.max(0.35, strength));
|
|
66
|
+
const dark = Math.max(0.40, light - 0.12);
|
|
67
|
+
const a = (value) => Number(value.toFixed(2));
|
|
68
|
+
return `
|
|
69
|
+
body {
|
|
70
|
+
background: transparent !important;
|
|
71
|
+
}
|
|
72
|
+
body #root {
|
|
73
|
+
--dsw-alias-bg-base: rgba(255, 255, 255, ${a(light)}) !important;
|
|
74
|
+
--dsw-alias-bg-layer-1: rgba(255, 255, 255, ${a(light)}) !important;
|
|
75
|
+
--dsw-alias-bg-layer-2: rgba(255, 255, 255, ${a(light)}) !important;
|
|
76
|
+
--dsw-alias-bg-layer-3: rgba(255, 255, 255, ${a(light)}) !important;
|
|
77
|
+
--dsw-alias-bg-module-platform: rgba(245, 246, 247, ${a(light + 0.02)}) !important;
|
|
78
|
+
--dsw-alias-bg-multi-select: rgba(245, 246, 247, ${a(light + 0.02)}) !important;
|
|
79
|
+
--dsw-alias-bg-overlay: rgba(233, 236, 242, .97) !important;
|
|
80
|
+
--dsw-specific-sidebar-fill: rgba(249, 250, 251, ${a(Math.max(0.36, light - 0.04))}) !important;
|
|
81
|
+
--dsw-specific-selector: rgba(245, 246, 247, ${a(light + 0.02)}) !important;
|
|
82
|
+
}
|
|
83
|
+
body[data-ds-dark-theme] #root {
|
|
84
|
+
--dsw-alias-bg-base: rgba(9, 12, 16, ${a(dark)}) !important;
|
|
85
|
+
--dsw-alias-bg-layer-1: rgba(12, 16, 22, ${a(dark)}) !important;
|
|
86
|
+
--dsw-alias-bg-layer-2: rgba(16, 20, 27, ${a(dark)}) !important;
|
|
87
|
+
--dsw-alias-bg-layer-3: rgba(20, 25, 33, ${a(dark)}) !important;
|
|
88
|
+
--dsw-alias-bg-module-platform: rgba(13, 17, 23, ${a(dark + 0.02)}) !important;
|
|
89
|
+
--dsw-alias-bg-multi-select: rgba(13, 17, 23, ${a(dark + 0.02)}) !important;
|
|
90
|
+
--dsw-alias-bg-overlay: rgba(18, 22, 30, .97) !important;
|
|
91
|
+
--dsw-specific-sidebar-fill: rgba(11, 15, 21, ${a(Math.max(0.35, dark - 0.05))}) !important;
|
|
92
|
+
--dsw-specific-selector: rgba(13, 17, 23, ${a(dark + 0.02)}) !important;
|
|
93
|
+
}
|
|
94
|
+
/* Official Harness Desktop 0.2.x: sidebar, centre, conversation and docked
|
|
95
|
+
rightbar each paint a surface, and translucent paints compound into a much
|
|
96
|
+
darker centre. Paint the shared frame once from the token, then clear the
|
|
97
|
+
columns so only that one translucent fill remains. */
|
|
98
|
+
html:is([data-platform="darwin"], [data-windows-titlebar]) body #root div:has(> [data-shell-overlay]) {
|
|
99
|
+
background: var(--dsw-alias-bg-base) !important;
|
|
100
|
+
}
|
|
101
|
+
/* The sidebar slot paints its own tint from this token in the Web layout as
|
|
102
|
+
well as the desktop one, so it is cleared at the semantic boundary rather
|
|
103
|
+
than only under the desktop attribute. */
|
|
104
|
+
body #root [data-slot="sidebar"] {
|
|
105
|
+
--dsw-specific-sidebar-fill: transparent !important;
|
|
106
|
+
}
|
|
107
|
+
html:is([data-platform="darwin"], [data-windows-titlebar]) body #root div:has(> [data-shell-overlay]) > :is(:first-child, :nth-child(2), [data-rightbar-col], [data-shell-bottom]),
|
|
108
|
+
html:is([data-platform="darwin"], [data-windows-titlebar]) body #root div:has(> [data-shell-overlay]) > :nth-child(2) [data-phase],
|
|
109
|
+
html:is([data-platform="darwin"], [data-windows-titlebar]) body #root [data-rightbar-col] [data-dockkit-host="dock"] > [data-dockkit-content] {
|
|
110
|
+
background: transparent !important;
|
|
111
|
+
}
|
|
112
|
+
html[data-windows-titlebar] body #root div:has(> [data-shell-overlay])::before {
|
|
113
|
+
background: transparent !important;
|
|
114
|
+
}
|
|
115
|
+
/* Composer, bubbles and code cards keep a solid surface inside the conversation
|
|
116
|
+
slot; settings and other plugin interfaces keep their original fills. */
|
|
117
|
+
body [data-slot="main.conversation"] {
|
|
118
|
+
--dsw-specific-input-major: var(--dsw-alias-bg-layer-1) !important;
|
|
119
|
+
--dsw-specific-bubble: var(--dsw-alias-bg-layer-2) !important;
|
|
120
|
+
--dsw-alias-markdown-code-block: var(--dsw-alias-bg-layer-1) !important;
|
|
121
|
+
--dsw-alias-markdown-code-block-banner: var(--dsw-alias-bg-layer-2) !important;
|
|
122
|
+
}
|
|
123
|
+
/* Dialog cards are body-level portals: keep them opaque so no text sits on the
|
|
124
|
+
sea. The plugin's own panel is excluded and styles itself. */
|
|
125
|
+
body :is([data-shortcut-modal="settings"], [role="dialog"], [role="alertdialog"]):not(#${PANEL_ID}) {
|
|
126
|
+
background: rgba(250, 251, 253, .97) !important;
|
|
127
|
+
}
|
|
128
|
+
body[data-ds-dark-theme] :is([data-shortcut-modal="settings"], [role="dialog"], [role="alertdialog"]):not(#${PANEL_ID}) {
|
|
129
|
+
background: rgba(24, 28, 35, .97) !important;
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const UI_CSS = `
|
|
135
|
+
#${DOCK_ID} {
|
|
136
|
+
position: fixed; right: 14px; bottom: 12px; z-index: 6000;
|
|
137
|
+
display: flex; align-items: center; gap: 8px;
|
|
138
|
+
pointer-events: none;
|
|
139
|
+
}
|
|
140
|
+
#${BUTTON_ID} {
|
|
141
|
+
flex: none;
|
|
142
|
+
width: 30px; height: 30px; padding: 0; border-radius: 9px;
|
|
143
|
+
display: flex; align-items: center; justify-content: center;
|
|
144
|
+
cursor: pointer; opacity: .8; pointer-events: auto;
|
|
145
|
+
border: 1px solid rgba(120, 170, 190, .38);
|
|
146
|
+
background: rgba(16, 40, 50, .55);
|
|
147
|
+
color: #e8f6fb;
|
|
148
|
+
backdrop-filter: blur(8px) saturate(130%);
|
|
149
|
+
transition: opacity .16s ease, background .16s ease, border-color .16s ease;
|
|
150
|
+
}
|
|
151
|
+
#${BUTTON_ID}:hover, #${BUTTON_ID}:focus-visible {
|
|
152
|
+
opacity: 1; background: rgba(20, 54, 66, .8); border-color: rgba(160, 220, 235, .65);
|
|
153
|
+
}
|
|
154
|
+
#${BUTTON_ID}[data-on="false"] { color: #c9d6da; border-color: rgba(150, 170, 180, .34); }
|
|
155
|
+
#${MILEAGE_ID} {
|
|
156
|
+
flex: none;
|
|
157
|
+
height: 30px; display: flex; align-items: center;
|
|
158
|
+
box-sizing: border-box;
|
|
159
|
+
font: 600 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
160
|
+
color: #082c36; white-space: nowrap;
|
|
161
|
+
text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 4px rgba(255, 255, 255, .95), 0 1px 2px rgba(255, 255, 255, .9);
|
|
162
|
+
pointer-events: none; user-select: none;
|
|
163
|
+
}
|
|
164
|
+
#${MILEAGE_ID}[hidden] { display: none; }
|
|
165
|
+
body[data-ds-dark-theme] #${MILEAGE_ID} {
|
|
166
|
+
color: #f2fafd;
|
|
167
|
+
text-shadow: 0 0 2px rgba(0, 0, 0, .95), 0 0 2px rgba(0, 0, 0, .9), 0 1px 3px rgba(0, 0, 0, .85);
|
|
168
|
+
}
|
|
169
|
+
#${PANEL_ID} {
|
|
170
|
+
position: fixed; right: 14px; bottom: 50px; z-index: 6001;
|
|
171
|
+
width: 240px; padding: 13px 14px 14px; border-radius: 12px;
|
|
172
|
+
max-height: calc(100dvh - 80px); overflow-y: auto;
|
|
173
|
+
background: rgba(248, 251, 252, .97);
|
|
174
|
+
border: 1px solid rgba(20, 60, 75, .16);
|
|
175
|
+
box-shadow: 0 12px 32px rgba(9, 32, 40, .22);
|
|
176
|
+
font: 12px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
177
|
+
color: #16333d;
|
|
178
|
+
}
|
|
179
|
+
body[data-ds-dark-theme] #${PANEL_ID} {
|
|
180
|
+
background: rgba(20, 27, 33, .97);
|
|
181
|
+
border-color: rgba(160, 200, 215, .22);
|
|
182
|
+
color: #e2eef2;
|
|
183
|
+
}
|
|
184
|
+
#${PANEL_ID}[hidden] { display: none; }
|
|
185
|
+
#${PANEL_ID} .ob-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 9px 0 0; }
|
|
186
|
+
#${PANEL_ID} .ob-row:first-child { margin-top: 0; }
|
|
187
|
+
#${PANEL_ID} .ob-title { font-weight: 600; margin: 0 0 6px; }
|
|
188
|
+
#${PANEL_ID} .ob-note { margin: 8px 0 0; opacity: .7; font-size: 11px; }
|
|
189
|
+
#${PANEL_ID} input[type="range"] { width: 100%; margin: 6px 0 0; }
|
|
190
|
+
#${PANEL_ID} select { font: inherit; padding: 2px 6px; border-radius: 6px; }
|
|
191
|
+
#${PANEL_ID} label { display: block; }
|
|
192
|
+
`;
|
|
193
|
+
|
|
194
|
+
function readSettings() {
|
|
195
|
+
try {
|
|
196
|
+
const raw = window.localStorage.getItem(STORE_KEY);
|
|
197
|
+
const saved = raw ? JSON.parse(raw) : {};
|
|
198
|
+
return {
|
|
199
|
+
enabled: typeof saved?.enabled === 'boolean' ? saved.enabled : DEFAULTS.enabled,
|
|
200
|
+
strength: Number.isFinite(saved?.strength) ? Math.min(0.95, Math.max(0.35, saved.strength)) : DEFAULTS.strength,
|
|
201
|
+
running: typeof saved?.running === 'boolean' ? saved.running : DEFAULTS.running,
|
|
202
|
+
quality: saved?.quality === 'high' ? 'high' : 'balanced',
|
|
203
|
+
cameraDistance: cameraValue('cameraDistance', saved?.cameraDistance),
|
|
204
|
+
cameraHeight: cameraValue('cameraHeight', saved?.cameraHeight),
|
|
205
|
+
cameraPitch: cameraValue('cameraPitch', saved?.cameraPitch),
|
|
206
|
+
cameraXOffset: cameraValue('cameraXOffset', saved?.cameraXOffset),
|
|
207
|
+
};
|
|
208
|
+
} catch {
|
|
209
|
+
return { ...DEFAULTS };
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function writeSettings(settings) {
|
|
214
|
+
try {
|
|
215
|
+
window.localStorage.setItem(STORE_KEY, JSON.stringify(settings));
|
|
216
|
+
} catch {}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function setStyle(id, css) {
|
|
220
|
+
let node = document.getElementById(id);
|
|
221
|
+
if (!node) {
|
|
222
|
+
node = document.createElement('style');
|
|
223
|
+
node.id = id;
|
|
224
|
+
(document.head || document.documentElement).appendChild(node);
|
|
225
|
+
}
|
|
226
|
+
node.textContent = css;
|
|
227
|
+
return node;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
inject: ['sessions', 'locale'],
|
|
232
|
+
apply(ctx) {
|
|
233
|
+
try {
|
|
234
|
+
if (window.localStorage.getItem(KILL_KEY) === '1') return;
|
|
235
|
+
if (new URLSearchParams(location.search).get('ocean') === 'off') return;
|
|
236
|
+
} catch {}
|
|
237
|
+
|
|
238
|
+
return ctx.effect(() => {
|
|
239
|
+
const state = { settings: readSettings(), sessionId: null, revealed: false, failed: false, disposed: false };
|
|
240
|
+
// Follow the host's own language service. Its `active` id is the
|
|
241
|
+
// authoritative value (e.g. zh-pirate, en, ja); document.lang is only
|
|
242
|
+
// a late mirror of it and can lag behind at mount time.
|
|
243
|
+
const activeLanguage = ctx.locale?.getSnapshot?.().active;
|
|
244
|
+
let text = messagesFor(activeLanguage || document.documentElement.lang || navigator.language);
|
|
245
|
+
let lastMileageData = null;
|
|
246
|
+
let frame = null;
|
|
247
|
+
let readyTimer = 0;
|
|
248
|
+
|
|
249
|
+
setStyle(UI_STYLE_ID, UI_CSS);
|
|
250
|
+
|
|
251
|
+
const mileageLabel = document.createElement('div');
|
|
252
|
+
mileageLabel.id = MILEAGE_ID;
|
|
253
|
+
mileageLabel.setAttribute('role', 'status');
|
|
254
|
+
mileageLabel.setAttribute('aria-live', 'polite');
|
|
255
|
+
mileageLabel.hidden = true;
|
|
256
|
+
let mileageTimer = 0;
|
|
257
|
+
let mileageGeneration = 0;
|
|
258
|
+
let mileageRequest = null;
|
|
259
|
+
|
|
260
|
+
const stopMileage = () => {
|
|
261
|
+
if (mileageTimer !== 0) window.clearTimeout(mileageTimer);
|
|
262
|
+
mileageTimer = 0;
|
|
263
|
+
mileageRequest?.abort();
|
|
264
|
+
mileageRequest = null;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const showMileage = () => {
|
|
268
|
+
mileageLabel.hidden = !(state.settings.enabled && state.revealed && mileageLabel.textContent !== '');
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
const applyMileage = (data) => {
|
|
272
|
+
if (!data || data.ok !== true) return;
|
|
273
|
+
const fleet = data.mode === 'fleet';
|
|
274
|
+
const meters = fleet ? data.fleetMeters : data.todayMeters;
|
|
275
|
+
if (typeof meters !== 'number' || !Number.isFinite(meters) || meters < 0) return;
|
|
276
|
+
lastMileageData = data;
|
|
277
|
+
const value = displayNauticalMiles(meters);
|
|
278
|
+
const next = `${fleet ? text.mileageFleet : text.mileageToday} ${value} ${text.mileageUnit}`;
|
|
279
|
+
if (next !== mileageLabel.textContent) mileageLabel.textContent = next;
|
|
280
|
+
showMileage();
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const fetchMileage = () => {
|
|
284
|
+
if (state.disposed || document.hidden || !state.settings.enabled || !state.revealed || mileageRequest) return;
|
|
285
|
+
if (typeof fetch !== 'function') return;
|
|
286
|
+
const generation = mileageGeneration;
|
|
287
|
+
const sessionId = state.sessionId;
|
|
288
|
+
const query = sessionId === null ? '' : `?sessionId=${encodeURIComponent(sessionId)}`;
|
|
289
|
+
const request = new AbortController();
|
|
290
|
+
mileageRequest = request;
|
|
291
|
+
try {
|
|
292
|
+
Promise.resolve(fetch(`/ocean-background/mileage${query}`, { cache: 'no-store', signal: request.signal }))
|
|
293
|
+
.then((response) => (response && response.ok ? response.json() : null))
|
|
294
|
+
.then((data) => {
|
|
295
|
+
if (state.disposed || !state.settings.enabled || mileageRequest !== request) return;
|
|
296
|
+
if (generation !== mileageGeneration || sessionId !== state.sessionId) return;
|
|
297
|
+
applyMileage(data);
|
|
298
|
+
})
|
|
299
|
+
.catch(() => {})
|
|
300
|
+
.finally(() => {
|
|
301
|
+
if (mileageRequest === request) mileageRequest = null;
|
|
302
|
+
});
|
|
303
|
+
} catch {
|
|
304
|
+
if (mileageRequest === request) mileageRequest = null;
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const scheduleMileage = () => {
|
|
309
|
+
if (state.disposed || document.hidden || !state.settings.enabled || !state.revealed || mileageTimer !== 0) return;
|
|
310
|
+
mileageTimer = window.setTimeout(() => {
|
|
311
|
+
mileageTimer = 0;
|
|
312
|
+
fetchMileage();
|
|
313
|
+
scheduleMileage();
|
|
314
|
+
}, MILEAGE_POLL_MS);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
const post = () => {
|
|
318
|
+
frame?.contentWindow?.postMessage({
|
|
319
|
+
type: 'ocean-settings',
|
|
320
|
+
settings: { ...state.settings, sessionId: state.sessionId, visible: !document.hidden },
|
|
321
|
+
}, location.origin);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
const clearDeadline = () => {
|
|
325
|
+
window.clearTimeout(readyTimer);
|
|
326
|
+
readyTimer = 0;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
const unmountFrame = () => {
|
|
330
|
+
clearDeadline();
|
|
331
|
+
stopMileage();
|
|
332
|
+
frame?.remove();
|
|
333
|
+
frame = null;
|
|
334
|
+
state.revealed = false;
|
|
335
|
+
mileageLabel.hidden = true;
|
|
336
|
+
document.getElementById(SHELL_STYLE_ID)?.remove();
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const armDeadline = () => {
|
|
340
|
+
if (!frame || state.revealed || document.hidden || readyTimer) return;
|
|
341
|
+
const pending = frame;
|
|
342
|
+
readyTimer = window.setTimeout(() => {
|
|
343
|
+
if (state.disposed || frame !== pending || state.revealed) return;
|
|
344
|
+
unmountFrame();
|
|
345
|
+
state.failed = true;
|
|
346
|
+
document.getElementById('ob-note').hidden = false;
|
|
347
|
+
console.warn('[ocean-background] renderer readiness timed out');
|
|
348
|
+
}, READY_TIMEOUT);
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
const mountFrame = () => {
|
|
352
|
+
if (frame || state.disposed || !state.settings.enabled || document.hidden) return;
|
|
353
|
+
state.failed = false;
|
|
354
|
+
document.getElementById('ob-note').hidden = true;
|
|
355
|
+
frame = document.createElement('iframe');
|
|
356
|
+
frame.id = FRAME_ID;
|
|
357
|
+
frame.setAttribute('aria-hidden', 'true');
|
|
358
|
+
frame.setAttribute('tabindex', '-1');
|
|
359
|
+
frame.title = 'Ocean background';
|
|
360
|
+
frame.style.cssText = 'position:fixed;inset:0;width:100%;height:100%;border:0;z-index:0;pointer-events:none;background:transparent;';
|
|
361
|
+
frame.addEventListener('load', post);
|
|
362
|
+
frame.src = `/ocean-background/?quality=${encodeURIComponent(state.settings.quality)}`;
|
|
363
|
+
const host = document.body || document.documentElement;
|
|
364
|
+
host.insertBefore(frame, host.firstChild);
|
|
365
|
+
armDeadline();
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const onMessage = (event) => {
|
|
369
|
+
if (state.disposed || !frame || event.origin !== location.origin || event.source !== frame.contentWindow) return;
|
|
370
|
+
if (event.data?.type !== 'ocean-ready' || state.revealed) return;
|
|
371
|
+
state.revealed = true;
|
|
372
|
+
clearDeadline();
|
|
373
|
+
if (state.settings.enabled) setStyle(SHELL_STYLE_ID, shellCss(state.settings.strength));
|
|
374
|
+
showMileage();
|
|
375
|
+
fetchMileage();
|
|
376
|
+
scheduleMileage();
|
|
377
|
+
};
|
|
378
|
+
window.addEventListener('message', onMessage);
|
|
379
|
+
|
|
380
|
+
const onVisibility = () => {
|
|
381
|
+
if (document.hidden) {
|
|
382
|
+
clearDeadline();
|
|
383
|
+
stopMileage();
|
|
384
|
+
} else {
|
|
385
|
+
if (!state.failed) mountFrame();
|
|
386
|
+
armDeadline();
|
|
387
|
+
fetchMileage();
|
|
388
|
+
scheduleMileage();
|
|
389
|
+
}
|
|
390
|
+
post();
|
|
391
|
+
};
|
|
392
|
+
document.addEventListener('visibilitychange', onVisibility);
|
|
393
|
+
|
|
394
|
+
// ---- controls ---------------------------------------------------------
|
|
395
|
+
// Plain DOM with an always-present stylesheet, like the reference plugin.
|
|
396
|
+
// Living in a slot shared the shell stylesheet, so switching the sea off
|
|
397
|
+
// also stripped the button's styling and lost it.
|
|
398
|
+
const button = document.createElement('button');
|
|
399
|
+
button.id = BUTTON_ID;
|
|
400
|
+
button.type = 'button';
|
|
401
|
+
button.title = text.open;
|
|
402
|
+
button.setAttribute('aria-label', text.open);
|
|
403
|
+
button.setAttribute('aria-controls', PANEL_ID);
|
|
404
|
+
button.innerHTML = '<svg viewBox="0 0 24 24" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true">'
|
|
405
|
+
+ '<path d="M2 15c2.5 0 2.5-2 5-2s2.5 2 5 2 2.5-2 5-2 2.5 2 5 2"/>'
|
|
406
|
+
+ '<path d="M2 19c2.5 0 2.5-2 5-2s2.5 2 5 2 2.5-2 5-2 2.5 2 5 2"/>'
|
|
407
|
+
+ '<path d="M12 4v5"/><path d="M9.5 6.5 12 4l2.5 2.5"/></svg>';
|
|
408
|
+
|
|
409
|
+
const panel = document.createElement('div');
|
|
410
|
+
panel.id = PANEL_ID;
|
|
411
|
+
panel.setAttribute('role', 'dialog');
|
|
412
|
+
panel.setAttribute('aria-label', text.open);
|
|
413
|
+
panel.hidden = true;
|
|
414
|
+
panel.innerHTML = ''
|
|
415
|
+
+ `<p class="ob-title" id="ob-title">${text.open}</p>`
|
|
416
|
+
+ `<div class="ob-row"><label for="ob-enabled" id="ob-show-label">${text.show}</label><input id="ob-enabled" type="checkbox"></div>`
|
|
417
|
+
+ `<div><div class="ob-row"><label for="ob-strength" id="ob-strength-label">${text.strength}</label><output id="ob-strength-out"></output></div>`
|
|
418
|
+
+ `<input id="ob-strength" type="range" min="35" max="95" step="1"></div>`
|
|
419
|
+
+ `<div class="ob-row"><label for="ob-running" id="ob-running-label">${text.running}</label><input id="ob-running" type="checkbox"></div>`
|
|
420
|
+
+ `<div class="ob-row"><label for="ob-quality" id="ob-quality-label">${text.quality}</label><select id="ob-quality">`
|
|
421
|
+
+ `<option value="balanced" id="ob-balanced-option">${text.balanced}</option><option value="high" id="ob-high-option">${text.high}</option></select></div>`
|
|
422
|
+
+ Object.entries(CAMERA_LIMITS).map(([key, limits]) =>
|
|
423
|
+
`<div><div class="ob-row"><label for="ob-${key}" id="ob-${key}-label">${text[key]}</label><output id="ob-${key}-out" for="ob-${key}"></output></div>`
|
|
424
|
+
+ `<input id="ob-${key}" type="range" min="${limits.min}" max="${limits.max}" step="${limits.step}"></div>`
|
|
425
|
+
).join('')
|
|
426
|
+
+ `<p class="ob-note" id="ob-camera-hint">${text.cameraHint}</p>`
|
|
427
|
+
+ `<p class="ob-note" id="ob-note" hidden>${text.recovering}</p>`;
|
|
428
|
+
|
|
429
|
+
const enabledInput = panel.querySelector('#ob-enabled');
|
|
430
|
+
const strengthInput = panel.querySelector('#ob-strength');
|
|
431
|
+
const strengthOut = panel.querySelector('#ob-strength-out');
|
|
432
|
+
const runningInput = panel.querySelector('#ob-running');
|
|
433
|
+
const qualitySelect = panel.querySelector('#ob-quality');
|
|
434
|
+
|
|
435
|
+
const syncControls = () => {
|
|
436
|
+
enabledInput.checked = state.settings.enabled;
|
|
437
|
+
strengthInput.value = String(Math.round(state.settings.strength * 100));
|
|
438
|
+
strengthOut.textContent = Math.round(state.settings.strength * 100) + '%';
|
|
439
|
+
runningInput.checked = state.settings.running;
|
|
440
|
+
qualitySelect.value = state.settings.quality;
|
|
441
|
+
for (const key of Object.keys(CAMERA_LIMITS)) {
|
|
442
|
+
panel.querySelector(`#ob-${key}`).value = String(state.settings[key]);
|
|
443
|
+
panel.querySelector(`#ob-${key}-out`).textContent = state.settings[key].toFixed(CAMERA_LIMITS[key].step === 1 ? 0 : 1)
|
|
444
|
+
+ (key === 'cameraPitch' ? '°' : '');
|
|
445
|
+
}
|
|
446
|
+
button.dataset.on = String(state.settings.enabled);
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
const setText = (id, value) => {
|
|
450
|
+
const node = panel.querySelector(`#${id}`);
|
|
451
|
+
if (node) node.textContent = value;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
const refreshLanguage = () => {
|
|
455
|
+
const active = ctx.locale?.getSnapshot?.().active;
|
|
456
|
+
text = messagesFor(active || document.documentElement.lang || navigator.language);
|
|
457
|
+
button.title = text.open;
|
|
458
|
+
button.setAttribute('aria-label', text.open);
|
|
459
|
+
panel.setAttribute('aria-label', text.open);
|
|
460
|
+
setText('ob-title', text.open);
|
|
461
|
+
setText('ob-show-label', text.show);
|
|
462
|
+
setText('ob-strength-label', text.strength);
|
|
463
|
+
setText('ob-running-label', text.running);
|
|
464
|
+
setText('ob-quality-label', text.quality);
|
|
465
|
+
setText('ob-balanced-option', text.balanced);
|
|
466
|
+
setText('ob-high-option', text.high);
|
|
467
|
+
for (const key of Object.keys(CAMERA_LIMITS)) setText(`ob-${key}-label`, text[key]);
|
|
468
|
+
setText('ob-camera-hint', text.cameraHint);
|
|
469
|
+
setText('ob-note', text.recovering);
|
|
470
|
+
if (lastMileageData) applyMileage(lastMileageData);
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
const stopLocale = typeof ctx.locale?.subscribe === 'function'
|
|
474
|
+
? ctx.locale.subscribe(refreshLanguage)
|
|
475
|
+
: null;
|
|
476
|
+
|
|
477
|
+
const applySettings = (patch) => {
|
|
478
|
+
const qualityChanged = patch.quality !== undefined && patch.quality !== state.settings.quality;
|
|
479
|
+
state.settings = { ...state.settings, ...patch };
|
|
480
|
+
writeSettings(state.settings);
|
|
481
|
+
syncControls();
|
|
482
|
+
if (!state.settings.enabled || qualityChanged) unmountFrame();
|
|
483
|
+
if (!state.settings.enabled) {
|
|
484
|
+
document.getElementById('ob-note').hidden = true;
|
|
485
|
+
stopMileage();
|
|
486
|
+
mileageLabel.hidden = true;
|
|
487
|
+
} else {
|
|
488
|
+
showMileage();
|
|
489
|
+
fetchMileage();
|
|
490
|
+
scheduleMileage();
|
|
491
|
+
}
|
|
492
|
+
mountFrame();
|
|
493
|
+
if (state.revealed) setStyle(SHELL_STYLE_ID, shellCss(state.settings.strength));
|
|
494
|
+
post();
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
enabledInput.addEventListener('change', () => applySettings({ enabled: enabledInput.checked }));
|
|
498
|
+
strengthInput.addEventListener('input', () => applySettings({ strength: Number(strengthInput.value) / 100 }));
|
|
499
|
+
runningInput.addEventListener('change', () => applySettings({ running: runningInput.checked }));
|
|
500
|
+
qualitySelect.addEventListener('change', () => applySettings({ quality: qualitySelect.value }));
|
|
501
|
+
for (const key of Object.keys(CAMERA_LIMITS)) {
|
|
502
|
+
const input = panel.querySelector(`#ob-${key}`);
|
|
503
|
+
input.addEventListener('input', () => applySettings({ [key]: cameraValue(key, Number(input.value)) }));
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
button.addEventListener('click', () => {
|
|
507
|
+
panel.hidden = !panel.hidden;
|
|
508
|
+
button.setAttribute('aria-expanded', String(!panel.hidden));
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
button.setAttribute('aria-expanded', 'false');
|
|
512
|
+
const onKeyDown = (event) => {
|
|
513
|
+
if (event.key !== 'Escape' || panel.hidden) return;
|
|
514
|
+
panel.hidden = true;
|
|
515
|
+
button.setAttribute('aria-expanded', 'false');
|
|
516
|
+
button.focus();
|
|
517
|
+
};
|
|
518
|
+
document.addEventListener('keydown', onKeyDown);
|
|
519
|
+
// One dock owns both controls. A stale node from an interrupted mount
|
|
520
|
+
// would otherwise sit on top of the new pair at the same coordinates.
|
|
521
|
+
for (const id of [DOCK_ID, BUTTON_ID, PANEL_ID, MILEAGE_ID]) {
|
|
522
|
+
document.getElementById(id)?.remove();
|
|
523
|
+
}
|
|
524
|
+
const dock = document.createElement('div');
|
|
525
|
+
dock.id = DOCK_ID;
|
|
526
|
+
dock.appendChild(mileageLabel);
|
|
527
|
+
dock.appendChild(button);
|
|
528
|
+
document.body.appendChild(dock);
|
|
529
|
+
document.body.appendChild(panel);
|
|
530
|
+
syncControls();
|
|
531
|
+
|
|
532
|
+
const sessions = ctx.sessions.list;
|
|
533
|
+
let selectionQueued = false;
|
|
534
|
+
const syncSelection = () => {
|
|
535
|
+
if (state.disposed) return;
|
|
536
|
+
// mainView is the Session Controller's explicit reference source.
|
|
537
|
+
const selected = Object.values(sessions.getSnapshot().byId)
|
|
538
|
+
.filter((session) => session.retainedBy?.mainView > 0);
|
|
539
|
+
const sessionId = selected.length === 1 ? selected[0].id : null;
|
|
540
|
+
if (sessionId === state.sessionId) return;
|
|
541
|
+
stopMileage();
|
|
542
|
+
state.sessionId = sessionId;
|
|
543
|
+
mileageGeneration += 1;
|
|
544
|
+
lastMileageData = null;
|
|
545
|
+
mileageLabel.textContent = '';
|
|
546
|
+
showMileage();
|
|
547
|
+
post();
|
|
548
|
+
fetchMileage();
|
|
549
|
+
scheduleMileage();
|
|
550
|
+
};
|
|
551
|
+
const stopSelection = sessions.subscribe(() => {
|
|
552
|
+
if (selectionQueued) return;
|
|
553
|
+
selectionQueued = true;
|
|
554
|
+
queueMicrotask(() => {
|
|
555
|
+
selectionQueued = false;
|
|
556
|
+
syncSelection();
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
syncSelection();
|
|
560
|
+
mountFrame();
|
|
561
|
+
|
|
562
|
+
return () => {
|
|
563
|
+
state.disposed = true;
|
|
564
|
+
stopSelection();
|
|
565
|
+
stopMileage();
|
|
566
|
+
stopLocale?.();
|
|
567
|
+
window.removeEventListener('message', onMessage);
|
|
568
|
+
document.removeEventListener('visibilitychange', onVisibility);
|
|
569
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
570
|
+
unmountFrame();
|
|
571
|
+
button.remove();
|
|
572
|
+
panel.remove();
|
|
573
|
+
mileageLabel.remove();
|
|
574
|
+
dock.remove();
|
|
575
|
+
document.getElementById(UI_STYLE_ID)?.remove();
|
|
576
|
+
};
|
|
577
|
+
}, 'ocean-background: mount');
|
|
578
|
+
},
|
|
579
|
+
};
|
|
580
|
+
},
|
|
581
|
+
});
|
|
582
|
+
|
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# 海洋背景
|
|
2
|
+
|
|
3
|
+
在整个 Harness 窗口后方铺一层日间海面。画面里的船不是为了装饰而存在,它们对应正在运行的工作。
|
|
4
|
+
|
|
5
|
+
## 画面
|
|
6
|
+
|
|
7
|
+
海盗大船代表当前主会话的主 Agent,在世界坐标持续向右航行,镜头水平跟随。海面和岛屿留在世界坐标。每个子 Agent 各对应一艘小艇,包含更深层子 Agent:工作开始时从左侧驶入并伴航,明确结束、失败或取消后向右驶出。等待输入时小艇留在队里。
|
|
8
|
+
|
|
9
|
+
帆表示工作状态。主 Agent 的回合正在进行时满帆,待命或等待输入时收起一部分帆;帆态不靠 token 静默时长判断。大船始终保持航行。
|
|
10
|
+
|
|
11
|
+
海浪只由 token 吞吐驱动。统计缓存输入、未缓存输入、缓存写入与输出四项 token 增量,每秒采样,指数平滑后按饱和曲线映射浪高。费用不参与驱动。主浪采用 196、132、86 个场景单位的三组波长,降低包络变化频率和高频法线细纹强度;船只浮动与海面使用同一份波浪参数。
|
|
12
|
+
|
|
13
|
+
普通浪顶保留蓝绿色,去掉按高度叠加的固定阳光色,并减弱浅色染色和天空反射。白沫强度在平滑吞吐超过 100 token/秒后逐步开启,400 token/秒时达到最大;还需经过浪面高度、坡度和两层碎片遮罩筛选。白沫最高混色比例为 34%,颜色保留少量海水底色,避免整片浪头泛白。船尾和水线接触泡沫独立保留。实际观感已通过实景验收。
|
|
14
|
+
|
|
15
|
+
海风同时最多两条,近、远各一条,每条风线本身从屏幕左边延伸到右边,端点位于画面之外。全线保持一道宽缓弧线,屏幕可见部分相对两端连线的弧高约为屏幕高度的 1%~3%,没有连续波形或多次转弯。每阵风持续 4.2~6.2 秒,右端先响应,左端延后 0.9~1.6 秒,中段使用独立的鼓起与回落过程;各端位移为所属高度范围的 60%~85%,避免整条线同步上下平移。先用 0.7 秒淡入,结束前用 1 秒淡出,再间隔 0.6~1.8 秒换位出现。远层首次出现比近层晚 1.2~2.4 秒,之后各自使用独立随机节奏。横向位置固定,近层总宽 6~8 个屏幕像素,远层 4~6 个屏幕像素,包含柔化边缘。天空前用偏深色,海面前用偏浅色,近层从船前掠过,远层保留场景遮挡。本轮改动已通过实景验收。
|
|
16
|
+
|
|
17
|
+
沿途景观有低平沙洲、带植被的绿岛和露出岩壁的岩岸岛,首次入画和回收时随机选择轮廓、大小与朝向。沙洲放在主船后面的远景层,深度坐标不大于 -120。礁石以低矮石群为主,偶尔出现细高海蚀石柱,可以从船前方经过。景物固定在世界坐标,随距离加雾,并避开船队航道和镜头净空区。远处偶尔有海鸟掠过。浅蓝色二维岛岸与山脊剪影已移除。
|
|
18
|
+
|
|
19
|
+
## 操作
|
|
20
|
+
|
|
21
|
+
右下角的按钮打开设置,可调整显示海面、背景强度、播放、画质、摄像机距离、摄像机高度、镜头左右偏移和摄像机俯仰角。里程读数与设置按钮放在同一个停靠容器里横向排列,两者不会再叠在一起。背景本身不接管鼠标,只有设置面板接受操作。
|
|
22
|
+
|
|
23
|
+
摄像机距离控制与主船的水平距离,范围 20 至 100,默认 44;摄像机高度控制距海面的高度,范围 2 至 40,默认 4.8。数值使用场景单位。距离和高度只改变摄像机位置。俯仰角单独控制上下转动,范围 -30° 至 60°,默认 2.7°;负值向上,正值向下,0° 为水平。左右朝向与侧倾保持固定。调整立即生效,暂停时也可调整,设置会自动保存。
|
|
24
|
+
|
|
25
|
+
画质分均衡与高画质两档,均衡档以稳定 30 帧为目标,高画质档以 60 帧为目标。
|
|
26
|
+
|
|
27
|
+
窗口隐藏或最小化时渲染暂停,Agent 的运行不受影响。
|
|
28
|
+
|
|
29
|
+
设置按钮旁有只读航行里程。空白新会话页显示本机今日总数,第一条用户消息被接受并记录后改为显示当前船队累计值;查看子 Agent 时沿用主船队。里程按大船实际前进距离记录,暂停和隐藏期间不增加,关闭背景时隐藏。记录保存在本机 DSH 数据目录,分叉从创建时的原船队快照接续;这些行为已通过实机验收。
|
|
30
|
+
|
|
31
|
+
## 限制
|
|
32
|
+
|
|
33
|
+
主船使用 Maksim Batyrev 的 Stylized Pirate Ship,按 CC BY 4.0 使用并改动了帆与材质。插件随包附带的资产与署名见 THIRD_PARTY_NOTICES.md。
|
|
34
|
+
|
|
35
|
+
小艇使用 Sk1ttle 的 Row Boat,按 CC BY 4.0 使用。划艇没有帆,工作状态由桨的轻微摆动表达,不套用大船的帆态规则。
|
|
36
|
+
|
|
37
|
+
帆面通过在加载时为每面帆烘焙一个收帆形态实现,没有使用骨骼或布料模拟。方形帆挂在横桁上,从正侧视角看到的是帆的边缘,画面里呈现为几条窄面。
|