Wire up the "change pack" button

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-05 17:37:11 -06:00
parent 06c4733e3f
commit a43b7e1d37
2 changed files with 10 additions and 1 deletions

View File

@ -22,8 +22,10 @@
<header id="header-pack"> <header id="header-pack">
<h2 id="level-pack-name">Chip's Challenge Level Pack 1</h2> <h2 id="level-pack-name">Chip's Challenge Level Pack 1</h2>
<nav> <nav>
<button class="set-nav-return" type="button" disabled>Change pack</button> <button id="main-change-pack" type="button">Change pack</button>
<!--
<button id="player-edit" type="button">Return to editor</button> <button id="player-edit" type="button">Return to editor</button>
-->
</nav> </nav>
</header> </header>
<header id="header-level"> <header id="header-level">

View File

@ -1809,12 +1809,19 @@ class Conductor {
} }
ev.target.blur(); ev.target.blur();
}); });
document.querySelector('#main-change-pack').addEventListener('click', ev => {
// TODO confirm
this.switch_to_splash();
});
/*
* FIXME restore, "return to editor" is bad text though
document.querySelector('#player-edit').addEventListener('click', ev => { document.querySelector('#player-edit').addEventListener('click', ev => {
// TODO should be able to jump to editor if we started in the // TODO should be able to jump to editor if we started in the
// player too! but should disable score tracking and have a revert // player too! but should disable score tracking and have a revert
// button // button
this.switch_to_editor(); this.switch_to_editor();
}); });
*/
this.update_nav_buttons(); this.update_nav_buttons();
this.switch_to_splash(); this.switch_to_splash();