mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-26 04:07:24 +00:00
Add decorations via the start menu
This commit is contained in:
18
birb.js
18
birb.js
@@ -493,18 +493,10 @@ function init() {
|
|||||||
if (e.target instanceof Node && !canvas.contains(e.target) && !document.querySelector(".birb-window")?.contains(e.target)) {
|
if (e.target instanceof Node && !canvas.contains(e.target) && !document.querySelector(".birb-window")?.contains(e.target)) {
|
||||||
removeStartMenu();
|
removeStartMenu();
|
||||||
}
|
}
|
||||||
// const x = e.clientX;
|
|
||||||
// const y = window.innerHeight - e.clientY;
|
|
||||||
// flyTo(x, y);
|
|
||||||
// focusOnElement();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
canvas.addEventListener("click", () => {
|
canvas.addEventListener("click", () => {
|
||||||
insertStartMenu();
|
insertStartMenu();
|
||||||
// focusOnElement();
|
|
||||||
// if (focusedElement === null && currentState === States.IDLE) {
|
|
||||||
// setAnimation(Animations.HEART)
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
canvas.addEventListener("mouseover", () => {
|
canvas.addEventListener("mouseover", () => {
|
||||||
@@ -636,8 +628,14 @@ function insertStartMenu() {
|
|||||||
pet();
|
pet();
|
||||||
});
|
});
|
||||||
content.appendChild(petButton);
|
content.appendChild(petButton);
|
||||||
content.appendChild(makeElement("birb-window-list-item", "Field Guide"));
|
let fieldGuideButton = makeElement("birb-window-list-item", "Field Guide");
|
||||||
content.appendChild(makeElement("birb-window-list-item", "Decorations"));
|
content.appendChild(fieldGuideButton);
|
||||||
|
let decorationsButton = makeElement("birb-window-list-item", "Decorations");
|
||||||
|
decorationsButton.addEventListener("click", () => {
|
||||||
|
removeStartMenu();
|
||||||
|
insertDecoration();
|
||||||
|
});
|
||||||
|
content.appendChild(decorationsButton);
|
||||||
content.appendChild(makeElement("birb-window-list-item", "Programs"));
|
content.appendChild(makeElement("birb-window-list-item", "Programs"));
|
||||||
content.appendChild(makeElement("birb-window-separator"));
|
content.appendChild(makeElement("birb-window-separator"));
|
||||||
content.appendChild(makeElement("birb-window-list-item", "Settings"));
|
content.appendChild(makeElement("birb-window-list-item", "Settings"));
|
||||||
|
|||||||
Reference in New Issue
Block a user