@felfhenor/shell 0.0.0-stage → 0.2.7
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/fesm2022/felfhenor-shell.mjs +3071 -0
- package/fesm2022/felfhenor-shell.mjs.map +1 -0
- package/i18n/shell.en.json +111 -0
- package/package.json +33 -4
- package/types/felfhenor-shell.d.ts +312 -0
- package/README.md +0 -3
|
@@ -0,0 +1,3071 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, Injectable, InjectionToken, Pipe, TemplateRef, computed, contentChildren, effect, inject, input, linkedSignal, makeEnvironmentProviders, output, provideAppInitializer, signal, untracked } from "@angular/core";
|
|
3
|
+
import { backupsList, felClock, felExport, felExportWithLogs, felHost, felImport, felIsDesktop, felNewRun, felNotifyRequestPermission, felOnSound, felOpenFolder, felOptions, felProject, felRestore, felSetLocale, felSteamInputType, felSteamShowKeyboard, i18nLocale, loopCatchUpProgress, loopSkipCatchUp, optionsHadStoredCopy, saveBlockedBy, t } from "@felfhenor/core";
|
|
4
|
+
import { FFAlertComponent, FFBarProgressComponent, FFButtonCloseComponent, FFButtonComponent, FFCardPageComponent, FFInputService, FFModalComponent, FFTabDirective, FFTabsDirective, FFTriggerTabsDirective, FF_BUTTON_FEEDBACK, FF_CONTROLLER_FAMILY_RESOLVER, FF_REDUCED_MOTION, FF_TEXT_KEYBOARD, FF_TRANSLATE, ffBindDocumentTheme } from "@felfhenor/ui";
|
|
5
|
+
import { FF_I18N_DEFAULTS, ffFillPlaceholders, ffModalClose, ffModalIsOpen, ffReducedMotionSignal } from "@felfhenor/ui/core";
|
|
6
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
7
|
+
const FEL_SHELL_CONFIG = new InjectionToken("FEL_SHELL_CONFIG", {
|
|
8
|
+
providedIn: "root",
|
|
9
|
+
factory: () => ({})
|
|
10
|
+
});
|
|
11
|
+
const CROSSFADE_SECONDS = 2;
|
|
12
|
+
const UNLOCK_EVENTS = [
|
|
13
|
+
"click",
|
|
14
|
+
"keydown",
|
|
15
|
+
"pointerdown"
|
|
16
|
+
];
|
|
17
|
+
var FelAudioService = class FelAudioService {
|
|
18
|
+
config = inject(FEL_SHELL_CONFIG).audio ?? {};
|
|
19
|
+
destroyRef = inject(DestroyRef);
|
|
20
|
+
context = typeof AudioContext === "undefined" ? void 0 : new AudioContext();
|
|
21
|
+
master = this.context?.createGain();
|
|
22
|
+
buffers = /* @__PURE__ */ new Map();
|
|
23
|
+
focused = signal(typeof document === "undefined" || document.hasFocus(), ...ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []);
|
|
24
|
+
bgm;
|
|
25
|
+
bgmWanted;
|
|
26
|
+
masterVolume = computed(() => {
|
|
27
|
+
const options = felOptions();
|
|
28
|
+
return options.muteWhenUnfocused && !this.focused() ? 0 : options.masterVolume;
|
|
29
|
+
}, ...ngDevMode ? [{ debugName: "masterVolume" }] : /* istanbul ignore next */ []);
|
|
30
|
+
bgmVolume = computed(() => felOptions().bgmPlay ? felOptions().bgmVolume : 0, ...ngDevMode ? [{ debugName: "bgmVolume" }] : /* istanbul ignore next */ []);
|
|
31
|
+
buttonFeedback = {
|
|
32
|
+
click: (sound, offset) => void this.playSfx(sound || "ui-click", offset),
|
|
33
|
+
hover: (offset) => void this.playSfx("ui-hover", offset)
|
|
34
|
+
};
|
|
35
|
+
constructor() {
|
|
36
|
+
if (!this.context || !this.master) return;
|
|
37
|
+
this.master.connect(this.context.destination);
|
|
38
|
+
effect(() => this.master?.gain.setTargetAtTime(this.masterVolume(), this.context.currentTime, .03));
|
|
39
|
+
effect(() => {
|
|
40
|
+
const volume = this.bgmVolume();
|
|
41
|
+
this.bgm?.gain.gain.setTargetAtTime(volume * this.bgm.mix, this.context.currentTime, .1);
|
|
42
|
+
});
|
|
43
|
+
Object.entries(this.config.sfx ?? {}).forEach(([name, sound]) => void this.buffer(name, sound));
|
|
44
|
+
this.listen();
|
|
45
|
+
}
|
|
46
|
+
listen() {
|
|
47
|
+
const unlock = () => void this.context?.resume();
|
|
48
|
+
const onFocus = () => this.focused.set(true);
|
|
49
|
+
const onBlur = () => this.focused.set(false);
|
|
50
|
+
UNLOCK_EVENTS.forEach((e) => document.addEventListener(e, unlock, { capture: true }));
|
|
51
|
+
window.addEventListener("focus", onFocus);
|
|
52
|
+
window.addEventListener("blur", onBlur);
|
|
53
|
+
const stopSound = felOnSound((event) => this.onSound(event));
|
|
54
|
+
this.destroyRef.onDestroy(() => {
|
|
55
|
+
UNLOCK_EVENTS.forEach((e) => document.removeEventListener(e, unlock, { capture: true }));
|
|
56
|
+
window.removeEventListener("focus", onFocus);
|
|
57
|
+
window.removeEventListener("blur", onBlur);
|
|
58
|
+
stopSound();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
onSound(event) {
|
|
62
|
+
if (event.kind === "sfx") this.playSfx(event.name);
|
|
63
|
+
else this.playBgm(event.name);
|
|
64
|
+
}
|
|
65
|
+
buffer(name, sound) {
|
|
66
|
+
const context = this.context;
|
|
67
|
+
if (!sound || !context) return Promise.resolve(void 0);
|
|
68
|
+
const cached = this.buffers.get(name);
|
|
69
|
+
if (cached) return cached;
|
|
70
|
+
const loading = fetch(sound.src).then((r) => r.arrayBuffer()).then((data) => context.decodeAudioData(data)).catch((error) => {
|
|
71
|
+
console.error(`Could not load sound "${name}" from ${sound.src}.`, error);
|
|
72
|
+
});
|
|
73
|
+
this.buffers.set(name, loading);
|
|
74
|
+
return loading;
|
|
75
|
+
}
|
|
76
|
+
isAudible() {
|
|
77
|
+
return this.context?.state === "running" || !!navigator.userActivation?.isActive;
|
|
78
|
+
}
|
|
79
|
+
async playSfx(name, detune = 0) {
|
|
80
|
+
if (!felOptions().sfxPlay || !this.context || !this.master || !this.isAudible()) return;
|
|
81
|
+
const sound = this.config.sfx?.[name];
|
|
82
|
+
const buffer = await this.buffer(name, sound);
|
|
83
|
+
if (!buffer) return;
|
|
84
|
+
const source = this.context.createBufferSource();
|
|
85
|
+
source.buffer = buffer;
|
|
86
|
+
source.detune.value = detune;
|
|
87
|
+
const gain = this.context.createGain();
|
|
88
|
+
gain.gain.value = felOptions().sfxVolume * (sound?.volume ?? 1);
|
|
89
|
+
source.connect(gain).connect(this.master);
|
|
90
|
+
source.start();
|
|
91
|
+
}
|
|
92
|
+
fadeOut(track) {
|
|
93
|
+
const now = this.context.currentTime;
|
|
94
|
+
track.gain.gain.cancelScheduledValues(now);
|
|
95
|
+
track.gain.gain.setValueAtTime(track.gain.gain.value, now);
|
|
96
|
+
track.gain.gain.linearRampToValueAtTime(0, now + CROSSFADE_SECONDS);
|
|
97
|
+
setTimeout(() => track.source.stop(), CROSSFADE_SECONDS * 1e3);
|
|
98
|
+
}
|
|
99
|
+
async playBgm(name) {
|
|
100
|
+
if (!this.context || !this.master || name === this.bgmWanted) return;
|
|
101
|
+
this.bgmWanted = name;
|
|
102
|
+
if (this.bgm) this.fadeOut(this.bgm);
|
|
103
|
+
this.bgm = void 0;
|
|
104
|
+
const buffer = name ? await this.buffer(name, this.config.bgm?.[name]) : void 0;
|
|
105
|
+
if (!buffer || !name || name !== this.bgmWanted) return;
|
|
106
|
+
const mix = this.config.bgm?.[name]?.volume ?? 1;
|
|
107
|
+
const source = this.context.createBufferSource();
|
|
108
|
+
source.buffer = buffer;
|
|
109
|
+
source.loop = true;
|
|
110
|
+
const gain = this.context.createGain();
|
|
111
|
+
const now = this.context.currentTime;
|
|
112
|
+
gain.gain.setValueAtTime(0, now);
|
|
113
|
+
gain.gain.linearRampToValueAtTime(this.bgmVolume() * mix, now + CROSSFADE_SECONDS);
|
|
114
|
+
source.connect(gain).connect(this.master);
|
|
115
|
+
source.start();
|
|
116
|
+
this.bgm = {
|
|
117
|
+
name,
|
|
118
|
+
mix,
|
|
119
|
+
source,
|
|
120
|
+
gain
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
124
|
+
minVersion: "12.0.0",
|
|
125
|
+
version: "22.3.0",
|
|
126
|
+
ngImport: i0,
|
|
127
|
+
type: FelAudioService,
|
|
128
|
+
deps: [],
|
|
129
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
130
|
+
});
|
|
131
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
132
|
+
minVersion: "12.0.0",
|
|
133
|
+
version: "22.3.0",
|
|
134
|
+
ngImport: i0,
|
|
135
|
+
type: FelAudioService,
|
|
136
|
+
providedIn: "root"
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
140
|
+
minVersion: "12.0.0",
|
|
141
|
+
version: "22.3.0",
|
|
142
|
+
ngImport: i0,
|
|
143
|
+
type: FelAudioService,
|
|
144
|
+
decorators: [{
|
|
145
|
+
type: Injectable,
|
|
146
|
+
args: [{ providedIn: "root" }]
|
|
147
|
+
}],
|
|
148
|
+
ctorParameters: () => []
|
|
149
|
+
});
|
|
150
|
+
const FEL_STRINGS = {
|
|
151
|
+
"fel.menu.continue": "Continue",
|
|
152
|
+
"fel.menu.newGame": "New Game",
|
|
153
|
+
"fel.menu.settings": "Settings",
|
|
154
|
+
"fel.menu.changelog": "What's New",
|
|
155
|
+
"fel.menu.quit": "Quit",
|
|
156
|
+
"fel.confirm.yes": "Yes",
|
|
157
|
+
"fel.confirm.no": "Cancel",
|
|
158
|
+
"fel.confirm.newGame": "Start a new game? Your current run is backed up first.",
|
|
159
|
+
"fel.confirm.restore": "Restore this backup? Your current run is backed up first.",
|
|
160
|
+
"fel.confirm.skipCatchUp": "Skip the rest? About {{ time }} of offline progress will be lost.",
|
|
161
|
+
"fel.save.title": "Save File",
|
|
162
|
+
"fel.save.export": "Export",
|
|
163
|
+
"fel.save.exportDone": "Copied to the clipboard and downloaded.",
|
|
164
|
+
"fel.save.import": "Import",
|
|
165
|
+
"fel.save.importPlaceholder": "Paste a save here, or choose a file...",
|
|
166
|
+
"fel.save.importFile": "Import File",
|
|
167
|
+
"fel.save.importDone": "Imported.",
|
|
168
|
+
"fel.save.exportWithLogs": "Export with Logs",
|
|
169
|
+
"fel.save.exportWithLogsDone": "Saved to your Downloads folder.",
|
|
170
|
+
"fel.save.openFolder": "Open Save Folder",
|
|
171
|
+
"fel.save.newRun": "New Run",
|
|
172
|
+
"fel.save.newRunDone": "Started a new run.",
|
|
173
|
+
"fel.save.backups": "Backups",
|
|
174
|
+
"fel.save.noBackups": "No backups yet.",
|
|
175
|
+
"fel.save.restore": "Restore",
|
|
176
|
+
"fel.save.restored": "Restored.",
|
|
177
|
+
"fel.save.backupReason.load": "On load",
|
|
178
|
+
"fel.save.backupReason.load-alternate": "Older copy",
|
|
179
|
+
"fel.save.backupReason.periodic": "Periodic",
|
|
180
|
+
"fel.save.backupReason.import": "Before import",
|
|
181
|
+
"fel.save.backupReason.restore": "Before restore",
|
|
182
|
+
"fel.save.backupReason.new-run": "Before new run",
|
|
183
|
+
"fel.save.blocked.loading": "the game is still loading",
|
|
184
|
+
"fel.save.blocked.load-failed": "the stored save could not be loaded",
|
|
185
|
+
"fel.save.blocked.newer-save": "the save is from a newer version of the game",
|
|
186
|
+
"fel.save.blocked.catch-up": "offline progress is still catching up",
|
|
187
|
+
"fel.save.blocked.backup": "a backup is being made",
|
|
188
|
+
"fel.save.savingOff": "Saving is off because {{ reasons }}.",
|
|
189
|
+
"fel.alerts.loadFailed": "Your save could not be loaded, so nothing is being saved. It has not been changed; restore a backup or start a new game.",
|
|
190
|
+
"fel.alerts.newerSave": "Your save is from a newer version of the game, so nothing is being saved until you update.",
|
|
191
|
+
"fel.alerts.restoreBackup": "Restore a Backup",
|
|
192
|
+
"fel.settings.title": "Settings",
|
|
193
|
+
"fel.settings.audio": "Audio",
|
|
194
|
+
"fel.settings.display": "Display",
|
|
195
|
+
"fel.settings.controls": "Controls",
|
|
196
|
+
"fel.settings.game": "Game",
|
|
197
|
+
"fel.settings.debug": "Debug",
|
|
198
|
+
"fel.settings.on": "On",
|
|
199
|
+
"fel.settings.off": "Off",
|
|
200
|
+
"fel.audio.master": "Master Volume",
|
|
201
|
+
"fel.audio.sfx": "Sound Effects",
|
|
202
|
+
"fel.audio.bgm": "Music",
|
|
203
|
+
"fel.audio.muteWhenUnfocused": "Mute When Unfocused",
|
|
204
|
+
"fel.display.uiScale": "UI Scale",
|
|
205
|
+
"fel.display.cleanFont": "Clean Font",
|
|
206
|
+
"fel.display.motion": "Motion",
|
|
207
|
+
"fel.display.motion.system": "System",
|
|
208
|
+
"fel.display.motion.reduce": "Reduced",
|
|
209
|
+
"fel.display.motion.full": "Full",
|
|
210
|
+
"fel.display.fullscreen": "Fullscreen",
|
|
211
|
+
"fel.display.windowSize": "Window Size",
|
|
212
|
+
"fel.controls.family": "Controller Buttons",
|
|
213
|
+
"fel.controls.family.auto": "Automatic",
|
|
214
|
+
"fel.controls.family.xbox": "Xbox",
|
|
215
|
+
"fel.controls.family.playstation": "PlayStation",
|
|
216
|
+
"fel.controls.family.switch": "Switch",
|
|
217
|
+
"fel.controls.family.switch2": "Switch 2",
|
|
218
|
+
"fel.controls.family.steam-controller": "Steam Controller",
|
|
219
|
+
"fel.controls.family.steam-deck": "Steam Deck",
|
|
220
|
+
"fel.game.language": "Language",
|
|
221
|
+
"fel.game.runInBackground": "Run in Background",
|
|
222
|
+
"fel.game.notifications": "Desktop Notifications",
|
|
223
|
+
"fel.game.flash": "Flash Taskbar on Alerts",
|
|
224
|
+
"fel.game.autosave": "Autosave Every",
|
|
225
|
+
"fel.game.autosaveTicks": "{{ count }} ticks",
|
|
226
|
+
"fel.debug.tickRate": "Tick Speed",
|
|
227
|
+
"fel.debug.paused": "Paused",
|
|
228
|
+
"fel.debug.devtools": "Open DevTools",
|
|
229
|
+
"fel.bar.pause": "Pause",
|
|
230
|
+
"fel.bar.resume": "Resume",
|
|
231
|
+
"fel.bar.savingOff": "Not Saving",
|
|
232
|
+
"fel.overlay.catchUp": "Catching up on {{ time }} away...",
|
|
233
|
+
"fel.overlay.skip": "Skip",
|
|
234
|
+
"fel.overlay.paused": "The game is paused.",
|
|
235
|
+
"fel.changelog.title": "What's New",
|
|
236
|
+
"fel.changelog.empty": "No changes listed."
|
|
237
|
+
};
|
|
238
|
+
function felText(key, params) {
|
|
239
|
+
const text = t(key, params);
|
|
240
|
+
if (text !== key) return text;
|
|
241
|
+
if (key in FEL_STRINGS) return ffFillPlaceholders(FEL_STRINGS[key], params);
|
|
242
|
+
const uiDefault = FF_I18N_DEFAULTS[key];
|
|
243
|
+
return uiDefault === void 0 ? key : ffFillPlaceholders(uiDefault, params);
|
|
244
|
+
}
|
|
245
|
+
var FelTextPipe = class FelTextPipe {
|
|
246
|
+
transform(key, params) {
|
|
247
|
+
return felText(key, params);
|
|
248
|
+
}
|
|
249
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
250
|
+
minVersion: "12.0.0",
|
|
251
|
+
version: "22.3.0",
|
|
252
|
+
ngImport: i0,
|
|
253
|
+
type: FelTextPipe,
|
|
254
|
+
deps: [],
|
|
255
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
256
|
+
});
|
|
257
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
258
|
+
minVersion: "14.0.0",
|
|
259
|
+
version: "22.3.0",
|
|
260
|
+
ngImport: i0,
|
|
261
|
+
type: FelTextPipe,
|
|
262
|
+
isStandalone: true,
|
|
263
|
+
name: "felT",
|
|
264
|
+
pure: false
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
268
|
+
minVersion: "12.0.0",
|
|
269
|
+
version: "22.3.0",
|
|
270
|
+
ngImport: i0,
|
|
271
|
+
type: FelTextPipe,
|
|
272
|
+
decorators: [{
|
|
273
|
+
type: Pipe,
|
|
274
|
+
args: [{
|
|
275
|
+
name: "felT",
|
|
276
|
+
pure: false
|
|
277
|
+
}]
|
|
278
|
+
}]
|
|
279
|
+
});
|
|
280
|
+
const QUIET_REASONS = ["backup", "loading"];
|
|
281
|
+
function felSaveBlockText(reasons) {
|
|
282
|
+
const shown = reasons.filter((r) => !QUIET_REASONS.includes(r));
|
|
283
|
+
if (shown.length === 0) return void 0;
|
|
284
|
+
return felText("fel.save.savingOff", { reasons: shown.map((r) => felText(`fel.save.blocked.${r}`)).join(", ") });
|
|
285
|
+
}
|
|
286
|
+
var FelGameBarComponent = class FelGameBarComponent {
|
|
287
|
+
settings = output();
|
|
288
|
+
paused = computed(() => felOptions().gameloopPaused, ...ngDevMode ? [{ debugName: "paused" }] : /* istanbul ignore next */ []);
|
|
289
|
+
savingOff = computed(() => felSaveBlockText(saveBlockedBy()), ...ngDevMode ? [{ debugName: "savingOff" }] : /* istanbul ignore next */ []);
|
|
290
|
+
togglePause() {
|
|
291
|
+
felOptions.update((o) => {
|
|
292
|
+
o.gameloopPaused = !o.gameloopPaused;
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
296
|
+
minVersion: "12.0.0",
|
|
297
|
+
version: "22.3.0",
|
|
298
|
+
ngImport: i0,
|
|
299
|
+
type: FelGameBarComponent,
|
|
300
|
+
deps: [],
|
|
301
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
302
|
+
});
|
|
303
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
304
|
+
minVersion: "17.0.0",
|
|
305
|
+
version: "22.3.0",
|
|
306
|
+
type: FelGameBarComponent,
|
|
307
|
+
isStandalone: true,
|
|
308
|
+
selector: "fel-game-bar",
|
|
309
|
+
outputs: { settings: "settings" },
|
|
310
|
+
ngImport: i0,
|
|
311
|
+
template: `
|
|
312
|
+
<header class="flex items-center gap-2 p-2">
|
|
313
|
+
<button
|
|
314
|
+
ffButton="ui-click"
|
|
315
|
+
class="btn btn-sm"
|
|
316
|
+
data-bar="pause"
|
|
317
|
+
(click)="togglePause()"
|
|
318
|
+
>
|
|
319
|
+
{{ (paused() ? 'fel.bar.resume' : 'fel.bar.pause') | felT }}
|
|
320
|
+
</button>
|
|
321
|
+
<div class="flex-1"><ng-content /></div>
|
|
322
|
+
@if (savingOff(); as reasons) {
|
|
323
|
+
<span
|
|
324
|
+
class="badge badge-warning"
|
|
325
|
+
data-bar="saving-off"
|
|
326
|
+
[title]="reasons"
|
|
327
|
+
>
|
|
328
|
+
{{ 'fel.bar.savingOff' | felT }}
|
|
329
|
+
</span>
|
|
330
|
+
}
|
|
331
|
+
<button
|
|
332
|
+
ffButton="ui-click"
|
|
333
|
+
class="btn btn-sm"
|
|
334
|
+
data-bar="settings"
|
|
335
|
+
(click)="settings.emit()"
|
|
336
|
+
>
|
|
337
|
+
{{ 'fel.menu.settings' | felT }}
|
|
338
|
+
</button>
|
|
339
|
+
</header>
|
|
340
|
+
`,
|
|
341
|
+
isInline: true,
|
|
342
|
+
dependencies: [{
|
|
343
|
+
kind: "component",
|
|
344
|
+
type: FFButtonComponent,
|
|
345
|
+
selector: "button[ffButton]",
|
|
346
|
+
inputs: [
|
|
347
|
+
"ffButton",
|
|
348
|
+
"ffSoundOffset",
|
|
349
|
+
"ffHotkey",
|
|
350
|
+
"ffHotkeyPreventDefault",
|
|
351
|
+
"ffPadAction",
|
|
352
|
+
"ffPadPriority",
|
|
353
|
+
"ffPadLabel",
|
|
354
|
+
"ffPadEnabled",
|
|
355
|
+
"ffPadWithin",
|
|
356
|
+
"ffTooltip",
|
|
357
|
+
"ffTooltipDisabled",
|
|
358
|
+
"ffTooltipPlacement"
|
|
359
|
+
]
|
|
360
|
+
}, {
|
|
361
|
+
kind: "pipe",
|
|
362
|
+
type: FelTextPipe,
|
|
363
|
+
name: "felT"
|
|
364
|
+
}],
|
|
365
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
369
|
+
minVersion: "12.0.0",
|
|
370
|
+
version: "22.3.0",
|
|
371
|
+
ngImport: i0,
|
|
372
|
+
type: FelGameBarComponent,
|
|
373
|
+
decorators: [{
|
|
374
|
+
type: Component,
|
|
375
|
+
args: [{
|
|
376
|
+
selector: "fel-game-bar",
|
|
377
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
378
|
+
imports: [FFButtonComponent, FelTextPipe],
|
|
379
|
+
template: `
|
|
380
|
+
<header class="flex items-center gap-2 p-2">
|
|
381
|
+
<button
|
|
382
|
+
ffButton="ui-click"
|
|
383
|
+
class="btn btn-sm"
|
|
384
|
+
data-bar="pause"
|
|
385
|
+
(click)="togglePause()"
|
|
386
|
+
>
|
|
387
|
+
{{ (paused() ? 'fel.bar.resume' : 'fel.bar.pause') | felT }}
|
|
388
|
+
</button>
|
|
389
|
+
<div class="flex-1"><ng-content /></div>
|
|
390
|
+
@if (savingOff(); as reasons) {
|
|
391
|
+
<span
|
|
392
|
+
class="badge badge-warning"
|
|
393
|
+
data-bar="saving-off"
|
|
394
|
+
[title]="reasons"
|
|
395
|
+
>
|
|
396
|
+
{{ 'fel.bar.savingOff' | felT }}
|
|
397
|
+
</span>
|
|
398
|
+
}
|
|
399
|
+
<button
|
|
400
|
+
ffButton="ui-click"
|
|
401
|
+
class="btn btn-sm"
|
|
402
|
+
data-bar="settings"
|
|
403
|
+
(click)="settings.emit()"
|
|
404
|
+
>
|
|
405
|
+
{{ 'fel.menu.settings' | felT }}
|
|
406
|
+
</button>
|
|
407
|
+
</header>
|
|
408
|
+
`
|
|
409
|
+
}]
|
|
410
|
+
}],
|
|
411
|
+
propDecorators: { settings: [{
|
|
412
|
+
type: i0.Output,
|
|
413
|
+
args: ["settings"]
|
|
414
|
+
}] }
|
|
415
|
+
});
|
|
416
|
+
var FelMainMenuComponent = class FelMainMenuComponent {
|
|
417
|
+
continue = output();
|
|
418
|
+
newGame = output();
|
|
419
|
+
settings = output();
|
|
420
|
+
changelog = output();
|
|
421
|
+
quit = output();
|
|
422
|
+
isDesktop = felIsDesktop();
|
|
423
|
+
hasRun = computed(() => felClock().ticks > 0, ...ngDevMode ? [{ debugName: "hasRun" }] : /* istanbul ignore next */ []);
|
|
424
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
425
|
+
minVersion: "12.0.0",
|
|
426
|
+
version: "22.3.0",
|
|
427
|
+
ngImport: i0,
|
|
428
|
+
type: FelMainMenuComponent,
|
|
429
|
+
deps: [],
|
|
430
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
431
|
+
});
|
|
432
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
433
|
+
minVersion: "17.0.0",
|
|
434
|
+
version: "22.3.0",
|
|
435
|
+
type: FelMainMenuComponent,
|
|
436
|
+
isStandalone: true,
|
|
437
|
+
selector: "fel-main-menu",
|
|
438
|
+
outputs: {
|
|
439
|
+
continue: "continue",
|
|
440
|
+
newGame: "newGame",
|
|
441
|
+
settings: "settings",
|
|
442
|
+
changelog: "changelog",
|
|
443
|
+
quit: "quit"
|
|
444
|
+
},
|
|
445
|
+
ngImport: i0,
|
|
446
|
+
template: `
|
|
447
|
+
<nav class="flex w-72 flex-col gap-2">
|
|
448
|
+
@if (hasRun()) {
|
|
449
|
+
<button
|
|
450
|
+
ffButton="ui-success"
|
|
451
|
+
class="btn btn-primary"
|
|
452
|
+
data-menu="continue"
|
|
453
|
+
(click)="continue.emit()"
|
|
454
|
+
>
|
|
455
|
+
{{ 'fel.menu.continue' | felT }}
|
|
456
|
+
</button>
|
|
457
|
+
}
|
|
458
|
+
<button
|
|
459
|
+
ffButton="ui-click"
|
|
460
|
+
class="btn"
|
|
461
|
+
[class.btn-primary]="!hasRun()"
|
|
462
|
+
data-menu="newGame"
|
|
463
|
+
(click)="newGame.emit()"
|
|
464
|
+
>
|
|
465
|
+
{{ 'fel.menu.newGame' | felT }}
|
|
466
|
+
</button>
|
|
467
|
+
<ng-content />
|
|
468
|
+
<button
|
|
469
|
+
ffButton="ui-click"
|
|
470
|
+
class="btn"
|
|
471
|
+
data-menu="settings"
|
|
472
|
+
(click)="settings.emit()"
|
|
473
|
+
>
|
|
474
|
+
{{ 'fel.menu.settings' | felT }}
|
|
475
|
+
</button>
|
|
476
|
+
<button
|
|
477
|
+
ffButton="ui-click"
|
|
478
|
+
class="btn"
|
|
479
|
+
data-menu="changelog"
|
|
480
|
+
(click)="changelog.emit()"
|
|
481
|
+
>
|
|
482
|
+
{{ 'fel.menu.changelog' | felT }}
|
|
483
|
+
</button>
|
|
484
|
+
@if (isDesktop) {
|
|
485
|
+
<button
|
|
486
|
+
ffButton="ui-error"
|
|
487
|
+
class="btn"
|
|
488
|
+
data-menu="quit"
|
|
489
|
+
(click)="quit.emit()"
|
|
490
|
+
>
|
|
491
|
+
{{ 'fel.menu.quit' | felT }}
|
|
492
|
+
</button>
|
|
493
|
+
}
|
|
494
|
+
</nav>
|
|
495
|
+
`,
|
|
496
|
+
isInline: true,
|
|
497
|
+
dependencies: [{
|
|
498
|
+
kind: "component",
|
|
499
|
+
type: FFButtonComponent,
|
|
500
|
+
selector: "button[ffButton]",
|
|
501
|
+
inputs: [
|
|
502
|
+
"ffButton",
|
|
503
|
+
"ffSoundOffset",
|
|
504
|
+
"ffHotkey",
|
|
505
|
+
"ffHotkeyPreventDefault",
|
|
506
|
+
"ffPadAction",
|
|
507
|
+
"ffPadPriority",
|
|
508
|
+
"ffPadLabel",
|
|
509
|
+
"ffPadEnabled",
|
|
510
|
+
"ffPadWithin",
|
|
511
|
+
"ffTooltip",
|
|
512
|
+
"ffTooltipDisabled",
|
|
513
|
+
"ffTooltipPlacement"
|
|
514
|
+
]
|
|
515
|
+
}, {
|
|
516
|
+
kind: "pipe",
|
|
517
|
+
type: FelTextPipe,
|
|
518
|
+
name: "felT"
|
|
519
|
+
}],
|
|
520
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
524
|
+
minVersion: "12.0.0",
|
|
525
|
+
version: "22.3.0",
|
|
526
|
+
ngImport: i0,
|
|
527
|
+
type: FelMainMenuComponent,
|
|
528
|
+
decorators: [{
|
|
529
|
+
type: Component,
|
|
530
|
+
args: [{
|
|
531
|
+
selector: "fel-main-menu",
|
|
532
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
533
|
+
imports: [FFButtonComponent, FelTextPipe],
|
|
534
|
+
template: `
|
|
535
|
+
<nav class="flex w-72 flex-col gap-2">
|
|
536
|
+
@if (hasRun()) {
|
|
537
|
+
<button
|
|
538
|
+
ffButton="ui-success"
|
|
539
|
+
class="btn btn-primary"
|
|
540
|
+
data-menu="continue"
|
|
541
|
+
(click)="continue.emit()"
|
|
542
|
+
>
|
|
543
|
+
{{ 'fel.menu.continue' | felT }}
|
|
544
|
+
</button>
|
|
545
|
+
}
|
|
546
|
+
<button
|
|
547
|
+
ffButton="ui-click"
|
|
548
|
+
class="btn"
|
|
549
|
+
[class.btn-primary]="!hasRun()"
|
|
550
|
+
data-menu="newGame"
|
|
551
|
+
(click)="newGame.emit()"
|
|
552
|
+
>
|
|
553
|
+
{{ 'fel.menu.newGame' | felT }}
|
|
554
|
+
</button>
|
|
555
|
+
<ng-content />
|
|
556
|
+
<button
|
|
557
|
+
ffButton="ui-click"
|
|
558
|
+
class="btn"
|
|
559
|
+
data-menu="settings"
|
|
560
|
+
(click)="settings.emit()"
|
|
561
|
+
>
|
|
562
|
+
{{ 'fel.menu.settings' | felT }}
|
|
563
|
+
</button>
|
|
564
|
+
<button
|
|
565
|
+
ffButton="ui-click"
|
|
566
|
+
class="btn"
|
|
567
|
+
data-menu="changelog"
|
|
568
|
+
(click)="changelog.emit()"
|
|
569
|
+
>
|
|
570
|
+
{{ 'fel.menu.changelog' | felT }}
|
|
571
|
+
</button>
|
|
572
|
+
@if (isDesktop) {
|
|
573
|
+
<button
|
|
574
|
+
ffButton="ui-error"
|
|
575
|
+
class="btn"
|
|
576
|
+
data-menu="quit"
|
|
577
|
+
(click)="quit.emit()"
|
|
578
|
+
>
|
|
579
|
+
{{ 'fel.menu.quit' | felT }}
|
|
580
|
+
</button>
|
|
581
|
+
}
|
|
582
|
+
</nav>
|
|
583
|
+
`
|
|
584
|
+
}]
|
|
585
|
+
}],
|
|
586
|
+
propDecorators: {
|
|
587
|
+
continue: [{
|
|
588
|
+
type: i0.Output,
|
|
589
|
+
args: ["continue"]
|
|
590
|
+
}],
|
|
591
|
+
newGame: [{
|
|
592
|
+
type: i0.Output,
|
|
593
|
+
args: ["newGame"]
|
|
594
|
+
}],
|
|
595
|
+
settings: [{
|
|
596
|
+
type: i0.Output,
|
|
597
|
+
args: ["settings"]
|
|
598
|
+
}],
|
|
599
|
+
changelog: [{
|
|
600
|
+
type: i0.Output,
|
|
601
|
+
args: ["changelog"]
|
|
602
|
+
}],
|
|
603
|
+
quit: [{
|
|
604
|
+
type: i0.Output,
|
|
605
|
+
args: ["quit"]
|
|
606
|
+
}]
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
var FelSaveAlertsComponent = class FelSaveAlertsComponent {
|
|
610
|
+
restoreBackup = output();
|
|
611
|
+
loadFailed = computed(() => saveBlockedBy().includes("load-failed"), ...ngDevMode ? [{ debugName: "loadFailed" }] : /* istanbul ignore next */ []);
|
|
612
|
+
newerSave = computed(() => saveBlockedBy().includes("newer-save"), ...ngDevMode ? [{ debugName: "newerSave" }] : /* istanbul ignore next */ []);
|
|
613
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
614
|
+
minVersion: "12.0.0",
|
|
615
|
+
version: "22.3.0",
|
|
616
|
+
ngImport: i0,
|
|
617
|
+
type: FelSaveAlertsComponent,
|
|
618
|
+
deps: [],
|
|
619
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
620
|
+
});
|
|
621
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
622
|
+
minVersion: "17.0.0",
|
|
623
|
+
version: "22.3.0",
|
|
624
|
+
type: FelSaveAlertsComponent,
|
|
625
|
+
isStandalone: true,
|
|
626
|
+
selector: "fel-save-alerts",
|
|
627
|
+
outputs: { restoreBackup: "restoreBackup" },
|
|
628
|
+
ngImport: i0,
|
|
629
|
+
template: `
|
|
630
|
+
@if (loadFailed()) {
|
|
631
|
+
<ff-alert
|
|
632
|
+
color="error"
|
|
633
|
+
class="flex flex-col items-start gap-2"
|
|
634
|
+
data-alert="load-failed"
|
|
635
|
+
>
|
|
636
|
+
<span>{{ 'fel.alerts.loadFailed' | felT }}</span>
|
|
637
|
+
<button
|
|
638
|
+
ffButton="ui-click"
|
|
639
|
+
class="btn btn-sm"
|
|
640
|
+
(click)="restoreBackup.emit()"
|
|
641
|
+
>
|
|
642
|
+
{{ 'fel.alerts.restoreBackup' | felT }}
|
|
643
|
+
</button>
|
|
644
|
+
</ff-alert>
|
|
645
|
+
}
|
|
646
|
+
@if (newerSave()) {
|
|
647
|
+
<ff-alert color="warning" data-alert="newer-save">
|
|
648
|
+
<span>{{ 'fel.alerts.newerSave' | felT }}</span>
|
|
649
|
+
</ff-alert>
|
|
650
|
+
}
|
|
651
|
+
`,
|
|
652
|
+
isInline: true,
|
|
653
|
+
dependencies: [
|
|
654
|
+
{
|
|
655
|
+
kind: "component",
|
|
656
|
+
type: FFAlertComponent,
|
|
657
|
+
selector: "ff-alert",
|
|
658
|
+
inputs: ["color", "role"]
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
kind: "component",
|
|
662
|
+
type: FFButtonComponent,
|
|
663
|
+
selector: "button[ffButton]",
|
|
664
|
+
inputs: [
|
|
665
|
+
"ffButton",
|
|
666
|
+
"ffSoundOffset",
|
|
667
|
+
"ffHotkey",
|
|
668
|
+
"ffHotkeyPreventDefault",
|
|
669
|
+
"ffPadAction",
|
|
670
|
+
"ffPadPriority",
|
|
671
|
+
"ffPadLabel",
|
|
672
|
+
"ffPadEnabled",
|
|
673
|
+
"ffPadWithin",
|
|
674
|
+
"ffTooltip",
|
|
675
|
+
"ffTooltipDisabled",
|
|
676
|
+
"ffTooltipPlacement"
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
kind: "pipe",
|
|
681
|
+
type: FelTextPipe,
|
|
682
|
+
name: "felT"
|
|
683
|
+
}
|
|
684
|
+
],
|
|
685
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
689
|
+
minVersion: "12.0.0",
|
|
690
|
+
version: "22.3.0",
|
|
691
|
+
ngImport: i0,
|
|
692
|
+
type: FelSaveAlertsComponent,
|
|
693
|
+
decorators: [{
|
|
694
|
+
type: Component,
|
|
695
|
+
args: [{
|
|
696
|
+
selector: "fel-save-alerts",
|
|
697
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
698
|
+
imports: [
|
|
699
|
+
FFAlertComponent,
|
|
700
|
+
FFButtonComponent,
|
|
701
|
+
FelTextPipe
|
|
702
|
+
],
|
|
703
|
+
template: `
|
|
704
|
+
@if (loadFailed()) {
|
|
705
|
+
<ff-alert
|
|
706
|
+
color="error"
|
|
707
|
+
class="flex flex-col items-start gap-2"
|
|
708
|
+
data-alert="load-failed"
|
|
709
|
+
>
|
|
710
|
+
<span>{{ 'fel.alerts.loadFailed' | felT }}</span>
|
|
711
|
+
<button
|
|
712
|
+
ffButton="ui-click"
|
|
713
|
+
class="btn btn-sm"
|
|
714
|
+
(click)="restoreBackup.emit()"
|
|
715
|
+
>
|
|
716
|
+
{{ 'fel.alerts.restoreBackup' | felT }}
|
|
717
|
+
</button>
|
|
718
|
+
</ff-alert>
|
|
719
|
+
}
|
|
720
|
+
@if (newerSave()) {
|
|
721
|
+
<ff-alert color="warning" data-alert="newer-save">
|
|
722
|
+
<span>{{ 'fel.alerts.newerSave' | felT }}</span>
|
|
723
|
+
</ff-alert>
|
|
724
|
+
}
|
|
725
|
+
`
|
|
726
|
+
}]
|
|
727
|
+
}],
|
|
728
|
+
propDecorators: { restoreBackup: [{
|
|
729
|
+
type: i0.Output,
|
|
730
|
+
args: ["restoreBackup"]
|
|
731
|
+
}] }
|
|
732
|
+
});
|
|
733
|
+
var FelSettingsTabDirective = class FelSettingsTabDirective {
|
|
734
|
+
template = inject(TemplateRef);
|
|
735
|
+
felSettingsTab = input.required(...ngDevMode ? [{ debugName: "felSettingsTab" }] : /* istanbul ignore next */ []);
|
|
736
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
737
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
738
|
+
minVersion: "12.0.0",
|
|
739
|
+
version: "22.3.0",
|
|
740
|
+
ngImport: i0,
|
|
741
|
+
type: FelSettingsTabDirective,
|
|
742
|
+
deps: [],
|
|
743
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
744
|
+
});
|
|
745
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
746
|
+
minVersion: "17.1.0",
|
|
747
|
+
version: "22.3.0",
|
|
748
|
+
type: FelSettingsTabDirective,
|
|
749
|
+
isStandalone: true,
|
|
750
|
+
selector: "ng-template[felSettingsTab]",
|
|
751
|
+
inputs: {
|
|
752
|
+
felSettingsTab: {
|
|
753
|
+
classPropertyName: "felSettingsTab",
|
|
754
|
+
publicName: "felSettingsTab",
|
|
755
|
+
isSignal: true,
|
|
756
|
+
isRequired: true,
|
|
757
|
+
transformFunction: null
|
|
758
|
+
},
|
|
759
|
+
label: {
|
|
760
|
+
classPropertyName: "label",
|
|
761
|
+
publicName: "label",
|
|
762
|
+
isSignal: true,
|
|
763
|
+
isRequired: true,
|
|
764
|
+
transformFunction: null
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
ngImport: i0
|
|
768
|
+
});
|
|
769
|
+
};
|
|
770
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
771
|
+
minVersion: "12.0.0",
|
|
772
|
+
version: "22.3.0",
|
|
773
|
+
ngImport: i0,
|
|
774
|
+
type: FelSettingsTabDirective,
|
|
775
|
+
decorators: [{
|
|
776
|
+
type: Directive,
|
|
777
|
+
args: [{ selector: "ng-template[felSettingsTab]" }]
|
|
778
|
+
}],
|
|
779
|
+
propDecorators: {
|
|
780
|
+
felSettingsTab: [{
|
|
781
|
+
type: i0.Input,
|
|
782
|
+
args: [{
|
|
783
|
+
isSignal: true,
|
|
784
|
+
alias: "felSettingsTab",
|
|
785
|
+
required: true
|
|
786
|
+
}]
|
|
787
|
+
}],
|
|
788
|
+
label: [{
|
|
789
|
+
type: i0.Input,
|
|
790
|
+
args: [{
|
|
791
|
+
isSignal: true,
|
|
792
|
+
alias: "label",
|
|
793
|
+
required: true
|
|
794
|
+
}]
|
|
795
|
+
}]
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
var FelSettingsLayoutComponent = class FelSettingsLayoutComponent {
|
|
799
|
+
closed = output();
|
|
800
|
+
tabs = contentChildren(FelSettingsTabDirective, ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
|
|
801
|
+
selected = signal(void 0, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
802
|
+
activeTab = computed(() => {
|
|
803
|
+
const tabs = this.tabs();
|
|
804
|
+
return tabs.find((t) => t.felSettingsTab() === this.selected()) ?? tabs[0];
|
|
805
|
+
}, ...ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []);
|
|
806
|
+
active = computed(() => this.activeTab()?.felSettingsTab(), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
807
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
808
|
+
minVersion: "12.0.0",
|
|
809
|
+
version: "22.3.0",
|
|
810
|
+
ngImport: i0,
|
|
811
|
+
type: FelSettingsLayoutComponent,
|
|
812
|
+
deps: [],
|
|
813
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
814
|
+
});
|
|
815
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
816
|
+
minVersion: "17.0.0",
|
|
817
|
+
version: "22.3.0",
|
|
818
|
+
type: FelSettingsLayoutComponent,
|
|
819
|
+
isStandalone: true,
|
|
820
|
+
selector: "fel-settings-layout",
|
|
821
|
+
outputs: { closed: "closed" },
|
|
822
|
+
queries: [{
|
|
823
|
+
propertyName: "tabs",
|
|
824
|
+
predicate: FelSettingsTabDirective,
|
|
825
|
+
isSignal: true
|
|
826
|
+
}],
|
|
827
|
+
ngImport: i0,
|
|
828
|
+
template: `
|
|
829
|
+
<ff-card-page heightProfile="full">
|
|
830
|
+
<span header>{{ 'fel.settings.title' | felT }}</span>
|
|
831
|
+
<span pageactionssecondary>
|
|
832
|
+
<ff-button-close (click)="closed.emit()" />
|
|
833
|
+
</span>
|
|
834
|
+
<div class="flex flex-col gap-4">
|
|
835
|
+
<div
|
|
836
|
+
ffTabs
|
|
837
|
+
ffTriggerTabs
|
|
838
|
+
[ffTabsActive]="active()"
|
|
839
|
+
(ffTabsActiveChange)="selected.set($event)"
|
|
840
|
+
>
|
|
841
|
+
@for (tab of tabs(); track tab.felSettingsTab()) {
|
|
842
|
+
<button
|
|
843
|
+
ffButton="ui-click"
|
|
844
|
+
[ffTab]="tab.felSettingsTab()"
|
|
845
|
+
[attr.data-tab]="tab.felSettingsTab()"
|
|
846
|
+
>
|
|
847
|
+
{{ tab.label() | felT }}
|
|
848
|
+
</button>
|
|
849
|
+
}
|
|
850
|
+
</div>
|
|
851
|
+
@if (activeTab(); as tab) {
|
|
852
|
+
<section
|
|
853
|
+
class="flex flex-col gap-3"
|
|
854
|
+
[attr.data-panel]="tab.felSettingsTab()"
|
|
855
|
+
>
|
|
856
|
+
<ng-container *ngTemplateOutlet="tab.template" />
|
|
857
|
+
</section>
|
|
858
|
+
}
|
|
859
|
+
</div>
|
|
860
|
+
</ff-card-page>
|
|
861
|
+
`,
|
|
862
|
+
isInline: true,
|
|
863
|
+
dependencies: [
|
|
864
|
+
{
|
|
865
|
+
kind: "directive",
|
|
866
|
+
type: NgTemplateOutlet,
|
|
867
|
+
selector: "[ngTemplateOutlet]",
|
|
868
|
+
inputs: [
|
|
869
|
+
"ngTemplateOutletContext",
|
|
870
|
+
"ngTemplateOutlet",
|
|
871
|
+
"ngTemplateOutletInjector"
|
|
872
|
+
]
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
kind: "component",
|
|
876
|
+
type: FFCardPageComponent,
|
|
877
|
+
selector: "ff-card-page",
|
|
878
|
+
inputs: ["heightProfile", "isEmbeddedInModal"]
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
kind: "component",
|
|
882
|
+
type: FFButtonComponent,
|
|
883
|
+
selector: "button[ffButton]",
|
|
884
|
+
inputs: [
|
|
885
|
+
"ffButton",
|
|
886
|
+
"ffSoundOffset",
|
|
887
|
+
"ffHotkey",
|
|
888
|
+
"ffHotkeyPreventDefault",
|
|
889
|
+
"ffPadAction",
|
|
890
|
+
"ffPadPriority",
|
|
891
|
+
"ffPadLabel",
|
|
892
|
+
"ffPadEnabled",
|
|
893
|
+
"ffPadWithin",
|
|
894
|
+
"ffTooltip",
|
|
895
|
+
"ffTooltipDisabled",
|
|
896
|
+
"ffTooltipPlacement"
|
|
897
|
+
]
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
kind: "component",
|
|
901
|
+
type: FFButtonCloseComponent,
|
|
902
|
+
selector: "ff-button-close",
|
|
903
|
+
inputs: ["showBackPrompt"]
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
kind: "directive",
|
|
907
|
+
type: FFTabDirective,
|
|
908
|
+
selector: "button[ffTab]",
|
|
909
|
+
inputs: ["ffTab"]
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
kind: "directive",
|
|
913
|
+
type: FFTabsDirective,
|
|
914
|
+
selector: "[ffTabs]",
|
|
915
|
+
inputs: ["ffTabsActive"],
|
|
916
|
+
outputs: ["ffTabsActiveChange"]
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
kind: "directive",
|
|
920
|
+
type: FFTriggerTabsDirective,
|
|
921
|
+
selector: "[ffTriggerTabs]"
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
kind: "pipe",
|
|
925
|
+
type: FelTextPipe,
|
|
926
|
+
name: "felT"
|
|
927
|
+
}
|
|
928
|
+
],
|
|
929
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
930
|
+
});
|
|
931
|
+
};
|
|
932
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
933
|
+
minVersion: "12.0.0",
|
|
934
|
+
version: "22.3.0",
|
|
935
|
+
ngImport: i0,
|
|
936
|
+
type: FelSettingsLayoutComponent,
|
|
937
|
+
decorators: [{
|
|
938
|
+
type: Component,
|
|
939
|
+
args: [{
|
|
940
|
+
selector: "fel-settings-layout",
|
|
941
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
942
|
+
imports: [
|
|
943
|
+
NgTemplateOutlet,
|
|
944
|
+
FFCardPageComponent,
|
|
945
|
+
FFButtonComponent,
|
|
946
|
+
FFButtonCloseComponent,
|
|
947
|
+
FFTabDirective,
|
|
948
|
+
FFTabsDirective,
|
|
949
|
+
FFTriggerTabsDirective,
|
|
950
|
+
FelTextPipe
|
|
951
|
+
],
|
|
952
|
+
template: `
|
|
953
|
+
<ff-card-page heightProfile="full">
|
|
954
|
+
<span header>{{ 'fel.settings.title' | felT }}</span>
|
|
955
|
+
<span pageactionssecondary>
|
|
956
|
+
<ff-button-close (click)="closed.emit()" />
|
|
957
|
+
</span>
|
|
958
|
+
<div class="flex flex-col gap-4">
|
|
959
|
+
<div
|
|
960
|
+
ffTabs
|
|
961
|
+
ffTriggerTabs
|
|
962
|
+
[ffTabsActive]="active()"
|
|
963
|
+
(ffTabsActiveChange)="selected.set($event)"
|
|
964
|
+
>
|
|
965
|
+
@for (tab of tabs(); track tab.felSettingsTab()) {
|
|
966
|
+
<button
|
|
967
|
+
ffButton="ui-click"
|
|
968
|
+
[ffTab]="tab.felSettingsTab()"
|
|
969
|
+
[attr.data-tab]="tab.felSettingsTab()"
|
|
970
|
+
>
|
|
971
|
+
{{ tab.label() | felT }}
|
|
972
|
+
</button>
|
|
973
|
+
}
|
|
974
|
+
</div>
|
|
975
|
+
@if (activeTab(); as tab) {
|
|
976
|
+
<section
|
|
977
|
+
class="flex flex-col gap-3"
|
|
978
|
+
[attr.data-panel]="tab.felSettingsTab()"
|
|
979
|
+
>
|
|
980
|
+
<ng-container *ngTemplateOutlet="tab.template" />
|
|
981
|
+
</section>
|
|
982
|
+
}
|
|
983
|
+
</div>
|
|
984
|
+
</ff-card-page>
|
|
985
|
+
`
|
|
986
|
+
}]
|
|
987
|
+
}],
|
|
988
|
+
propDecorators: {
|
|
989
|
+
closed: [{
|
|
990
|
+
type: i0.Output,
|
|
991
|
+
args: ["closed"]
|
|
992
|
+
}],
|
|
993
|
+
tabs: [{
|
|
994
|
+
type: i0.ContentChildren,
|
|
995
|
+
args: [i0.forwardRef(() => FelSettingsTabDirective), { isSignal: true }]
|
|
996
|
+
}]
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
var FelTitleComponent = class FelTitleComponent {
|
|
1000
|
+
logo = input(...ngDevMode ? [void 0, { debugName: "logo" }] : /* istanbul ignore next */ []);
|
|
1001
|
+
name = felProject().name;
|
|
1002
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1003
|
+
minVersion: "12.0.0",
|
|
1004
|
+
version: "22.3.0",
|
|
1005
|
+
ngImport: i0,
|
|
1006
|
+
type: FelTitleComponent,
|
|
1007
|
+
deps: [],
|
|
1008
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1009
|
+
});
|
|
1010
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1011
|
+
minVersion: "17.0.0",
|
|
1012
|
+
version: "22.3.0",
|
|
1013
|
+
type: FelTitleComponent,
|
|
1014
|
+
isStandalone: true,
|
|
1015
|
+
selector: "fel-title",
|
|
1016
|
+
inputs: { logo: {
|
|
1017
|
+
classPropertyName: "logo",
|
|
1018
|
+
publicName: "logo",
|
|
1019
|
+
isSignal: true,
|
|
1020
|
+
isRequired: false,
|
|
1021
|
+
transformFunction: null
|
|
1022
|
+
} },
|
|
1023
|
+
ngImport: i0,
|
|
1024
|
+
template: `
|
|
1025
|
+
<div class="flex flex-col items-center gap-4 text-center">
|
|
1026
|
+
@if (logo(); as src) {
|
|
1027
|
+
<img [src]="src" [alt]="name" class="max-h-40" />
|
|
1028
|
+
}
|
|
1029
|
+
<h1 class="text-6xl" [textContent]="name"></h1>
|
|
1030
|
+
</div>
|
|
1031
|
+
`,
|
|
1032
|
+
isInline: true,
|
|
1033
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1034
|
+
});
|
|
1035
|
+
};
|
|
1036
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1037
|
+
minVersion: "12.0.0",
|
|
1038
|
+
version: "22.3.0",
|
|
1039
|
+
ngImport: i0,
|
|
1040
|
+
type: FelTitleComponent,
|
|
1041
|
+
decorators: [{
|
|
1042
|
+
type: Component,
|
|
1043
|
+
args: [{
|
|
1044
|
+
selector: "fel-title",
|
|
1045
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1046
|
+
template: `
|
|
1047
|
+
<div class="flex flex-col items-center gap-4 text-center">
|
|
1048
|
+
@if (logo(); as src) {
|
|
1049
|
+
<img [src]="src" [alt]="name" class="max-h-40" />
|
|
1050
|
+
}
|
|
1051
|
+
<h1 class="text-6xl" [textContent]="name"></h1>
|
|
1052
|
+
</div>
|
|
1053
|
+
`
|
|
1054
|
+
}]
|
|
1055
|
+
}],
|
|
1056
|
+
propDecorators: { logo: [{
|
|
1057
|
+
type: i0.Input,
|
|
1058
|
+
args: [{
|
|
1059
|
+
isSignal: true,
|
|
1060
|
+
alias: "logo",
|
|
1061
|
+
required: false
|
|
1062
|
+
}]
|
|
1063
|
+
}] }
|
|
1064
|
+
});
|
|
1065
|
+
const FEL_CHANGELOG_URL = "changelog.md";
|
|
1066
|
+
const felChangelogUnseen = computed(() => felOptions().lastSeenVersion !== felProject().version, ...ngDevMode ? [{ debugName: "felChangelogUnseen" }] : /* istanbul ignore next */ []);
|
|
1067
|
+
async function felChangelogMarkSeen() {
|
|
1068
|
+
const version = felProject().version;
|
|
1069
|
+
if (felOptions().lastSeenVersion === version) return;
|
|
1070
|
+
await felOptions.update((o) => {
|
|
1071
|
+
o.lastSeenVersion = version;
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
async function felChangelogSkipOnFirstLaunch() {
|
|
1075
|
+
if (!optionsHadStoredCopy() && felClock().ticks === 0) await felChangelogMarkSeen();
|
|
1076
|
+
}
|
|
1077
|
+
async function felChangelogLoad() {
|
|
1078
|
+
const response = await fetch(FEL_CHANGELOG_URL).catch(() => void 0);
|
|
1079
|
+
return response?.ok ? response.text() : "";
|
|
1080
|
+
}
|
|
1081
|
+
function felChangelogParse(markdown) {
|
|
1082
|
+
return markdown.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0).map((line) => {
|
|
1083
|
+
const heading = /^(#{1,6})\s+(.*)$/.exec(line);
|
|
1084
|
+
if (heading) return {
|
|
1085
|
+
kind: "heading",
|
|
1086
|
+
level: heading[1].length,
|
|
1087
|
+
text: felChangelogInline(heading[2])
|
|
1088
|
+
};
|
|
1089
|
+
const item = /^[-*]\s+(.*)$/.exec(line);
|
|
1090
|
+
if (item) return {
|
|
1091
|
+
kind: "item",
|
|
1092
|
+
text: felChangelogInline(item[1])
|
|
1093
|
+
};
|
|
1094
|
+
return {
|
|
1095
|
+
kind: "text",
|
|
1096
|
+
text: felChangelogInline(line)
|
|
1097
|
+
};
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
function felChangelogInline(text) {
|
|
1101
|
+
return text.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/[*_`]/g, "");
|
|
1102
|
+
}
|
|
1103
|
+
const FEL_CHANGELOG_MODAL = "fel-changelog";
|
|
1104
|
+
var FelChangelogModalComponent = class FelChangelogModalComponent {
|
|
1105
|
+
blocks = signal([], ...ngDevMode ? [{ debugName: "blocks" }] : /* istanbul ignore next */ []);
|
|
1106
|
+
constructor() {
|
|
1107
|
+
effect(() => {
|
|
1108
|
+
if (!ffModalIsOpen("fel-changelog")) return;
|
|
1109
|
+
untracked(() => {
|
|
1110
|
+
felChangelogMarkSeen();
|
|
1111
|
+
felChangelogLoad().then((md) => this.blocks.set(felChangelogParse(md)));
|
|
1112
|
+
});
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
close() {
|
|
1116
|
+
ffModalClose(FEL_CHANGELOG_MODAL);
|
|
1117
|
+
}
|
|
1118
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1119
|
+
minVersion: "12.0.0",
|
|
1120
|
+
version: "22.3.0",
|
|
1121
|
+
ngImport: i0,
|
|
1122
|
+
type: FelChangelogModalComponent,
|
|
1123
|
+
deps: [],
|
|
1124
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1125
|
+
});
|
|
1126
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1127
|
+
minVersion: "17.0.0",
|
|
1128
|
+
version: "22.3.0",
|
|
1129
|
+
type: FelChangelogModalComponent,
|
|
1130
|
+
isStandalone: true,
|
|
1131
|
+
selector: "fel-changelog-modal",
|
|
1132
|
+
ngImport: i0,
|
|
1133
|
+
template: `
|
|
1134
|
+
<ff-modal
|
|
1135
|
+
modalId="fel-changelog"
|
|
1136
|
+
[showCloseButton]="true"
|
|
1137
|
+
(modalClose)="close()"
|
|
1138
|
+
>
|
|
1139
|
+
<span title>{{ 'fel.changelog.title' | felT }}</span>
|
|
1140
|
+
<div body class="flex flex-col gap-1" data-changelog>
|
|
1141
|
+
@for (block of blocks(); track $index) {
|
|
1142
|
+
@switch (block.kind) {
|
|
1143
|
+
@case ('heading') {
|
|
1144
|
+
<h3 class="mt-3 font-bold" [class.text-lg]="block.level === 2">
|
|
1145
|
+
{{ block.text }}
|
|
1146
|
+
</h3>
|
|
1147
|
+
}
|
|
1148
|
+
@case ('item') {
|
|
1149
|
+
<p class="pl-4">• {{ block.text }}</p>
|
|
1150
|
+
}
|
|
1151
|
+
@default {
|
|
1152
|
+
<p>{{ block.text }}</p>
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
} @empty {
|
|
1156
|
+
<p class="opacity-70">{{ 'fel.changelog.empty' | felT }}</p>
|
|
1157
|
+
}
|
|
1158
|
+
</div>
|
|
1159
|
+
</ff-modal>
|
|
1160
|
+
`,
|
|
1161
|
+
isInline: true,
|
|
1162
|
+
dependencies: [{
|
|
1163
|
+
kind: "component",
|
|
1164
|
+
type: FFModalComponent,
|
|
1165
|
+
selector: "ff-modal",
|
|
1166
|
+
inputs: [
|
|
1167
|
+
"modalId",
|
|
1168
|
+
"allowEscToClose",
|
|
1169
|
+
"closeOnBackdropClick",
|
|
1170
|
+
"showCloseButton",
|
|
1171
|
+
"widthClass",
|
|
1172
|
+
"bodyHeightClass"
|
|
1173
|
+
],
|
|
1174
|
+
outputs: ["modalClose"]
|
|
1175
|
+
}, {
|
|
1176
|
+
kind: "pipe",
|
|
1177
|
+
type: FelTextPipe,
|
|
1178
|
+
name: "felT"
|
|
1179
|
+
}],
|
|
1180
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1181
|
+
});
|
|
1182
|
+
};
|
|
1183
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1184
|
+
minVersion: "12.0.0",
|
|
1185
|
+
version: "22.3.0",
|
|
1186
|
+
ngImport: i0,
|
|
1187
|
+
type: FelChangelogModalComponent,
|
|
1188
|
+
decorators: [{
|
|
1189
|
+
type: Component,
|
|
1190
|
+
args: [{
|
|
1191
|
+
selector: "fel-changelog-modal",
|
|
1192
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1193
|
+
imports: [FFModalComponent, FelTextPipe],
|
|
1194
|
+
template: `
|
|
1195
|
+
<ff-modal
|
|
1196
|
+
modalId="fel-changelog"
|
|
1197
|
+
[showCloseButton]="true"
|
|
1198
|
+
(modalClose)="close()"
|
|
1199
|
+
>
|
|
1200
|
+
<span title>{{ 'fel.changelog.title' | felT }}</span>
|
|
1201
|
+
<div body class="flex flex-col gap-1" data-changelog>
|
|
1202
|
+
@for (block of blocks(); track $index) {
|
|
1203
|
+
@switch (block.kind) {
|
|
1204
|
+
@case ('heading') {
|
|
1205
|
+
<h3 class="mt-3 font-bold" [class.text-lg]="block.level === 2">
|
|
1206
|
+
{{ block.text }}
|
|
1207
|
+
</h3>
|
|
1208
|
+
}
|
|
1209
|
+
@case ('item') {
|
|
1210
|
+
<p class="pl-4">• {{ block.text }}</p>
|
|
1211
|
+
}
|
|
1212
|
+
@default {
|
|
1213
|
+
<p>{{ block.text }}</p>
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
} @empty {
|
|
1217
|
+
<p class="opacity-70">{{ 'fel.changelog.empty' | felT }}</p>
|
|
1218
|
+
}
|
|
1219
|
+
</div>
|
|
1220
|
+
</ff-modal>
|
|
1221
|
+
`
|
|
1222
|
+
}]
|
|
1223
|
+
}],
|
|
1224
|
+
ctorParameters: () => []
|
|
1225
|
+
});
|
|
1226
|
+
function felDurationText(ms) {
|
|
1227
|
+
const seconds = Math.max(0, Math.round(ms / 1e3));
|
|
1228
|
+
const hours = Math.floor(seconds / 3600);
|
|
1229
|
+
const minutes = Math.floor(seconds % 3600 / 60);
|
|
1230
|
+
if (hours > 0) return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;
|
|
1231
|
+
if (minutes > 0) return `${minutes}m`;
|
|
1232
|
+
return `${seconds}s`;
|
|
1233
|
+
}
|
|
1234
|
+
var FelOverlaysComponent = class FelOverlaysComponent {
|
|
1235
|
+
catchUp = loopCatchUpProgress;
|
|
1236
|
+
confirmingSkip = linkedSignal({
|
|
1237
|
+
...ngDevMode ? { debugName: "confirmingSkip" } : /* istanbul ignore next */ {},
|
|
1238
|
+
source: () => !!this.catchUp(),
|
|
1239
|
+
computation: () => false
|
|
1240
|
+
});
|
|
1241
|
+
paused = computed(() => felOptions().gameloopPaused, ...ngDevMode ? [{ debugName: "paused" }] : /* istanbul ignore next */ []);
|
|
1242
|
+
remaining = computed(() => {
|
|
1243
|
+
const progress = this.catchUp();
|
|
1244
|
+
if (!progress) return "";
|
|
1245
|
+
return felDurationText((progress.total - progress.done) / Math.max(1, felOptions().debugTickMultiplier) * felProject().loop.tickMs);
|
|
1246
|
+
}, ...ngDevMode ? [{ debugName: "remaining" }] : /* istanbul ignore next */ []);
|
|
1247
|
+
async skip() {
|
|
1248
|
+
this.confirmingSkip.set(false);
|
|
1249
|
+
await loopSkipCatchUp();
|
|
1250
|
+
}
|
|
1251
|
+
resume() {
|
|
1252
|
+
felOptions.update((o) => {
|
|
1253
|
+
o.gameloopPaused = false;
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1257
|
+
minVersion: "12.0.0",
|
|
1258
|
+
version: "22.3.0",
|
|
1259
|
+
ngImport: i0,
|
|
1260
|
+
type: FelOverlaysComponent,
|
|
1261
|
+
deps: [],
|
|
1262
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1263
|
+
});
|
|
1264
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1265
|
+
minVersion: "17.0.0",
|
|
1266
|
+
version: "22.3.0",
|
|
1267
|
+
type: FelOverlaysComponent,
|
|
1268
|
+
isStandalone: true,
|
|
1269
|
+
selector: "fel-overlays",
|
|
1270
|
+
ngImport: i0,
|
|
1271
|
+
template: `
|
|
1272
|
+
@if (catchUp(); as progress) {
|
|
1273
|
+
<div
|
|
1274
|
+
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
|
|
1275
|
+
data-overlay="catch-up"
|
|
1276
|
+
>
|
|
1277
|
+
<div class="card bg-base-100 flex w-96 flex-col gap-3 p-6">
|
|
1278
|
+
<span>{{ 'fel.overlay.catchUp' | felT: { time: remaining() } }}</span>
|
|
1279
|
+
<ff-bar-progress [value]="progress.done" [max]="progress.total" />
|
|
1280
|
+
@if (confirmingSkip()) {
|
|
1281
|
+
<span class="text-sm">
|
|
1282
|
+
{{ 'fel.confirm.skipCatchUp' | felT: { time: remaining() } }}
|
|
1283
|
+
</span>
|
|
1284
|
+
<span class="flex gap-2">
|
|
1285
|
+
<button
|
|
1286
|
+
ffButton="ui-error"
|
|
1287
|
+
class="btn btn-sm btn-warning"
|
|
1288
|
+
data-overlay="skip-yes"
|
|
1289
|
+
(click)="skip()"
|
|
1290
|
+
>
|
|
1291
|
+
{{ 'fel.confirm.yes' | felT }}
|
|
1292
|
+
</button>
|
|
1293
|
+
<button
|
|
1294
|
+
ffButton="ui-click"
|
|
1295
|
+
class="btn btn-sm"
|
|
1296
|
+
(click)="confirmingSkip.set(false)"
|
|
1297
|
+
>
|
|
1298
|
+
{{ 'fel.confirm.no' | felT }}
|
|
1299
|
+
</button>
|
|
1300
|
+
</span>
|
|
1301
|
+
} @else {
|
|
1302
|
+
<button
|
|
1303
|
+
ffButton="ui-click"
|
|
1304
|
+
class="btn btn-sm self-end"
|
|
1305
|
+
data-overlay="skip"
|
|
1306
|
+
(click)="confirmingSkip.set(true)"
|
|
1307
|
+
>
|
|
1308
|
+
{{ 'fel.overlay.skip' | felT }}
|
|
1309
|
+
</button>
|
|
1310
|
+
}
|
|
1311
|
+
</div>
|
|
1312
|
+
</div>
|
|
1313
|
+
}
|
|
1314
|
+
@if (paused()) {
|
|
1315
|
+
<div
|
|
1316
|
+
class="fixed bottom-4 left-1/2 z-40 -translate-x-1/2"
|
|
1317
|
+
data-overlay="paused"
|
|
1318
|
+
>
|
|
1319
|
+
<div class="alert alert-info flex gap-3">
|
|
1320
|
+
<span>{{ 'fel.overlay.paused' | felT }}</span>
|
|
1321
|
+
<button ffButton="ui-click" class="btn btn-sm" (click)="resume()">
|
|
1322
|
+
{{ 'fel.bar.resume' | felT }}
|
|
1323
|
+
</button>
|
|
1324
|
+
</div>
|
|
1325
|
+
</div>
|
|
1326
|
+
}
|
|
1327
|
+
`,
|
|
1328
|
+
isInline: true,
|
|
1329
|
+
dependencies: [
|
|
1330
|
+
{
|
|
1331
|
+
kind: "component",
|
|
1332
|
+
type: FFBarProgressComponent,
|
|
1333
|
+
selector: "ff-bar-progress",
|
|
1334
|
+
inputs: [
|
|
1335
|
+
"value",
|
|
1336
|
+
"max",
|
|
1337
|
+
"color",
|
|
1338
|
+
"size",
|
|
1339
|
+
"shimmer"
|
|
1340
|
+
]
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
kind: "component",
|
|
1344
|
+
type: FFButtonComponent,
|
|
1345
|
+
selector: "button[ffButton]",
|
|
1346
|
+
inputs: [
|
|
1347
|
+
"ffButton",
|
|
1348
|
+
"ffSoundOffset",
|
|
1349
|
+
"ffHotkey",
|
|
1350
|
+
"ffHotkeyPreventDefault",
|
|
1351
|
+
"ffPadAction",
|
|
1352
|
+
"ffPadPriority",
|
|
1353
|
+
"ffPadLabel",
|
|
1354
|
+
"ffPadEnabled",
|
|
1355
|
+
"ffPadWithin",
|
|
1356
|
+
"ffTooltip",
|
|
1357
|
+
"ffTooltipDisabled",
|
|
1358
|
+
"ffTooltipPlacement"
|
|
1359
|
+
]
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
kind: "pipe",
|
|
1363
|
+
type: FelTextPipe,
|
|
1364
|
+
name: "felT"
|
|
1365
|
+
}
|
|
1366
|
+
],
|
|
1367
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1368
|
+
});
|
|
1369
|
+
};
|
|
1370
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1371
|
+
minVersion: "12.0.0",
|
|
1372
|
+
version: "22.3.0",
|
|
1373
|
+
ngImport: i0,
|
|
1374
|
+
type: FelOverlaysComponent,
|
|
1375
|
+
decorators: [{
|
|
1376
|
+
type: Component,
|
|
1377
|
+
args: [{
|
|
1378
|
+
selector: "fel-overlays",
|
|
1379
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1380
|
+
imports: [
|
|
1381
|
+
FFBarProgressComponent,
|
|
1382
|
+
FFButtonComponent,
|
|
1383
|
+
FelTextPipe
|
|
1384
|
+
],
|
|
1385
|
+
template: `
|
|
1386
|
+
@if (catchUp(); as progress) {
|
|
1387
|
+
<div
|
|
1388
|
+
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
|
|
1389
|
+
data-overlay="catch-up"
|
|
1390
|
+
>
|
|
1391
|
+
<div class="card bg-base-100 flex w-96 flex-col gap-3 p-6">
|
|
1392
|
+
<span>{{ 'fel.overlay.catchUp' | felT: { time: remaining() } }}</span>
|
|
1393
|
+
<ff-bar-progress [value]="progress.done" [max]="progress.total" />
|
|
1394
|
+
@if (confirmingSkip()) {
|
|
1395
|
+
<span class="text-sm">
|
|
1396
|
+
{{ 'fel.confirm.skipCatchUp' | felT: { time: remaining() } }}
|
|
1397
|
+
</span>
|
|
1398
|
+
<span class="flex gap-2">
|
|
1399
|
+
<button
|
|
1400
|
+
ffButton="ui-error"
|
|
1401
|
+
class="btn btn-sm btn-warning"
|
|
1402
|
+
data-overlay="skip-yes"
|
|
1403
|
+
(click)="skip()"
|
|
1404
|
+
>
|
|
1405
|
+
{{ 'fel.confirm.yes' | felT }}
|
|
1406
|
+
</button>
|
|
1407
|
+
<button
|
|
1408
|
+
ffButton="ui-click"
|
|
1409
|
+
class="btn btn-sm"
|
|
1410
|
+
(click)="confirmingSkip.set(false)"
|
|
1411
|
+
>
|
|
1412
|
+
{{ 'fel.confirm.no' | felT }}
|
|
1413
|
+
</button>
|
|
1414
|
+
</span>
|
|
1415
|
+
} @else {
|
|
1416
|
+
<button
|
|
1417
|
+
ffButton="ui-click"
|
|
1418
|
+
class="btn btn-sm self-end"
|
|
1419
|
+
data-overlay="skip"
|
|
1420
|
+
(click)="confirmingSkip.set(true)"
|
|
1421
|
+
>
|
|
1422
|
+
{{ 'fel.overlay.skip' | felT }}
|
|
1423
|
+
</button>
|
|
1424
|
+
}
|
|
1425
|
+
</div>
|
|
1426
|
+
</div>
|
|
1427
|
+
}
|
|
1428
|
+
@if (paused()) {
|
|
1429
|
+
<div
|
|
1430
|
+
class="fixed bottom-4 left-1/2 z-40 -translate-x-1/2"
|
|
1431
|
+
data-overlay="paused"
|
|
1432
|
+
>
|
|
1433
|
+
<div class="alert alert-info flex gap-3">
|
|
1434
|
+
<span>{{ 'fel.overlay.paused' | felT }}</span>
|
|
1435
|
+
<button ffButton="ui-click" class="btn btn-sm" (click)="resume()">
|
|
1436
|
+
{{ 'fel.bar.resume' | felT }}
|
|
1437
|
+
</button>
|
|
1438
|
+
</div>
|
|
1439
|
+
</div>
|
|
1440
|
+
}
|
|
1441
|
+
`
|
|
1442
|
+
}]
|
|
1443
|
+
}]
|
|
1444
|
+
});
|
|
1445
|
+
const STEAM_INPUT_FAMILIES = {
|
|
1446
|
+
SteamController: "steam-controller",
|
|
1447
|
+
SteamDeckController: "steam-deck",
|
|
1448
|
+
XBox360Controller: "xbox",
|
|
1449
|
+
XBoxOneController: "xbox",
|
|
1450
|
+
GenericGamepad: "xbox",
|
|
1451
|
+
PS3Controller: "playstation",
|
|
1452
|
+
PS4Controller: "playstation",
|
|
1453
|
+
PS5Controller: "playstation",
|
|
1454
|
+
SwitchProController: "switch",
|
|
1455
|
+
SwitchJoyConPair: "switch",
|
|
1456
|
+
SwitchJoyConSingle: "switch"
|
|
1457
|
+
};
|
|
1458
|
+
async function felSteamControllerFamily() {
|
|
1459
|
+
const type = await felSteamInputType();
|
|
1460
|
+
return type ? STEAM_INPUT_FAMILIES[type] : void 0;
|
|
1461
|
+
}
|
|
1462
|
+
function felReducedMotion() {
|
|
1463
|
+
const system = ffReducedMotionSignal();
|
|
1464
|
+
return computed(() => {
|
|
1465
|
+
const preference = felOptions().motionPreference;
|
|
1466
|
+
return preference === "system" ? system() : preference === "reduce";
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1469
|
+
function felShellInit() {
|
|
1470
|
+
ffBindDocumentTheme({
|
|
1471
|
+
cleanFont: () => felOptions().cleanFont,
|
|
1472
|
+
uiScale: () => felOptions().uiScale
|
|
1473
|
+
});
|
|
1474
|
+
const input = inject(FFInputService);
|
|
1475
|
+
effect(() => {
|
|
1476
|
+
const family = felOptions().controllerFamily;
|
|
1477
|
+
input.setFamilyOverride(family === "auto" ? void 0 : family);
|
|
1478
|
+
});
|
|
1479
|
+
inject(FelAudioService);
|
|
1480
|
+
}
|
|
1481
|
+
function provideFelShell(config = {}) {
|
|
1482
|
+
return makeEnvironmentProviders([
|
|
1483
|
+
{
|
|
1484
|
+
provide: FEL_SHELL_CONFIG,
|
|
1485
|
+
useValue: config
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
provide: FF_TRANSLATE,
|
|
1489
|
+
useValue: felText
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
provide: FF_REDUCED_MOTION,
|
|
1493
|
+
useFactory: felReducedMotion
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
provide: FF_BUTTON_FEEDBACK,
|
|
1497
|
+
useFactory: () => inject(FelAudioService).buttonFeedback
|
|
1498
|
+
},
|
|
1499
|
+
...felIsDesktop() ? [{
|
|
1500
|
+
provide: FF_TEXT_KEYBOARD,
|
|
1501
|
+
useValue: felSteamShowKeyboard
|
|
1502
|
+
}, {
|
|
1503
|
+
provide: FF_CONTROLLER_FAMILY_RESOLVER,
|
|
1504
|
+
useValue: felSteamControllerFamily
|
|
1505
|
+
}] : [],
|
|
1506
|
+
provideAppInitializer(felShellInit)
|
|
1507
|
+
]);
|
|
1508
|
+
}
|
|
1509
|
+
var FelSavePanelComponent = class FelSavePanelComponent {
|
|
1510
|
+
isDesktop = felIsDesktop();
|
|
1511
|
+
backups = signal([], ...ngDevMode ? [{ debugName: "backups" }] : /* istanbul ignore next */ []);
|
|
1512
|
+
exported = signal("", ...ngDevMode ? [{ debugName: "exported" }] : /* istanbul ignore next */ []);
|
|
1513
|
+
pending = signal(void 0, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
|
|
1514
|
+
message = signal(void 0, ...ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []);
|
|
1515
|
+
savingOff = computed(() => felSaveBlockText(saveBlockedBy()), ...ngDevMode ? [{ debugName: "savingOff" }] : /* istanbul ignore next */ []);
|
|
1516
|
+
constructor() {
|
|
1517
|
+
this.refresh();
|
|
1518
|
+
}
|
|
1519
|
+
async refresh() {
|
|
1520
|
+
this.backups.set(await backupsList());
|
|
1521
|
+
}
|
|
1522
|
+
async report(result, doneKey) {
|
|
1523
|
+
this.message.set({
|
|
1524
|
+
ok: result.ok,
|
|
1525
|
+
text: result.ok ? felText(doneKey) : result.error ?? ""
|
|
1526
|
+
});
|
|
1527
|
+
await this.refresh();
|
|
1528
|
+
}
|
|
1529
|
+
backupLabel(backup) {
|
|
1530
|
+
return `${new Date(backup.createdAt).toLocaleString()} · ${felText(`fel.save.backupReason.${backup.reason}`)} · ${backup.ticks}`;
|
|
1531
|
+
}
|
|
1532
|
+
export() {
|
|
1533
|
+
const json = felExport();
|
|
1534
|
+
this.exported.set(json);
|
|
1535
|
+
navigator.clipboard?.writeText(json).catch(() => void 0);
|
|
1536
|
+
const link = document.createElement("a");
|
|
1537
|
+
link.href = URL.createObjectURL(new Blob([json], { type: "application/json" }));
|
|
1538
|
+
link.download = `save-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.json`;
|
|
1539
|
+
link.click();
|
|
1540
|
+
setTimeout(() => URL.revokeObjectURL(link.href), 1e3);
|
|
1541
|
+
this.message.set({
|
|
1542
|
+
ok: true,
|
|
1543
|
+
text: felText("fel.save.exportDone")
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
async import(json) {
|
|
1547
|
+
await this.report(await felImport(json), "fel.save.importDone");
|
|
1548
|
+
}
|
|
1549
|
+
async importFile(event) {
|
|
1550
|
+
const input = event.target;
|
|
1551
|
+
const file = input.files?.[0];
|
|
1552
|
+
input.value = "";
|
|
1553
|
+
if (file) await this.import(await file.text());
|
|
1554
|
+
}
|
|
1555
|
+
async exportWithLogs() {
|
|
1556
|
+
await this.report(await felExportWithLogs(), "fel.save.exportWithLogsDone");
|
|
1557
|
+
}
|
|
1558
|
+
openFolder() {
|
|
1559
|
+
felOpenFolder("saves");
|
|
1560
|
+
}
|
|
1561
|
+
async confirm(pending) {
|
|
1562
|
+
this.pending.set(void 0);
|
|
1563
|
+
if (pending.kind === "newRun") await this.report(await felNewRun(), "fel.save.newRunDone");
|
|
1564
|
+
else await this.report(await felRestore(pending.backup.id), "fel.save.restored");
|
|
1565
|
+
}
|
|
1566
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1567
|
+
minVersion: "12.0.0",
|
|
1568
|
+
version: "22.3.0",
|
|
1569
|
+
ngImport: i0,
|
|
1570
|
+
type: FelSavePanelComponent,
|
|
1571
|
+
deps: [],
|
|
1572
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1573
|
+
});
|
|
1574
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1575
|
+
minVersion: "17.0.0",
|
|
1576
|
+
version: "22.3.0",
|
|
1577
|
+
type: FelSavePanelComponent,
|
|
1578
|
+
isStandalone: true,
|
|
1579
|
+
selector: "fel-save-panel",
|
|
1580
|
+
ngImport: i0,
|
|
1581
|
+
template: `
|
|
1582
|
+
<section class="flex flex-col gap-3" data-save-panel>
|
|
1583
|
+
<h3 class="text-lg">{{ 'fel.save.title' | felT }}</h3>
|
|
1584
|
+
@if (savingOff(); as text) {
|
|
1585
|
+
<ff-alert color="warning" role="status" data-save="saving-off">
|
|
1586
|
+
{{ text }}
|
|
1587
|
+
</ff-alert>
|
|
1588
|
+
}
|
|
1589
|
+
@if (message(); as m) {
|
|
1590
|
+
<ff-alert
|
|
1591
|
+
[color]="m.ok ? 'success' : 'error'"
|
|
1592
|
+
role="status"
|
|
1593
|
+
data-save="message"
|
|
1594
|
+
>
|
|
1595
|
+
{{ m.text }}
|
|
1596
|
+
</ff-alert>
|
|
1597
|
+
}
|
|
1598
|
+
@if (pending(); as p) {
|
|
1599
|
+
<ff-alert
|
|
1600
|
+
color="warning"
|
|
1601
|
+
class="flex flex-col items-start gap-2"
|
|
1602
|
+
data-save="confirm"
|
|
1603
|
+
>
|
|
1604
|
+
<span>
|
|
1605
|
+
{{
|
|
1606
|
+
(p.kind === 'newRun'
|
|
1607
|
+
? 'fel.confirm.newGame'
|
|
1608
|
+
: 'fel.confirm.restore'
|
|
1609
|
+
) | felT
|
|
1610
|
+
}}
|
|
1611
|
+
</span>
|
|
1612
|
+
<span class="flex gap-2">
|
|
1613
|
+
<button
|
|
1614
|
+
ffButton="ui-success"
|
|
1615
|
+
class="btn btn-sm btn-warning"
|
|
1616
|
+
data-save="confirm-yes"
|
|
1617
|
+
(click)="confirm(p)"
|
|
1618
|
+
>
|
|
1619
|
+
{{ 'fel.confirm.yes' | felT }}
|
|
1620
|
+
</button>
|
|
1621
|
+
<button
|
|
1622
|
+
ffButton="ui-error"
|
|
1623
|
+
class="btn btn-sm"
|
|
1624
|
+
(click)="pending.set(undefined)"
|
|
1625
|
+
>
|
|
1626
|
+
{{ 'fel.confirm.no' | felT }}
|
|
1627
|
+
</button>
|
|
1628
|
+
</span>
|
|
1629
|
+
</ff-alert>
|
|
1630
|
+
}
|
|
1631
|
+
<div class="flex flex-wrap gap-2">
|
|
1632
|
+
<button
|
|
1633
|
+
ffButton="ui-click"
|
|
1634
|
+
class="btn btn-sm"
|
|
1635
|
+
data-save="export"
|
|
1636
|
+
(click)="export()"
|
|
1637
|
+
>
|
|
1638
|
+
{{ 'fel.save.export' | felT }}
|
|
1639
|
+
</button>
|
|
1640
|
+
<button
|
|
1641
|
+
ffButton="ui-click"
|
|
1642
|
+
class="btn btn-sm"
|
|
1643
|
+
data-save="import"
|
|
1644
|
+
(click)="import(paste.value)"
|
|
1645
|
+
>
|
|
1646
|
+
{{ 'fel.save.import' | felT }}
|
|
1647
|
+
</button>
|
|
1648
|
+
<button ffButton="ui-click" class="btn btn-sm" (click)="file.click()">
|
|
1649
|
+
{{ 'fel.save.importFile' | felT }}
|
|
1650
|
+
</button>
|
|
1651
|
+
<input
|
|
1652
|
+
#file
|
|
1653
|
+
type="file"
|
|
1654
|
+
accept=".json,application/json"
|
|
1655
|
+
class="hidden"
|
|
1656
|
+
(change)="importFile($event)"
|
|
1657
|
+
/>
|
|
1658
|
+
@if (isDesktop) {
|
|
1659
|
+
<button
|
|
1660
|
+
ffButton="ui-click"
|
|
1661
|
+
class="btn btn-sm"
|
|
1662
|
+
(click)="exportWithLogs()"
|
|
1663
|
+
>
|
|
1664
|
+
{{ 'fel.save.exportWithLogs' | felT }}
|
|
1665
|
+
</button>
|
|
1666
|
+
<button ffButton="ui-click" class="btn btn-sm" (click)="openFolder()">
|
|
1667
|
+
{{ 'fel.save.openFolder' | felT }}
|
|
1668
|
+
</button>
|
|
1669
|
+
}
|
|
1670
|
+
<button
|
|
1671
|
+
ffButton="ui-error"
|
|
1672
|
+
class="btn btn-sm btn-warning"
|
|
1673
|
+
data-save="new-run"
|
|
1674
|
+
(click)="pending.set({ kind: 'newRun' })"
|
|
1675
|
+
>
|
|
1676
|
+
{{ 'fel.save.newRun' | felT }}
|
|
1677
|
+
</button>
|
|
1678
|
+
</div>
|
|
1679
|
+
<textarea
|
|
1680
|
+
#paste
|
|
1681
|
+
class="textarea h-20 w-full font-mono text-xs"
|
|
1682
|
+
[placeholder]="'fel.save.importPlaceholder' | felT"
|
|
1683
|
+
[value]="exported()"
|
|
1684
|
+
></textarea>
|
|
1685
|
+
<h4>{{ 'fel.save.backups' | felT }}</h4>
|
|
1686
|
+
<ul class="flex flex-col gap-1" data-save="backups">
|
|
1687
|
+
@for (backup of backups(); track backup.id) {
|
|
1688
|
+
<li class="flex items-center justify-between gap-2 text-sm">
|
|
1689
|
+
<span>{{ backupLabel(backup) }}</span>
|
|
1690
|
+
<button
|
|
1691
|
+
ffButton="ui-click"
|
|
1692
|
+
class="btn btn-xs"
|
|
1693
|
+
(click)="pending.set({ kind: 'restore', backup })"
|
|
1694
|
+
>
|
|
1695
|
+
{{ 'fel.save.restore' | felT }}
|
|
1696
|
+
</button>
|
|
1697
|
+
</li>
|
|
1698
|
+
} @empty {
|
|
1699
|
+
<li class="text-sm opacity-70">{{ 'fel.save.noBackups' | felT }}</li>
|
|
1700
|
+
}
|
|
1701
|
+
</ul>
|
|
1702
|
+
</section>
|
|
1703
|
+
`,
|
|
1704
|
+
isInline: true,
|
|
1705
|
+
dependencies: [
|
|
1706
|
+
{
|
|
1707
|
+
kind: "component",
|
|
1708
|
+
type: FFAlertComponent,
|
|
1709
|
+
selector: "ff-alert",
|
|
1710
|
+
inputs: ["color", "role"]
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
kind: "component",
|
|
1714
|
+
type: FFButtonComponent,
|
|
1715
|
+
selector: "button[ffButton]",
|
|
1716
|
+
inputs: [
|
|
1717
|
+
"ffButton",
|
|
1718
|
+
"ffSoundOffset",
|
|
1719
|
+
"ffHotkey",
|
|
1720
|
+
"ffHotkeyPreventDefault",
|
|
1721
|
+
"ffPadAction",
|
|
1722
|
+
"ffPadPriority",
|
|
1723
|
+
"ffPadLabel",
|
|
1724
|
+
"ffPadEnabled",
|
|
1725
|
+
"ffPadWithin",
|
|
1726
|
+
"ffTooltip",
|
|
1727
|
+
"ffTooltipDisabled",
|
|
1728
|
+
"ffTooltipPlacement"
|
|
1729
|
+
]
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
kind: "pipe",
|
|
1733
|
+
type: FelTextPipe,
|
|
1734
|
+
name: "felT"
|
|
1735
|
+
}
|
|
1736
|
+
],
|
|
1737
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1738
|
+
});
|
|
1739
|
+
};
|
|
1740
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1741
|
+
minVersion: "12.0.0",
|
|
1742
|
+
version: "22.3.0",
|
|
1743
|
+
ngImport: i0,
|
|
1744
|
+
type: FelSavePanelComponent,
|
|
1745
|
+
decorators: [{
|
|
1746
|
+
type: Component,
|
|
1747
|
+
args: [{
|
|
1748
|
+
selector: "fel-save-panel",
|
|
1749
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1750
|
+
imports: [
|
|
1751
|
+
FFAlertComponent,
|
|
1752
|
+
FFButtonComponent,
|
|
1753
|
+
FelTextPipe
|
|
1754
|
+
],
|
|
1755
|
+
template: `
|
|
1756
|
+
<section class="flex flex-col gap-3" data-save-panel>
|
|
1757
|
+
<h3 class="text-lg">{{ 'fel.save.title' | felT }}</h3>
|
|
1758
|
+
@if (savingOff(); as text) {
|
|
1759
|
+
<ff-alert color="warning" role="status" data-save="saving-off">
|
|
1760
|
+
{{ text }}
|
|
1761
|
+
</ff-alert>
|
|
1762
|
+
}
|
|
1763
|
+
@if (message(); as m) {
|
|
1764
|
+
<ff-alert
|
|
1765
|
+
[color]="m.ok ? 'success' : 'error'"
|
|
1766
|
+
role="status"
|
|
1767
|
+
data-save="message"
|
|
1768
|
+
>
|
|
1769
|
+
{{ m.text }}
|
|
1770
|
+
</ff-alert>
|
|
1771
|
+
}
|
|
1772
|
+
@if (pending(); as p) {
|
|
1773
|
+
<ff-alert
|
|
1774
|
+
color="warning"
|
|
1775
|
+
class="flex flex-col items-start gap-2"
|
|
1776
|
+
data-save="confirm"
|
|
1777
|
+
>
|
|
1778
|
+
<span>
|
|
1779
|
+
{{
|
|
1780
|
+
(p.kind === 'newRun'
|
|
1781
|
+
? 'fel.confirm.newGame'
|
|
1782
|
+
: 'fel.confirm.restore'
|
|
1783
|
+
) | felT
|
|
1784
|
+
}}
|
|
1785
|
+
</span>
|
|
1786
|
+
<span class="flex gap-2">
|
|
1787
|
+
<button
|
|
1788
|
+
ffButton="ui-success"
|
|
1789
|
+
class="btn btn-sm btn-warning"
|
|
1790
|
+
data-save="confirm-yes"
|
|
1791
|
+
(click)="confirm(p)"
|
|
1792
|
+
>
|
|
1793
|
+
{{ 'fel.confirm.yes' | felT }}
|
|
1794
|
+
</button>
|
|
1795
|
+
<button
|
|
1796
|
+
ffButton="ui-error"
|
|
1797
|
+
class="btn btn-sm"
|
|
1798
|
+
(click)="pending.set(undefined)"
|
|
1799
|
+
>
|
|
1800
|
+
{{ 'fel.confirm.no' | felT }}
|
|
1801
|
+
</button>
|
|
1802
|
+
</span>
|
|
1803
|
+
</ff-alert>
|
|
1804
|
+
}
|
|
1805
|
+
<div class="flex flex-wrap gap-2">
|
|
1806
|
+
<button
|
|
1807
|
+
ffButton="ui-click"
|
|
1808
|
+
class="btn btn-sm"
|
|
1809
|
+
data-save="export"
|
|
1810
|
+
(click)="export()"
|
|
1811
|
+
>
|
|
1812
|
+
{{ 'fel.save.export' | felT }}
|
|
1813
|
+
</button>
|
|
1814
|
+
<button
|
|
1815
|
+
ffButton="ui-click"
|
|
1816
|
+
class="btn btn-sm"
|
|
1817
|
+
data-save="import"
|
|
1818
|
+
(click)="import(paste.value)"
|
|
1819
|
+
>
|
|
1820
|
+
{{ 'fel.save.import' | felT }}
|
|
1821
|
+
</button>
|
|
1822
|
+
<button ffButton="ui-click" class="btn btn-sm" (click)="file.click()">
|
|
1823
|
+
{{ 'fel.save.importFile' | felT }}
|
|
1824
|
+
</button>
|
|
1825
|
+
<input
|
|
1826
|
+
#file
|
|
1827
|
+
type="file"
|
|
1828
|
+
accept=".json,application/json"
|
|
1829
|
+
class="hidden"
|
|
1830
|
+
(change)="importFile($event)"
|
|
1831
|
+
/>
|
|
1832
|
+
@if (isDesktop) {
|
|
1833
|
+
<button
|
|
1834
|
+
ffButton="ui-click"
|
|
1835
|
+
class="btn btn-sm"
|
|
1836
|
+
(click)="exportWithLogs()"
|
|
1837
|
+
>
|
|
1838
|
+
{{ 'fel.save.exportWithLogs' | felT }}
|
|
1839
|
+
</button>
|
|
1840
|
+
<button ffButton="ui-click" class="btn btn-sm" (click)="openFolder()">
|
|
1841
|
+
{{ 'fel.save.openFolder' | felT }}
|
|
1842
|
+
</button>
|
|
1843
|
+
}
|
|
1844
|
+
<button
|
|
1845
|
+
ffButton="ui-error"
|
|
1846
|
+
class="btn btn-sm btn-warning"
|
|
1847
|
+
data-save="new-run"
|
|
1848
|
+
(click)="pending.set({ kind: 'newRun' })"
|
|
1849
|
+
>
|
|
1850
|
+
{{ 'fel.save.newRun' | felT }}
|
|
1851
|
+
</button>
|
|
1852
|
+
</div>
|
|
1853
|
+
<textarea
|
|
1854
|
+
#paste
|
|
1855
|
+
class="textarea h-20 w-full font-mono text-xs"
|
|
1856
|
+
[placeholder]="'fel.save.importPlaceholder' | felT"
|
|
1857
|
+
[value]="exported()"
|
|
1858
|
+
></textarea>
|
|
1859
|
+
<h4>{{ 'fel.save.backups' | felT }}</h4>
|
|
1860
|
+
<ul class="flex flex-col gap-1" data-save="backups">
|
|
1861
|
+
@for (backup of backups(); track backup.id) {
|
|
1862
|
+
<li class="flex items-center justify-between gap-2 text-sm">
|
|
1863
|
+
<span>{{ backupLabel(backup) }}</span>
|
|
1864
|
+
<button
|
|
1865
|
+
ffButton="ui-click"
|
|
1866
|
+
class="btn btn-xs"
|
|
1867
|
+
(click)="pending.set({ kind: 'restore', backup })"
|
|
1868
|
+
>
|
|
1869
|
+
{{ 'fel.save.restore' | felT }}
|
|
1870
|
+
</button>
|
|
1871
|
+
</li>
|
|
1872
|
+
} @empty {
|
|
1873
|
+
<li class="text-sm opacity-70">{{ 'fel.save.noBackups' | felT }}</li>
|
|
1874
|
+
}
|
|
1875
|
+
</ul>
|
|
1876
|
+
</section>
|
|
1877
|
+
`
|
|
1878
|
+
}]
|
|
1879
|
+
}],
|
|
1880
|
+
ctorParameters: () => []
|
|
1881
|
+
});
|
|
1882
|
+
function felSetOption(key, value) {
|
|
1883
|
+
felOptions.update((o) => {
|
|
1884
|
+
o[key] = value;
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
var FelOptionToggleComponent = class FelOptionToggleComponent {
|
|
1888
|
+
option = input.required(...ngDevMode ? [{ debugName: "option" }] : /* istanbul ignore next */ []);
|
|
1889
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
1890
|
+
value = computed(() => felOptions()[this.option()], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
1891
|
+
toggle() {
|
|
1892
|
+
felSetOption(this.option(), !this.value());
|
|
1893
|
+
}
|
|
1894
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1895
|
+
minVersion: "12.0.0",
|
|
1896
|
+
version: "22.3.0",
|
|
1897
|
+
ngImport: i0,
|
|
1898
|
+
type: FelOptionToggleComponent,
|
|
1899
|
+
deps: [],
|
|
1900
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1901
|
+
});
|
|
1902
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1903
|
+
minVersion: "17.1.0",
|
|
1904
|
+
version: "22.3.0",
|
|
1905
|
+
type: FelOptionToggleComponent,
|
|
1906
|
+
isStandalone: true,
|
|
1907
|
+
selector: "fel-option-toggle",
|
|
1908
|
+
inputs: {
|
|
1909
|
+
option: {
|
|
1910
|
+
classPropertyName: "option",
|
|
1911
|
+
publicName: "option",
|
|
1912
|
+
isSignal: true,
|
|
1913
|
+
isRequired: true,
|
|
1914
|
+
transformFunction: null
|
|
1915
|
+
},
|
|
1916
|
+
label: {
|
|
1917
|
+
classPropertyName: "label",
|
|
1918
|
+
publicName: "label",
|
|
1919
|
+
isSignal: true,
|
|
1920
|
+
isRequired: true,
|
|
1921
|
+
transformFunction: null
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1924
|
+
ngImport: i0,
|
|
1925
|
+
template: `
|
|
1926
|
+
<div
|
|
1927
|
+
class="flex items-center justify-between gap-4"
|
|
1928
|
+
[attr.data-option]="option()"
|
|
1929
|
+
>
|
|
1930
|
+
<span>{{ label() | felT }}</span>
|
|
1931
|
+
<button
|
|
1932
|
+
ffButton="ui-click"
|
|
1933
|
+
class="btn btn-sm min-w-20"
|
|
1934
|
+
[class.btn-primary]="value()"
|
|
1935
|
+
(click)="toggle()"
|
|
1936
|
+
>
|
|
1937
|
+
{{ (value() ? 'fel.settings.on' : 'fel.settings.off') | felT }}
|
|
1938
|
+
</button>
|
|
1939
|
+
</div>
|
|
1940
|
+
`,
|
|
1941
|
+
isInline: true,
|
|
1942
|
+
dependencies: [{
|
|
1943
|
+
kind: "component",
|
|
1944
|
+
type: FFButtonComponent,
|
|
1945
|
+
selector: "button[ffButton]",
|
|
1946
|
+
inputs: [
|
|
1947
|
+
"ffButton",
|
|
1948
|
+
"ffSoundOffset",
|
|
1949
|
+
"ffHotkey",
|
|
1950
|
+
"ffHotkeyPreventDefault",
|
|
1951
|
+
"ffPadAction",
|
|
1952
|
+
"ffPadPriority",
|
|
1953
|
+
"ffPadLabel",
|
|
1954
|
+
"ffPadEnabled",
|
|
1955
|
+
"ffPadWithin",
|
|
1956
|
+
"ffTooltip",
|
|
1957
|
+
"ffTooltipDisabled",
|
|
1958
|
+
"ffTooltipPlacement"
|
|
1959
|
+
]
|
|
1960
|
+
}, {
|
|
1961
|
+
kind: "pipe",
|
|
1962
|
+
type: FelTextPipe,
|
|
1963
|
+
name: "felT"
|
|
1964
|
+
}],
|
|
1965
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1966
|
+
});
|
|
1967
|
+
};
|
|
1968
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1969
|
+
minVersion: "12.0.0",
|
|
1970
|
+
version: "22.3.0",
|
|
1971
|
+
ngImport: i0,
|
|
1972
|
+
type: FelOptionToggleComponent,
|
|
1973
|
+
decorators: [{
|
|
1974
|
+
type: Component,
|
|
1975
|
+
args: [{
|
|
1976
|
+
selector: "fel-option-toggle",
|
|
1977
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1978
|
+
imports: [FFButtonComponent, FelTextPipe],
|
|
1979
|
+
template: `
|
|
1980
|
+
<div
|
|
1981
|
+
class="flex items-center justify-between gap-4"
|
|
1982
|
+
[attr.data-option]="option()"
|
|
1983
|
+
>
|
|
1984
|
+
<span>{{ label() | felT }}</span>
|
|
1985
|
+
<button
|
|
1986
|
+
ffButton="ui-click"
|
|
1987
|
+
class="btn btn-sm min-w-20"
|
|
1988
|
+
[class.btn-primary]="value()"
|
|
1989
|
+
(click)="toggle()"
|
|
1990
|
+
>
|
|
1991
|
+
{{ (value() ? 'fel.settings.on' : 'fel.settings.off') | felT }}
|
|
1992
|
+
</button>
|
|
1993
|
+
</div>
|
|
1994
|
+
`
|
|
1995
|
+
}]
|
|
1996
|
+
}],
|
|
1997
|
+
propDecorators: {
|
|
1998
|
+
option: [{
|
|
1999
|
+
type: i0.Input,
|
|
2000
|
+
args: [{
|
|
2001
|
+
isSignal: true,
|
|
2002
|
+
alias: "option",
|
|
2003
|
+
required: true
|
|
2004
|
+
}]
|
|
2005
|
+
}],
|
|
2006
|
+
label: [{
|
|
2007
|
+
type: i0.Input,
|
|
2008
|
+
args: [{
|
|
2009
|
+
isSignal: true,
|
|
2010
|
+
alias: "label",
|
|
2011
|
+
required: true
|
|
2012
|
+
}]
|
|
2013
|
+
}]
|
|
2014
|
+
}
|
|
2015
|
+
});
|
|
2016
|
+
var FelOptionSliderComponent = class FelOptionSliderComponent {
|
|
2017
|
+
option = input.required(...ngDevMode ? [{ debugName: "option" }] : /* istanbul ignore next */ []);
|
|
2018
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
2019
|
+
min = input(0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
2020
|
+
max = input(1, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
2021
|
+
step = input(.05, ...ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []);
|
|
2022
|
+
value = computed(() => felOptions()[this.option()], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
2023
|
+
percent = computed(() => `${Math.round(this.value() * 100)}%`, ...ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []);
|
|
2024
|
+
set(event) {
|
|
2025
|
+
felSetOption(this.option(), Number(event.target.value));
|
|
2026
|
+
}
|
|
2027
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2028
|
+
minVersion: "12.0.0",
|
|
2029
|
+
version: "22.3.0",
|
|
2030
|
+
ngImport: i0,
|
|
2031
|
+
type: FelOptionSliderComponent,
|
|
2032
|
+
deps: [],
|
|
2033
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2034
|
+
});
|
|
2035
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2036
|
+
minVersion: "17.1.0",
|
|
2037
|
+
version: "22.3.0",
|
|
2038
|
+
type: FelOptionSliderComponent,
|
|
2039
|
+
isStandalone: true,
|
|
2040
|
+
selector: "fel-option-slider",
|
|
2041
|
+
inputs: {
|
|
2042
|
+
option: {
|
|
2043
|
+
classPropertyName: "option",
|
|
2044
|
+
publicName: "option",
|
|
2045
|
+
isSignal: true,
|
|
2046
|
+
isRequired: true,
|
|
2047
|
+
transformFunction: null
|
|
2048
|
+
},
|
|
2049
|
+
label: {
|
|
2050
|
+
classPropertyName: "label",
|
|
2051
|
+
publicName: "label",
|
|
2052
|
+
isSignal: true,
|
|
2053
|
+
isRequired: true,
|
|
2054
|
+
transformFunction: null
|
|
2055
|
+
},
|
|
2056
|
+
min: {
|
|
2057
|
+
classPropertyName: "min",
|
|
2058
|
+
publicName: "min",
|
|
2059
|
+
isSignal: true,
|
|
2060
|
+
isRequired: false,
|
|
2061
|
+
transformFunction: null
|
|
2062
|
+
},
|
|
2063
|
+
max: {
|
|
2064
|
+
classPropertyName: "max",
|
|
2065
|
+
publicName: "max",
|
|
2066
|
+
isSignal: true,
|
|
2067
|
+
isRequired: false,
|
|
2068
|
+
transformFunction: null
|
|
2069
|
+
},
|
|
2070
|
+
step: {
|
|
2071
|
+
classPropertyName: "step",
|
|
2072
|
+
publicName: "step",
|
|
2073
|
+
isSignal: true,
|
|
2074
|
+
isRequired: false,
|
|
2075
|
+
transformFunction: null
|
|
2076
|
+
}
|
|
2077
|
+
},
|
|
2078
|
+
ngImport: i0,
|
|
2079
|
+
template: `
|
|
2080
|
+
<label
|
|
2081
|
+
class="flex items-center justify-between gap-4"
|
|
2082
|
+
[attr.data-option]="option()"
|
|
2083
|
+
>
|
|
2084
|
+
<span>{{ label() | felT }}</span>
|
|
2085
|
+
<span class="flex items-center gap-2">
|
|
2086
|
+
<input
|
|
2087
|
+
type="range"
|
|
2088
|
+
class="range range-sm w-48"
|
|
2089
|
+
[min]="min()"
|
|
2090
|
+
[max]="max()"
|
|
2091
|
+
[step]="step()"
|
|
2092
|
+
[value]="value()"
|
|
2093
|
+
(change)="set($event)"
|
|
2094
|
+
/>
|
|
2095
|
+
<span class="w-12 text-right" [textContent]="percent()"></span>
|
|
2096
|
+
</span>
|
|
2097
|
+
</label>
|
|
2098
|
+
`,
|
|
2099
|
+
isInline: true,
|
|
2100
|
+
dependencies: [{
|
|
2101
|
+
kind: "pipe",
|
|
2102
|
+
type: FelTextPipe,
|
|
2103
|
+
name: "felT"
|
|
2104
|
+
}],
|
|
2105
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2106
|
+
});
|
|
2107
|
+
};
|
|
2108
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2109
|
+
minVersion: "12.0.0",
|
|
2110
|
+
version: "22.3.0",
|
|
2111
|
+
ngImport: i0,
|
|
2112
|
+
type: FelOptionSliderComponent,
|
|
2113
|
+
decorators: [{
|
|
2114
|
+
type: Component,
|
|
2115
|
+
args: [{
|
|
2116
|
+
selector: "fel-option-slider",
|
|
2117
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2118
|
+
imports: [FelTextPipe],
|
|
2119
|
+
template: `
|
|
2120
|
+
<label
|
|
2121
|
+
class="flex items-center justify-between gap-4"
|
|
2122
|
+
[attr.data-option]="option()"
|
|
2123
|
+
>
|
|
2124
|
+
<span>{{ label() | felT }}</span>
|
|
2125
|
+
<span class="flex items-center gap-2">
|
|
2126
|
+
<input
|
|
2127
|
+
type="range"
|
|
2128
|
+
class="range range-sm w-48"
|
|
2129
|
+
[min]="min()"
|
|
2130
|
+
[max]="max()"
|
|
2131
|
+
[step]="step()"
|
|
2132
|
+
[value]="value()"
|
|
2133
|
+
(change)="set($event)"
|
|
2134
|
+
/>
|
|
2135
|
+
<span class="w-12 text-right" [textContent]="percent()"></span>
|
|
2136
|
+
</span>
|
|
2137
|
+
</label>
|
|
2138
|
+
`
|
|
2139
|
+
}]
|
|
2140
|
+
}],
|
|
2141
|
+
propDecorators: {
|
|
2142
|
+
option: [{
|
|
2143
|
+
type: i0.Input,
|
|
2144
|
+
args: [{
|
|
2145
|
+
isSignal: true,
|
|
2146
|
+
alias: "option",
|
|
2147
|
+
required: true
|
|
2148
|
+
}]
|
|
2149
|
+
}],
|
|
2150
|
+
label: [{
|
|
2151
|
+
type: i0.Input,
|
|
2152
|
+
args: [{
|
|
2153
|
+
isSignal: true,
|
|
2154
|
+
alias: "label",
|
|
2155
|
+
required: true
|
|
2156
|
+
}]
|
|
2157
|
+
}],
|
|
2158
|
+
min: [{
|
|
2159
|
+
type: i0.Input,
|
|
2160
|
+
args: [{
|
|
2161
|
+
isSignal: true,
|
|
2162
|
+
alias: "min",
|
|
2163
|
+
required: false
|
|
2164
|
+
}]
|
|
2165
|
+
}],
|
|
2166
|
+
max: [{
|
|
2167
|
+
type: i0.Input,
|
|
2168
|
+
args: [{
|
|
2169
|
+
isSignal: true,
|
|
2170
|
+
alias: "max",
|
|
2171
|
+
required: false
|
|
2172
|
+
}]
|
|
2173
|
+
}],
|
|
2174
|
+
step: [{
|
|
2175
|
+
type: i0.Input,
|
|
2176
|
+
args: [{
|
|
2177
|
+
isSignal: true,
|
|
2178
|
+
alias: "step",
|
|
2179
|
+
required: false
|
|
2180
|
+
}]
|
|
2181
|
+
}]
|
|
2182
|
+
}
|
|
2183
|
+
});
|
|
2184
|
+
var FelSettingsAudioComponent = class FelSettingsAudioComponent {
|
|
2185
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2186
|
+
minVersion: "12.0.0",
|
|
2187
|
+
version: "22.3.0",
|
|
2188
|
+
ngImport: i0,
|
|
2189
|
+
type: FelSettingsAudioComponent,
|
|
2190
|
+
deps: [],
|
|
2191
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2192
|
+
});
|
|
2193
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2194
|
+
minVersion: "14.0.0",
|
|
2195
|
+
version: "22.3.0",
|
|
2196
|
+
type: FelSettingsAudioComponent,
|
|
2197
|
+
isStandalone: true,
|
|
2198
|
+
selector: "fel-settings-audio",
|
|
2199
|
+
ngImport: i0,
|
|
2200
|
+
template: `
|
|
2201
|
+
<fel-option-slider option="masterVolume" label="fel.audio.master" />
|
|
2202
|
+
<fel-option-toggle option="sfxPlay" label="fel.audio.sfx" />
|
|
2203
|
+
<fel-option-slider option="sfxVolume" label="fel.audio.sfx" />
|
|
2204
|
+
<fel-option-toggle option="bgmPlay" label="fel.audio.bgm" />
|
|
2205
|
+
<fel-option-slider option="bgmVolume" label="fel.audio.bgm" />
|
|
2206
|
+
<fel-option-toggle
|
|
2207
|
+
option="muteWhenUnfocused"
|
|
2208
|
+
label="fel.audio.muteWhenUnfocused"
|
|
2209
|
+
/>
|
|
2210
|
+
`,
|
|
2211
|
+
isInline: true,
|
|
2212
|
+
dependencies: [{
|
|
2213
|
+
kind: "component",
|
|
2214
|
+
type: FelOptionSliderComponent,
|
|
2215
|
+
selector: "fel-option-slider",
|
|
2216
|
+
inputs: [
|
|
2217
|
+
"option",
|
|
2218
|
+
"label",
|
|
2219
|
+
"min",
|
|
2220
|
+
"max",
|
|
2221
|
+
"step"
|
|
2222
|
+
]
|
|
2223
|
+
}, {
|
|
2224
|
+
kind: "component",
|
|
2225
|
+
type: FelOptionToggleComponent,
|
|
2226
|
+
selector: "fel-option-toggle",
|
|
2227
|
+
inputs: ["option", "label"]
|
|
2228
|
+
}],
|
|
2229
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2230
|
+
});
|
|
2231
|
+
};
|
|
2232
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2233
|
+
minVersion: "12.0.0",
|
|
2234
|
+
version: "22.3.0",
|
|
2235
|
+
ngImport: i0,
|
|
2236
|
+
type: FelSettingsAudioComponent,
|
|
2237
|
+
decorators: [{
|
|
2238
|
+
type: Component,
|
|
2239
|
+
args: [{
|
|
2240
|
+
selector: "fel-settings-audio",
|
|
2241
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2242
|
+
imports: [FelOptionSliderComponent, FelOptionToggleComponent],
|
|
2243
|
+
template: `
|
|
2244
|
+
<fel-option-slider option="masterVolume" label="fel.audio.master" />
|
|
2245
|
+
<fel-option-toggle option="sfxPlay" label="fel.audio.sfx" />
|
|
2246
|
+
<fel-option-slider option="sfxVolume" label="fel.audio.sfx" />
|
|
2247
|
+
<fel-option-toggle option="bgmPlay" label="fel.audio.bgm" />
|
|
2248
|
+
<fel-option-slider option="bgmVolume" label="fel.audio.bgm" />
|
|
2249
|
+
<fel-option-toggle
|
|
2250
|
+
option="muteWhenUnfocused"
|
|
2251
|
+
label="fel.audio.muteWhenUnfocused"
|
|
2252
|
+
/>
|
|
2253
|
+
`
|
|
2254
|
+
}]
|
|
2255
|
+
}]
|
|
2256
|
+
});
|
|
2257
|
+
const FAMILIES = [
|
|
2258
|
+
"auto",
|
|
2259
|
+
"xbox",
|
|
2260
|
+
"playstation",
|
|
2261
|
+
"switch",
|
|
2262
|
+
"switch2",
|
|
2263
|
+
"steam-controller",
|
|
2264
|
+
"steam-deck"
|
|
2265
|
+
];
|
|
2266
|
+
var FelSettingsControlsComponent = class FelSettingsControlsComponent {
|
|
2267
|
+
families = FAMILIES;
|
|
2268
|
+
current = computed(() => felOptions().controllerFamily, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
2269
|
+
set(family) {
|
|
2270
|
+
felSetOption("controllerFamily", family);
|
|
2271
|
+
}
|
|
2272
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2273
|
+
minVersion: "12.0.0",
|
|
2274
|
+
version: "22.3.0",
|
|
2275
|
+
ngImport: i0,
|
|
2276
|
+
type: FelSettingsControlsComponent,
|
|
2277
|
+
deps: [],
|
|
2278
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2279
|
+
});
|
|
2280
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2281
|
+
minVersion: "17.0.0",
|
|
2282
|
+
version: "22.3.0",
|
|
2283
|
+
type: FelSettingsControlsComponent,
|
|
2284
|
+
isStandalone: true,
|
|
2285
|
+
selector: "fel-settings-controls",
|
|
2286
|
+
ngImport: i0,
|
|
2287
|
+
template: `
|
|
2288
|
+
<div class="flex flex-col gap-2" data-option="controllerFamily">
|
|
2289
|
+
<span>{{ 'fel.controls.family' | felT }}</span>
|
|
2290
|
+
<span class="flex flex-wrap gap-1">
|
|
2291
|
+
@for (family of families; track family) {
|
|
2292
|
+
<button
|
|
2293
|
+
ffButton="ui-click"
|
|
2294
|
+
class="btn btn-sm"
|
|
2295
|
+
[class.btn-primary]="family === current()"
|
|
2296
|
+
[attr.data-family]="family"
|
|
2297
|
+
(click)="set(family)"
|
|
2298
|
+
>
|
|
2299
|
+
{{ 'fel.controls.family.' + family | felT }}
|
|
2300
|
+
</button>
|
|
2301
|
+
}
|
|
2302
|
+
</span>
|
|
2303
|
+
</div>
|
|
2304
|
+
`,
|
|
2305
|
+
isInline: true,
|
|
2306
|
+
dependencies: [{
|
|
2307
|
+
kind: "component",
|
|
2308
|
+
type: FFButtonComponent,
|
|
2309
|
+
selector: "button[ffButton]",
|
|
2310
|
+
inputs: [
|
|
2311
|
+
"ffButton",
|
|
2312
|
+
"ffSoundOffset",
|
|
2313
|
+
"ffHotkey",
|
|
2314
|
+
"ffHotkeyPreventDefault",
|
|
2315
|
+
"ffPadAction",
|
|
2316
|
+
"ffPadPriority",
|
|
2317
|
+
"ffPadLabel",
|
|
2318
|
+
"ffPadEnabled",
|
|
2319
|
+
"ffPadWithin",
|
|
2320
|
+
"ffTooltip",
|
|
2321
|
+
"ffTooltipDisabled",
|
|
2322
|
+
"ffTooltipPlacement"
|
|
2323
|
+
]
|
|
2324
|
+
}, {
|
|
2325
|
+
kind: "pipe",
|
|
2326
|
+
type: FelTextPipe,
|
|
2327
|
+
name: "felT"
|
|
2328
|
+
}],
|
|
2329
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2330
|
+
});
|
|
2331
|
+
};
|
|
2332
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2333
|
+
minVersion: "12.0.0",
|
|
2334
|
+
version: "22.3.0",
|
|
2335
|
+
ngImport: i0,
|
|
2336
|
+
type: FelSettingsControlsComponent,
|
|
2337
|
+
decorators: [{
|
|
2338
|
+
type: Component,
|
|
2339
|
+
args: [{
|
|
2340
|
+
selector: "fel-settings-controls",
|
|
2341
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2342
|
+
imports: [FFButtonComponent, FelTextPipe],
|
|
2343
|
+
template: `
|
|
2344
|
+
<div class="flex flex-col gap-2" data-option="controllerFamily">
|
|
2345
|
+
<span>{{ 'fel.controls.family' | felT }}</span>
|
|
2346
|
+
<span class="flex flex-wrap gap-1">
|
|
2347
|
+
@for (family of families; track family) {
|
|
2348
|
+
<button
|
|
2349
|
+
ffButton="ui-click"
|
|
2350
|
+
class="btn btn-sm"
|
|
2351
|
+
[class.btn-primary]="family === current()"
|
|
2352
|
+
[attr.data-family]="family"
|
|
2353
|
+
(click)="set(family)"
|
|
2354
|
+
>
|
|
2355
|
+
{{ 'fel.controls.family.' + family | felT }}
|
|
2356
|
+
</button>
|
|
2357
|
+
}
|
|
2358
|
+
</span>
|
|
2359
|
+
</div>
|
|
2360
|
+
`
|
|
2361
|
+
}]
|
|
2362
|
+
}]
|
|
2363
|
+
});
|
|
2364
|
+
const TICK_RATES = [
|
|
2365
|
+
1,
|
|
2366
|
+
5,
|
|
2367
|
+
10,
|
|
2368
|
+
50,
|
|
2369
|
+
100
|
|
2370
|
+
];
|
|
2371
|
+
var FelSettingsDebugComponent = class FelSettingsDebugComponent {
|
|
2372
|
+
tickRates = TICK_RATES;
|
|
2373
|
+
hasDevTools = !!felHost()?.window;
|
|
2374
|
+
tickRate = computed(() => felOptions().debugTickMultiplier, ...ngDevMode ? [{ debugName: "tickRate" }] : /* istanbul ignore next */ []);
|
|
2375
|
+
setTickRate(rate) {
|
|
2376
|
+
felSetOption("debugTickMultiplier", rate);
|
|
2377
|
+
}
|
|
2378
|
+
openDevTools() {
|
|
2379
|
+
felHost()?.window?.toggleDevTools();
|
|
2380
|
+
}
|
|
2381
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2382
|
+
minVersion: "12.0.0",
|
|
2383
|
+
version: "22.3.0",
|
|
2384
|
+
ngImport: i0,
|
|
2385
|
+
type: FelSettingsDebugComponent,
|
|
2386
|
+
deps: [],
|
|
2387
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2388
|
+
});
|
|
2389
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2390
|
+
minVersion: "17.0.0",
|
|
2391
|
+
version: "22.3.0",
|
|
2392
|
+
type: FelSettingsDebugComponent,
|
|
2393
|
+
isStandalone: true,
|
|
2394
|
+
selector: "fel-settings-debug",
|
|
2395
|
+
ngImport: i0,
|
|
2396
|
+
template: `
|
|
2397
|
+
<div
|
|
2398
|
+
class="flex items-center justify-between gap-4"
|
|
2399
|
+
data-option="debugTickMultiplier"
|
|
2400
|
+
>
|
|
2401
|
+
<span>{{ 'fel.debug.tickRate' | felT }}</span>
|
|
2402
|
+
<span class="flex flex-wrap gap-1">
|
|
2403
|
+
@for (rate of tickRates; track rate) {
|
|
2404
|
+
<button
|
|
2405
|
+
ffButton="ui-click"
|
|
2406
|
+
class="btn btn-sm"
|
|
2407
|
+
[class.btn-primary]="rate === tickRate()"
|
|
2408
|
+
(click)="setTickRate(rate)"
|
|
2409
|
+
>
|
|
2410
|
+
{{ rate }}×
|
|
2411
|
+
</button>
|
|
2412
|
+
}
|
|
2413
|
+
</span>
|
|
2414
|
+
</div>
|
|
2415
|
+
<fel-option-toggle option="gameloopPaused" label="fel.debug.paused" />
|
|
2416
|
+
@if (hasDevTools) {
|
|
2417
|
+
<button
|
|
2418
|
+
ffButton="ui-click"
|
|
2419
|
+
class="btn btn-sm self-start"
|
|
2420
|
+
(click)="openDevTools()"
|
|
2421
|
+
>
|
|
2422
|
+
{{ 'fel.debug.devtools' | felT }}
|
|
2423
|
+
</button>
|
|
2424
|
+
}
|
|
2425
|
+
`,
|
|
2426
|
+
isInline: true,
|
|
2427
|
+
dependencies: [
|
|
2428
|
+
{
|
|
2429
|
+
kind: "component",
|
|
2430
|
+
type: FFButtonComponent,
|
|
2431
|
+
selector: "button[ffButton]",
|
|
2432
|
+
inputs: [
|
|
2433
|
+
"ffButton",
|
|
2434
|
+
"ffSoundOffset",
|
|
2435
|
+
"ffHotkey",
|
|
2436
|
+
"ffHotkeyPreventDefault",
|
|
2437
|
+
"ffPadAction",
|
|
2438
|
+
"ffPadPriority",
|
|
2439
|
+
"ffPadLabel",
|
|
2440
|
+
"ffPadEnabled",
|
|
2441
|
+
"ffPadWithin",
|
|
2442
|
+
"ffTooltip",
|
|
2443
|
+
"ffTooltipDisabled",
|
|
2444
|
+
"ffTooltipPlacement"
|
|
2445
|
+
]
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
kind: "component",
|
|
2449
|
+
type: FelOptionToggleComponent,
|
|
2450
|
+
selector: "fel-option-toggle",
|
|
2451
|
+
inputs: ["option", "label"]
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
kind: "pipe",
|
|
2455
|
+
type: FelTextPipe,
|
|
2456
|
+
name: "felT"
|
|
2457
|
+
}
|
|
2458
|
+
],
|
|
2459
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2460
|
+
});
|
|
2461
|
+
};
|
|
2462
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2463
|
+
minVersion: "12.0.0",
|
|
2464
|
+
version: "22.3.0",
|
|
2465
|
+
ngImport: i0,
|
|
2466
|
+
type: FelSettingsDebugComponent,
|
|
2467
|
+
decorators: [{
|
|
2468
|
+
type: Component,
|
|
2469
|
+
args: [{
|
|
2470
|
+
selector: "fel-settings-debug",
|
|
2471
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2472
|
+
imports: [
|
|
2473
|
+
FFButtonComponent,
|
|
2474
|
+
FelTextPipe,
|
|
2475
|
+
FelOptionToggleComponent
|
|
2476
|
+
],
|
|
2477
|
+
template: `
|
|
2478
|
+
<div
|
|
2479
|
+
class="flex items-center justify-between gap-4"
|
|
2480
|
+
data-option="debugTickMultiplier"
|
|
2481
|
+
>
|
|
2482
|
+
<span>{{ 'fel.debug.tickRate' | felT }}</span>
|
|
2483
|
+
<span class="flex flex-wrap gap-1">
|
|
2484
|
+
@for (rate of tickRates; track rate) {
|
|
2485
|
+
<button
|
|
2486
|
+
ffButton="ui-click"
|
|
2487
|
+
class="btn btn-sm"
|
|
2488
|
+
[class.btn-primary]="rate === tickRate()"
|
|
2489
|
+
(click)="setTickRate(rate)"
|
|
2490
|
+
>
|
|
2491
|
+
{{ rate }}×
|
|
2492
|
+
</button>
|
|
2493
|
+
}
|
|
2494
|
+
</span>
|
|
2495
|
+
</div>
|
|
2496
|
+
<fel-option-toggle option="gameloopPaused" label="fel.debug.paused" />
|
|
2497
|
+
@if (hasDevTools) {
|
|
2498
|
+
<button
|
|
2499
|
+
ffButton="ui-click"
|
|
2500
|
+
class="btn btn-sm self-start"
|
|
2501
|
+
(click)="openDevTools()"
|
|
2502
|
+
>
|
|
2503
|
+
{{ 'fel.debug.devtools' | felT }}
|
|
2504
|
+
</button>
|
|
2505
|
+
}
|
|
2506
|
+
`
|
|
2507
|
+
}]
|
|
2508
|
+
}]
|
|
2509
|
+
});
|
|
2510
|
+
const MOTION = [
|
|
2511
|
+
"system",
|
|
2512
|
+
"reduce",
|
|
2513
|
+
"full"
|
|
2514
|
+
];
|
|
2515
|
+
const WINDOW_SIZES = [
|
|
2516
|
+
[1280, 720],
|
|
2517
|
+
[1600, 900],
|
|
2518
|
+
[1920, 1080],
|
|
2519
|
+
[2560, 1440]
|
|
2520
|
+
];
|
|
2521
|
+
var FelSettingsDisplayComponent = class FelSettingsDisplayComponent {
|
|
2522
|
+
motion = MOTION;
|
|
2523
|
+
windowState = signal(void 0, ...ngDevMode ? [{ debugName: "windowState" }] : /* istanbul ignore next */ []);
|
|
2524
|
+
motionPreference = computed(() => felOptions().motionPreference, ...ngDevMode ? [{ debugName: "motionPreference" }] : /* istanbul ignore next */ []);
|
|
2525
|
+
sizesThatFit = computed(() => {
|
|
2526
|
+
const state = this.windowState();
|
|
2527
|
+
return state ? WINDOW_SIZES.filter(([w, h]) => w <= state.maxWidth && h <= state.maxHeight && w >= state.minWidth) : [];
|
|
2528
|
+
}, ...ngDevMode ? [{ debugName: "sizesThatFit" }] : /* istanbul ignore next */ []);
|
|
2529
|
+
constructor() {
|
|
2530
|
+
const win = felHost()?.window;
|
|
2531
|
+
if (!win) return;
|
|
2532
|
+
win.state().then((state) => this.windowState.update((current) => current ?? state));
|
|
2533
|
+
const stop = win.onStateChange((state) => this.windowState.set(state));
|
|
2534
|
+
inject(DestroyRef).onDestroy(stop);
|
|
2535
|
+
}
|
|
2536
|
+
setMotion(choice) {
|
|
2537
|
+
felSetOption("motionPreference", choice);
|
|
2538
|
+
}
|
|
2539
|
+
async toggleFullscreen(state) {
|
|
2540
|
+
const next = await felHost()?.window?.setFullscreen(!state.fullscreen);
|
|
2541
|
+
if (next) this.windowState.set(next);
|
|
2542
|
+
}
|
|
2543
|
+
async setSize([width, height]) {
|
|
2544
|
+
const next = await felHost()?.window?.setSize(width, height);
|
|
2545
|
+
if (next) this.windowState.set(next);
|
|
2546
|
+
}
|
|
2547
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2548
|
+
minVersion: "12.0.0",
|
|
2549
|
+
version: "22.3.0",
|
|
2550
|
+
ngImport: i0,
|
|
2551
|
+
type: FelSettingsDisplayComponent,
|
|
2552
|
+
deps: [],
|
|
2553
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2554
|
+
});
|
|
2555
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2556
|
+
minVersion: "17.0.0",
|
|
2557
|
+
version: "22.3.0",
|
|
2558
|
+
type: FelSettingsDisplayComponent,
|
|
2559
|
+
isStandalone: true,
|
|
2560
|
+
selector: "fel-settings-display",
|
|
2561
|
+
ngImport: i0,
|
|
2562
|
+
template: `
|
|
2563
|
+
<fel-option-slider
|
|
2564
|
+
option="uiScale"
|
|
2565
|
+
label="fel.display.uiScale"
|
|
2566
|
+
[min]="0.75"
|
|
2567
|
+
[max]="1.5"
|
|
2568
|
+
/>
|
|
2569
|
+
<fel-option-toggle option="cleanFont" label="fel.display.cleanFont" />
|
|
2570
|
+
<div
|
|
2571
|
+
class="flex items-center justify-between gap-4"
|
|
2572
|
+
data-option="motionPreference"
|
|
2573
|
+
>
|
|
2574
|
+
<span>{{ 'fel.display.motion' | felT }}</span>
|
|
2575
|
+
<span class="join">
|
|
2576
|
+
@for (choice of motion; track choice) {
|
|
2577
|
+
<button
|
|
2578
|
+
ffButton="ui-click"
|
|
2579
|
+
class="btn btn-sm join-item"
|
|
2580
|
+
[class.btn-primary]="choice === motionPreference()"
|
|
2581
|
+
(click)="setMotion(choice)"
|
|
2582
|
+
>
|
|
2583
|
+
{{ 'fel.display.motion.' + choice | felT }}
|
|
2584
|
+
</button>
|
|
2585
|
+
}
|
|
2586
|
+
</span>
|
|
2587
|
+
</div>
|
|
2588
|
+
@if (windowState(); as state) {
|
|
2589
|
+
<div
|
|
2590
|
+
class="flex items-center justify-between gap-4"
|
|
2591
|
+
data-option="fullscreen"
|
|
2592
|
+
>
|
|
2593
|
+
<span>{{ 'fel.display.fullscreen' | felT }}</span>
|
|
2594
|
+
<button
|
|
2595
|
+
ffButton="ui-click"
|
|
2596
|
+
class="btn btn-sm min-w-20"
|
|
2597
|
+
[class.btn-primary]="state.fullscreen"
|
|
2598
|
+
(click)="toggleFullscreen(state)"
|
|
2599
|
+
>
|
|
2600
|
+
{{
|
|
2601
|
+
(state.fullscreen ? 'fel.settings.on' : 'fel.settings.off') | felT
|
|
2602
|
+
}}
|
|
2603
|
+
</button>
|
|
2604
|
+
</div>
|
|
2605
|
+
@if (!state.fullscreen) {
|
|
2606
|
+
<div
|
|
2607
|
+
class="flex items-center justify-between gap-4"
|
|
2608
|
+
data-option="windowSize"
|
|
2609
|
+
>
|
|
2610
|
+
<span>{{ 'fel.display.windowSize' | felT }}</span>
|
|
2611
|
+
<span class="flex flex-wrap gap-1">
|
|
2612
|
+
@for (size of sizesThatFit(); track size[0]) {
|
|
2613
|
+
<button
|
|
2614
|
+
ffButton="ui-click"
|
|
2615
|
+
class="btn btn-sm"
|
|
2616
|
+
[class.btn-primary]="
|
|
2617
|
+
size[0] === state.width && size[1] === state.height
|
|
2618
|
+
"
|
|
2619
|
+
(click)="setSize(size)"
|
|
2620
|
+
>
|
|
2621
|
+
{{ size[0] }}×{{ size[1] }}
|
|
2622
|
+
</button>
|
|
2623
|
+
}
|
|
2624
|
+
</span>
|
|
2625
|
+
</div>
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
`,
|
|
2629
|
+
isInline: true,
|
|
2630
|
+
dependencies: [
|
|
2631
|
+
{
|
|
2632
|
+
kind: "component",
|
|
2633
|
+
type: FFButtonComponent,
|
|
2634
|
+
selector: "button[ffButton]",
|
|
2635
|
+
inputs: [
|
|
2636
|
+
"ffButton",
|
|
2637
|
+
"ffSoundOffset",
|
|
2638
|
+
"ffHotkey",
|
|
2639
|
+
"ffHotkeyPreventDefault",
|
|
2640
|
+
"ffPadAction",
|
|
2641
|
+
"ffPadPriority",
|
|
2642
|
+
"ffPadLabel",
|
|
2643
|
+
"ffPadEnabled",
|
|
2644
|
+
"ffPadWithin",
|
|
2645
|
+
"ffTooltip",
|
|
2646
|
+
"ffTooltipDisabled",
|
|
2647
|
+
"ffTooltipPlacement"
|
|
2648
|
+
]
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
kind: "component",
|
|
2652
|
+
type: FelOptionSliderComponent,
|
|
2653
|
+
selector: "fel-option-slider",
|
|
2654
|
+
inputs: [
|
|
2655
|
+
"option",
|
|
2656
|
+
"label",
|
|
2657
|
+
"min",
|
|
2658
|
+
"max",
|
|
2659
|
+
"step"
|
|
2660
|
+
]
|
|
2661
|
+
},
|
|
2662
|
+
{
|
|
2663
|
+
kind: "component",
|
|
2664
|
+
type: FelOptionToggleComponent,
|
|
2665
|
+
selector: "fel-option-toggle",
|
|
2666
|
+
inputs: ["option", "label"]
|
|
2667
|
+
},
|
|
2668
|
+
{
|
|
2669
|
+
kind: "pipe",
|
|
2670
|
+
type: FelTextPipe,
|
|
2671
|
+
name: "felT"
|
|
2672
|
+
}
|
|
2673
|
+
],
|
|
2674
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2675
|
+
});
|
|
2676
|
+
};
|
|
2677
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2678
|
+
minVersion: "12.0.0",
|
|
2679
|
+
version: "22.3.0",
|
|
2680
|
+
ngImport: i0,
|
|
2681
|
+
type: FelSettingsDisplayComponent,
|
|
2682
|
+
decorators: [{
|
|
2683
|
+
type: Component,
|
|
2684
|
+
args: [{
|
|
2685
|
+
selector: "fel-settings-display",
|
|
2686
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2687
|
+
imports: [
|
|
2688
|
+
FFButtonComponent,
|
|
2689
|
+
FelTextPipe,
|
|
2690
|
+
FelOptionSliderComponent,
|
|
2691
|
+
FelOptionToggleComponent
|
|
2692
|
+
],
|
|
2693
|
+
template: `
|
|
2694
|
+
<fel-option-slider
|
|
2695
|
+
option="uiScale"
|
|
2696
|
+
label="fel.display.uiScale"
|
|
2697
|
+
[min]="0.75"
|
|
2698
|
+
[max]="1.5"
|
|
2699
|
+
/>
|
|
2700
|
+
<fel-option-toggle option="cleanFont" label="fel.display.cleanFont" />
|
|
2701
|
+
<div
|
|
2702
|
+
class="flex items-center justify-between gap-4"
|
|
2703
|
+
data-option="motionPreference"
|
|
2704
|
+
>
|
|
2705
|
+
<span>{{ 'fel.display.motion' | felT }}</span>
|
|
2706
|
+
<span class="join">
|
|
2707
|
+
@for (choice of motion; track choice) {
|
|
2708
|
+
<button
|
|
2709
|
+
ffButton="ui-click"
|
|
2710
|
+
class="btn btn-sm join-item"
|
|
2711
|
+
[class.btn-primary]="choice === motionPreference()"
|
|
2712
|
+
(click)="setMotion(choice)"
|
|
2713
|
+
>
|
|
2714
|
+
{{ 'fel.display.motion.' + choice | felT }}
|
|
2715
|
+
</button>
|
|
2716
|
+
}
|
|
2717
|
+
</span>
|
|
2718
|
+
</div>
|
|
2719
|
+
@if (windowState(); as state) {
|
|
2720
|
+
<div
|
|
2721
|
+
class="flex items-center justify-between gap-4"
|
|
2722
|
+
data-option="fullscreen"
|
|
2723
|
+
>
|
|
2724
|
+
<span>{{ 'fel.display.fullscreen' | felT }}</span>
|
|
2725
|
+
<button
|
|
2726
|
+
ffButton="ui-click"
|
|
2727
|
+
class="btn btn-sm min-w-20"
|
|
2728
|
+
[class.btn-primary]="state.fullscreen"
|
|
2729
|
+
(click)="toggleFullscreen(state)"
|
|
2730
|
+
>
|
|
2731
|
+
{{
|
|
2732
|
+
(state.fullscreen ? 'fel.settings.on' : 'fel.settings.off') | felT
|
|
2733
|
+
}}
|
|
2734
|
+
</button>
|
|
2735
|
+
</div>
|
|
2736
|
+
@if (!state.fullscreen) {
|
|
2737
|
+
<div
|
|
2738
|
+
class="flex items-center justify-between gap-4"
|
|
2739
|
+
data-option="windowSize"
|
|
2740
|
+
>
|
|
2741
|
+
<span>{{ 'fel.display.windowSize' | felT }}</span>
|
|
2742
|
+
<span class="flex flex-wrap gap-1">
|
|
2743
|
+
@for (size of sizesThatFit(); track size[0]) {
|
|
2744
|
+
<button
|
|
2745
|
+
ffButton="ui-click"
|
|
2746
|
+
class="btn btn-sm"
|
|
2747
|
+
[class.btn-primary]="
|
|
2748
|
+
size[0] === state.width && size[1] === state.height
|
|
2749
|
+
"
|
|
2750
|
+
(click)="setSize(size)"
|
|
2751
|
+
>
|
|
2752
|
+
{{ size[0] }}×{{ size[1] }}
|
|
2753
|
+
</button>
|
|
2754
|
+
}
|
|
2755
|
+
</span>
|
|
2756
|
+
</div>
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
`
|
|
2760
|
+
}]
|
|
2761
|
+
}],
|
|
2762
|
+
ctorParameters: () => []
|
|
2763
|
+
});
|
|
2764
|
+
const AUTOSAVE_TICKS = [
|
|
2765
|
+
15,
|
|
2766
|
+
30,
|
|
2767
|
+
60,
|
|
2768
|
+
300
|
|
2769
|
+
];
|
|
2770
|
+
var FelSettingsGameComponent = class FelSettingsGameComponent {
|
|
2771
|
+
locales = input(["en"], ...ngDevMode ? [{ debugName: "locales" }] : /* istanbul ignore next */ []);
|
|
2772
|
+
notificationCategories = input([], ...ngDevMode ? [{ debugName: "notificationCategories" }] : /* istanbul ignore next */ []);
|
|
2773
|
+
isDesktop = felIsDesktop();
|
|
2774
|
+
autosaveTicks = AUTOSAVE_TICKS;
|
|
2775
|
+
locale = i18nLocale;
|
|
2776
|
+
notifications = computed(() => felOptions().desktopNotifications, ...ngDevMode ? [{ debugName: "notifications" }] : /* istanbul ignore next */ []);
|
|
2777
|
+
autosave = computed(() => felOptions().autosaveInterval, ...ngDevMode ? [{ debugName: "autosave" }] : /* istanbul ignore next */ []);
|
|
2778
|
+
setLocale(code) {
|
|
2779
|
+
felSetLocale(code);
|
|
2780
|
+
}
|
|
2781
|
+
async toggleNotifications() {
|
|
2782
|
+
const next = !this.notifications();
|
|
2783
|
+
if (next) await felNotifyRequestPermission();
|
|
2784
|
+
felSetOption("desktopNotifications", next);
|
|
2785
|
+
}
|
|
2786
|
+
isCategoryOn(id) {
|
|
2787
|
+
return felOptions().notificationKinds[id] !== false;
|
|
2788
|
+
}
|
|
2789
|
+
toggleCategory(id) {
|
|
2790
|
+
const next = !this.isCategoryOn(id);
|
|
2791
|
+
felOptions.update((o) => {
|
|
2792
|
+
o.notificationKinds[id] = next;
|
|
2793
|
+
});
|
|
2794
|
+
}
|
|
2795
|
+
setAutosave(ticks) {
|
|
2796
|
+
felSetOption("autosaveInterval", ticks);
|
|
2797
|
+
}
|
|
2798
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2799
|
+
minVersion: "12.0.0",
|
|
2800
|
+
version: "22.3.0",
|
|
2801
|
+
ngImport: i0,
|
|
2802
|
+
type: FelSettingsGameComponent,
|
|
2803
|
+
deps: [],
|
|
2804
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2805
|
+
});
|
|
2806
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2807
|
+
minVersion: "17.0.0",
|
|
2808
|
+
version: "22.3.0",
|
|
2809
|
+
type: FelSettingsGameComponent,
|
|
2810
|
+
isStandalone: true,
|
|
2811
|
+
selector: "fel-settings-game",
|
|
2812
|
+
inputs: {
|
|
2813
|
+
locales: {
|
|
2814
|
+
classPropertyName: "locales",
|
|
2815
|
+
publicName: "locales",
|
|
2816
|
+
isSignal: true,
|
|
2817
|
+
isRequired: false,
|
|
2818
|
+
transformFunction: null
|
|
2819
|
+
},
|
|
2820
|
+
notificationCategories: {
|
|
2821
|
+
classPropertyName: "notificationCategories",
|
|
2822
|
+
publicName: "notificationCategories",
|
|
2823
|
+
isSignal: true,
|
|
2824
|
+
isRequired: false,
|
|
2825
|
+
transformFunction: null
|
|
2826
|
+
}
|
|
2827
|
+
},
|
|
2828
|
+
ngImport: i0,
|
|
2829
|
+
template: `
|
|
2830
|
+
<div class="flex items-center justify-between gap-4" data-option="locale">
|
|
2831
|
+
<span>{{ 'fel.game.language' | felT }}</span>
|
|
2832
|
+
<span class="flex flex-wrap gap-1">
|
|
2833
|
+
@for (code of locales(); track code) {
|
|
2834
|
+
<button
|
|
2835
|
+
ffButton="ui-click"
|
|
2836
|
+
class="btn btn-sm"
|
|
2837
|
+
[class.btn-primary]="code === locale()"
|
|
2838
|
+
[attr.data-locale]="code"
|
|
2839
|
+
(click)="setLocale(code)"
|
|
2840
|
+
>
|
|
2841
|
+
{{ code }}
|
|
2842
|
+
</button>
|
|
2843
|
+
}
|
|
2844
|
+
</span>
|
|
2845
|
+
</div>
|
|
2846
|
+
@if (isDesktop) {
|
|
2847
|
+
<fel-option-toggle
|
|
2848
|
+
option="runInBackground"
|
|
2849
|
+
label="fel.game.runInBackground"
|
|
2850
|
+
/>
|
|
2851
|
+
<fel-option-toggle option="flashTaskbarOnAlerts" label="fel.game.flash" />
|
|
2852
|
+
}
|
|
2853
|
+
<div
|
|
2854
|
+
class="flex items-center justify-between gap-4"
|
|
2855
|
+
data-option="desktopNotifications"
|
|
2856
|
+
>
|
|
2857
|
+
<span>{{ 'fel.game.notifications' | felT }}</span>
|
|
2858
|
+
<button
|
|
2859
|
+
ffButton="ui-click"
|
|
2860
|
+
class="btn btn-sm min-w-20"
|
|
2861
|
+
[class.btn-primary]="notifications()"
|
|
2862
|
+
(click)="toggleNotifications()"
|
|
2863
|
+
>
|
|
2864
|
+
{{ (notifications() ? 'fel.settings.on' : 'fel.settings.off') | felT }}
|
|
2865
|
+
</button>
|
|
2866
|
+
</div>
|
|
2867
|
+
@if (notifications()) {
|
|
2868
|
+
@for (category of notificationCategories(); track category.id) {
|
|
2869
|
+
<div
|
|
2870
|
+
class="flex items-center justify-between gap-4 pl-4"
|
|
2871
|
+
[attr.data-category]="category.id"
|
|
2872
|
+
>
|
|
2873
|
+
<span>{{ category.label | felT }}</span>
|
|
2874
|
+
<button
|
|
2875
|
+
ffButton="ui-click"
|
|
2876
|
+
class="btn btn-xs min-w-16"
|
|
2877
|
+
[class.btn-primary]="isCategoryOn(category.id)"
|
|
2878
|
+
(click)="toggleCategory(category.id)"
|
|
2879
|
+
>
|
|
2880
|
+
{{
|
|
2881
|
+
(isCategoryOn(category.id)
|
|
2882
|
+
? 'fel.settings.on'
|
|
2883
|
+
: 'fel.settings.off'
|
|
2884
|
+
) | felT
|
|
2885
|
+
}}
|
|
2886
|
+
</button>
|
|
2887
|
+
</div>
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
<div
|
|
2891
|
+
class="flex items-center justify-between gap-4"
|
|
2892
|
+
data-option="autosaveInterval"
|
|
2893
|
+
>
|
|
2894
|
+
<span>{{ 'fel.game.autosave' | felT }}</span>
|
|
2895
|
+
<span class="flex flex-wrap gap-1">
|
|
2896
|
+
@for (ticks of autosaveTicks; track ticks) {
|
|
2897
|
+
<button
|
|
2898
|
+
ffButton="ui-click"
|
|
2899
|
+
class="btn btn-sm"
|
|
2900
|
+
[class.btn-primary]="ticks === autosave()"
|
|
2901
|
+
(click)="setAutosave(ticks)"
|
|
2902
|
+
>
|
|
2903
|
+
{{ 'fel.game.autosaveTicks' | felT: { count: ticks } }}
|
|
2904
|
+
</button>
|
|
2905
|
+
}
|
|
2906
|
+
</span>
|
|
2907
|
+
</div>
|
|
2908
|
+
<fel-save-panel />
|
|
2909
|
+
`,
|
|
2910
|
+
isInline: true,
|
|
2911
|
+
dependencies: [
|
|
2912
|
+
{
|
|
2913
|
+
kind: "component",
|
|
2914
|
+
type: FFButtonComponent,
|
|
2915
|
+
selector: "button[ffButton]",
|
|
2916
|
+
inputs: [
|
|
2917
|
+
"ffButton",
|
|
2918
|
+
"ffSoundOffset",
|
|
2919
|
+
"ffHotkey",
|
|
2920
|
+
"ffHotkeyPreventDefault",
|
|
2921
|
+
"ffPadAction",
|
|
2922
|
+
"ffPadPriority",
|
|
2923
|
+
"ffPadLabel",
|
|
2924
|
+
"ffPadEnabled",
|
|
2925
|
+
"ffPadWithin",
|
|
2926
|
+
"ffTooltip",
|
|
2927
|
+
"ffTooltipDisabled",
|
|
2928
|
+
"ffTooltipPlacement"
|
|
2929
|
+
]
|
|
2930
|
+
},
|
|
2931
|
+
{
|
|
2932
|
+
kind: "component",
|
|
2933
|
+
type: FelOptionToggleComponent,
|
|
2934
|
+
selector: "fel-option-toggle",
|
|
2935
|
+
inputs: ["option", "label"]
|
|
2936
|
+
},
|
|
2937
|
+
{
|
|
2938
|
+
kind: "component",
|
|
2939
|
+
type: FelSavePanelComponent,
|
|
2940
|
+
selector: "fel-save-panel"
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
kind: "pipe",
|
|
2944
|
+
type: FelTextPipe,
|
|
2945
|
+
name: "felT"
|
|
2946
|
+
}
|
|
2947
|
+
],
|
|
2948
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2949
|
+
});
|
|
2950
|
+
};
|
|
2951
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2952
|
+
minVersion: "12.0.0",
|
|
2953
|
+
version: "22.3.0",
|
|
2954
|
+
ngImport: i0,
|
|
2955
|
+
type: FelSettingsGameComponent,
|
|
2956
|
+
decorators: [{
|
|
2957
|
+
type: Component,
|
|
2958
|
+
args: [{
|
|
2959
|
+
selector: "fel-settings-game",
|
|
2960
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2961
|
+
imports: [
|
|
2962
|
+
FFButtonComponent,
|
|
2963
|
+
FelTextPipe,
|
|
2964
|
+
FelOptionToggleComponent,
|
|
2965
|
+
FelSavePanelComponent
|
|
2966
|
+
],
|
|
2967
|
+
template: `
|
|
2968
|
+
<div class="flex items-center justify-between gap-4" data-option="locale">
|
|
2969
|
+
<span>{{ 'fel.game.language' | felT }}</span>
|
|
2970
|
+
<span class="flex flex-wrap gap-1">
|
|
2971
|
+
@for (code of locales(); track code) {
|
|
2972
|
+
<button
|
|
2973
|
+
ffButton="ui-click"
|
|
2974
|
+
class="btn btn-sm"
|
|
2975
|
+
[class.btn-primary]="code === locale()"
|
|
2976
|
+
[attr.data-locale]="code"
|
|
2977
|
+
(click)="setLocale(code)"
|
|
2978
|
+
>
|
|
2979
|
+
{{ code }}
|
|
2980
|
+
</button>
|
|
2981
|
+
}
|
|
2982
|
+
</span>
|
|
2983
|
+
</div>
|
|
2984
|
+
@if (isDesktop) {
|
|
2985
|
+
<fel-option-toggle
|
|
2986
|
+
option="runInBackground"
|
|
2987
|
+
label="fel.game.runInBackground"
|
|
2988
|
+
/>
|
|
2989
|
+
<fel-option-toggle option="flashTaskbarOnAlerts" label="fel.game.flash" />
|
|
2990
|
+
}
|
|
2991
|
+
<div
|
|
2992
|
+
class="flex items-center justify-between gap-4"
|
|
2993
|
+
data-option="desktopNotifications"
|
|
2994
|
+
>
|
|
2995
|
+
<span>{{ 'fel.game.notifications' | felT }}</span>
|
|
2996
|
+
<button
|
|
2997
|
+
ffButton="ui-click"
|
|
2998
|
+
class="btn btn-sm min-w-20"
|
|
2999
|
+
[class.btn-primary]="notifications()"
|
|
3000
|
+
(click)="toggleNotifications()"
|
|
3001
|
+
>
|
|
3002
|
+
{{ (notifications() ? 'fel.settings.on' : 'fel.settings.off') | felT }}
|
|
3003
|
+
</button>
|
|
3004
|
+
</div>
|
|
3005
|
+
@if (notifications()) {
|
|
3006
|
+
@for (category of notificationCategories(); track category.id) {
|
|
3007
|
+
<div
|
|
3008
|
+
class="flex items-center justify-between gap-4 pl-4"
|
|
3009
|
+
[attr.data-category]="category.id"
|
|
3010
|
+
>
|
|
3011
|
+
<span>{{ category.label | felT }}</span>
|
|
3012
|
+
<button
|
|
3013
|
+
ffButton="ui-click"
|
|
3014
|
+
class="btn btn-xs min-w-16"
|
|
3015
|
+
[class.btn-primary]="isCategoryOn(category.id)"
|
|
3016
|
+
(click)="toggleCategory(category.id)"
|
|
3017
|
+
>
|
|
3018
|
+
{{
|
|
3019
|
+
(isCategoryOn(category.id)
|
|
3020
|
+
? 'fel.settings.on'
|
|
3021
|
+
: 'fel.settings.off'
|
|
3022
|
+
) | felT
|
|
3023
|
+
}}
|
|
3024
|
+
</button>
|
|
3025
|
+
</div>
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
<div
|
|
3029
|
+
class="flex items-center justify-between gap-4"
|
|
3030
|
+
data-option="autosaveInterval"
|
|
3031
|
+
>
|
|
3032
|
+
<span>{{ 'fel.game.autosave' | felT }}</span>
|
|
3033
|
+
<span class="flex flex-wrap gap-1">
|
|
3034
|
+
@for (ticks of autosaveTicks; track ticks) {
|
|
3035
|
+
<button
|
|
3036
|
+
ffButton="ui-click"
|
|
3037
|
+
class="btn btn-sm"
|
|
3038
|
+
[class.btn-primary]="ticks === autosave()"
|
|
3039
|
+
(click)="setAutosave(ticks)"
|
|
3040
|
+
>
|
|
3041
|
+
{{ 'fel.game.autosaveTicks' | felT: { count: ticks } }}
|
|
3042
|
+
</button>
|
|
3043
|
+
}
|
|
3044
|
+
</span>
|
|
3045
|
+
</div>
|
|
3046
|
+
<fel-save-panel />
|
|
3047
|
+
`
|
|
3048
|
+
}]
|
|
3049
|
+
}],
|
|
3050
|
+
propDecorators: {
|
|
3051
|
+
locales: [{
|
|
3052
|
+
type: i0.Input,
|
|
3053
|
+
args: [{
|
|
3054
|
+
isSignal: true,
|
|
3055
|
+
alias: "locales",
|
|
3056
|
+
required: false
|
|
3057
|
+
}]
|
|
3058
|
+
}],
|
|
3059
|
+
notificationCategories: [{
|
|
3060
|
+
type: i0.Input,
|
|
3061
|
+
args: [{
|
|
3062
|
+
isSignal: true,
|
|
3063
|
+
alias: "notificationCategories",
|
|
3064
|
+
required: false
|
|
3065
|
+
}]
|
|
3066
|
+
}]
|
|
3067
|
+
}
|
|
3068
|
+
});
|
|
3069
|
+
export { FEL_CHANGELOG_MODAL, FEL_CHANGELOG_URL, FEL_SHELL_CONFIG, FEL_STRINGS, FelAudioService, FelChangelogModalComponent, FelGameBarComponent, FelMainMenuComponent, FelOptionSliderComponent, FelOptionToggleComponent, FelOverlaysComponent, FelSaveAlertsComponent, FelSavePanelComponent, FelSettingsAudioComponent, FelSettingsControlsComponent, FelSettingsDebugComponent, FelSettingsDisplayComponent, FelSettingsGameComponent, FelSettingsLayoutComponent, FelSettingsTabDirective, FelTextPipe, FelTitleComponent, felChangelogLoad, felChangelogMarkSeen, felChangelogParse, felChangelogSkipOnFirstLaunch, felChangelogUnseen, felDurationText, felSaveBlockText, felSetOption, felText, provideFelShell };
|
|
3070
|
+
|
|
3071
|
+
//# sourceMappingURL=felfhenor-shell.mjs.map
|