⚔ Console Modes

Gamepad users have two distinct modes: Combat and Inventory. Each mode enables different binds and controls, with automatic switching based on user interaction.

Mode Overview

Understanding Combat vs Inventory modes

⚔

Combat Mode

Default

Character controls are active. Inventory interaction is disabled. Quick hotbar access for equipping items during gameplay.

Enabled Binds

1-9: Hotbar slots R1+X: Slot 1 R1+Y: Slot 2 L1+X: Slot 5

Disabled Features

✖ Selection navigation ✖ Swap/Drop actions ✖ Drag-and-drop
🎒

Inventory Mode

Toggle

Character controls are suppressed. UI navigation is active. Full inventory management with selection-based actions.

Enabled Binds

D-Pad: Navigate slots Y: Swap X: Drop A: Quick Move B: Cancel

Disabled Features

✖ Hotbar slot shortcuts ✖ Character movement

Mode Switching

How to transition between modes

🔬

Long Press L3

Hold the left stick (L3) for 0.5 seconds to toggle between modes.

↔
📍

Context Switch

ConsoleModeManager enables/disables IllusionIAS contexts automatically.

↔
🟠

Visual Indicator

Badge appears showing current mode with color coding.

Long Press Configuration Luau
-- src/client/StowayClientv1_2/Input/ConsoleModeManager.luau

-- Long press duration (seconds)
local LONG_PRESS_DURATION = 0.5

-- Detection logic
switchAction.Activated:Connect(function(active, pressed)
    if pressed then
        isPressed = true
        -- Schedule toggle after duration
        longPressTask = task.delay(LONG_PRESS_DURATION, function()
            if isPressed then
                ConsoleModeManager.ToggleMode()
            end)
    else
        isPressed = false
        if longPressTask then
            task.cancel(longPressTask)
            longPressTask = nil
        end
    end
end)

Visual Mode Indicator

HUD badge showing current mode

A small badge appears in the bottom-right corner showing the current mode:

⚔ COMBAT

Combat Mode

Reddish badge, character controls active

🎒 SELECTING

Inventory Mode

Greenish badge, shows selection state

Mode Indicator Creation Luau
function CreateModeIndicator()
    local player = game.GetService("Players").LocalPlayer
    
    modeIndicatorGui = Instance.new("ScreenGui")
    modeIndicatorGui.Name = "StowayConsoleHUD"
    modeIndicatorGui.Parent = player:WaitForChild("PlayerGui")

    local bg = Instance.new("Frame")
    bg.Name = "ModeBadge"
    bg.Size = UDim2.fromOffset(150, 40)
    bg.Position = UDim2.new(0.95, -160, 0.85, 0)
    bg.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
    bg.Parent = modeIndicatorGui

    modeTextLabel = Instance.new("TextLabel")
    modeTextLabel.Text = "COMBAT"
    modeTextLabel.TextColor3 = Color3.fromRGB(255, 100, 100)  -- Red
    modeTextLabel.Parent = bg
end

Mode Transition Behavior

What happens when switching modes

Action Switching to Combat Switching to Inventory
InputManager Combat context enabled Inventory context enabled
SelectionManager Disabled, clears selection Enabled
GuiService GuiNavigationEnabled = false GuiNavigationEnabled = true
Mode Indicator "COMBAT" (red) "SELECTING" (green)
Hooks OnDeselect fired -

Code Structure

ConsoleModeManager implementation

ConsoleModeManager.luau Luau
local ConsoleModeManager = {}
local CurrentMode = ""  -- "Combat" | "Inventory"

-- Set mode directly
function ConsoleModeManager.SetMode(modeName)
    if CurrentMode == modeName then return end
    CurrentMode = modeName

    if modeName == "Combat" then
        InputManager.SetCombatEnabled(true)
        InputManager.SetInventoryEnabled(false)
        SelectionManager.SetEnabled(false)
        GuiService.GuiNavigationEnabled = false
        GuiService.SelectedObject = nil
        
        if modeTextLabel then
            modeTextLabel.Text = "⚔ COMBAT"
            modeTextLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
        end

    elseif modeName == "Inventory" then
        InputManager.SetCombatEnabled(false)
        InputManager.SetInventoryEnabled(true)
        SelectionManager.SetEnabled(true)
        GuiService.GuiNavigationEnabled = true
        
        if modeTextLabel then
            modeTextLabel.Text = "🎒 SELECTING"
            modeTextLabel.TextColor3 = Color3.fromRGB(100, 255, 150)
        end
    end
end

-- Toggle between modes
function ConsoleModeManager.ToggleMode()
    if CurrentMode == "Combat" then
        ConsoleModeManager.SetMode("Inventory")
    else
        ConsoleModeManager.SetMode("Combat")
    end
end

return ConsoleModeManager

State Callback

React to mode changes

SelectionManager provides a callback that updates the mode indicator text when selection state changes:

State Change Callback Luau
-- Connected in SetMode when entering Inventory mode
SelectionManager.OnStateChanged = function(newDesc)
    if modeTextLabel then
        modeTextLabel.Text = "🎒 " .. newDesc
    end
end

-- Returns descriptions like:
-- "🖼 SELECTING"     (idle)
-- "🔄 SWAP - SELECT TARGET" (source selected)
-- "🗑 DROPPING ITEM"  (dropping)

Customization

Modifying mode behavior

Related Documentation

See also