File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ --!strict
2+
3+ local Players = game :GetService ("Players" )
4+ local RunService = game :GetService ("RunService" )
5+
6+ local player = Players .LocalPlayer
7+ local playerGui = player :WaitForChild ("PlayerGui" )
8+ local screenGui = playerGui :WaitForChild ("SatchelGui" )
9+
10+ local function getEnabled ()
11+ assert (RunService :IsClient (), "getEnabled can only be called on the client" )
12+
13+ return screenGui .Enabled
14+ end
15+
16+ return getEnabled
Original file line number Diff line number Diff line change @@ -4,9 +4,15 @@ local RunService = game:GetService("RunService")
44
55local TopbarPlus = require (script .Parent .Parent .Parent .topbarplus )
66
7- local function getTopbarIcon (): TopbarPlus .Icon
7+ local function getTopbarIcon (): TopbarPlus .Icon ?
88 assert (RunService :IsClient (), "getTopbarIcon can only be called on the client" )
9- print ("Not implemented" )
9+
10+ for _ , icon in TopbarPlus .getIcons () do
11+ if icon .captionText == "Inventory" then
12+ return icon
13+ end
14+ end
15+
1016 return nil
1117end
1218
Original file line number Diff line number Diff line change 33local Players = game :GetService ("Players" )
44local RunService = game :GetService ("RunService" )
55
6+ local getTopbarIcon = require (script .Parent .getTopbarIcon )
7+
68local player = Players .LocalPlayer
79local playerGui = player :WaitForChild ("PlayerGui" )
810local screenGui = playerGui :WaitForChild ("SatchelGui" )
@@ -12,7 +14,10 @@ local function setEnabled(isEnabled: boolean)
1214
1315 screenGui .Enabled = isEnabled
1416
15- -- TODO: Disable topbar icon
17+ local icon = getTopbarIcon ()
18+ if icon then
19+ icon :setEnabled (isEnabled )
20+ end
1621end
1722
1823return setEnabled
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ local bindableEvents = script.BindableEvents
44
55return {
66 -- Functions
7+ getEnabled = require (script .Api .getEnabled ),
78 setEnabled = require (script .Api .setEnabled ),
89 getTopbarIcon = require (script .Api .getTopbarIcon ),
910 openInventory = require (script .Api .openInventory ),
You can’t perform that action at this time.
0 commit comments