mirror of
https://github.com/isledecomp/isle.pizza.git
synced 2026-05-01 18:23:56 +00:00
Add Rabbits extension to Extras tab (#31)
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
Remove temporary poc.si hack and add Rabbits as a proper toggleable extension in the config UI, service worker caching, and config save/load.
This commit is contained in:
parent
93a0c46b46
commit
429a36d3d1
@ -219,9 +219,11 @@ function applyConfigToForm(form, config) {
|
||||
const hdMusic = elements["HD Music"];
|
||||
const widescreenBgs = elements["Widescreen Backgrounds"];
|
||||
const badEnding = elements["Extended Bad Ending FMV"];
|
||||
const rabbits = elements["Rabbits"];
|
||||
if (hdMusic) hdMusic.checked = config[key].includes("hdmusic.si");
|
||||
if (widescreenBgs) widescreenBgs.checked = config[key].includes("widescreen.si");
|
||||
if (badEnding) badEnding.checked = config[key].includes("badend.si");
|
||||
if (rabbits) rabbits.checked = config[key].includes("rabbits.si");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -338,7 +340,8 @@ export async function saveConfigFromDOM(multiplayer = null) {
|
||||
const hdMusic = document.getElementById('check-hd-music');
|
||||
const widescreenBgs = document.getElementById('check-widescreen-bgs');
|
||||
const badEnding = document.getElementById('check-ending');
|
||||
return getSiFilesForCache(hdMusic, widescreenBgs, badEnding);
|
||||
const rabbits = document.getElementById('check-rabbits');
|
||||
return getSiFilesForCache(hdMusic, widescreenBgs, badEnding, rabbits);
|
||||
};
|
||||
return saveConfig(form, getSiFiles, true, multiplayer);
|
||||
}
|
||||
|
||||
@ -77,8 +77,9 @@ export function checkCacheStatus() {
|
||||
const hdMusic = document.getElementById('check-hd-music');
|
||||
const widescreenBgs = document.getElementById('check-widescreen-bgs');
|
||||
const badEnding = document.getElementById('check-ending');
|
||||
const rabbits = document.getElementById('check-rabbits');
|
||||
|
||||
const siFiles = getSiFilesForCache(hdMusic, widescreenBgs, badEnding);
|
||||
const siFiles = getSiFilesForCache(hdMusic, widescreenBgs, badEnding, rabbits);
|
||||
|
||||
navigator.serviceWorker.controller.postMessage({
|
||||
action: 'check_cache_status',
|
||||
@ -88,11 +89,12 @@ export function checkCacheStatus() {
|
||||
});
|
||||
}
|
||||
|
||||
export function getSiFilesForCache(hdMusic, widescreenBgs, badEnding) {
|
||||
export function getSiFilesForCache(hdMusic, widescreenBgs, badEnding, rabbits) {
|
||||
const siFiles = [];
|
||||
if (hdMusic?.checked) siFiles.push('/LEGO/extra/hdmusic.si');
|
||||
if (widescreenBgs?.checked) siFiles.push('/LEGO/extra/widescreen.si');
|
||||
if (badEnding?.checked) siFiles.push('/LEGO/extra/badend.si');
|
||||
if (rabbits?.checked) siFiles.push('/LEGO/extra/rabbits.si');
|
||||
return siFiles;
|
||||
}
|
||||
|
||||
|
||||
@ -123,7 +123,8 @@
|
||||
const hdMusic = document.getElementById('check-hd-music');
|
||||
const widescreenBgs = document.getElementById('check-widescreen-bgs');
|
||||
const badEnding = document.getElementById('check-ending');
|
||||
return getSiFilesForCache(hdMusic, widescreenBgs, badEnding);
|
||||
const rabbits = document.getElementById('check-rabbits');
|
||||
return getSiFilesForCache(hdMusic, widescreenBgs, badEnding, rabbits);
|
||||
}
|
||||
|
||||
function handleFormChange() {
|
||||
|
||||
@ -37,6 +37,10 @@
|
||||
<label><input type="checkbox" id="check-ending" name="Extended Bad Ending FMV" data-not-ini="true" disabled={opfsDisabled} onchange={handleExtensionChange}><span class="toggle-slider"></span><span class="toggle-label">Extended Bad Ending FMV <span class="toggle-badge">+20MB</span></span></label>
|
||||
<span class="tooltip-trigger">?<span class="tooltip-content">Plays the extended / "uncut" Bad Ending animation as found in beta versions of the game upon failing to catch the Brickster.</span></span>
|
||||
</div>
|
||||
<div class="toggle-switch">
|
||||
<label><input type="checkbox" id="check-rabbits" name="Rabbits" data-not-ini="true" disabled={opfsDisabled} onchange={handleExtensionChange}><span class="toggle-slider"></span><span class="toggle-label">Rabbits <span class="toggle-badge">+3MB</span></span></label>
|
||||
<span class="tooltip-trigger">?<span class="tooltip-content">Adds two rabbits that hop around on the mountain top, visiting and nibbling on plants.</span></span>
|
||||
</div>
|
||||
<div class="toggle-switch">
|
||||
<label><input type="checkbox" id="check-third-person-camera" name="Third Person Camera" data-not-ini="true" disabled={opfsDisabled} onchange={handleExtensionChange}><span class="toggle-slider"></span><span class="toggle-label">Third-person Camera <span class="toggle-badge-experimental"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9 3L12 14L15 3"/><path d="M6 3H18"/><path d="M5 21H19L17 8H7L5 21Z"/></svg> Experimental</span></span></label>
|
||||
<span class="tooltip-trigger">?<span class="tooltip-content">Switches to a third-person camera that follows your character around LEGO Island.</span></span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user