From 9dc272964d06c7732b284da6dbeeb583c84b072f Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Tue, 19 May 2020 12:07:42 +0200
Subject: [PATCH] add extra info to quicklinks

---
 src/gui/quicklinks.js | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/gui/quicklinks.js b/src/gui/quicklinks.js
index aca857fef97..5e62587f0c4 100644
--- a/src/gui/quicklinks.js
+++ b/src/gui/quicklinks.js
@@ -56,6 +56,27 @@ App.UI.quickMenu = (function() {
 		"BG Select": "Armory",
 	});
 
+	// extra information behind the link, is a function
+	const extraInfo = cleanPassageMapping({
+		Arcade: () => `(${App.Entity.facilities.arcade.employeesIDs().size}/${V.arcade}${
+			V.abbreviateSidebar === 2 ? " inmates" : ""})`,
+		"BG Select": () => V.Bodyguard !== 0 ? "(BG)" : "",
+		Brothel: () => `(${App.Entity.facilities.brothel.employeesIDs().size}/${V.brothel}${
+			V.abbreviateSidebar === 2 ? ` whores${V.Madam ? ", madam" : ""}` : V.Madam ? ", L" : ""})`,
+		Club: () => `(${App.Entity.facilities.club.employeesIDs().size}/${V.brothel}${
+			V.abbreviateSidebar === 2 ? ` sluts${V.DJ ? ", DJ" : ""}` : V.DJ ? ", L" : ""})`,
+		Dairy: () => {
+			const SCapT9 = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren;
+			return `(${App.Entity.facilities.dairy.employeesIDs().size}${SCapT9 ? `+${SCapT9}` : ""}/${V.dairy}${
+				V.abbreviateSidebar === 2 ? ` cows${V.Milkmaid ? ", milkmaid" : ""}`
+					: V.Milkmaid ? ", L" : ""}`;
+		},
+		"Head Girl Suite": () => V.HeadGirl !== 0 ? `(HG${
+			App.Entity.facilities.headGirlSuite.employeesIDs().size ?
+				V.abbreviateSidebar === 2 ? " and slave" : ", 1" : ""})` : "",
+	});
+
+	// true shows a notification symbol
 	const notifications = cleanPassageMapping({
 		"Manage Corporation": () => V.corp.SpecToken > 0 && V.corp.SpecTimer === 0,
 	});
@@ -216,15 +237,19 @@ App.UI.quickMenu = (function() {
 			notificationPassages.push(div);
 			div.classList.add("notification");
 		}
+		// there is additional non-link info
+		if (extraInfo[passage]) {
+			div.append(" ", extraInfo[passage]());
+		}
 		// we are already on this passage
 		if (State.passage === passage) {
-			div.append(uiName(passage));
+			div.prepend(uiName(passage));
 			currentPassage = div;
 			return;
 		}
 		// That is not a passage we can safely jump to, it's a deco element
 		if (hidden || !jumpTo.includes(passage)) {
-			div.append(uiName(passage));
+			div.prepend(uiName(passage));
 			return;
 		}
 		// Create link
@@ -233,7 +258,7 @@ App.UI.quickMenu = (function() {
 		a.onclick = () => {
 			Engine.play(passage);
 		};
-		div.append(a);
+		div.prepend(a);
 		if (hotkeys[passage]) {
 			div.append(" ", App.UI.DOM.makeElement("span", `[${hotkeys[passage]}]`, "hotkey"));
 		}
-- 
GitLab