From 04d60d8f9117f6501da2eef7fb4f1a9b6e78ac78 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Fri, 22 Mar 2019 23:08:54 -0400
Subject: [PATCH] Show number of assigned slaves on tabs

---
 src/uncategorized/main.tw | 97 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 86 insertions(+), 11 deletions(-)

diff --git a/src/uncategorized/main.tw b/src/uncategorized/main.tw
index 7530e37a8e7..7cf93987b8d 100644
--- a/src/uncategorized/main.tw
+++ b/src/uncategorized/main.tw
@@ -106,20 +106,95 @@ __''MAIN MENU''__&nbsp;&nbsp;&nbsp;&nbsp;//[[Summary Options]]//
 	<body>
 
 	<div class="tab">
+		<<set _penthouseSlaves = 0>>
 		<<if $useSlaveSummaryOverviewTab == 1>>
 		<button class="tablinks" onclick="opentab(event, 'overview')" id="tab overview">Overview</button>
 		<</if>>
-		<button class="tablinks" onclick="opentab(event, 'resting')" id="tab resting">Resting</button>
-		<button class="tablinks" onclick="opentab(event, 'stay confined')" id="tab stay confined">Confined</button>
-		<button class="tablinks" onclick="opentab(event, 'take classes')" id="tab take classes">Students</button>
-		<button class="tablinks" onclick="opentab(event, 'please you')" id="tab please you">Fucktoys</button>
-		<button class="tablinks" onclick="opentab(event, 'whore')" id="tab whore">Whores</button>
-		<button class="tablinks" onclick="opentab(event, 'serve the public')" id="tab serve the public">Public Servants</button>
-		<button class="tablinks" onclick="opentab(event, 'be a servant')" id="tab be a servant">Servants</button>
-		<button class="tablinks" onclick="opentab(event, 'get milked')" id="tab milked">Cows</button>
-		<button class="tablinks" onclick="opentab(event, 'work a glory hole')" id="tab work a glory hole">Gloryhole</button>
-		<button class="tablinks" onclick="opentab(event, 'be a subordinate slave')" id="tab be a subordinate slave">Subordinate slaves</button>
-		<button class="tablinks" onclick="opentab(event, 'all')" id="tab all">All</button>
+		<button class="tablinks" onclick="opentab(event, 'resting')" id="tab resting">
+			Resting
+			<<if $JobIDArray['rest'].length > 0>>
+				<<print " (" + $JobIDArray['rest'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['rest'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'stay confined')" id="tab stay confined">
+			Confined
+			<<if $JobIDArray['stay confined'].length > 0>>
+				<<print " (" + $JobIDArray['stay confined'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['stay confined'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'take classes')" id="tab take classes">
+			Students
+			<<if $JobIDArray['take classes'].length > 0>>
+				<<print " (" + $JobIDArray['take classes'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['take classes'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'please you')" id="tab please you">
+			Fucktoys
+			<<if $JobIDArray['please you'].length > 0>>
+				<<print " (" + $JobIDArray['please you'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['please you'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'whore')" id="tab whore">
+			Whores
+			<<if $JobIDArray['whore'].length > 0>>
+				<<print " (" + $JobIDArray['whore'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['whore'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'serve the public')" id="tab serve the public">
+			Public Servants
+			<<if $JobIDArray['serve the public'].length > 0>>
+				<<print " (" + $JobIDArray['serve the public'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['serve the public'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'be a servant')" id="tab be a servant">
+			Servants
+			<<if $JobIDArray['be a servant'].length > 0>>
+				<<print " (" + $JobIDArray['be a servant'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['be a servant'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'get milked')" id="tab milked">
+			Cows
+			<<if $JobIDArray['get milked'].length > 0>>
+				<<print " (" + $JobIDArray['get milked'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['get milked'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'work a glory hole')" id="tab work a glory hole">
+			Gloryhole
+			<<if $JobIDArray['work a glory hole'].length > 0>>
+				<<print " (" + $JobIDArray['work a glory hole'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['work a glory hole'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'be a subordinate slave')" id="tab be a subordinate slave">
+			Subordinate slaves
+			<<if $JobIDArray['be a subordinate slave'].length > 0>>
+				<<print " (" + $JobIDArray['be a subordinate slave'].length + ")">>
+				<<set _penthouseSlaves += $JobIDArray['be a subordinate slave'].length>>
+			<</if>>
+		</button>
+		<button class="tablinks" onclick="opentab(event, 'all')" id="tab all">
+			All
+			<<if  _penthouseSlaves > 0>>
+				<<if $Headgirl != 0>>
+					<<set _penthouseSlaves++>>
+				<</if>>
+				<<if $Recruiter != 0>>
+					<<set _penthouseSlaves++>>
+				<</if>>
+				<<if $Bodyguard != 0>>
+					<<set _penthouseSlaves++>>
+				<</if>>
+				<<print " (" +  _penthouseSlaves + ")">>
+			<</if>>
+		</button>
 	</div>
 
 	<div id="overview" class="tabcontent">
-- 
GitLab