Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions src/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,15 @@ local function MakeSlot(parent, index)
if FullHotbarSlots >= 1 and not GamepadActionsBound then
-- Player added first item to a hotbar slot, enable BindCoreAction
GamepadActionsBound = true
-- ROBLOX deviation START: change action name from RBX to Backpack
ContextActionService:BindAction(
"RBXHotbarEquip",
"BackpackHotbarEquip",
changeToolFunc,
false,
Enum.KeyCode.ButtonL1,
Enum.KeyCode.ButtonR1
)
-- ROBLOX deviation END
end
end
end
Expand Down Expand Up @@ -487,7 +489,7 @@ local function MakeSlot(parent, index)
FullHotbarSlots = FullHotbarSlots - 1
if FullHotbarSlots < 1 then
GamepadActionsBound = false
ContextActionService:UnbindAction("RBXHotbarEquip")
ContextActionService:UnbindAction("BackpackHotbarEquip") -- ROBLOX deviation: change action name from RBX to Backpack
end
end

Expand Down Expand Up @@ -1104,8 +1106,10 @@ local selectDirection = Vector2.new(0, 0)
local hotbarVisible = false

function unbindAllGamepadEquipActions()
ContextActionService:UnbindAction("RBXBackpackHasGamepadFocus")
ContextActionService:UnbindAction("RBXCloseInventory")
-- ROBLOX deviation START: change action name from RBX to Backpack
ContextActionService:UnbindAction("BackpackHasGamepadFocus")
ContextActionService:UnbindAction("BackpackCloseInventory")
-- ROBLOX deviation END
end

local function setHotbarVisibility(visible, isInventoryScreen)
Expand Down Expand Up @@ -1355,14 +1359,16 @@ function enableGamepadInventoryControl()
end
end

ContextActionService:BindAction("RBXBackpackHasGamepadFocus", noOpFunc, false, Enum.UserInputType.Gamepad1)
-- ROBLOX deviation START: change action name from RBX to Backpack
ContextActionService:BindAction("BackpackHasGamepadFocus", noOpFunc, false, Enum.UserInputType.Gamepad1)
ContextActionService:BindAction(
"RBXCloseInventory",
"BackpackCloseInventory",
goBackOneLevel,
false,
Enum.KeyCode.ButtonB,
Enum.KeyCode.ButtonStart
)
-- ROBLOX deviation END

-- Gaze select will automatically select the object for us!
if not UseGazeSelection() then
Expand All @@ -1388,20 +1394,22 @@ end
local function bindBackpackHotbarAction()
if WholeThingEnabled and not GamepadActionsBound then
GamepadActionsBound = true
-- ROBLOX deviation START: change action name from RBX to Backpack
ContextActionService:BindAction(
"RBXHotbarEquip",
"BackpackHotbarEquip",
changeToolFunc,
false,
Enum.KeyCode.ButtonL1,
Enum.KeyCode.ButtonR1
)
-- ROBLOX deviation END
end
end

local function unbindBackpackHotbarAction()
disableGamepadInventoryControl()
GamepadActionsBound = false
ContextActionService:UnbindAction("RBXHotbarEquip")
ContextActionService:UnbindAction("BackpackHotbarEquip") -- ROBLOX deviation: change action name from RBX to Backpack
end

function gamepadDisconnected()
Expand All @@ -1414,7 +1422,7 @@ end
function gamepadConnected()
if not VRService.VREnabled then
GamepadEnabled = true
GuiService:AddSelectionParent("RBXBackpackSelection", MainFrame)
GuiService:AddSelectionParent("BackpackSelection", MainFrame) -- ROBLOX deviation: change action name from RBX to Backpack

if FullHotbarSlots >= 1 then
bindBackpackHotbarAction()
Expand Down Expand Up @@ -1918,11 +1926,13 @@ do -- Make the Inventory expand/collapse arrow (unless TopBar)
disableGamepadInventoryControl()
end

-- ROBLOX deviation START: change action name from RBX to Backpack
if InventoryFrame.Visible then
ContextActionService:BindAction("RBXRemoveSlot", removeHotBarSlot, false, Enum.KeyCode.ButtonX)
ContextActionService:BindAction("BackpackRemoveSlot", removeHotBarSlot, false, Enum.KeyCode.ButtonX)
else
ContextActionService:UnbindAction("RBXRemoveSlot")
ContextActionService:UnbindAction("BackpackRemoveSlot")
end
-- ROBLOX deviation END

BackpackScript.IsOpen = InventoryFrame.Visible
BackpackScript.StateChanged:Fire(InventoryFrame.Visible)
Expand Down