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", "shapes", "square", "switch",
"tablet", "tree", "vidimage", "tablet", "tree", "vidimage",
"wap", "wbridge", "wrepeater", "wap", "wbridge", "wrepeater",
"wrouter", "x", "info", "menu"], "wrouter", "x", "info", "menu",
"eye", "queryuser",
],
["img/ArrowUp.png", "img/ArrowDown.png", "img/Animations.png", ["img/ArrowUp.png", "img/ArrowDown.png", "img/Animations.png",
"img/BurnMark.png", "img/cellphone.png", "img/Circle.png", "img/BurnMark.png", "img/cellphone.png", "img/Circle.png",
"img/Copier.png", "img/firewall.png", "img/fluorescent.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/Switch.png", "img/tablet.png", "img/tree.png",
"img/VidImage.png", "img/WAP.png", "img/WBridge.png", "img/VidImage.png", "img/WAP.png", "img/WBridge.png",
"img/WRepeater.png", "img/WRouter.png", "img/X.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. InitializeGameMenu // this is called when all images have loaded.
); );
@ -102,6 +106,9 @@ function PrintScreen(WhatPassedIn=-1)
//Draw the info button //Draw the info button
MainCanvas_ctx.drawImage(imageFromName("info"),MainCanvas.width - small_button_size,small_button_size,small_button_size,small_button_size); 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(); drawSelectMenu();
PrintAllNetworkLinks(); PrintAllNetworkLinks();
PrintAllNetworkDevices(); PrintAllNetworkDevices();
@ -188,6 +195,12 @@ function handleMouseUp(evt)
//It is the info button //It is the info button
uiMode=1; uiMode=1;
PrintScreen(); 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();
} }
} }
} }