Able to click on the eye and toggle the view

This commit is contained in:
Tim Young 2024-04-22 15:37:28 -05:00
parent 50099ee4ef
commit 4ec5b370e9

View File

@ -25,7 +25,9 @@ const imageCollection = loadImages(
"shapes", "square", "switch",
"tablet", "tree", "vidimage",
"wap", "wbridge", "wrepeater",
"wrouter", "x", "info", "menu"],
"wrouter", "x", "info", "menu",
"eye", "queryuser",
],
["img/ArrowUp.png", "img/ArrowDown.png", "img/Animations.png",
"img/BurnMark.png", "img/cellphone.png", "img/Circle.png",
"img/Copier.png", "img/firewall.png", "img/fluorescent.png",
@ -36,7 +38,9 @@ const imageCollection = loadImages(
"img/Switch.png", "img/tablet.png", "img/tree.png",
"img/VidImage.png", "img/WAP.png", "img/WBridge.png",
"img/WRepeater.png", "img/WRouter.png", "img/X.png",
"img/info.png", "img/menu.png"],
"img/info.png", "img/menu.png", "img/eye.png",
"img/menu.png",
],
InitializeGameMenu // this is called when all images have loaded.
);
@ -101,7 +105,10 @@ function PrintScreen(WhatPassedIn=-1)
//Draw the info button
MainCanvas_ctx.drawImage(imageFromName("info"),MainCanvas.width - small_button_size,small_button_size,small_button_size,small_button_size);
//Draw the info button
MainCanvas_ctx.drawImage(imageFromName("eye"), MainCanvas.width - small_button_size, small_button_size*2, small_button_size, small_button_size);
drawSelectMenu();
PrintAllNetworkLinks();
PrintAllNetworkDevices();
@ -188,6 +195,12 @@ function handleMouseUp(evt)
//It is the info button
uiMode=1;
PrintScreen();
} else if (evt.pageY < small_button_size * 3) {
console.log("Selected 'eye' button");
//It is the eye button
uiDeviceInfoLevel++;
if (uiDeviceInfoLevel > 3) uiDeviceInfoLevel = 0;
PrintScreen();
}
}
}