From 4ec5b370e94c5a6a61ac982fb86c151d6fd66fd4 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 22 Apr 2024 15:37:28 -0500 Subject: [PATCH] Able to click on the eye and toggle the view --- Web/ui.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Web/ui.js b/Web/ui.js index 337c48b..2a04757 100644 --- a/Web/ui.js +++ b/Web/ui.js @@ -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(); } } }