feat(nds): add audio in all menus
This commit is contained in:
@@ -58,6 +58,8 @@ const BIG_CIRCLE_DURATION = 0.09;
|
||||
const POST_DURATION = 0.07;
|
||||
|
||||
const startButtonAnimation = (type: ButtonType) => {
|
||||
assets.audio.pkmnButton.play();
|
||||
|
||||
const anim: ButtonAnimation = {
|
||||
type,
|
||||
position: BUTTONS[type].position,
|
||||
|
||||
@@ -53,13 +53,20 @@ useKeyDown(({ key }) => {
|
||||
|
||||
switch (key) {
|
||||
case "NDS_UP":
|
||||
selectedOption = "yes";
|
||||
if (selectedOption !== "yes") {
|
||||
selectedOption = "yes";
|
||||
assets.audio.pkmnSelector.play();
|
||||
}
|
||||
break;
|
||||
case "NDS_DOWN":
|
||||
selectedOption = "no";
|
||||
if (selectedOption !== "no") {
|
||||
selectedOption = "no";
|
||||
assets.audio.pkmnSelector.play();
|
||||
}
|
||||
break;
|
||||
case "NDS_A":
|
||||
case "NDS_START":
|
||||
assets.audio.pkmnSelector.play();
|
||||
setTimeout(() => {
|
||||
if (selectedOption === "yes") store.visitProject();
|
||||
store.showConfirmationPopup = false;
|
||||
@@ -90,12 +97,14 @@ onClick((x, y) => {
|
||||
const ACTIVATION_DELAY = 50;
|
||||
|
||||
if (rectContains([198, 105, 50, 14], [x, y])) {
|
||||
assets.audio.pkmnSelector.play();
|
||||
selectedOption = "yes";
|
||||
setTimeout(() => {
|
||||
store.visitProject();
|
||||
store.showConfirmationPopup = false;
|
||||
}, ACTIVATION_DELAY);
|
||||
} else if (rectContains([198, 121, 50, 14], [x, y])) {
|
||||
assets.audio.pkmnSelector.play();
|
||||
selectedOption = "no";
|
||||
setTimeout(() => (store.showConfirmationPopup = false), ACTIVATION_DELAY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user