RyanLua / Satchel

A modern alternative to Roblox's default backpack. Satchel aims to be more customizable and easier to use than the default backpack while still having a "vanilla" feel.
http://satchel.ryanluu.dev
Mozilla Public License 2.0
35 stars 4 forks source link

GetCore: TopbarEnabled has not been registered by the CoreScripts #12

Closed VoiditeDev closed 1 year ago

VoiditeDev commented 1 year ago

Description

This bug states that TopbarEnabled doesn't work when you try to put it to `

What was expected?

I expect that it should use TopbarEnabled to make it work fine

What actually happened?

It failed to use TopbarEnabled and ended up putting an error

Steps to reproduce

  1. Start a game
  2. Check the output

Relevant log output

12:38:20.262  GetCore: TopbarEnabled has not been registered by the CoreScripts  -  Client - SatchelScript:1416
  12:38:20.262  Stack Begin  -  Studio
  12:38:20.262  Script 'Players.VSCPlays.PlayerScripts.Satchel.SatchelScript', Line 1416 - function OnIconChanged  -  Studio - SatchelScript:1416
  12:38:20.262  Script 'Players.VSCPlays.PlayerScripts.Satchel.SatchelScript', Line 2031  -  Studio - SatchelScript:2031
  12:38:20.262  Stack End  -  Studio

Other details

image

This is the code

local function OnIconChanged(enabled: boolean): ()
    -- Check for enabling/disabling the whole thing
    enabled = enabled and StarterGui:GetCore("TopbarEnabled") -- the error part
    InventoryIcon:setEnabled(enabled and not GuiService.MenuIsOpen)
    WholeThingEnabled = enabled
    MainFrame.Visible = enabled

    -- Eat/Release hotkeys (Doesn't affect UserInputService)
    -- for _, keyString in pairs(HotkeyStrings) do
    --  if enabled then
    --      GuiService:AddKey(keyString)
    --  else
    --      GuiService:RemoveKey(keyString)
    --  end
    -- end

    if enabled then
        if FullHotbarSlots >= 1 then
            bindBackpackHotbarAction()
        end
    else
        unbindBackpackHotbarAction()
    end
end

A fix is to place StarterGui:GetCore("TopbarEnabled") in a pcall()

Severity

Low

Platforms affected

No response

Code of Conduct

RyanLua commented 1 year ago

oh nevermind, I was using an older version of satchel soo that’s why it wasn’t working

https://devforum.roblox.com/t/satchel-open-source-backpack-system/2451549/113

And it looks like it resolved itself... I'll be closing this issue now. If you have this error again, don't hesitate to create another issue.